Compare commits

..

22 Commits
6478 ... 6261

Author SHA1 Message Date
Marshall Greenblatt
de5b72441b Update to Chromium version 122.0.6261.130 2024-03-14 14:36:31 +00:00
Marshall Greenblatt
6e69d20878 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:51:30 -05:00
qqqqqqqqq
46f5c48410 Replace non-standard memory.h with cstring (fixes #3665)
cef_string_wrappers.h uses a non-standard header memory.h, which breaks
the build on UCRT environments. Replace <memory.h> include with <cstring>,
which is guaranteed to contain strlen.
2024-03-08 14:51:29 -05:00
Marshall Greenblatt
c902316ee9 Update to Chromium version 122.0.6261.112 2024-03-06 16:13:50 +00:00
Marshall Greenblatt
d14e0517a1 Update to Chromium version 122.0.6261.94 2024-02-28 16:28:20 +00:00
Marshall Greenblatt
40272b5bc5 Update to Chromium version 122.0.6261.69 2024-02-22 17:24:43 -05:00
Marshall Greenblatt
dd187af001 mac: Add fallback for unsupported --lang values (fixes #3653) 2024-02-20 13:34:39 -05:00
Nik Pavlov
8b7af53124 chrome: Add SetAccessibilityState support (fixes #3649) 2024-02-20 13:34:33 -05:00
Marshall Greenblatt
f09a9bc0b1 win: distrib: Add DirectX compiler binaries for WebGPU (fixes #3646) 2024-02-15 17:02:59 -05:00
Marshall Greenblatt
2fa5949d07 alloy: Allow --remote-debugging-port=0 (fixes #3619) 2024-02-15 16:16:19 -05:00
Marshall Greenblatt
b919ac4739 alloy: Fix crash on JS dialog from PDF viewer (fixes #3644) 2024-02-15 15:36:25 -05:00
Marshall Greenblatt
a485dc81e0 chrome: win: Disable taskbar decoration for PiP and DevTools windows (fixes #3645) 2024-02-15 14:19:31 -05:00
Marshall Greenblatt
1082b30c0e chrome: win: Fix crash on ShowProfileErrorDialog (fixes #3648) 2024-02-15 12:26:08 -05:00
Marshall Greenblatt
1a6f3c337f 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 19:58:29 -05:00
Marshall Greenblatt
b7e35d2878 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 19:58:29 -05:00
Marshall Greenblatt
36e4ef1673 alloy: Fix crash when accessing FirstPartySets (fixes #3643)
Initialize FirstPartySets without PrivacySandbox or IdentityManager
dependencies.
2024-02-13 16:03:16 -05:00
Marshall Greenblatt
56f1033fd9 Update to Chromium version 122.0.6261.29 2024-02-08 15:01:12 +00:00
Marshall Greenblatt
1bfee76f5f chrome: win: Fix taskbar grouping of PiP and DevTools windows (fixes #3641) 2024-02-06 13:56:27 -05:00
Marshall Greenblatt
7dbf26919a views: win: Fix occlusion tracking of initially-minimized windows (fixes #3638)
Chromium considers initially-minimized windows to be visible at
creation time in the Aura layer. This confuses the native occlusion
detector which knows that the OS window is initially hidden due to
IsIconic returning true. Start occlusion tracking with consistent
state by delaying enablement until the initially-minimized window is
restored for the first time.
2024-02-05 16:49:59 -05:00
Shezan Baig
114665f178 Always assign |is_guest_view| in CefBrowserInfo::GetFrameForGlobalToken 2024-02-05 11:33:01 -05:00
Marshall Greenblatt
3d83c932f1 Update to Chromium version 122.0.6261.18 2024-02-01 14:28:51 +00:00
Marshall Greenblatt
f3f83ff8cf Update to Chromium version 122.0.6261.6 2024-01-30 19:11:36 -05:00
1236 changed files with 12680 additions and 20043 deletions

1
.gitignore vendored
View File

@@ -51,5 +51,6 @@ Thumbs.db
/binary_distrib
/docs
# CEF generated files
/include/cef_config.h
/include/cef_version.h
.ccls-cache/

394
BUILD.gn
View File

@@ -99,7 +99,6 @@ import("//build/config/locales.gni")
import("//build/config/ozone.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni")
import("//cef/libcef/features/features.gni")
import("//chrome/common/features.gni")
import("//content/public/app/mac_helpers.gni")
import("//extensions/buildflags/buildflags.gni")
@@ -252,7 +251,8 @@ if (is_linux) {
# Set by GetRequiredArgs() in //cef/tools/gn_args.py.
#
# Enable support for Print Preview.
# Set ENABLE_PRINTING=1 ENABLE_BASIC_PRINTING=1.
assert(enable_basic_printing)
assert(enable_print_preview)
# Enable support for Widevine CDM.
@@ -349,10 +349,6 @@ if (is_win) {
"//build/config:precompiled_headers",
]
public_configs = [
"libcef/features:config",
]
if (is_component_build) {
# Avoid linker errors with content_switches.cc in component build by not
# defining CONTENT_EXPORT.
@@ -461,14 +457,32 @@ source_set("libcef_test_support") {
source_set("libcef_static") {
sources = includes_common +
gypi_paths.autogen_cpp_includes + [
"libcef/browser/alloy/alloy_browser_context.cc",
"libcef/browser/alloy/alloy_browser_context.h",
"libcef/browser/alloy/alloy_browser_host_impl.cc",
"libcef/browser/alloy/alloy_browser_host_impl.h",
"libcef/browser/alloy/alloy_browser_main.cc",
"libcef/browser/alloy/alloy_browser_main.h",
"libcef/browser/alloy/alloy_content_browser_client.cc",
"libcef/browser/alloy/alloy_content_browser_client.h",
"libcef/browser/alloy/alloy_download_util.cc",
"libcef/browser/alloy/alloy_download_util.h",
"libcef/browser/alloy/alloy_web_contents_view_delegate.cc",
"libcef/browser/alloy/alloy_web_contents_view_delegate.h",
"libcef/browser/alloy/browser_platform_delegate_alloy.cc",
"libcef/browser/alloy/browser_platform_delegate_alloy.h",
"libcef/browser/alloy/dialogs/alloy_constrained_window_views_client.cc",
"libcef/browser/alloy/dialogs/alloy_constrained_window_views_client.h",
"libcef/browser/alloy/dialogs/alloy_javascript_dialog_manager_delegate.cc",
"libcef/browser/alloy/dialogs/alloy_javascript_dialog_manager_delegate.h",
"libcef/browser/alloy/dialogs/alloy_web_contents_dialog_helper.cc",
"libcef/browser/alloy/dialogs/alloy_web_contents_dialog_helper.h",
"libcef/browser/alloy/chrome_browser_process_alloy.cc",
"libcef/browser/alloy/chrome_browser_process_alloy.h",
"libcef/browser/alloy/chrome_profile_manager_alloy.cc",
"libcef/browser/alloy/chrome_profile_manager_alloy.h",
"libcef/browser/alloy/chrome_profile_alloy.cc",
"libcef/browser/alloy/chrome_profile_alloy.h",
"libcef/browser/audio_capturer.cc",
"libcef/browser/audio_capturer.h",
"libcef/browser/audio_loopback_stream_creator.cc",
@@ -477,6 +491,8 @@ source_set("libcef_static") {
"libcef/browser/browser_contents_delegate.h",
"libcef/browser/browser_context.cc",
"libcef/browser/browser_context.h",
"libcef/browser/browser_context_keyed_service_factories.cc",
"libcef/browser/browser_context_keyed_service_factories.h",
"libcef/browser/browser_frame.cc",
"libcef/browser/browser_frame.h",
"libcef/browser/browser_host_base.cc",
@@ -512,14 +528,9 @@ source_set("libcef_static") {
"libcef/browser/chrome/chrome_content_browser_client_cef.h",
"libcef/browser/chrome/chrome_context_menu_handler.cc",
"libcef/browser/chrome/chrome_context_menu_handler.h",
"libcef/browser/chrome/chrome_devtools_window_runner.cc",
"libcef/browser/chrome/chrome_devtools_window_runner.h",
"libcef/browser/chrome/chrome_startup_browser_creator.cc",
"libcef/browser/chrome/chrome_startup_browser_creator.h",
"libcef/browser/chrome/chrome_web_contents_view_delegate_cef.h",
"libcef/browser/chrome_crash_reporter_client_stub.cc",
"libcef/browser/chrome/extensions/chrome_extension_util.cc",
"libcef/browser/chrome/extensions/chrome_extension_util.h",
"libcef/browser/chrome/extensions/chrome_mime_handler_view_guest_delegate_cef.cc",
"libcef/browser/chrome/extensions/chrome_mime_handler_view_guest_delegate_cef.h",
"libcef/browser/chrome/views/browser_platform_delegate_chrome_child_window.cc",
@@ -544,18 +555,62 @@ source_set("libcef_static") {
"libcef/browser/context_menu_params_impl.h",
"libcef/browser/devtools/devtools_controller.cc",
"libcef/browser/devtools/devtools_controller.h",
"libcef/browser/devtools/devtools_protocol_manager.cc",
"libcef/browser/devtools/devtools_protocol_manager.h",
"libcef/browser/devtools/devtools_window_runner.h",
"libcef/browser/devtools/devtools_window_runner_create.cc",
"libcef/browser/devtools/devtools_file_manager.cc",
"libcef/browser/devtools/devtools_file_manager.h",
"libcef/browser/devtools/devtools_frontend.cc",
"libcef/browser/devtools/devtools_frontend.h",
"libcef/browser/devtools/devtools_manager.cc",
"libcef/browser/devtools/devtools_manager.h",
"libcef/browser/devtools/devtools_manager_delegate.cc",
"libcef/browser/devtools/devtools_manager_delegate.h",
"libcef/browser/download_item_impl.cc",
"libcef/browser/download_item_impl.h",
"libcef/browser/download_manager_delegate.cc",
"libcef/browser/download_manager_delegate.h",
"libcef/browser/download_manager_delegate_impl.cc",
"libcef/browser/download_manager_delegate_impl.h",
"libcef/browser/extension_impl.cc",
"libcef/browser/extension_impl.h",
"libcef/browser/extensions/api/file_system/cef_file_system_delegate.cc",
"libcef/browser/extensions/api/file_system/cef_file_system_delegate.h",
"libcef/browser/extensions/api/storage/sync_value_store_cache.cc",
"libcef/browser/extensions/api/storage/sync_value_store_cache.h",
"libcef/browser/extensions/api/tabs/tabs_api.cc",
"libcef/browser/extensions/api/tabs/tabs_api.h",
"libcef/browser/extensions/alloy_extensions_util.cc",
"libcef/browser/extensions/alloy_extensions_util.h",
"libcef/browser/extensions/browser_extensions_util.cc",
"libcef/browser/extensions/browser_extensions_util.h",
"libcef/browser/extensions/browser_platform_delegate_background.cc",
"libcef/browser/extensions/browser_platform_delegate_background.h",
"libcef/browser/extensions/chrome_api_registration.cc",
"libcef/browser/extensions/chrome_api_registration.h",
"libcef/browser/extensions/component_extension_resource_manager.cc",
"libcef/browser/extensions/component_extension_resource_manager.h",
"libcef/browser/extensions/extensions_api_client.cc",
"libcef/browser/extensions/extensions_api_client.h",
"libcef/browser/extensions/extensions_browser_api_provider.cc",
"libcef/browser/extensions/extensions_browser_api_provider.h",
"libcef/browser/extensions/extensions_browser_client.cc",
"libcef/browser/extensions/extensions_browser_client.h",
"libcef/browser/extensions/extension_background_host.cc",
"libcef/browser/extensions/extension_background_host.h",
"libcef/browser/extensions/extension_function_details.cc",
"libcef/browser/extensions/extension_function_details.h",
"libcef/browser/extensions/extension_host_delegate.cc",
"libcef/browser/extensions/extension_host_delegate.h",
"libcef/browser/extensions/extension_system.cc",
"libcef/browser/extensions/extension_system.h",
"libcef/browser/extensions/extension_system_factory.cc",
"libcef/browser/extensions/extension_system_factory.h",
"libcef/browser/extensions/extension_view_host.cc",
"libcef/browser/extensions/extension_view_host.h",
"libcef/browser/extensions/extension_web_contents_observer.cc",
"libcef/browser/extensions/extension_web_contents_observer.h",
"libcef/browser/extensions/mime_handler_view_guest_delegate.cc",
"libcef/browser/extensions/mime_handler_view_guest_delegate.h",
"libcef/browser/extensions/value_store/cef_value_store.cc",
"libcef/browser/extensions/value_store/cef_value_store.h",
"libcef/browser/extensions/value_store/cef_value_store_factory.cc",
"libcef/browser/extensions/value_store/cef_value_store_factory.h",
"libcef/browser/file_dialog_manager.cc",
"libcef/browser/file_dialog_manager.h",
"libcef/browser/file_dialog_runner.cc",
@@ -565,8 +620,6 @@ source_set("libcef_static") {
"libcef/browser/frame_service_base.h",
"libcef/browser/global_preference_manager_impl.cc",
"libcef/browser/global_preference_manager_impl.h",
"libcef/browser/hang_monitor.cc",
"libcef/browser/hang_monitor.h",
"libcef/browser/image_impl.cc",
"libcef/browser/image_impl.h",
"libcef/browser/iothread_state.cc",
@@ -578,6 +631,8 @@ source_set("libcef_static") {
"libcef/browser/main_runner.h",
"libcef/browser/media_access_query.cc",
"libcef/browser/media_access_query.h",
"libcef/browser/media_capture_devices_dispatcher.cc",
"libcef/browser/media_capture_devices_dispatcher.h",
"libcef/browser/media_router/media_route_impl.cc",
"libcef/browser/media_router/media_route_impl.h",
"libcef/browser/media_router/media_router_impl.cc",
@@ -606,6 +661,12 @@ source_set("libcef_static") {
"libcef/browser/net/chrome_scheme_handler.cc",
"libcef/browser/net/chrome_scheme_handler.h",
"libcef/browser/net/crlset_file_util_impl.cc",
"libcef/browser/net/devtools_scheme_handler.cc",
"libcef/browser/net/devtools_scheme_handler.h",
"libcef/browser/net/internal_scheme_handler.cc",
"libcef/browser/net/internal_scheme_handler.h",
"libcef/browser/net/scheme_handler.cc",
"libcef/browser/net/scheme_handler.h",
"libcef/browser/net/throttle_handler.cc",
"libcef/browser/net/throttle_handler.h",
"libcef/browser/net_service/browser_urlrequest_impl.cc",
@@ -661,6 +722,8 @@ source_set("libcef_static") {
"libcef/browser/prefs/pref_helper.h",
"libcef/browser/prefs/pref_registrar.cc",
"libcef/browser/prefs/pref_registrar.h",
"libcef/browser/prefs/pref_store.cc",
"libcef/browser/prefs/pref_store.h",
"libcef/browser/prefs/renderer_prefs.cc",
"libcef/browser/prefs/renderer_prefs.h",
"libcef/browser/print_settings_impl.cc",
@@ -677,6 +740,10 @@ source_set("libcef_static") {
"libcef/browser/server_impl.h",
"libcef/browser/simple_menu_model_impl.cc",
"libcef/browser/simple_menu_model_impl.h",
"libcef/browser/speech_recognition_manager_delegate.cc",
"libcef/browser/speech_recognition_manager_delegate.h",
"libcef/browser/ssl_host_state_delegate.cc",
"libcef/browser/ssl_host_state_delegate.h",
"libcef/browser/ssl_info_impl.cc",
"libcef/browser/ssl_info_impl.h",
"libcef/browser/ssl_status_impl.cc",
@@ -705,8 +772,6 @@ source_set("libcef_static") {
"libcef/browser/views/browser_view_view.h",
"libcef/browser/views/button_impl.h",
"libcef/browser/views/button_view.h",
"libcef/browser/views/color_provider_tracker.cc",
"libcef/browser/views/color_provider_tracker.h",
"libcef/browser/views/display_impl.cc",
"libcef/browser/views/display_impl.h",
"libcef/browser/views/fill_layout_impl.cc",
@@ -742,11 +807,7 @@ source_set("libcef_static") {
"libcef/browser/views/view_util.cc",
"libcef/browser/views/view_util.h",
"libcef/browser/views/view_view.h",
"libcef/browser/views/widget.cc",
"libcef/browser/views/widget.h",
"libcef/browser/views/widget_destruction_observer.h",
"libcef/browser/views/widget_impl.cc",
"libcef/browser/views/widget_impl.h",
"libcef/browser/views/window_impl.cc",
"libcef/browser/views/window_impl.h",
"libcef/browser/views/window_view.cc",
@@ -759,6 +820,12 @@ source_set("libcef_static") {
"libcef/browser/xml_reader_impl.h",
"libcef/browser/zip_reader_impl.cc",
"libcef/browser/zip_reader_impl.h",
"libcef/common/alloy/alloy_content_client.cc",
"libcef/common/alloy/alloy_content_client.h",
"libcef/common/alloy/alloy_main_delegate.cc",
"libcef/common/alloy/alloy_main_delegate.h",
"libcef/common/alloy/alloy_main_runner_delegate.cc",
"libcef/common/alloy/alloy_main_runner_delegate.h",
"libcef/common/app_manager.cc",
"libcef/common/app_manager.h",
"libcef/common/base_impl.cc",
@@ -778,6 +845,14 @@ source_set("libcef_static") {
"libcef/common/crash_reporting.h",
"libcef/common/drag_data_impl.cc",
"libcef/common/drag_data_impl.h",
"libcef/common/extensions/chrome_generated_schemas.cc",
"libcef/common/extensions/chrome_generated_schemas.h",
"libcef/common/extensions/extensions_api_provider.cc",
"libcef/common/extensions/extensions_api_provider.h",
"libcef/common/extensions/extensions_client.cc",
"libcef/common/extensions/extensions_client.h",
"libcef/common/extensions/extensions_util.cc",
"libcef/common/extensions/extensions_util.h",
"libcef/common/file_util_impl.cc",
"libcef/common/frame_util.cc",
"libcef/common/frame_util.h",
@@ -787,6 +862,8 @@ source_set("libcef_static") {
"libcef/common/main_runner_handler.h",
"libcef/common/net/http_header_utils.cc",
"libcef/common/net/http_header_utils.h",
"libcef/common/net/net_resource_provider.cc",
"libcef/common/net/net_resource_provider.h",
"libcef/common/net/scheme_registration.cc",
"libcef/common/net/scheme_registration.h",
"libcef/common/net/url_util.cc",
@@ -836,6 +913,12 @@ source_set("libcef_static") {
"libcef/common/waitable_event_impl.h",
"libcef/features/runtime.h",
"libcef/features/runtime_checks.h",
"libcef/renderer/alloy/alloy_content_renderer_client.cc",
"libcef/renderer/alloy/alloy_content_renderer_client.h",
"libcef/renderer/alloy/alloy_render_thread_observer.cc",
"libcef/renderer/alloy/alloy_render_thread_observer.h",
"libcef/renderer/alloy/url_loader_throttle_provider_impl.cc",
"libcef/renderer/alloy/url_loader_throttle_provider_impl.h",
"libcef/renderer/browser_impl.cc",
"libcef/renderer/browser_impl.h",
"libcef/renderer/chrome/chrome_content_renderer_client_cef.cc",
@@ -844,10 +927,12 @@ source_set("libcef_static") {
"libcef/renderer/dom_document_impl.h",
"libcef/renderer/dom_node_impl.cc",
"libcef/renderer/dom_node_impl.h",
"libcef/renderer/extensions/extensions_renderer_api_provider.cc",
"libcef/renderer/extensions/extensions_renderer_api_provider.h",
"libcef/renderer/extensions/extensions_dispatcher_delegate.cc",
"libcef/renderer/extensions/extensions_dispatcher_delegate.h",
"libcef/renderer/extensions/extensions_renderer_client.cc",
"libcef/renderer/extensions/extensions_renderer_client.h",
"libcef/renderer/extensions/print_render_frame_helper_delegate.cc",
"libcef/renderer/extensions/print_render_frame_helper_delegate.h",
"libcef/renderer/frame_impl.cc",
"libcef/renderer/frame_impl.h",
"libcef/renderer/render_frame_observer.cc",
@@ -865,121 +950,6 @@ source_set("libcef_static") {
"//chrome/app/chrome_main_delegate.h",
]
if (enable_alloy_bootstrap) {
sources += [
"libcef/browser/alloy/alloy_browser_context.cc",
"libcef/browser/alloy/alloy_browser_context.h",
"libcef/browser/alloy/alloy_browser_main.cc",
"libcef/browser/alloy/alloy_browser_main.h",
"libcef/browser/alloy/alloy_content_browser_client.cc",
"libcef/browser/alloy/alloy_content_browser_client.h",
"libcef/browser/alloy/alloy_download_manager_delegate.cc",
"libcef/browser/alloy/alloy_download_manager_delegate.h",
"libcef/browser/alloy/alloy_download_util.cc",
"libcef/browser/alloy/alloy_download_util.h",
"libcef/browser/alloy/alloy_web_contents_view_delegate.cc",
"libcef/browser/alloy/alloy_web_contents_view_delegate.h",
"libcef/browser/alloy/devtools/alloy_devtools_window_runner.cc",
"libcef/browser/alloy/devtools/alloy_devtools_window_runner.h",
"libcef/browser/alloy/devtools/devtools_file_manager.cc",
"libcef/browser/alloy/devtools/devtools_file_manager.h",
"libcef/browser/alloy/devtools/devtools_frontend.cc",
"libcef/browser/alloy/devtools/devtools_frontend.h",
"libcef/browser/alloy/devtools/devtools_manager_delegate.cc",
"libcef/browser/alloy/devtools/devtools_manager_delegate.h",
"libcef/browser/alloy/dialogs/alloy_javascript_dialog_manager_delegate.cc",
"libcef/browser/alloy/dialogs/alloy_javascript_dialog_manager_delegate.h",
"libcef/browser/alloy/chrome_browser_process_alloy.cc",
"libcef/browser/alloy/chrome_browser_process_alloy.h",
"libcef/browser/alloy/chrome_profile_manager_alloy.cc",
"libcef/browser/alloy/chrome_profile_manager_alloy.h",
"libcef/browser/alloy/chrome_profile_alloy.cc",
"libcef/browser/alloy/chrome_profile_alloy.h",
"libcef/browser/browser_context_keyed_service_factories.cc",
"libcef/browser/browser_context_keyed_service_factories.h",
"libcef/browser/extension_impl.cc",
"libcef/browser/extension_impl.h",
"libcef/browser/extensions/api/file_system/cef_file_system_delegate.cc",
"libcef/browser/extensions/api/file_system/cef_file_system_delegate.h",
"libcef/browser/extensions/api/storage/sync_value_store_cache.cc",
"libcef/browser/extensions/api/storage/sync_value_store_cache.h",
"libcef/browser/extensions/api/tabs/tabs_api.cc",
"libcef/browser/extensions/api/tabs/tabs_api.h",
"libcef/browser/extensions/alloy_extensions_util.cc",
"libcef/browser/extensions/alloy_extensions_util.h",
"libcef/browser/extensions/browser_platform_delegate_background.cc",
"libcef/browser/extensions/browser_platform_delegate_background.h",
"libcef/browser/extensions/chrome_api_registration.cc",
"libcef/browser/extensions/chrome_api_registration.h",
"libcef/browser/extensions/component_extension_resource_manager.cc",
"libcef/browser/extensions/component_extension_resource_manager.h",
"libcef/browser/extensions/extensions_api_client.cc",
"libcef/browser/extensions/extensions_api_client.h",
"libcef/browser/extensions/extensions_browser_api_provider.cc",
"libcef/browser/extensions/extensions_browser_api_provider.h",
"libcef/browser/extensions/extensions_browser_client.cc",
"libcef/browser/extensions/extensions_browser_client.h",
"libcef/browser/extensions/extension_background_host.cc",
"libcef/browser/extensions/extension_background_host.h",
"libcef/browser/extensions/extension_function_details.cc",
"libcef/browser/extensions/extension_function_details.h",
"libcef/browser/extensions/extension_host_delegate.cc",
"libcef/browser/extensions/extension_host_delegate.h",
"libcef/browser/extensions/extension_system.cc",
"libcef/browser/extensions/extension_system.h",
"libcef/browser/extensions/extension_system_factory.cc",
"libcef/browser/extensions/extension_system_factory.h",
"libcef/browser/extensions/extension_view_host.cc",
"libcef/browser/extensions/extension_view_host.h",
"libcef/browser/extensions/extension_web_contents_observer.cc",
"libcef/browser/extensions/extension_web_contents_observer.h",
"libcef/browser/extensions/mime_handler_view_guest_delegate.cc",
"libcef/browser/extensions/mime_handler_view_guest_delegate.h",
"libcef/browser/extensions/value_store/cef_value_store.cc",
"libcef/browser/extensions/value_store/cef_value_store.h",
"libcef/browser/extensions/value_store/cef_value_store_factory.cc",
"libcef/browser/extensions/value_store/cef_value_store_factory.h",
"libcef/browser/media_capture_devices_dispatcher.cc",
"libcef/browser/media_capture_devices_dispatcher.h",
"libcef/browser/net/devtools_scheme_handler.cc",
"libcef/browser/net/devtools_scheme_handler.h",
"libcef/browser/net/internal_scheme_handler.cc",
"libcef/browser/net/internal_scheme_handler.h",
"libcef/browser/net/scheme_handler.cc",
"libcef/browser/net/scheme_handler.h",
"libcef/browser/prefs/pref_store.cc",
"libcef/browser/prefs/pref_store.h",
"libcef/browser/speech_recognition_manager_delegate.cc",
"libcef/browser/speech_recognition_manager_delegate.h",
"libcef/browser/ssl_host_state_delegate.cc",
"libcef/browser/ssl_host_state_delegate.h",
"libcef/common/alloy/alloy_content_client.cc",
"libcef/common/alloy/alloy_content_client.h",
"libcef/common/alloy/alloy_main_delegate.cc",
"libcef/common/alloy/alloy_main_delegate.h",
"libcef/common/alloy/alloy_main_runner_delegate.cc",
"libcef/common/alloy/alloy_main_runner_delegate.h",
"libcef/common/extensions/chrome_generated_schemas.cc",
"libcef/common/extensions/chrome_generated_schemas.h",
"libcef/common/extensions/extensions_api_provider.cc",
"libcef/common/extensions/extensions_api_provider.h",
"libcef/common/extensions/extensions_client.cc",
"libcef/common/extensions/extensions_client.h",
"libcef/common/extensions/extensions_util.cc",
"libcef/common/extensions/extensions_util.h",
"libcef/common/net/net_resource_provider.cc",
"libcef/common/net/net_resource_provider.h",
"libcef/renderer/alloy/alloy_content_renderer_client.cc",
"libcef/renderer/alloy/alloy_content_renderer_client.h",
"libcef/renderer/alloy/alloy_render_frame_observer.cc",
"libcef/renderer/alloy/alloy_render_frame_observer.h",
"libcef/renderer/alloy/alloy_render_thread_observer.cc",
"libcef/renderer/alloy/alloy_render_thread_observer.h",
"libcef/renderer/alloy/url_loader_throttle_provider_impl.cc",
"libcef/renderer/alloy/url_loader_throttle_provider_impl.h",
]
}
configs += [
"libcef/features:config",
"//build/config:precompiled_headers",
@@ -1017,6 +987,7 @@ source_set("libcef_static") {
# Normal build dependencies. Should be sorted alphabetically.
"//base:base_static",
"//base/third_party/dynamic_annotations",
"//cc",
"//chrome:dependencies",
"//chrome:packed_resources",
@@ -1127,6 +1098,12 @@ source_set("libcef_static") {
deps += [ "//content:sandbox_helper_win" ]
}
libs = [
"comctl32.lib",
# For D3D11_DECODER_PROFILE_H264_VLD_NOFGT.
"dxguid.lib",
]
data_deps = [
"//chrome/elevation_service",
]
@@ -1144,30 +1121,27 @@ source_set("libcef_static") {
"libcef/common/util_linux.cc",
]
deps += [
"//build/config/freetype",
"//third_party/fontconfig",
]
if (ozone_platform_x11) {
sources += [
"libcef/browser/native/window_x11.cc",
"libcef/browser/native/window_x11.h",
]
} else {
deps += [ "//third_party/angle:libEGL" ]
}
if (use_dbus) {
deps += [ "//dbus" ]
defines = [ "USE_DBUS" ]
deps += [
"//build/config/freetype",
"//third_party/fontconfig",
]
if (is_linux && !ozone_platform_x11) {
deps += [
"//third_party/angle:libEGL",
]
}
}
if (is_mac) {
sources += includes_mac + [
"libcef/browser/chrome/chrome_content_browser_client_cef_mac.mm",
"libcef/browser/chrome/chrome_web_contents_view_delegate_cef_mac.mm",
"libcef/browser/native/browser_platform_delegate_native_mac.h",
"libcef/browser/native/browser_platform_delegate_native_mac.mm",
"libcef/browser/native/cursor_util_mac.mm",
@@ -1189,10 +1163,6 @@ source_set("libcef_static") {
"//chrome/app/chrome_main_mac.h",
"//chrome/app/chrome_main_mac.mm",
]
} else {
sources += [
"libcef/browser/chrome/chrome_web_contents_view_delegate_cef.cc",
]
}
if (ozone_platform_x11) {
@@ -1243,30 +1213,19 @@ config("libcef_autogen_config") {
}
}
# Configuration that supports #include paths relative to src/cef/ for CEF
# client-side code. CEF library-side code (Chromium code and cef/libcef/
# directory) uses #include paths relative to src/. See libcef/features:config
# for CEF library-side configuration.
config("libcef_includes_config") {
include_dirs = [
# cef/include/ directory and CEF client-side code use #includes relative to
# the cef/ directory.
".",
# CEF generated header files that also need to be discoverable.
# These #includes from client-side code will not be prefixed with cef/.
# They will be copied to the include/ directory in the binary distribution.
"$root_out_dir/includes/cef",
]
}
# Configuration that will be applied to all targets that depend on
# libcef_dll_wrapper.
config("libcef_dll_wrapper_config") {
configs = [
":libcef_autogen_config",
":libcef_includes_config",
include_dirs = [
# CEF sources use include paths relative to the CEF root directory.
".",
# CEF generates some header files that also need to be discoverable.
# They will be copied to the include/ directory in the binary distribution.
"$root_out_dir/includes",
]
configs = [ ":libcef_autogen_config" ]
if (is_win) {
if (current_cpu == "x86") {
# Set the initial stack size to 0.5MiB, instead of the 1.5MiB minimum
@@ -1314,23 +1273,20 @@ static_library("libcef_dll_wrapper") {
if (is_win) {
static_library("cef_sandbox") {
sources = [ "libcef_dll/sandbox/sandbox_win.cc" ]
configs += [ ":libcef_includes_config" ]
deps = [
":make_config_header",
"libcef/features",
"//sandbox",
]
# CEF sources use include paths relative to the CEF root directory.
include_dirs = [ "." ]
deps = [ "libcef/features", "//sandbox" ]
}
}
if (is_mac) {
static_library("cef_sandbox") {
sources = [ "libcef_dll/sandbox/sandbox_mac.mm" ]
configs += [ ":libcef_includes_config" ]
# CEF sources use include paths relative to the CEF root directory.
include_dirs = [ "." ]
deps = [
":make_config_header",
"//build/config:executable_deps",
"//sandbox/mac:seatbelt",
"//sandbox/mac:seatbelt"
]
}
}
@@ -1386,7 +1342,7 @@ template("make_pack_header") {
# Generate cef_pack_resources.h.
make_pack_header("resources") {
header = "$root_out_dir/includes/cef/include/cef_pack_resources.h"
header = "$root_out_dir/includes/include/cef_pack_resources.h"
inputs = [
"$root_gen_dir/base/tracing/protos/grit/tracing_proto_resources.h",
"$root_gen_dir/cef/grit/cef_resources.h",
@@ -1450,7 +1406,7 @@ make_pack_header("resources") {
# Generate cef_pack_strings.h.
make_pack_header("strings") {
header = "$root_out_dir/includes/cef/include/cef_pack_strings.h"
header = "$root_out_dir/includes/include/cef_pack_strings.h"
inputs = [
"$root_gen_dir/cef/grit/cef_strings.h",
"$root_gen_dir/chrome/grit/branded_strings.h",
@@ -1488,7 +1444,7 @@ make_pack_header("strings") {
# Generate cef_command_ids.h.
make_pack_header("command_ids") {
header = "$root_out_dir/includes/cef/include/cef_command_ids.h"
header = "$root_out_dir/includes/include/cef_command_ids.h"
inputs = [
"//chrome/app/chrome_command_ids.h",
]
@@ -1506,43 +1462,18 @@ action("make_api_hash_header") {
gypi_paths2.includes_capi +
gypi_paths.autogen_capi_includes
include_dir = [ "include" ]
outputs = [ "$root_out_dir/includes/cef/include/cef_api_hash.h" ]
outputs = [ "$root_out_dir/includes/include/cef_api_hash.h" ]
args = rebase_path(outputs + include_dir, root_build_dir)
}
# This no-op action lists args.gn as an output, allowing it to be referenced as
# an input (trigger) for other actions. Otherwise, GN will complain that no
# target generates the args.gn file because its below the $root_out_dir.
action("args_gn_source") {
script = "//build/noop.py"
outputs = [ "$root_out_dir/args.gn" ]
}
# Generate cef_config.h.
action("make_config_header") {
script = "tools/make_config_header.py"
deps = [ ":args_gn_source" ]
outputs = [ "$root_out_dir/includes/include/cef_config.h" ]
inputs = [ "$root_out_dir/args.gn" ]
outputs = [ "$root_out_dir/includes/cef/include/cef_config.h" ]
args = rebase_path(outputs + inputs, root_build_dir)
}
# Generate cef_color_ids.h.
action("make_colorids_header") {
script = "tools/make_colorids_header.py"
inputs = [
"//ui/color/color_id.h",
"//components/color/color_id.h",
"//chrome/browser/ui/color/chrome_color_id.h",
]
outputs = [ "$root_out_dir/includes/cef/include/cef_color_ids.h" ]
args = rebase_path(outputs + inputs, root_build_dir)
args = rebase_path(outputs + [ "$root_out_dir/args.gn" ], root_build_dir)
}
# Generate pack files and associated CEF header files.
@@ -1553,7 +1484,6 @@ group("cef_make_headers") {
":make_pack_header_command_ids",
":make_api_hash_header",
":make_config_header",
":make_colorids_header",
]
}
@@ -1751,12 +1681,6 @@ if (is_mac) {
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
configs += [ "//build/config/win:delayloads" ]
libs = [
"comctl32.lib",
# For D3D11_DECODER_PROFILE_H264_VLD_NOFGT.
"dxguid.lib",
]
}
if (is_linux && !is_debug && !use_partition_alloc_as_malloc) {
@@ -1976,6 +1900,13 @@ if (is_mac) {
]
}
bundle_data("cefclient_resources_bundle_data_extensions_set_page_color") {
sources = gypi_paths2.cefclient_sources_resources_extensions_set_page_color
outputs = [
"{{bundle_resources_dir}}/extensions/set_page_color/{{source_file_part}}",
]
}
bundle_data("cefclient_resources_bundle_data_english") {
sources = [
"tests/cefclient/resources/mac/English.lproj/InfoPlist.strings",
@@ -2025,12 +1956,12 @@ if (is_mac) {
gypi_paths2.cefclient_sources_mac
deps = [
":cefclient_resources_bundle_data",
":cefclient_resources_bundle_data_extensions_set_page_color",
":cefclient_resources_bundle_data_english",
":cefclient_xibs",
]
frameworks = [
"AppKit.framework",
"IOSurface.framework",
"OpenGL.framework",
]
defines = [
@@ -2214,6 +2145,11 @@ if (is_mac) {
gypi_paths2.cefclient_sources_resources
outputs = [ "${root_out_dir}/cefclient_files/{{source_file_part}}" ]
}
copy("copy_cefclient_files_extensions_set_page_color") {
sources = gypi_paths2.cefclient_sources_resources_extensions_set_page_color
outputs = [ "${root_out_dir}/cefclient_files/extensions/set_page_color/{{source_file_part}}" ]
}
}
executable("cefclient") {
@@ -2271,13 +2207,8 @@ if (is_mac) {
if (target_cpu != "arm64") {
libs += [
"glu32.lib",
"opengl32.lib",
]
ldflags = [
"/DELAYLOAD:glu32.dll",
"/DELAYLOAD:oleaut32.dll",
"/DELAYLOAD:opengl32.dll",
"glu32.lib"
]
}
}
@@ -2289,6 +2220,7 @@ if (is_mac) {
deps += [
":copy_cefclient_files",
":copy_cefclient_files_extensions_set_page_color",
]
libs = [

View File

@@ -7,6 +7,6 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/126.0.6478.183',
'depot_tools_checkout': 'fca881606e'
'chromium_checkout': 'refs/tags/122.0.6261.130',
'depot_tools_checkout': '10bd39fd47'
}

View File

@@ -39,7 +39,6 @@
'chrome/renderer/chrome_content_renderer_client.*',
'chrome/renderer/extensions/chrome_extensions_renderer_client.*',
'components/content_settings/core/common/content_settings_types.mojom',
'components/permissions/request_type.h',
'content/browser/renderer_host/render_widget_host_view_base.*',
'content/public/browser/content_browser_client.*',
'content/public/browser/render_widget_host_view.h',

View File

@@ -240,18 +240,16 @@ PRINT_CEF_CONFIG()
# Define the API documentation target.
#
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile")
find_package(Doxygen)
if(DOXYGEN_FOUND)
add_custom_target(apidocs ALL
# Generate documentation in the docs/html directory.
COMMAND "${DOXYGEN_EXECUTABLE}" Doxyfile
# Write a docs/index.html file.
COMMAND ${CMAKE_COMMAND} -E echo "<html><head><meta http-equiv=\"refresh\" content=\"0;URL='html/index.html'\"/></head></html>" > docs/index.html
WORKING_DIRECTORY "${CEF_ROOT}"
COMMENT "Generating API documentation with Doxygen..."
VERBATIM )
else()
message(WARNING "Doxygen must be installed to generate API documentation.")
endif()
endif()
find_package(Doxygen)
if(DOXYGEN_FOUND)
add_custom_target(apidocs ALL
# Generate documentation in the docs/html directory.
COMMAND "${DOXYGEN_EXECUTABLE}" Doxyfile
# Write a docs/index.html file.
COMMAND ${CMAKE_COMMAND} -E echo "<html><head><meta http-equiv=\"refresh\" content=\"0;URL='html/index.html'\"/></head></html>" > docs/index.html
WORKING_DIRECTORY "${CEF_ROOT}"
COMMENT "Generating API documentation with Doxygen..."
VERBATIM )
else()
message(WARNING "Doxygen must be installed to generate API documentation.")
endif()

View File

@@ -8,7 +8,7 @@
# by hand. See the translator.README.txt file in the tools directory for
# more information.
#
# $hash=3b28f3236c16d2b776a44674ae3bae0a070e9f27$
# $hash=25599539f43226aac01bfcb74f19ac74217aee9a$
#
{
@@ -85,7 +85,6 @@
'include/cef_task.h',
'include/cef_thread.h',
'include/cef_trace.h',
'include/cef_unresponsive_process_callback.h',
'include/cef_urlrequest.h',
'include/cef_v8.h',
'include/cef_values.h',
@@ -190,7 +189,6 @@
'include/capi/cef_task_capi.h',
'include/capi/cef_thread_capi.h',
'include/capi/cef_trace_capi.h',
'include/capi/cef_unresponsive_process_callback_capi.h',
'include/capi/cef_urlrequest_capi.h',
'include/capi/cef_v8_capi.h',
'include/capi/cef_values_capi.h',
@@ -510,8 +508,6 @@
'libcef_dll/cpptoc/urlrequest_cpptoc.h',
'libcef_dll/ctocpp/urlrequest_client_ctocpp.cc',
'libcef_dll/ctocpp/urlrequest_client_ctocpp.h',
'libcef_dll/cpptoc/unresponsive_process_callback_cpptoc.cc',
'libcef_dll/cpptoc/unresponsive_process_callback_cpptoc.h',
'libcef_dll/ctocpp/v8accessor_ctocpp.cc',
'libcef_dll/ctocpp/v8accessor_ctocpp.h',
'libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.cc',
@@ -840,8 +836,6 @@
'libcef_dll/ctocpp/urlrequest_ctocpp.h',
'libcef_dll/cpptoc/urlrequest_client_cpptoc.cc',
'libcef_dll/cpptoc/urlrequest_client_cpptoc.h',
'libcef_dll/ctocpp/unresponsive_process_callback_ctocpp.cc',
'libcef_dll/ctocpp/unresponsive_process_callback_ctocpp.h',
'libcef_dll/cpptoc/v8accessor_cpptoc.cc',
'libcef_dll/cpptoc/v8accessor_cpptoc.h',
'libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.cc',

View File

@@ -20,6 +20,7 @@
'include/base/cef_logging.h',
'include/base/cef_macros.h',
'include/base/cef_platform_thread.h',
'include/base/cef_ptr_util.h',
'include/base/cef_ref_counted.h',
'include/base/cef_scoped_refptr.h',
'include/base/cef_thread_checker.h',
@@ -28,7 +29,6 @@
'include/base/cef_weak_ptr.h',
'include/base/internal/cef_bind_internal.h',
'include/base/internal/cef_callback_internal.h',
'include/base/internal/cef_color_id_macros.inc',
'include/base/internal/cef_lock_impl.h',
'include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h',
'include/base/internal/cef_scoped_policy.h',
@@ -55,8 +55,6 @@
'include/internal/cef_types.h',
'include/internal/cef_types_content_settings.h',
'include/internal/cef_types_geometry.h',
'include/internal/cef_types_runtime.h',
'include/internal/cef_types_color.h',
],
'includes_capi': [
'include/capi/cef_base_capi.h',
@@ -166,6 +164,8 @@
'shared_sources_browser': [
'tests/shared/browser/client_app_browser.cc',
'tests/shared/browser/client_app_browser.h',
'tests/shared/browser/extension_util.cc',
'tests/shared/browser/extension_util.h',
'tests/shared/browser/file_util.cc',
'tests/shared/browser/file_util.h',
'tests/shared/browser/geometry_util.cc',
@@ -220,8 +220,6 @@
'tests/shared/browser/util_win.h',
],
'cefclient_sources_browser': [
'tests/cefclient/browser/base_client_handler.cc',
'tests/cefclient/browser/base_client_handler.h',
'tests/cefclient/browser/binary_transfer_test.cc',
'tests/cefclient/browser/binary_transfer_test.h',
'tests/cefclient/browser/binding_test.cc',
@@ -242,11 +240,10 @@
'tests/cefclient/browser/client_prefs.cc',
'tests/cefclient/browser/client_prefs.h',
'tests/cefclient/browser/client_types.h',
'tests/cefclient/browser/default_client_handler.cc',
'tests/cefclient/browser/default_client_handler.h',
'tests/cefclient/browser/dialog_test.cc',
'tests/cefclient/browser/dialog_test.h',
'tests/cefclient/browser/hang_test.cc',
'tests/cefclient/browser/hang_test.h',
'tests/cefclient/browser/image_cache.cc',
'tests/cefclient/browser/image_cache.h',
'tests/cefclient/browser/main_context.cc',
@@ -312,12 +309,11 @@
'tests/cefclient/renderer/performance_test_tests.cc',
],
'cefclient_sources_resources': [
'tests/cefclient/resources/binary_transfer.html',
'tests/cefclient/resources/binding.html',
'tests/cefclient/resources/dialogs.html',
'tests/cefclient/resources/draggable.html',
'tests/cefclient/resources/hang.html',
'tests/cefclient/resources/ipc_performance.html',
'tests/cefclient/resources/binary_transfer.html',
'tests/cefclient/resources/localstorage.html',
'tests/cefclient/resources/logo.png',
'tests/cefclient/resources/media_router.html',
@@ -335,6 +331,13 @@
'tests/cefclient/resources/window.html',
'tests/cefclient/resources/xmlhttprequest.html',
],
'cefclient_sources_resources_extensions_set_page_color': [
'tests/cefclient/resources/extensions/set_page_color/icon.png',
'tests/cefclient/resources/extensions/set_page_color/manifest.json',
'tests/cefclient/resources/extensions/set_page_color/popup.html',
'tests/cefclient/resources/extensions/set_page_color/popup.js',
'tests/cefclient/resources/extensions/set_page_color/README.md',
],
'cefclient_sources_win': [
'tests/cefclient/browser/browser_window_osr_win.cc',
'tests/cefclient/browser/browser_window_osr_win.h',
@@ -481,6 +484,13 @@
'tests/ceftests/dom_unittest.cc',
'tests/ceftests/download_unittest.cc',
'tests/ceftests/draggable_regions_unittest.cc',
'tests/ceftests/extensions/background_unittest.cc',
'tests/ceftests/extensions/chrome_alarms_unittest.cc',
'tests/ceftests/extensions/chrome_storage_unittest.cc',
'tests/ceftests/extensions/chrome_tabs_unittest.cc',
'tests/ceftests/extensions/extension_test_handler.cc',
'tests/ceftests/extensions/extension_test_handler.h',
'tests/ceftests/extensions/view_unittest.cc',
'tests/ceftests/file_util_unittest.cc',
'tests/ceftests/frame_handler_unittest.cc',
'tests/ceftests/frame_unittest.cc',

View File

@@ -304,9 +304,8 @@ if(OS_MAC)
# Standard libraries.
set(CEF_STANDARD_LIBS
-lpthread
"-framework AppKit"
"-framework Cocoa"
"-framework IOSurface"
"-framework AppKit"
)
# Find the newest available base SDK.

View File

@@ -69,28 +69,7 @@
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "build/build_config.h"
#include "cef/libcef/features/features.h"
// The following #defines are used in cef/include/ headers and CEF client-side
// code. CEF library-side code should use BUILDFLAG checks directly instead of
// these #defines. CEF client-side code will get these #defines from
// cef_config.h so any changes must also be reflected in
// tools/make_config_header.py.
#if BUILDFLAG(IS_LINUX)
#include "ui/base/ozone_buildflags.h"
#if BUILDFLAG(IS_OZONE_X11)
#define CEF_X11 1
#endif
#endif
#if !BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
#define DISABLE_ALLOY_BOOTSTRAP 1
#endif
#else // !USING_CHROMIUM_INCLUDES
#include "include/cef_config.h"
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2021 Marshall A. Greenblatt. Portions copyright (c) 2015
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -27,31 +28,33 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_COLOR_H_
#define CEF_INCLUDE_INTERNAL_CEF_TYPES_COLOR_H_
#ifndef INCLUDE_BASE_CEF_PTR_UTIL_H_
#define INCLUDE_BASE_CEF_PTR_UTIL_H_
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/memory/ptr_util.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <memory>
#include <utility>
namespace base {
///
/// Describes how to interpret the components of a pixel.
/// Helper to transfer ownership of a raw pointer to a std::unique_ptr<T>.
/// Note that std::unique_ptr<T> has very different semantics from
/// std::unique_ptr<T[]>: do not use this helper for array allocations.
///
typedef enum {
///
/// RGBA with 8 bits per pixel (32bits total).
///
CEF_COLOR_TYPE_RGBA_8888,
///
/// BGRA with 8 bits per pixel (32bits total).
///
CEF_COLOR_TYPE_BGRA_8888,
} cef_color_type_t;
#ifdef __cplusplus
template <typename T>
std::unique_ptr<T> WrapUnique(T* ptr) {
return std::unique_ptr<T>(ptr);
}
#endif
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_COLOR_H_
} // namespace base
#endif // INCLUDE_BASE_CEF_PTR_UTIL_H_

View File

@@ -66,7 +66,6 @@
// updated to match.
#include <stddef.h>
#include <tuple>
#include <utility>

View File

@@ -1,50 +0,0 @@
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The following macros are used to declare both the color id enumerations and
// the stringized names of the enumeration elements for use in dump_colors. To
// stringize the element names, define STRINGIZE_COLOR_IDS prior to including
// this file. This file is intended to be included just before and just after
// the enumeration or string array declarations.
#if !defined(COLOR_ID_MACROS_DEFINED)
#define COLOR_ID_MACROS_DEFINED
#if defined(STRINGIZE_COLOR_IDS)
// Convert first token to string, throw away the rest.
#define D1(enum_name) #enum_name
#define D2(enum_name, enum_value) #enum_name
#else // defined(STRINGIZE_COLOR_IDS)
// Declare enum with optional assigned value.
#define D1(enum_name) enum_name
#define D2(enum_name, enum_value) enum_name = enum_value
#endif // defined(STRINGIZE_COLOR_IDS)
// Select which token in the declaration is the assigned value.
// Use first and optional third token, ignore optional second.
#define E1(enum_name) D1(enum_name)
#define E2(enum_name, old_enum_name) D1(enum_name)
#define E3(enum_name, old_enum_name, enum_value) D2(enum_name, enum_value)
#define GET_E(_1, _2, _3, macro_name, ...) macro_name
#if defined(COMPILER_MSVC)
// Workaround for MSVC not properly expanding __VA_ARGS__.
#define EXPAND(x) x
#define E_CPONLY(...) EXPAND(E(__VA_ARGS__))
#define E(...) EXPAND(GET_E(__VA_ARGS__, E3, E2, E1)(__VA_ARGS__)),
#else // !defined(COMPILER_MSVC)
#define E_CPONLY(...) E(__VA_ARGS__)
#define E(...) GET_E(__VA_ARGS__, E3, E2, E1)(__VA_ARGS__),
#endif // !defined(COMPILER_MSVC)
#else // !defined(COLOR_ID_MACROS_DEFINED)
#undef D1
#undef D2
#undef E1
#undef E2
#undef E3
#if defined(COMPILER_MSVC)
#undef EXPAND
#endif
#undef E_CPONLY
#undef GET_E
#undef E
#undef COLOR_ID_MACROS_DEFINED
#endif // !defined(COLOR_ID_MACROS_DEFINED)

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=dfa0d4d2da319b2fd5e92324fd14301b500ceb5c$
// $hash=b9a2bad4a30bcb99384197c9f7409116dc5b376e$
//
#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
@@ -137,26 +137,15 @@ CEF_EXPORT int cef_execute_process(const cef_main_args_t* args,
/// true (1) if initialization succeeds. Returns false (0) if initialization
/// fails or if early exit is desired (for example, due to process singleton
/// relaunch behavior). If this function returns false (0) then the application
/// should exit immediately without calling any other CEF functions except,
/// optionally, CefGetErrorCode. The |windows_sandbox_info| parameter is only
/// used on Windows and may be NULL (see cef_sandbox_win.h for details).
/// should exit immediately without calling any other CEF functions. The
/// |windows_sandbox_info| parameter is only used on Windows and may be NULL
/// (see cef_sandbox_win.h for details).
///
CEF_EXPORT int cef_initialize(const cef_main_args_t* args,
const struct _cef_settings_t* settings,
cef_app_t* application,
void* windows_sandbox_info);
///
/// This function can optionally be called on the main application thread after
/// CefInitialize to retrieve the initialization exit code. When CefInitialize
/// returns true (1) the exit code will be 0 (CEF_RESULT_CODE_NORMAL_EXIT).
/// Otherwise, see cef_resultcode_t for possible exit code values including
/// browser process initialization errors and normal early exit conditions (such
/// as CEF_RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED for process singleton
/// relaunch behavior).
///
CEF_EXPORT int cef_get_exit_code(void);
///
/// This function should be called on the main application thread to shut down
/// the CEF browser process before the application exits. Do not call any other

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=6ee74f31d37a1b5ab3c9c5ccbe2dce9841329b38$
// $hash=e7f9480661f77931890085d6c5bf23d9842212e2$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
@@ -911,8 +911,6 @@ typedef struct _cef_browser_host_t {
/// Returns the extension hosted in this browser or NULL if no extension is
/// hosted. See cef_request_context_t::LoadExtension for details.
///
/// WARNING: This function is deprecated and will be removed in ~M127.
///
struct _cef_extension_t*(CEF_CALLBACK* get_extension)(
struct _cef_browser_host_t* self);
@@ -921,8 +919,6 @@ typedef struct _cef_browser_host_t {
/// script. Background hosts do not have a window and are not displayable. See
/// cef_request_context_t::LoadExtension for details.
///
/// WARNING: This function is deprecated and will be removed in ~M127.
///
int(CEF_CALLBACK* is_background_host)(struct _cef_browser_host_t* self);
///
@@ -978,24 +974,6 @@ typedef struct _cef_browser_host_t {
struct _cef_browser_host_t* self,
int command_id,
cef_window_open_disposition_t disposition);
///
/// Returns true (1) if the render process associated with this browser is
/// currently unresponsive as indicated by a lack of input event processing
/// for at least 15 seconds. To receive associated state change notifications
/// and optionally handle an unresponsive render process implement
/// cef_request_handler_t::OnRenderProcessUnresponsive. This function can only
/// be called on the UI thread.
///
int(CEF_CALLBACK* is_render_process_unresponsive)(
struct _cef_browser_host_t* self);
///
/// Returns the runtime style for this browser (ALLOY or CHROME). See
/// cef_runtime_style_t documentation for details.
///
cef_runtime_style_t(CEF_CALLBACK* get_runtime_style)(
struct _cef_browser_host_t* self);
} cef_browser_host_t;
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=bf7208a86ee17f63fd7163cef8c3a13373a1f1c8$
// $hash=5644fdc2453dd083079bf9e3616b687eeb49f250$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
@@ -86,20 +86,13 @@ typedef struct _cef_dialog_handler_t {
/// to show the default title ("Open" or "Save" depending on the mode).
/// |default_file_path| is the path with optional directory and/or file name
/// component that should be initially selected in the dialog.
/// |accept_filters| are used to restrict the selectable file types and may be
/// any combination of valid lower-cased MIME types (e.g. "text/*" or
/// "image/*") and individual file extensions (e.g. ".txt" or ".png").
/// |accept_extensions| provides the semicolon-delimited expansion of MIME
/// types to file extensions (if known, or NULL string otherwise).
/// |accept_descriptions| provides the descriptions for MIME types (if known,
/// or NULL string otherwise). For example, the "image/*" mime type might have
/// extensions ".png;.jpg;.bmp;..." and description "Image Files".
/// |accept_filters|, |accept_extensions| and |accept_descriptions| will all
/// be the same size. To display a custom dialog return true (1) and execute
/// |callback| either inline or at a later time. To display the default dialog
/// return false (0). If this function returns false (0) it may be called an
/// additional time for the same dialog (both before and after MIME type
/// expansion).
/// |accept_filters| are used to restrict the selectable file types and may
/// any combination of (a) valid lower-cased MIME types (e.g. "text/*" or
/// "image/*"), (b) individual file extensions (e.g. ".txt" or ".png"), or (c)
/// combined description and file extension delimited using "|" and ";" (e.g.
/// "Image Types|.png;.gif;.jpg"). To display a custom dialog return true (1)
/// and execute |callback| either inline or at a later time. To display the
/// default dialog return false (0).
///
int(CEF_CALLBACK* on_file_dialog)(
struct _cef_dialog_handler_t* self,
@@ -108,8 +101,6 @@ typedef struct _cef_dialog_handler_t {
const cef_string_t* title,
const cef_string_t* default_file_path,
cef_string_list_t accept_filters,
cef_string_list_t accept_extensions,
cef_string_list_t accept_descriptions,
struct _cef_file_dialog_callback_t* callback);
} cef_dialog_handler_t;

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=7ecfb07a95315ff81937e9f68d419122fc88f1b7$
// $hash=60a08a60be70e8fe5df17f18f8e5758e1830d5e1$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
@@ -117,13 +117,12 @@ typedef struct _cef_download_handler_t {
///
/// Called before a download begins. |suggested_name| is the suggested name
/// for the download file. Return true (1) and execute |callback| either
/// asynchronously or in this function to continue or cancel the download.
/// Return false (0) to proceed with default handling (cancel with Alloy
/// style, download shelf with Chrome style). Do not keep a reference to
/// |download_item| outside of this function.
/// for the download file. By default the download will be canceled. Execute
/// |callback| either asynchronously or in this function to continue the
/// download if desired. Do not keep a reference to |download_item| outside of
/// this function.
///
int(CEF_CALLBACK* on_before_download)(
void(CEF_CALLBACK* on_before_download)(
struct _cef_download_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_download_item_t* download_item,

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=634054ad25154c30fb4ec630fe7fb79b0cf1f9b3$
// $hash=0ca2b788f70f8c9f5b2706d691d8e063be00ed19$
//
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_
@@ -54,8 +54,6 @@ struct _cef_request_context_t;
/// Object representing an extension. Methods may be called on any thread unless
/// otherwise indicated.
///
/// WARNING: This API is deprecated and will be removed in ~M127.
///
typedef struct _cef_extension_t {
///
/// Base structure.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=ebac34c9b85de780ce7524211c5dd61a80d4576c$
// $hash=5cfff4465a586d2b2ea7b54a9549096faec415f6$
//
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_
@@ -80,8 +80,6 @@ typedef struct _cef_get_extension_resource_callback_t {
/// cef_request_context_t::LoadExtension for information about extension
/// loading.
///
/// WARNING: This API is deprecated and will be removed in ~M127.
///
typedef struct _cef_extension_handler_t {
///
/// Base structure.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5151b6ea3c06e46a75f2cd7679044a2891063d29$
// $hash=5309b2f6da62526ed92c928c0918bc27898cf03b$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
@@ -149,27 +149,17 @@ typedef struct _cef_render_handler_t {
/// Called when an element has been rendered to the shared texture handle.
/// |type| indicates whether the element is the view or the popup widget.
/// |dirtyRects| contains the set of rectangles in pixel coordinates that need
/// to be repainted. |info| contains the shared handle; on Windows it is a
/// HANDLE to a texture that can be opened with D3D11 OpenSharedResource, on
/// macOS it is an IOSurface pointer that can be opened with Metal or OpenGL,
/// and on Linux it contains several planes, each with an fd to the underlying
/// system native buffer.
/// to be repainted. |shared_handle| is the handle for a D3D11 Texture2D that
/// can be accessed via ID3D11Device using the OpenSharedResource function.
/// This function is only called when cef_window_tInfo::shared_texture_enabled
/// is set to true (1), and is currently only supported on Windows.
///
/// The underlying implementation uses a pool to deliver frames. As a result,
/// the handle may differ every frame depending on how many frames are in-
/// progress. The handle's resource cannot be cached and cannot be accessed
/// outside of this callback. It should be reopened each time this callback is
/// executed and the contents should be copied to a texture owned by the
/// client application. The contents of |info| will be released back to the
/// pool after this callback returns.
///
void(CEF_CALLBACK* on_accelerated_paint)(
struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
cef_paint_element_type_t type,
size_t dirtyRectsCount,
cef_rect_t const* dirtyRects,
const cef_accelerated_paint_info_t* info);
void(CEF_CALLBACK* on_accelerated_paint)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
cef_paint_element_type_t type,
size_t dirtyRectsCount,
cef_rect_t const* dirtyRects,
void* shared_handle);
///
/// Called to retrieve the size of the touch handle for the specified

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=2c496139ca9a59303b1493ee93d2c3ae96a956c0$
// $hash=23302ef6e4458aa3e7065aeaca3421a6f0b58361$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
@@ -253,8 +253,6 @@ typedef struct _cef_request_context_t {
/// See https://developer.chrome.com/extensions for extension implementation
/// and usage documentation.
///
/// WARNING: This function is deprecated and will be removed in ~M127.
///
void(CEF_CALLBACK* load_extension)(struct _cef_request_context_t* self,
const cef_string_t* root_directory,
struct _cef_dictionary_value_t* manifest,
@@ -266,8 +264,6 @@ typedef struct _cef_request_context_t {
/// access to the extension (see HasExtension). This function must be called
/// on the browser process UI thread.
///
/// WARNING: This function is deprecated and will be removed in ~M127.
///
int(CEF_CALLBACK* did_load_extension)(struct _cef_request_context_t* self,
const cef_string_t* extension_id);
@@ -277,8 +273,6 @@ typedef struct _cef_request_context_t {
/// extension (see DidLoadExtension). This function must be called on the
/// browser process UI thread.
///
/// WARNING: This function is deprecated and will be removed in ~M127.
///
int(CEF_CALLBACK* has_extension)(struct _cef_request_context_t* self,
const cef_string_t* extension_id);
@@ -288,8 +282,6 @@ typedef struct _cef_request_context_t {
/// extension ID values. Returns true (1) on success. This function must be
/// called on the browser process UI thread.
///
/// WARNING: This function is deprecated and will be removed in ~M127.
///
int(CEF_CALLBACK* get_extensions)(struct _cef_request_context_t* self,
cef_string_list_t extension_ids);
@@ -298,8 +290,6 @@ typedef struct _cef_request_context_t {
/// extension is accessible in this context (see HasExtension). This function
/// must be called on the browser process UI thread.
///
/// WARNING: This function is deprecated and will be removed in ~M127.
///
struct _cef_extension_t*(CEF_CALLBACK* get_extension)(
struct _cef_request_context_t* self,
const cef_string_t* extension_id);
@@ -378,39 +368,6 @@ typedef struct _cef_request_context_t {
const cef_string_t* top_level_url,
cef_content_setting_types_t content_type,
cef_content_setting_values_t value);
///
/// Sets the Chrome color scheme for all browsers that share this request
/// context. |variant| values of SYSTEM, LIGHT and DARK change the underlying
/// color mode (e.g. light vs dark). Other |variant| values determine how
/// |user_color| will be applied in the current color mode. If |user_color| is
/// transparent (0) the default color will be used.
///
void(CEF_CALLBACK* set_chrome_color_scheme)(
struct _cef_request_context_t* self,
cef_color_variant_t variant,
cef_color_t user_color);
///
/// Returns the current Chrome color scheme mode (SYSTEM, LIGHT or DARK). Must
/// be called on the browser process UI thread.
///
cef_color_variant_t(CEF_CALLBACK* get_chrome_color_scheme_mode)(
struct _cef_request_context_t* self);
///
/// Returns the current Chrome color scheme color, or transparent (0) for the
/// default color. Must be called on the browser process UI thread.
///
cef_color_t(CEF_CALLBACK* get_chrome_color_scheme_color)(
struct _cef_request_context_t* self);
///
/// Returns the current Chrome color scheme variant. Must be called on the
/// browser process UI thread.
///
cef_color_variant_t(CEF_CALLBACK* get_chrome_color_scheme_variant)(
struct _cef_request_context_t* self);
} cef_request_context_t;
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=2e8b5c5107f61e3d4c333dc02c76a9f30cd0cf83$
// $hash=3b59c0bc014d773dedc24649071141ee2dd2125c$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
@@ -48,7 +48,6 @@
#include "include/capi/cef_request_capi.h"
#include "include/capi/cef_resource_request_handler_capi.h"
#include "include/capi/cef_ssl_info_capi.h"
#include "include/capi/cef_unresponsive_process_callback_capi.h"
#include "include/capi/cef_x509_certificate_capi.h"
#ifdef __cplusplus
@@ -223,53 +222,14 @@ typedef struct _cef_request_handler_t {
void(CEF_CALLBACK* on_render_view_ready)(struct _cef_request_handler_t* self,
struct _cef_browser_t* browser);
///
/// Called on the browser process UI thread when the render process is
/// unresponsive as indicated by a lack of input event processing for at least
/// 15 seconds. Return false (0) for the default behavior which is an
/// indefinite wait with the Alloy runtime or display of the "Page
/// unresponsive" dialog with the Chrome runtime. Return true (1) and don't
/// execute the callback for an indefinite wait without display of the Chrome
/// runtime dialog. Return true (1) and call
/// cef_unresponsive_process_callback_t::Wait either in this function or at a
/// later time to reset the wait timer, potentially triggering another call to
/// this function if the process remains unresponsive. Return true (1) and
/// call cef_unresponsive_process_callback_t:: Terminate either in this
/// function or at a later time to terminate the unresponsive process,
/// resulting in a call to OnRenderProcessTerminated.
/// OnRenderProcessResponsive will be called if the process becomes responsive
/// after this function is called. This functionality depends on the hang
/// monitor which can be disabled by passing the `--disable-hang-monitor`
/// command-line flag.
///
int(CEF_CALLBACK* on_render_process_unresponsive)(
struct _cef_request_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_unresponsive_process_callback_t* callback);
///
/// Called on the browser process UI thread when the render process becomes
/// responsive after previously being unresponsive. See documentation on
/// OnRenderProcessUnresponsive.
///
void(CEF_CALLBACK* on_render_process_responsive)(
struct _cef_request_handler_t* self,
struct _cef_browser_t* browser);
///
/// Called on the browser process UI thread when the render process terminates
/// unexpectedly. |status| indicates how the process terminated. |error_code|
/// and |error_string| represent the error that would be displayed in Chrome's
/// "Aw, Snap!" view. Possible |error_code| values include cef_resultcode_t
/// non-normal exit values and platform-specific crash values (for example, a
/// Posix signal or Windows hardware exception).
/// unexpectedly. |status| indicates how the process terminated.
///
void(CEF_CALLBACK* on_render_process_terminated)(
struct _cef_request_handler_t* self,
struct _cef_browser_t* browser,
cef_termination_status_t status,
int error_code,
const cef_string_t* error_string);
cef_termination_status_t status);
///
/// Called on the browser process UI thread when the window.document object of

View File

@@ -1,74 +0,0 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=9ad38f2709d9e3b1bd0e99c279b0497b8aa4c82a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_UNRESPONSIVE_PROCESS_CALLBACK_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_UNRESPONSIVE_PROCESS_CALLBACK_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Callback structure for asynchronous handling of an unresponsive process.
///
typedef struct _cef_unresponsive_process_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Reset the timeout for the unresponsive process.
///
void(CEF_CALLBACK* wait)(struct _cef_unresponsive_process_callback_t* self);
///
/// Terminate the unresponsive process.
///
void(CEF_CALLBACK* terminate)(
struct _cef_unresponsive_process_callback_t* self);
} cef_unresponsive_process_callback_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_UNRESPONSIVE_PROCESS_CALLBACK_CAPI_H_

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5dd4948a92af2ad69e2171f2dffb8f2c23e5c147$
// $hash=3a188f380f8044060ea93fdca0b3d231df88979d$
//
#ifndef CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_
@@ -611,6 +611,7 @@ typedef struct _cef_v8value_t {
///
int(CEF_CALLBACK* set_value_byaccessor)(struct _cef_v8value_t* self,
const cef_string_t* key,
cef_v8_accesscontrol_t settings,
cef_v8_propertyattribute_t attribute);
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=da2edf5e08eb45942b6a82109aa86682c202ccac$
// $hash=db81a65aba3c2d1213744ad4251322acf97c608c$
//
#ifndef CEF_INCLUDE_CAPI_TEST_CEF_TEST_HELPERS_CAPI_H_
@@ -67,14 +67,6 @@ CEF_EXPORT void cef_execute_java_script_with_user_gesture_for_tests(
///
CEF_EXPORT void cef_set_data_directory_for_tests(const cef_string_t* dir);
///
/// Returns true (1) if |feature_name| is enabled by default, command line or
/// field trial. This supports a short list of curated values that are queried
/// by unit tests.
///
CEF_EXPORT int cef_is_feature_enabled_for_tests(
const cef_string_t* feature_name);
#ifdef __cplusplus
}
#endif

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=1c2fbbffaf51e90a2d55bfa7eb3fa3a4e315f4ac$
// $hash=2e5a3b3b1f427a7eb1e6a447fe0d31c5ace49469$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_CAPI_H_
@@ -93,13 +93,6 @@ typedef struct _cef_browser_view_t {
///
void(CEF_CALLBACK* set_prefer_accelerators)(struct _cef_browser_view_t* self,
int prefer_accelerators);
///
/// Returns the runtime style for this BrowserView (ALLOY or CHROME). See
/// cef_runtime_style_t documentation for details.
///
cef_runtime_style_t(CEF_CALLBACK* get_runtime_style)(
struct _cef_browser_view_t* self);
} cef_browser_view_t;
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a0a9f2bfcdf8e05d3d1114fcd8860caaa726ec98$
// $hash=1f2a6e206b86945386bef57167b80e2fb6067c59$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_DELEGATE_CAPI_H_
@@ -141,13 +141,6 @@ typedef struct _cef_browser_view_delegate_t {
struct _cef_browser_view_delegate_t* self,
struct _cef_browser_view_t* browser_view,
cef_gesture_command_t gesture_command);
///
/// Optionally change the runtime style for this BrowserView. See
/// cef_runtime_style_t documentation for details.
///
cef_runtime_style_t(CEF_CALLBACK* get_browser_runtime_style)(
struct _cef_browser_view_delegate_t* self);
} cef_browser_view_delegate_t;
#ifdef __cplusplus

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=08f13de764f30261616372dfffb7f97c57957f73$
// $hash=48df6ccac2c68f32c7024ae68c8a6b6a5f8ed914$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_CAPI_H_
@@ -338,30 +338,16 @@ typedef struct _cef_view_t {
void(CEF_CALLBACK* request_focus)(struct _cef_view_t* self);
///
/// Sets the background color for this View. The background color will be
/// automatically reset when cef_view_delegate_t::OnThemeChanged is called.
/// Sets the background color for this View.
///
void(CEF_CALLBACK* set_background_color)(struct _cef_view_t* self,
cef_color_t color);
///
/// Returns the background color for this View. If the background color is
/// unset then the current `GetThemeColor(CEF_ColorPrimaryBackground)` value
/// will be returned. If this View belongs to an overlay (created with
/// cef_window_t::AddOverlayView), and the background color is unset, then a
/// value of transparent (0) will be returned.
/// Returns the background color for this View.
///
cef_color_t(CEF_CALLBACK* get_background_color)(struct _cef_view_t* self);
///
/// Returns the current theme color associated with |color_id|, or the
/// placeholder color (red) if unset. See cef_color_ids.h for standard ID
/// values. Standard colors can be overridden and custom colors can be added
/// using cef_window_t::SetThemeColor.
///
cef_color_t(CEF_CALLBACK* get_theme_color)(struct _cef_view_t* self,
int color_id);
///
/// Convert |point| from this View's coordinate system to DIP screen
/// coordinates. This View must belong to a Window when calling this function.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=0f562c026f64ca19a32834dcc1e1cd3a98be2f1f$
// $hash=4e421d2d1e24df6e58f7a7c0c074056bc5284df4$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_DELEGATE_CAPI_H_
@@ -140,28 +140,6 @@ typedef struct _cef_view_delegate_t {
///
void(CEF_CALLBACK* on_blur)(struct _cef_view_delegate_t* self,
struct _cef_view_t* view);
///
/// Called when the theme for |view| has changed, after the new theme colors
/// have already been applied. Views are notified via the component hierarchy
/// in depth-first reverse order (children before parents).
///
/// This will be called in the following cases:
///
/// 1. When |view|, or a parent of |view|, is added to a Window. 2. When the
/// native/OS or Chrome theme changes for the Window that contains
/// |view|. See CefWindowDelegate::OnThemeColorsChanged documentation.
/// 3. When the client explicitly calls cef_window_t::ThemeChanged on the
/// Window
/// that contains |view|.
///
/// Optionally use this callback to override the new per-View theme colors by
/// calling cef_view_t::SetBackgroundColor or the appropriate component-
/// specific function. See cef_window_t::SetThemeColor documentation for how
/// to customize additional Window theme colors.
///
void(CEF_CALLBACK* on_theme_changed)(struct _cef_view_delegate_t* self,
struct _cef_view_t* view);
} cef_view_delegate_t;
#ifdef __cplusplus

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=dd32b58ec9aca0e04a1d30ccf94a741995fcc094$
// $hash=dbe89dfdd14eb114e3f2d16fbfc55624bb91e7ce$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_CAPI_H_
@@ -364,50 +364,6 @@ typedef struct _cef_window_t {
/// Remove all keyboard accelerators.
///
void(CEF_CALLBACK* remove_all_accelerators)(struct _cef_window_t* self);
///
/// Override a standard theme color or add a custom color associated with
/// |color_id|. See cef_color_ids.h for standard ID values. Recommended usage
/// is as follows:
///
/// 1. Customize the default native/OS theme by calling SetThemeColor before
/// showing the first Window. When done setting colors call
/// CefWindow::ThemeChanged to trigger CefViewDelegate::OnThemeChanged
/// notifications.
/// 2. Customize the current native/OS or Chrome theme after it changes by
/// calling SetThemeColor from the CefWindowDelegate::OnThemeColorsChanged
/// callback. CefViewDelegate::OnThemeChanged notifications will then be
/// triggered automatically.
///
/// The configured color will be available immediately via
/// cef_view_t::GetThemeColor and will be applied to each View in this
/// Window's component hierarchy when cef_view_delegate_t::OnThemeChanged is
/// called. See OnThemeColorsChanged documentation for additional details.
///
/// Clients wishing to add custom colors should use |color_id| values >=
/// CEF_ChromeColorsEnd.
///
void(CEF_CALLBACK* set_theme_color)(struct _cef_window_t* self,
int color_id,
cef_color_t color);
///
/// Trigger cef_view_delegate_t::OnThemeChanged callbacks for each View in
/// this Window's component hierarchy. Unlike a native/OS or Chrome theme
/// change this function does not reset theme colors to standard values and
/// does not result in a call to cef_window_delegate_t::OnThemeColorsChanged.
///
/// Do not call this function from cef_window_delegate_t::OnThemeColorsChanged
/// or cef_view_delegate_t::OnThemeChanged.
///
void(CEF_CALLBACK* theme_changed)(struct _cef_window_t* self);
///
/// Returns the runtime style for this Window (ALLOY or CHROME). See
/// cef_runtime_style_t documentation for details.
///
cef_runtime_style_t(CEF_CALLBACK* get_runtime_style)(
struct _cef_window_t* self);
} cef_window_t;
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=e8c9e32caa8d317a7cb6ff2f0ad6be49cf1b7ad1$
// $hash=c1c2705cdef7d9189557b57531dc2d53e9f68d0c$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_
@@ -182,20 +182,6 @@ typedef struct _cef_window_delegate_t {
struct _cef_window_t* window,
float* titlebar_height);
///
/// Return whether the view should accept the initial mouse-down event,
/// allowing it to respond to click-through behavior. If STATE_ENABLED is
/// returned, the view will be sent a mouseDown: message for an initial mouse-
/// down event, activating the view with one click, instead of clicking first
/// to make the window active and then clicking the view.
///
/// This function is only supported on macOS. For more details, refer to the
/// documentation of acceptsFirstMouse.
///
cef_state_t(CEF_CALLBACK* accepts_first_mouse)(
struct _cef_window_delegate_t* self,
struct _cef_window_t* window);
///
/// Return true (1) if |window| can be resized.
///
@@ -238,50 +224,6 @@ typedef struct _cef_window_delegate_t {
int(CEF_CALLBACK* on_key_event)(struct _cef_window_delegate_t* self,
struct _cef_window_t* window,
const cef_key_event_t* event);
///
/// Called after the native/OS or Chrome theme for |window| has changed.
/// |chrome_theme| will be true (1) if the notification is for a Chrome theme.
///
/// Native/OS theme colors are configured globally and do not need to be
/// customized for each Window individually. An example of a native/OS theme
/// change that triggers this callback is when the user switches between dark
/// and light mode during application lifespan. Native/OS theme changes can be
/// disabled by passing the `--force-dark-mode` or `--force-light-mode`
/// command-line flag.
///
/// Chrome theme colors will be applied and this callback will be triggered
/// if/when a BrowserView is added to the Window's component hierarchy. Chrome
/// theme colors can be configured on a per-RequestContext basis using
/// cef_request_context_t::SetChromeColorScheme or (Chrome runtime only) by
/// visiting chrome://settings/manageProfile. Any theme changes using those
/// mechanisms will also trigger this callback. Chrome theme colors will be
/// persisted and restored from disk cache with the Chrome runtime, and with
/// the Alloy runtime if persist_user_preferences is set to true (1) via
/// CefSettings or cef_request_context_tSettings.
///
/// This callback is not triggered on Window creation so clients that wish to
/// customize the initial native/OS theme must call
/// cef_window_t::SetThemeColor and cef_window_t::ThemeChanged before showing
/// the first Window.
///
/// Theme colors will be reset to standard values before this callback is
/// called for the first affected Window. Call cef_window_t::SetThemeColor
/// from inside this callback to override a standard color or add a custom
/// color. cef_view_delegate_t::OnThemeChanged will be called after this
/// callback for the complete |window| component hierarchy.
///
void(CEF_CALLBACK* on_theme_colors_changed)(
struct _cef_window_delegate_t* self,
struct _cef_window_t* window,
int chrome_theme);
///
/// Optionally change the runtime style for this Window. See
/// cef_runtime_style_t documentation for details.
///
cef_runtime_style_t(CEF_CALLBACK* get_window_runtime_style)(
struct _cef_window_delegate_t* self);
} cef_window_delegate_t;
#ifdef __cplusplus

View File

@@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "ed1dfa5ff8a041241f8fb72eb7454811f358f0d3"
#define CEF_API_HASH_UNIVERSAL "afb63c581ad6ef9b3d3ebed472cc66f75ce4647f"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "0d99d1b9b85b2efab91a39d6fc325bb6d56fd524"
#define CEF_API_HASH_PLATFORM "504dbb53deeebd11a16ea01533c5d9ecfa6be555"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "e585e190387e31a71267207b66d175e213991470"
#define CEF_API_HASH_PLATFORM "dc3cf1d007fec844ab287dac384c8b00366d46fc"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "09d3e280ed38f7a082b794c56ff71c52f86f0ea8"
#define CEF_API_HASH_PLATFORM "2b47d389c64db81913818b708b78868a22e65b66"
#endif
#ifdef __cplusplus

View File

@@ -71,9 +71,9 @@ int CefExecuteProcess(const CefMainArgs& args,
/// true if initialization succeeds. Returns false if initialization fails or if
/// early exit is desired (for example, due to process singleton relaunch
/// behavior). If this function returns false then the application should exit
/// immediately without calling any other CEF functions except, optionally,
/// CefGetErrorCode. The |windows_sandbox_info| parameter is only used on
/// Windows and may be NULL (see cef_sandbox_win.h for details).
/// immediately without calling any other CEF functions. The
/// |windows_sandbox_info| parameter is only used on Windows and may be NULL
/// (see cef_sandbox_win.h for details).
///
/*--cef(api_hash_check,optional_param=application,
optional_param=windows_sandbox_info)--*/
@@ -82,18 +82,6 @@ bool CefInitialize(const CefMainArgs& args,
CefRefPtr<CefApp> application,
void* windows_sandbox_info);
///
/// This function can optionally be called on the main application thread after
/// CefInitialize to retrieve the initialization exit code. When CefInitialize
/// returns true the exit code will be 0 (CEF_RESULT_CODE_NORMAL_EXIT).
/// Otherwise, see cef_resultcode_t for possible exit code values including
/// browser process initialization errors and normal early exit conditions (such
/// as CEF_RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED for process singleton
/// relaunch behavior).
///
/*--cef()--*/
int CefGetExitCode();
///
/// This function should be called on the main application thread to shut down
/// the CEF browser process before the application exits. Do not call any

View File

@@ -39,7 +39,6 @@
#pragma once
#include <vector>
#include "include/cef_base.h"
#include "include/cef_devtools_message_observer.h"
#include "include/cef_drag_data.h"
@@ -943,8 +942,6 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
/// Returns the extension hosted in this browser or NULL if no extension is
/// hosted. See CefRequestContext::LoadExtension for details.
///
/// WARNING: This method is deprecated and will be removed in ~M127.
///
/*--cef()--*/
virtual CefRefPtr<CefExtension> GetExtension() = 0;
@@ -953,8 +950,6 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
/// Background hosts do not have a window and are not displayable. See
/// CefRequestContext::LoadExtension for details.
///
/// WARNING: This method is deprecated and will be removed in ~M127.
///
/*--cef()--*/
virtual bool IsBackgroundHost() = 0;
@@ -1012,24 +1007,6 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
virtual void ExecuteChromeCommand(
int command_id,
cef_window_open_disposition_t disposition) = 0;
///
/// Returns true if the render process associated with this browser is
/// currently unresponsive as indicated by a lack of input event processing
/// for at least 15 seconds. To receive associated state change notifications
/// and optionally handle an unresponsive render process implement
/// CefRequestHandler::OnRenderProcessUnresponsive. This method can only be
/// called on the UI thread.
///
/*--cef()--*/
virtual bool IsRenderProcessUnresponsive() = 0;
///
/// Returns the runtime style for this browser (ALLOY or CHROME). See
/// cef_runtime_style_t documentation for details.
///
/*--cef(default_retval=CEF_RUNTIME_STYLE_DEFAULT)--*/
virtual cef_runtime_style_t GetRuntimeStyle() = 0;
};
#endif // CEF_INCLUDE_CEF_BROWSER_H_

View File

@@ -40,7 +40,6 @@
#include <map>
#include <vector>
#include "include/cef_base.h"
///

View File

@@ -39,7 +39,6 @@
#pragma once
#include <vector>
#include "include/cef_base.h"
#include "include/cef_callback.h"

View File

@@ -77,30 +77,21 @@ class CefDialogHandler : public virtual CefBaseRefCounted {
/// empty to show the default title ("Open" or "Save" depending on the mode).
/// |default_file_path| is the path with optional directory and/or file name
/// component that should be initially selected in the dialog.
/// |accept_filters| are used to restrict the selectable file types and may be
/// any combination of valid lower-cased MIME types (e.g. "text/*" or
/// "image/*") and individual file extensions (e.g. ".txt" or ".png").
/// |accept_extensions| provides the semicolon-delimited expansion of MIME
/// types to file extensions (if known, or empty string otherwise).
/// |accept_descriptions| provides the descriptions for MIME types (if known,
/// or empty string otherwise). For example, the "image/*" mime type might
/// have extensions ".png;.jpg;.bmp;..." and description "Image Files".
/// |accept_filters|, |accept_extensions| and |accept_descriptions| will all
/// be the same size. To display a custom dialog return true and execute
/// |callback| either inline or at a later time. To display the default dialog
/// return false. If this method returns false it may be called an additional
/// time for the same dialog (both before and after MIME type expansion).
/// |accept_filters| are used to restrict the selectable file types and may
/// any combination of (a) valid lower-cased MIME types (e.g. "text/*" or
/// "image/*"), (b) individual file extensions (e.g. ".txt" or ".png"), or (c)
/// combined description and file extension delimited using "|" and ";" (e.g.
/// "Image Types|.png;.gif;.jpg"). To display a custom dialog return true and
/// execute |callback| either inline or at a later time. To display the
/// default dialog return false.
///
/*--cef(optional_param=title,optional_param=default_file_path,
optional_param=accept_filters,optional_param=accept_extensions,
optional_param=accept_descriptions)--*/
optional_param=accept_filters)--*/
virtual bool OnFileDialog(CefRefPtr<CefBrowser> browser,
FileDialogMode mode,
const CefString& title,
const CefString& default_file_path,
const std::vector<CefString>& accept_filters,
const std::vector<CefString>& accept_extensions,
const std::vector<CefString>& accept_descriptions,
CefRefPtr<CefFileDialogCallback> callback) {
return false;
}

View File

@@ -39,7 +39,6 @@
#pragma once
#include <map>
#include "include/cef_base.h"
class CefDOMDocument;

View File

@@ -106,19 +106,17 @@ class CefDownloadHandler : public virtual CefBaseRefCounted {
///
/// Called before a download begins. |suggested_name| is the suggested name
/// for the download file. Return true and execute |callback| either
/// asynchronously or in this method to continue or cancel the download.
/// Return false to proceed with default handling (cancel with Alloy style,
/// download shelf with Chrome style). Do not keep a reference to
/// |download_item| outside of this method.
/// for the download file. By default the download will be canceled. Execute
/// |callback| either asynchronously or in this method to continue the
/// download if desired. Do not keep a reference to |download_item| outside of
/// this method.
///
/*--cef()--*/
virtual bool OnBeforeDownload(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefDownloadItem> download_item,
const CefString& suggested_name,
CefRefPtr<CefBeforeDownloadCallback> callback) {
return false;
}
virtual void OnBeforeDownload(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefDownloadItem> download_item,
const CefString& suggested_name,
CefRefPtr<CefBeforeDownloadCallback> callback) = 0;
///
/// Called when a download's status or progress information has been updated.

View File

@@ -39,7 +39,6 @@
#pragma once
#include <vector>
#include "include/cef_base.h"
#include "include/cef_image.h"
#include "include/cef_stream.h"

View File

@@ -48,8 +48,6 @@ class CefRequestContext;
/// Object representing an extension. Methods may be called on any thread unless
/// otherwise indicated.
///
/// WARNING: This API is deprecated and will be removed in ~M127.
///
/*--cef(source=library)--*/
class CefExtension : public CefBaseRefCounted {
public:

View File

@@ -70,8 +70,6 @@ class CefGetExtensionResourceCallback : public CefBaseRefCounted {
/// The methods of this class will be called on the UI thread. See
/// CefRequestContext::LoadExtension for information about extension loading.
///
/// WARNING: This API is deprecated and will be removed in ~M127.
///
/*--cef(source=client)--*/
class CefExtensionHandler : public virtual CefBaseRefCounted {
public:

View File

@@ -39,7 +39,6 @@
#pragma once
#include <vector>
#include "include/cef_base.h"
#include "include/cef_callback.h"
#include "include/cef_registration.h"

View File

@@ -152,25 +152,16 @@ class CefRenderHandler : public virtual CefBaseRefCounted {
/// Called when an element has been rendered to the shared texture handle.
/// |type| indicates whether the element is the view or the popup widget.
/// |dirtyRects| contains the set of rectangles in pixel coordinates that need
/// to be repainted. |info| contains the shared handle; on Windows it is a
/// HANDLE to a texture that can be opened with D3D11 OpenSharedResource, on
/// macOS it is an IOSurface pointer that can be opened with Metal or OpenGL,
/// and on Linux it contains several planes, each with an fd to the underlying
/// system native buffer.
///
/// The underlying implementation uses a pool to deliver frames. As a result,
/// the handle may differ every frame depending on how many frames are
/// in-progress. The handle's resource cannot be cached and cannot be accessed
/// outside of this callback. It should be reopened each time this callback is
/// executed and the contents should be copied to a texture owned by the
/// client application. The contents of |info| will be released back to the
/// pool after this callback returns.
/// to be repainted. |shared_handle| is the handle for a D3D11 Texture2D that
/// can be accessed via ID3D11Device using the OpenSharedResource method. This
/// method is only called when CefWindowInfo::shared_texture_enabled is set to
/// true, and is currently only supported on Windows.
///
/*--cef()--*/
virtual void OnAcceleratedPaint(CefRefPtr<CefBrowser> browser,
PaintElementType type,
const RectList& dirtyRects,
const CefAcceleratedPaintInfo& info) {}
void* shared_handle) {}
///
/// Called to retrieve the size of the touch handle for the specified

View File

@@ -40,7 +40,6 @@
#include <map>
#include <vector>
#include "include/cef_base.h"
class CefPostData;

View File

@@ -266,8 +266,6 @@ class CefRequestContext : public CefPreferenceManager {
/// See https://developer.chrome.com/extensions for extension implementation
/// and usage documentation.
///
/// WARNING: This method is deprecated and will be removed in ~M127.
///
/*--cef(optional_param=manifest,optional_param=handler)--*/
virtual void LoadExtension(const CefString& root_directory,
CefRefPtr<CefDictionaryValue> manifest,
@@ -279,8 +277,6 @@ class CefRequestContext : public CefPreferenceManager {
/// access to the extension (see HasExtension). This method must be called on
/// the browser process UI thread.
///
/// WARNING: This method is deprecated and will be removed in ~M127.
///
/*--cef()--*/
virtual bool DidLoadExtension(const CefString& extension_id) = 0;
@@ -290,8 +286,6 @@ class CefRequestContext : public CefPreferenceManager {
/// extension (see DidLoadExtension). This method must be called on the
/// browser process UI thread.
///
/// WARNING: This method is deprecated and will be removed in ~M127.
///
/*--cef()--*/
virtual bool HasExtension(const CefString& extension_id) = 0;
@@ -301,8 +295,6 @@ class CefRequestContext : public CefPreferenceManager {
/// extension ID values. Returns true on success. This method must be called
/// on the browser process UI thread.
///
/// WARNING: This method is deprecated and will be removed in ~M127.
///
/*--cef()--*/
virtual bool GetExtensions(std::vector<CefString>& extension_ids) = 0;
@@ -311,8 +303,6 @@ class CefRequestContext : public CefPreferenceManager {
/// extension is accessible in this context (see HasExtension). This method
/// must be called on the browser process UI thread.
///
/// WARNING: This method is deprecated and will be removed in ~M127.
///
/*--cef()--*/
virtual CefRefPtr<CefExtension> GetExtension(
const CefString& extension_id) = 0;
@@ -391,38 +381,6 @@ class CefRequestContext : public CefPreferenceManager {
const CefString& top_level_url,
cef_content_setting_types_t content_type,
cef_content_setting_values_t value) = 0;
///
/// Sets the Chrome color scheme for all browsers that share this request
/// context. |variant| values of SYSTEM, LIGHT and DARK change the underlying
/// color mode (e.g. light vs dark). Other |variant| values determine how
/// |user_color| will be applied in the current color mode. If |user_color| is
/// transparent (0) the default color will be used.
///
/*--cef()--*/
virtual void SetChromeColorScheme(cef_color_variant_t variant,
cef_color_t user_color) = 0;
///
/// Returns the current Chrome color scheme mode (SYSTEM, LIGHT or DARK). Must
/// be called on the browser process UI thread.
///
/*--cef(default_retval=CEF_COLOR_VARIANT_SYSTEM)--*/
virtual cef_color_variant_t GetChromeColorSchemeMode() = 0;
///
/// Returns the current Chrome color scheme color, or transparent (0) for the
/// default color. Must be called on the browser process UI thread.
///
/*--cef(default_retval=0)--*/
virtual cef_color_t GetChromeColorSchemeColor() = 0;
///
/// Returns the current Chrome color scheme variant. Must be called on the
/// browser process UI thread.
///
/*--cef(default_retval=CEF_COLOR_VARIANT_SYSTEM)--*/
virtual cef_color_variant_t GetChromeColorSchemeVariant() = 0;
};
#endif // CEF_INCLUDE_CEF_REQUEST_CONTEXT_H_

View File

@@ -48,7 +48,6 @@
#include "include/cef_request.h"
#include "include/cef_resource_request_handler.h"
#include "include/cef_ssl_info.h"
#include "include/cef_unresponsive_process_callback.h"
#include "include/cef_x509_certificate.h"
///
@@ -222,52 +221,14 @@ class CefRequestHandler : public virtual CefBaseRefCounted {
/*--cef()--*/
virtual void OnRenderViewReady(CefRefPtr<CefBrowser> browser) {}
///
/// Called on the browser process UI thread when the render process is
/// unresponsive as indicated by a lack of input event processing for at
/// least 15 seconds. Return false for the default behavior which is an
/// indefinite wait with the Alloy runtime or display of the "Page
/// unresponsive" dialog with the Chrome runtime. Return true and don't
/// execute the callback for an indefinite wait without display of the Chrome
/// runtime dialog. Return true and call CefUnresponsiveProcessCallback::Wait
/// either in this method or at a later time to reset the wait timer,
/// potentially triggering another call to this method if the process remains
/// unresponsive. Return true and call CefUnresponsiveProcessCallback::
/// Terminate either in this method or at a later time to terminate the
/// unresponsive process, resulting in a call to OnRenderProcessTerminated.
/// OnRenderProcessResponsive will be called if the process becomes responsive
/// after this method is called. This functionality depends on the hang
/// monitor which can be disabled by passing the `--disable-hang-monitor`
/// command-line flag.
///
/*--cef()--*/
virtual bool OnRenderProcessUnresponsive(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefUnresponsiveProcessCallback> callback) {
return false;
}
///
/// Called on the browser process UI thread when the render process becomes
/// responsive after previously being unresponsive. See documentation on
/// OnRenderProcessUnresponsive.
///
/*--cef()--*/
virtual void OnRenderProcessResponsive(CefRefPtr<CefBrowser> browser) {}
///
/// Called on the browser process UI thread when the render process
/// terminates unexpectedly. |status| indicates how the process terminated.
/// |error_code| and |error_string| represent the error that would be
/// displayed in Chrome's "Aw, Snap!" view. Possible |error_code| values
/// include cef_resultcode_t non-normal exit values and platform-specific
/// crash values (for example, a Posix signal or Windows hardware exception).
/// terminates unexpectedly. |status| indicates how the process
/// terminated.
///
/*--cef()--*/
virtual void OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser,
TerminationStatus status,
int error_code,
const CefString& error_string) {}
TerminationStatus status) {}
///
/// Called on the browser process UI thread when the window.document object of

View File

@@ -39,7 +39,6 @@
#pragma once
#include <map>
#include "include/cef_base.h"
///

View File

@@ -39,7 +39,6 @@
#pragma once
#include <map>
#include "include/cef_base.h"
#include "include/cef_callback.h"
#include "include/cef_request.h"

View File

@@ -40,6 +40,7 @@
#include "include/cef_base.h"
#include "include/cef_values.h"
#include "include/cef_x509_certificate.h"
///

View File

@@ -1,62 +0,0 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// The contents of this file must follow a specific format in order to
// support the CEF translator tool. See the translator.README.txt file in the
// tools directory for more information.
//
#ifndef CEF_INCLUDE_CEF_UNRESPONSIVE_PROCESS_CALLBACK_H_
#define CEF_INCLUDE_CEF_UNRESPONSIVE_PROCESS_CALLBACK_H_
#pragma once
#include "include/cef_base.h"
///
/// Callback interface for asynchronous handling of an unresponsive process.
///
/*--cef(source=library)--*/
class CefUnresponsiveProcessCallback : public virtual CefBaseRefCounted {
public:
///
/// Reset the timeout for the unresponsive process.
///
/*--cef()--*/
virtual void Wait() = 0;
///
/// Terminate the unresponsive process.
///
/*--cef()--*/
virtual void Terminate() = 0;
};
#endif // CEF_INCLUDE_CEF_UNRESPONSIVE_PROCESS_CALLBACK_H_

View File

@@ -39,7 +39,6 @@
#pragma once
#include <vector>
#include "include/cef_base.h"
#include "include/cef_browser.h"
#include "include/cef_frame.h"
@@ -435,6 +434,7 @@ class CefV8ArrayBufferReleaseCallback : public virtual CefBaseRefCounted {
/*--cef(source=library,no_debugct_check)--*/
class CefV8Value : public virtual CefBaseRefCounted {
public:
typedef cef_v8_accesscontrol_t AccessControl;
typedef cef_v8_propertyattribute_t PropertyAttribute;
///
@@ -793,7 +793,9 @@ class CefV8Value : public virtual CefBaseRefCounted {
/// will return true even though assignment failed.
///
/*--cef(capi_name=set_value_byaccessor,optional_param=key)--*/
virtual bool SetValue(const CefString& key, PropertyAttribute attribute) = 0;
virtual bool SetValue(const CefString& key,
AccessControl settings,
PropertyAttribute attribute) = 0;
///
/// Read the keys for the object's values into the specified vector. Integer-

View File

@@ -39,7 +39,6 @@
#pragma once
#include <vector>
#include "include/cef_base.h"
class CefBinaryValue;

View File

@@ -70,7 +70,6 @@ struct CefWindowInfoTraits {
target->shared_texture_enabled = src->shared_texture_enabled;
target->external_begin_frame_enabled = src->external_begin_frame_enabled;
target->window = src->window;
target->runtime_style = src->runtime_style;
}
};
@@ -111,7 +110,6 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
void SetAsWindowless(CefWindowHandle parent) {
windowless_rendering_enabled = true;
parent_window = parent;
runtime_style = CEF_RUNTIME_STYLE_ALLOY;
}
};

View File

@@ -71,7 +71,6 @@ struct CefWindowInfoTraits {
target->shared_texture_enabled = src->shared_texture_enabled;
target->external_begin_frame_enabled = src->external_begin_frame_enabled;
target->view = src->view;
target->runtime_style = src->runtime_style;
}
};
@@ -113,7 +112,6 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
void SetAsWindowless(CefWindowHandle parent) {
windowless_rendering_enabled = true;
parent_view = parent;
runtime_style = CEF_RUNTIME_STYLE_ALLOY;
}
};

View File

@@ -235,14 +235,12 @@ typedef struct _cef_settings_t {
///
cef_string_t main_bundle_path;
#if !defined(DISABLE_ALLOY_BOOTSTRAP)
///
/// Set to true (1) to enable use of the Chrome runtime in CEF. This feature
/// is considered experimental and is not recommended for most users at this
/// time. See issue #2969 for details.
///
int chrome_runtime;
#endif
///
/// Set to true (1) to have the browser process message loop run in a separate
@@ -919,16 +917,6 @@ typedef enum {
/// Out of memory. Some platforms may use TS_PROCESS_CRASHED instead.
///
TS_PROCESS_OOM,
///
/// Child process never launched.
///
TS_LAUNCH_FAILED,
///
/// On Windows, the OS terminated the process due to code integrity failure.
///
TS_INTEGRITY_FAILURE,
} cef_termination_status_t;
///
@@ -1039,100 +1027,6 @@ typedef enum {
CERT_STATUS_CT_COMPLIANCE_FAILED = 1 << 20,
} cef_cert_status_t;
///
/// Process result codes. This is not a comprehensive list, as result codes
/// might also include platform-specific crash values (Posix signal or Windows
/// hardware exception), or internal-only implementation values.
///
typedef enum {
// The following values should be kept in sync with Chromium's
// content::ResultCode type.
CEF_RESULT_CODE_NORMAL_EXIT,
/// Process was killed by user or system.
CEF_RESULT_CODE_KILLED,
/// Process hung.
CEF_RESULT_CODE_HUNG,
/// A bad message caused the process termination.
CEF_RESULT_CODE_KILLED_BAD_MESSAGE,
/// The GPU process exited because initialization failed.
CEF_RESULT_CODE_GPU_DEAD_ON_ARRIVAL,
// The following values should be kept in sync with Chromium's
// chrome::ResultCode type. Unused chrome values are excluded.
CEF_RESULT_CODE_CHROME_FIRST,
/// A critical chrome file is missing.
CEF_RESULT_CODE_MISSING_DATA = 7,
/// Command line parameter is not supported.
CEF_RESULT_CODE_UNSUPPORTED_PARAM = 13,
/// The profile was in use on another host.
CEF_RESULT_CODE_PROFILE_IN_USE = 21,
/// Failed to pack an extension via the command line.
CEF_RESULT_CODE_PACK_EXTENSION_ERROR = 22,
/// The browser process exited early by passing the command line to another
/// running browser.
CEF_RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED = 24,
/// A browser process was sandboxed. This should never happen.
CEF_RESULT_CODE_INVALID_SANDBOX_STATE = 31,
/// Cloud policy enrollment failed or was given up by user.
CEF_RESULT_CODE_CLOUD_POLICY_ENROLLMENT_FAILED = 32,
/// The GPU process was terminated due to context lost.
CEF_RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST = 34,
/// An early startup command was executed and the browser must exit.
CEF_RESULT_CODE_NORMAL_EXIT_PACK_EXTENSION_SUCCESS = 36,
/// The browser process exited because system resources are exhausted. The
/// system state can't be recovered and will be unstable.
CEF_RESULT_CODE_SYSTEM_RESOURCE_EXHAUSTED = 37,
CEF_RESULT_CODE_CHROME_LAST = 39,
// The following values should be kept in sync with Chromium's
// sandbox::TerminationCodes type.
CEF_RESULT_CODE_SANDBOX_FATAL_FIRST = 7006,
/// Windows sandbox could not set the integrity level.
CEF_RESULT_CODE_SANDBOX_FATAL_INTEGRITY = CEF_RESULT_CODE_SANDBOX_FATAL_FIRST,
/// Windows sandbox could not lower the token.
CEF_RESULT_CODE_SANDBOX_FATAL_DROPTOKEN,
/// Windows sandbox failed to flush registry handles.
CEF_RESULT_CODE_SANDBOX_FATAL_FLUSHANDLES,
/// Windows sandbox failed to forbid HCKU caching.
CEF_RESULT_CODE_SANDBOX_FATAL_CACHEDISABLE,
/// Windows sandbox failed to close pending handles.
CEF_RESULT_CODE_SANDBOX_FATAL_CLOSEHANDLES,
/// Windows sandbox could not set the mitigation policy.
CEF_RESULT_CODE_SANDBOX_FATAL_MITIGATION,
/// Windows sandbox exceeded the job memory limit.
CEF_RESULT_CODE_SANDBOX_FATAL_MEMORY_EXCEEDED,
/// Windows sandbox failed to warmup.
CEF_RESULT_CODE_SANDBOX_FATAL_WARMUP,
CEF_RESULT_CODE_SANDBOX_FATAL_LAST,
} cef_resultcode_t;
///
/// The manner in which a link click should be opened. These constants match
/// their equivalents in Chromium's window_open_disposition.h and should not be
@@ -1239,6 +1133,16 @@ typedef enum {
CEF_TEXT_INPUT_MODE_MAX = CEF_TEXT_INPUT_MODE_SEARCH,
} cef_text_input_mode_t;
///
/// V8 access control values.
///
typedef enum {
V8_ACCESS_CONTROL_DEFAULT = 0,
V8_ACCESS_CONTROL_ALL_CAN_READ = 1,
V8_ACCESS_CONTROL_ALL_CAN_WRITE = 1 << 1,
V8_ACCESS_CONTROL_PROHIBITS_OVERWRITING = 1 << 2
} cef_v8_accesscontrol_t;
///
/// V8 property attribute values.
///
@@ -2432,7 +2336,6 @@ typedef enum {
DOM_FORM_CONTROL_TYPE_BUTTON_SUBMIT,
DOM_FORM_CONTROL_TYPE_BUTTON_RESET,
DOM_FORM_CONTROL_TYPE_BUTTON_SELECT_LIST,
DOM_FORM_CONTROL_TYPE_BUTTON_POPOVER,
DOM_FORM_CONTROL_TYPE_FIELDSET,
DOM_FORM_CONTROL_TYPE_INPUT_BUTTON,
DOM_FORM_CONTROL_TYPE_INPUT_CHECKBOX,
@@ -2917,6 +2820,21 @@ typedef enum {
RESPONSE_FILTER_ERROR
} cef_response_filter_status_t;
///
/// Describes how to interpret the components of a pixel.
///
typedef enum {
///
/// RGBA with 8 bits per pixel (32bits total).
///
CEF_COLOR_TYPE_RGBA_8888,
///
/// BGRA with 8 bits per pixel (32bits total).
///
CEF_COLOR_TYPE_BGRA_8888,
} cef_color_type_t;
///
/// Describes how to interpret the alpha component of a pixel.
///
@@ -2949,22 +2867,51 @@ typedef enum {
} cef_text_style_t;
///
/// Specifies where along the axis the CefBoxLayout child views should be laid
/// out. Should be kept in sync with Chromium's views::LayoutAlignment type.
/// Specifies where along the main axis the CefBoxLayout child views should be
/// laid out.
///
typedef enum {
/// Child views will be left/top-aligned.
CEF_AXIS_ALIGNMENT_START,
///
/// Child views will be left-aligned.
///
CEF_MAIN_AXIS_ALIGNMENT_START,
///
/// Child views will be center-aligned.
CEF_AXIS_ALIGNMENT_CENTER,
///
CEF_MAIN_AXIS_ALIGNMENT_CENTER,
/// Child views will be right/bottom-aligned.
CEF_AXIS_ALIGNMENT_END,
///
/// Child views will be right-aligned.
///
CEF_MAIN_AXIS_ALIGNMENT_END,
} cef_main_axis_alignment_t;
///
/// Specifies where along the cross axis the CefBoxLayout child views should be
/// laid out.
///
typedef enum {
///
/// Child views will be stretched to fit.
CEF_AXIS_ALIGNMENT_STRETCH,
} cef_axis_alignment_t;
///
CEF_CROSS_AXIS_ALIGNMENT_STRETCH,
///
/// Child views will be left-aligned.
///
CEF_CROSS_AXIS_ALIGNMENT_START,
///
/// Child views will be center-aligned.
///
CEF_CROSS_AXIS_ALIGNMENT_CENTER,
///
/// Child views will be right-aligned.
///
CEF_CROSS_AXIS_ALIGNMENT_END,
} cef_cross_axis_alignment_t;
///
/// Settings used when initializing a CefBoxLayout.
@@ -3001,12 +2948,12 @@ typedef struct _cef_box_layout_settings_t {
///
/// Specifies where along the main axis the child views should be laid out.
///
cef_axis_alignment_t main_axis_alignment;
cef_main_axis_alignment_t main_axis_alignment;
///
/// Specifies where along the cross axis the child views should be laid out.
///
cef_axis_alignment_t cross_axis_alignment;
cef_cross_axis_alignment_t cross_axis_alignment;
///
/// Minimum cross axis size.
@@ -3275,65 +3222,64 @@ typedef enum {
/// Front L, Front R, Front C, LFE, Back L, Back R
CEF_CHANNEL_LAYOUT_5_1_BACK = 12,
/// Front L, Front R, Front C, Back L, Back R, Side L, Side R
/// Front L, Front R, Front C, Side L, Side R, Back L, Back R
CEF_CHANNEL_LAYOUT_7_0 = 13,
/// Front L, Front R, Front C, LFE, Back L, Back R, Side L, Side R
/// Front L, Front R, Front C, LFE, Side L, Side R, Back L, Back R
CEF_CHANNEL_LAYOUT_7_1 = 14,
/// Front L, Front R, Front C, LFE, Front LofC, Front RofC, Side L, Side R
/// Front L, Front R, Front C, LFE, Side L, Side R, Front LofC, Front RofC
CEF_CHANNEL_LAYOUT_7_1_WIDE = 15,
/// Front L, Front R
/// Stereo L, Stereo R
CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX = 16,
/// Front L, Front R, LFE
/// Stereo L, Stereo R, LFE
CEF_CHANNEL_LAYOUT_2POINT1 = 17,
/// Front L, Front R, Front C, LFE
/// Stereo L, Stereo R, Front C, LFE
CEF_CHANNEL_LAYOUT_3_1 = 18,
/// Front L, Front R, Front C, LFE, Back C
/// Stereo L, Stereo R, Front C, Rear C, LFE
CEF_CHANNEL_LAYOUT_4_1 = 19,
/// Front L, Front R, Front C, Back C, Side L, Side R
/// Stereo L, Stereo R, Front C, Side L, Side R, Back C
CEF_CHANNEL_LAYOUT_6_0 = 20,
/// Front L, Front R, Front LofC, Front RofC, Side L, Side R
/// Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC
CEF_CHANNEL_LAYOUT_6_0_FRONT = 21,
/// Front L, Front R, Front C, Back L, Back R, Back C
/// Stereo L, Stereo R, Front C, Rear L, Rear R, Rear C
CEF_CHANNEL_LAYOUT_HEXAGONAL = 22,
/// Front L, Front R, Front C, LFE, Back C, Side L, Side R
/// Stereo L, Stereo R, Front C, LFE, Side L, Side R, Rear Center
CEF_CHANNEL_LAYOUT_6_1 = 23,
/// Front L, Front R, Front C, LFE, Back L, Back R, Back C
/// Stereo L, Stereo R, Front C, LFE, Back L, Back R, Rear Center
CEF_CHANNEL_LAYOUT_6_1_BACK = 24,
/// Front L, Front R, LFE, Front LofC, Front RofC, Side L, Side R
/// Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC, LFE
CEF_CHANNEL_LAYOUT_6_1_FRONT = 25,
/// Front L, Front R, Front C, Front LofC, Front RofC, Side L, Side R
/// Front L, Front R, Front C, Side L, Side R, Front LofC, Front RofC
CEF_CHANNEL_LAYOUT_7_0_FRONT = 26,
/// Front L, Front R, Front C, LFE, Back L, Back R, Front LofC, Front RofC
CEF_CHANNEL_LAYOUT_7_1_WIDE_BACK = 27,
/// Front L, Front R, Front C, Back L, Back R, Back C, Side L, Side R
/// Front L, Front R, Front C, Side L, Side R, Rear L, Back R, Back C.
CEF_CHANNEL_LAYOUT_OCTAGONAL = 28,
/// Channels are not explicitly mapped to speakers.
CEF_CHANNEL_LAYOUT_DISCRETE = 29,
/// Deprecated, but keeping the enum value for UMA consistency.
/// Front L, Front R, Front C. Front C contains the keyboard mic audio. This
/// layout is only intended for input for WebRTC. The Front C channel
/// is stripped away in the WebRTC audio input pipeline and never seen outside
/// of that.
CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC = 30,
/// Front L, Front R, LFE, Side L, Side R
/// Front L, Front R, Side L, Side R, LFE
CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE = 31,
/// Actual channel layout is specified in the bitstream and the actual channel
@@ -3347,14 +3293,8 @@ typedef enum {
/// kMaxConcurrentChannels
CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX = 33,
/// Front C, LFE
CEF_CHANNEL_LAYOUT_1_1 = 34,
/// Front L, Front R, LFE, Back C
CEF_CHANNEL_LAYOUT_3_1_BACK = 35,
/// Max value, must always equal the largest entry ever logged.
CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_3_1_BACK
CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX
} cef_channel_layout_t;
///
@@ -3463,18 +3403,18 @@ typedef enum {
CEF_CPAIT_COOKIE_CONTROLS,
CEF_CPAIT_FILE_SYSTEM_ACCESS,
CEF_CPAIT_FIND,
CEF_CPAIT_MEMORY_SAVER,
CEF_CPAIT_HIGH_EFFICIENCY,
CEF_CPAIT_INTENT_PICKER,
CEF_CPAIT_LOCAL_CARD_MIGRATION,
CEF_CPAIT_MANAGE_PASSWORDS,
CEF_CPAIT_PAYMENTS_OFFER_NOTIFICATION,
CEF_CPAIT_PRICE_TRACKING,
CEF_CPAIT_PWA_INSTALL,
CEF_CPAIT_QR_CODE_GENERATOR_DEPRECATED,
CEF_CPAIT_READER_MODE_DEPRECATED,
CEF_CPAIT_QR_CODE_GENERATOR,
CEF_CPAIT_READER_MODE,
CEF_CPAIT_SAVE_AUTOFILL_ADDRESS,
CEF_CPAIT_SAVE_CARD,
CEF_CPAIT_SEND_TAB_TO_SELF_DEPRECATED,
CEF_CPAIT_SEND_TAB_TO_SELF,
CEF_CPAIT_SHARING_HUB,
CEF_CPAIT_SIDE_SEARCH,
CEF_CPAIT_SMS_REMOTE_FETCHER,
@@ -3486,9 +3426,7 @@ typedef enum {
CEF_CPAIT_MANDATORY_REAUTH,
CEF_CPAIT_PRICE_INSIGHTS,
CEF_CPAIT_PRICE_READ_ANYTHING,
CEF_CPAIT_PRODUCT_SPECIFICATIONS,
CEF_CPAIT_LENS_OVERLAY,
CEF_CPAIT_MAX_VALUE = CEF_CPAIT_LENS_OVERLAY,
CEF_CPAIT_MAX_VALUE = CEF_CPAIT_PRICE_READ_ANYTHING,
} cef_chrome_page_action_icon_type_t;
///
@@ -3628,20 +3566,18 @@ typedef enum {
CEF_PERMISSION_TYPE_DISK_QUOTA = 1 << 7,
CEF_PERMISSION_TYPE_LOCAL_FONTS = 1 << 8,
CEF_PERMISSION_TYPE_GEOLOCATION = 1 << 9,
CEF_PERMISSION_TYPE_IDENTITY_PROVIDER = 1 << 10,
CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 11,
CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 12,
CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 10,
CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 11,
CEF_PERMISSION_TYPE_MIDI = 1 << 12,
CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 13,
CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 14,
CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 15,
CEF_PERMISSION_TYPE_KEYBOARD_LOCK = 1 << 16,
CEF_PERMISSION_TYPE_POINTER_LOCK = 1 << 17,
CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = 1 << 18,
CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = 1 << 19,
CEF_PERMISSION_TYPE_STORAGE_ACCESS = 1 << 20,
CEF_PERMISSION_TYPE_VR_SESSION = 1 << 21,
CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT = 1 << 22,
CEF_PERMISSION_TYPE_FILE_SYSTEM_ACCESS = 1 << 23,
CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = 1 << 16,
CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = 1 << 17,
CEF_PERMISSION_TYPE_STORAGE_ACCESS = 1 << 18,
CEF_PERMISSION_TYPE_VR_SESSION = 1 << 19,
CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT = 1 << 20,
CEF_PERMISSION_TYPE_FILE_SYSTEM_ACCESS = 1 << 21,
} cef_permission_request_types_t;
///
@@ -3835,20 +3771,6 @@ typedef enum {
CEF_ZOOM_COMMAND_IN,
} cef_zoom_command_t;
///
/// Specifies the color variants supported by
/// CefRequestContext::SetChromeThemeColor.
///
typedef enum {
CEF_COLOR_VARIANT_SYSTEM,
CEF_COLOR_VARIANT_LIGHT,
CEF_COLOR_VARIANT_DARK,
CEF_COLOR_VARIANT_TONAL_SPOT,
CEF_COLOR_VARIANT_NEUTRAL,
CEF_COLOR_VARIANT_VIBRANT,
CEF_COLOR_VARIANT_EXPRESSIVE,
} cef_color_variant_t;
#ifdef __cplusplus
}
#endif

View File

@@ -380,13 +380,6 @@ typedef enum {
/// a requesting-origin/top-level-site combination and persistent.
CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_TPCD_TRIAL,
/// Content Setting for a first-party origin trial that allows websites to
/// enable third-party cookie deprecation.
/// ALLOW (default): no effect (e.g. third-party cookies allowed, if not
/// blocked otherwise).
/// BLOCK: third-party cookies blocked, but 3PCD mitigations enabled.
CEF_CONTENT_SETTING_TOP_LEVEL_TPCD_ORIGIN_TRIAL,
/// Content setting used to indicate whether entering picture-in-picture
/// automatically should be enabled.
CEF_CONTENT_SETTING_TYPE_AUTO_PICTURE_IN_PICTURE,
@@ -414,36 +407,7 @@ typedef enum {
/// Content settings for access to printers for the Web Printing API.
CEF_CONTENT_SETTING_TYPE_WEB_PRINTING,
/// Content setting used to indicate whether entering HTML Fullscreen
/// automatically (i.e. without transient activation) should be enabled.
CEF_CONTENT_SETTING_TYPE_AUTOMATIC_FULLSCREEN,
/// Content settings used to indicate that a web app is allowed to prompt the
/// user for the installation of sub apps.
CEF_CONTENT_SETTING_TYPE_SUB_APP_INSTALLATION_PROMPTS,
/// Whether an application can enumerate audio output device.
CEF_CONTENT_SETTING_TYPE_SPEAKER_SELECTION,
/// Content settings for access to the Direct Sockets API.
CEF_CONTENT_SETTING_TYPE_DIRECT_SOCKETS,
/// Keyboard Lock API allows a site to capture keyboard inputs that would
/// otherwise be handled by the OS or the browser.
CEF_CONTENT_SETTING_TYPE_KEYBOARD_LOCK,
/// Pointer Lock API allows a site to hide the cursor and have exclusive
/// access to mouse inputs.
CEF_CONTENT_SETTING_TYPE_POINTER_LOCK,
/// Website setting which is used for UnusedSitePermissionsService to store
/// auto-revoked notification permissions from abusive sites.
REVOKED_ABUSIVE_NOTIFICATION_PERMISSIONS,
/// Content setting that controls tracking protection status per site.
/// BLOCK: Protections enabled. This is the default state.
/// ALLOW: Protections disabled.
TRACKING_PROTECTION,
CEF_CONTENT_SETTING_TYPE_NUM_TYPES,
} cef_content_setting_types_t;
///

View File

@@ -32,6 +32,7 @@
#pragma once
#include "include/base/cef_build.h"
#include "include/cef_config.h"
#if defined(OS_LINUX)
@@ -42,9 +43,7 @@ typedef struct _XDisplay XDisplay;
#include "include/internal/cef_export.h"
#include "include/internal/cef_string.h"
#include "include/internal/cef_types_color.h"
#include "include/internal/cef_types_geometry.h"
#include "include/internal/cef_types_runtime.h"
// Handle types.
#if defined(CEF_X11)
@@ -136,65 +135,8 @@ typedef struct _cef_window_info_t {
/// Pointer for the new browser window. Only used with windowed rendering.
///
cef_window_handle_t window;
///
/// Optionally change the runtime style. Alloy style will always be used if
/// |windowless_rendering_enabled| is true. See cef_runtime_style_t
/// documentation for details.
///
cef_runtime_style_t runtime_style;
} cef_window_info_t;
///
/// Structure containing the plane information of the shared texture.
/// Sync with native_pixmap_handle.h
///
typedef struct _cef_accelerated_paint_native_pixmap_plane_info_t {
///
/// The strides and offsets in bytes to be used when accessing the buffers via
/// a memory mapping. One per plane per entry. Size in bytes of the plane is
/// necessary to map the buffers.
///
uint32_t stride;
uint64_t offset;
uint64_t size;
///
/// File descriptor for the underlying memory object (usually dmabuf).
///
int fd;
} cef_accelerated_paint_native_pixmap_plane_t;
#define kAcceleratedPaintMaxPlanes 4
///
/// Structure containing shared texture information for the OnAcceleratedPaint
/// callback. Resources will be released to the underlying pool for reuse when
/// the callback returns from client code.
///
typedef struct _cef_accelerated_paint_info_t {
///
/// Planes of the shared texture, usually file descriptors of dmabufs.
///
cef_accelerated_paint_native_pixmap_plane_t
planes[kAcceleratedPaintMaxPlanes];
///
/// Plane count.
///
int plane_count;
///
/// Modifier could be used with EGL driver.
///
uint64_t modifier;
///
/// The pixel format of the texture.
///
cef_color_type_t format;
} cef_accelerated_paint_info_t;
#ifdef __cplusplus
}
#endif

View File

@@ -35,9 +35,7 @@
#if defined(OS_MAC)
#include "include/internal/cef_string.h"
#include "include/internal/cef_types_color.h"
#include "include/internal/cef_types_geometry.h"
#include "include/internal/cef_types_runtime.h"
// Handle types.
// Actually NSCursor*
@@ -46,8 +44,6 @@
#define cef_event_handle_t void*
// Actually NSView*
#define cef_window_handle_t void*
// Actually IOSurface*
#define cef_shared_texture_handle_t void*
#define kNullCursorHandle NULL
#define kNullEventHandle NULL
@@ -138,32 +134,8 @@ typedef struct _cef_window_info_t {
/// rendering.
///
cef_window_handle_t view;
///
/// Optionally change the runtime style. Alloy style will always be used if
/// |windowless_rendering_enabled| is true or if |parent_view| is provided.
/// See cef_runtime_style_t documentation for details.
///
cef_runtime_style_t runtime_style;
} cef_window_info_t;
///
/// Structure containing shared texture information for the OnAcceleratedPaint
/// callback. Resources will be released to the underlying pool for reuse when
/// the callback returns from client code.
///
typedef struct _cef_accelerated_paint_info_t {
///
/// Handle for the shared texture IOSurface.
///
cef_shared_texture_handle_t shared_texture_io_surface;
///
/// The pixel format of the texture.
///
cef_color_type_t format;
} cef_accelerated_paint_info_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,88 +0,0 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_RUNTIME_H_
#define CEF_INCLUDE_INTERNAL_CEF_TYPES_RUNTIME_H_
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
///
/// CEF supports both a Chrome runtime (based on the Chrome UI layer) and an
/// Alloy runtime (based on the Chromium content layer). The Chrome runtime
/// provides the full Chrome UI and browser functionality whereas the Alloy
/// runtime provides less default browser functionality but adds additional
/// client callbacks and support for windowless (off-screen) rendering. For
/// additional comparative details on runtime types see
/// https://bitbucket.org/chromiumembedded/cef/wiki/Architecture.md#markdown-header-cef3
///
/// Each runtime is composed of a bootstrap component and a style component. The
/// bootstrap component is configured via CefSettings.chrome_runtime and cannot
/// be changed after CefInitialize. The style component is individually
/// configured for each window/browser at creation time and, in combination with
/// the Chrome bootstrap, different styles can be mixed during runtime.
///
/// Windowless rendering will always use Alloy style. Windowed rendering with a
/// default window or client-provided parent window can configure the style via
/// CefWindowInfo.runtime_style. Windowed rendering with the Views framework can
/// configure the style via CefWindowDelegate::GetWindowRuntimeStyle and
/// CefBrowserViewDelegate::GetBrowserRuntimeStyle. Alloy style Windows with the
/// Views framework can host only Alloy style BrowserViews but Chrome style
/// Windows can host both style BrowserViews. Additionally, a Chrome style
/// Window can host at most one Chrome style BrowserView but potentially
/// multiple Alloy style BrowserViews. See CefWindowInfo.runtime_style
/// documentation for any additional platform-specific limitations.
///
typedef enum {
///
/// Use the default runtime style. The default style will match the
/// CefSettings.chrome_runtime value in most cases. See above documentation
/// for exceptions.
///
CEF_RUNTIME_STYLE_DEFAULT,
///
/// Use the Chrome runtime style. Only supported with the Chrome runtime.
///
CEF_RUNTIME_STYLE_CHROME,
///
/// Use the Alloy runtime style. Supported with both the Alloy and Chrome
/// runtime.
///
CEF_RUNTIME_STYLE_ALLOY,
} cef_runtime_style_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_RUNTIME_H_

View File

@@ -37,15 +37,12 @@
#include <windows.h>
#include "include/internal/cef_string.h"
#include "include/internal/cef_types_color.h"
#include "include/internal/cef_types_geometry.h"
#include "include/internal/cef_types_runtime.h"
// Handle types.
#define cef_cursor_handle_t HCURSOR
#define cef_event_handle_t MSG*
#define cef_window_handle_t HWND
#define cef_shared_texture_handle_t HANDLE
#define kNullCursorHandle NULL
#define kNullEventHandle NULL
@@ -105,33 +102,8 @@ typedef struct _cef_window_info_t {
/// Handle for the new browser window. Only used with windowed rendering.
///
cef_window_handle_t window;
///
/// Optionally change the runtime style. Alloy style will always be used if
/// |windowless_rendering_enabled| is true. See cef_runtime_style_t
/// documentation for details.
///
cef_runtime_style_t runtime_style;
} cef_window_info_t;
///
/// Structure containing shared texture information for the OnAcceleratedPaint
/// callback. Resources will be released to the underlying pool for reuse when
/// the callback returns from client code.
///
typedef struct _cef_accelerated_paint_info_t {
///
/// Handle for the shared texture. The shared texture is instantiated
/// without a keyed mutex.
///
cef_shared_texture_handle_t shared_texture_handle;
///
/// The pixel format of the texture.
///
cef_color_type_t format;
} cef_accelerated_paint_info_t;
#ifdef __cplusplus
}
#endif

View File

@@ -387,9 +387,7 @@ struct CefSettingsTraits {
&target->framework_dir_path, copy);
cef_string_set(src->main_bundle_path.str, src->main_bundle_path.length,
&target->main_bundle_path, copy);
#if !defined(DISABLE_ALLOY_BOOTSTRAP)
target->chrome_runtime = src->chrome_runtime;
#endif
target->multi_threaded_message_loop = src->multi_threaded_message_loop;
target->external_message_pump = src->external_message_pump;
target->windowless_rendering_enabled = src->windowless_rendering_enabled;
@@ -699,9 +697,7 @@ using CefPdfPrintSettings = CefStructBase<CefPdfPrintSettingsTraits>;
///
class CefBoxLayoutSettings : public cef_box_layout_settings_t {
public:
CefBoxLayoutSettings() : cef_box_layout_settings_t{} {
cross_axis_alignment = CEF_AXIS_ALIGNMENT_STRETCH;
}
CefBoxLayoutSettings() : cef_box_layout_settings_t{} {}
CefBoxLayoutSettings(const cef_box_layout_settings_t& r)
: cef_box_layout_settings_t(r) {}
};
@@ -752,14 +748,4 @@ struct CefMediaSinkDeviceInfoTraits {
///
using CefMediaSinkDeviceInfo = CefStructBase<CefMediaSinkDeviceInfoTraits>;
///
/// Class representing accelerated paint info.
///
class CefAcceleratedPaintInfo : public cef_accelerated_paint_info_t {
public:
CefAcceleratedPaintInfo() : cef_accelerated_paint_info_t{} {}
CefAcceleratedPaintInfo(const cef_accelerated_paint_info_t& r)
: cef_accelerated_paint_info_t(r) {}
};
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_

View File

@@ -73,7 +73,6 @@ struct CefWindowInfoTraits {
target->shared_texture_enabled = src->shared_texture_enabled;
target->external_begin_frame_enabled = src->external_begin_frame_enabled;
target->window = src->window;
target->runtime_style = src->runtime_style;
}
};
@@ -131,7 +130,6 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
void SetAsWindowless(CefWindowHandle parent) {
windowless_rendering_enabled = TRUE;
parent_window = parent;
runtime_style = CEF_RUNTIME_STYLE_ALLOY;
}
};

View File

@@ -67,12 +67,4 @@ void CefExecuteJavaScriptWithUserGestureForTests(CefRefPtr<CefFrame> frame,
/*--cef()--*/
void CefSetDataDirectoryForTests(const CefString& dir);
///
/// Returns true if |feature_name| is enabled by default, command line or field
/// trial. This supports a short list of curated values that are queried by unit
/// tests.
///
/*--cef()--*/
bool CefIsFeatureEnabledForTests(const CefString& feature_name);
#endif // CEF_INCLUDE_TEST_CEF_TEST_HELPERS_H_

View File

@@ -49,7 +49,6 @@
#endif
#include <map>
#include "include/cef_base.h"
#include "include/cef_request.h"

View File

@@ -107,13 +107,6 @@ class CefBrowserView : public CefView {
///
/*--cef()--*/
virtual void SetPreferAccelerators(bool prefer_accelerators) = 0;
///
/// Returns the runtime style for this BrowserView (ALLOY or CHROME). See
/// cef_runtime_style_t documentation for details.
///
/*--cef(default_retval=CEF_RUNTIME_STYLE_DEFAULT)--*/
virtual cef_runtime_style_t GetRuntimeStyle() = 0;
};
#endif // CEF_INCLUDE_VIEWS_CEF_BROWSER_VIEW_H_

View File

@@ -140,15 +140,6 @@ class CefBrowserViewDelegate : public CefViewDelegate {
cef_gesture_command_t gesture_command) {
return false;
}
///
/// Optionally change the runtime style for this BrowserView. See
/// cef_runtime_style_t documentation for details.
///
/*--cef(default_retval=CEF_RUNTIME_STYLE_DEFAULT)--*/
virtual cef_runtime_style_t GetBrowserRuntimeStyle() {
return CEF_RUNTIME_STYLE_DEFAULT;
}
};
#endif // CEF_INCLUDE_VIEWS_CEF_BROWSER_VIEW_DELEGATE_H_

View File

@@ -357,31 +357,17 @@ class CefView : public CefBaseRefCounted {
virtual void RequestFocus() = 0;
///
/// Sets the background color for this View. The background color will be
/// automatically reset when CefViewDelegate::OnThemeChanged is called.
/// Sets the background color for this View.
///
/*--cef()--*/
virtual void SetBackgroundColor(cef_color_t color) = 0;
///
/// Returns the background color for this View. If the background color is
/// unset then the current `GetThemeColor(CEF_ColorPrimaryBackground)` value
/// will be returned. If this View belongs to an overlay (created with
/// CefWindow::AddOverlayView), and the background color is unset, then a
/// value of transparent (0) will be returned.
/// Returns the background color for this View.
///
/*--cef()--*/
virtual cef_color_t GetBackgroundColor() = 0;
///
/// Returns the current theme color associated with |color_id|, or the
/// placeholder color (red) if unset. See cef_color_ids.h for standard ID
/// values. Standard colors can be overridden and custom colors can be added
/// using CefWindow::SetThemeColor.
///
/*--cef()--*/
virtual cef_color_t GetThemeColor(int color_id) = 0;
///
/// Convert |point| from this View's coordinate system to DIP screen
/// coordinates. This View must belong to a Window when calling this method.

View File

@@ -131,27 +131,6 @@ class CefViewDelegate : public virtual CefBaseRefCounted {
///
/*--cef()--*/
virtual void OnBlur(CefRefPtr<CefView> view) {}
///
/// Called when the theme for |view| has changed, after the new theme colors
/// have already been applied. Views are notified via the component hierarchy
/// in depth-first reverse order (children before parents).
///
/// This will be called in the following cases:
///
/// 1. When |view|, or a parent of |view|, is added to a Window.
/// 2. When the native/OS or Chrome theme changes for the Window that contains
/// |view|. See CefWindowDelegate::OnThemeColorsChanged documentation.
/// 3. When the client explicitly calls CefWindow::ThemeChanged on the Window
/// that contains |view|.
///
/// Optionally use this callback to override the new per-View theme colors by
/// calling CefView::SetBackgroundColor or the appropriate component-specific
/// method. See CefWindow::SetThemeColor documentation for how to customize
/// additional Window theme colors.
///
/*--cef()--*/
virtual void OnThemeChanged(CefRefPtr<CefView> view) {}
};
#endif // CEF_INCLUDE_VIEWS_CEF_WINDOW_DELEGATE_H_

View File

@@ -377,50 +377,6 @@ class CefWindow : public CefPanel {
///
/*--cef()--*/
virtual void RemoveAllAccelerators() = 0;
///
/// Override a standard theme color or add a custom color associated with
/// |color_id|. See cef_color_ids.h for standard ID values. Recommended usage
/// is as follows:
///
/// 1. Customize the default native/OS theme by calling SetThemeColor before
/// showing the first Window. When done setting colors call
/// CefWindow::ThemeChanged to trigger CefViewDelegate::OnThemeChanged
/// notifications.
/// 2. Customize the current native/OS or Chrome theme after it changes by
/// calling SetThemeColor from the CefWindowDelegate::OnThemeColorsChanged
/// callback. CefViewDelegate::OnThemeChanged notifications will then be
/// triggered automatically.
///
/// The configured color will be available immediately via
/// CefView::GetThemeColor and will be applied to each View in this Window's
/// component hierarchy when CefViewDelegate::OnThemeChanged is called. See
/// OnThemeColorsChanged documentation for additional details.
///
/// Clients wishing to add custom colors should use |color_id| values >=
/// CEF_ChromeColorsEnd.
///
/*--cef()--*/
virtual void SetThemeColor(int color_id, cef_color_t color) = 0;
///
/// Trigger CefViewDelegate::OnThemeChanged callbacks for each View in this
/// Window's component hierarchy. Unlike a native/OS or Chrome theme change
/// this method does not reset theme colors to standard values and does not
/// result in a call to CefWindowDelegate::OnThemeColorsChanged.
///
/// Do not call this method from CefWindowDelegate::OnThemeColorsChanged or
/// CefViewDelegate::OnThemeChanged.
///
/*--cef()--*/
virtual void ThemeChanged() = 0;
///
/// Returns the runtime style for this Window (ALLOY or CHROME). See
/// cef_runtime_style_t documentation for details.
///
/*--cef(default_retval=CEF_RUNTIME_STYLE_DEFAULT)--*/
virtual cef_runtime_style_t GetRuntimeStyle() = 0;
};
#endif // CEF_INCLUDE_VIEWS_CEF_WINDOW_H_

View File

@@ -164,11 +164,12 @@ class CefWindowDelegate : public CefPanelDelegate {
}
///
/// Return whether the titlebar height should be overridden, and sets the
/// height of the titlebar in |titlebar_height|. On macOS, it can also be used
/// to adjust the vertical position of the traffic light buttons in frameless
/// windows. The buttons will be positioned halfway down the titlebar at a
/// height of |titlebar_height| / 2.
/// Return whether the titlebar height should be overridden,
/// and sets the height of the titlebar in |titlebar_height|.
/// On macOS, it can also be used to adjust the vertical position
/// of the traffic light buttons in frameless windows.
/// The buttons will be positioned halfway down the titlebar
/// at a height of |titlebar_height| / 2.
///
/*--cef()--*/
virtual bool GetTitlebarHeight(CefRefPtr<CefWindow> window,
@@ -176,21 +177,6 @@ class CefWindowDelegate : public CefPanelDelegate {
return false;
}
///
/// Return whether the view should accept the initial mouse-down event,
/// allowing it to respond to click-through behavior. If STATE_ENABLED is
/// returned, the view will be sent a mouseDown: message for an initial
/// mouse-down event, activating the view with one click, instead of clicking
/// first to make the window active and then clicking the view.
///
/// This method is only supported on macOS. For more details, refer to the
/// documentation of acceptsFirstMouse.
///
/*--cef(default_retval=STATE_DEFAULT)--*/
virtual cef_state_t AcceptsFirstMouse(CefRefPtr<CefWindow> window) {
return STATE_DEFAULT;
}
///
/// Return true if |window| can be resized.
///
@@ -236,50 +222,6 @@ class CefWindowDelegate : public CefPanelDelegate {
const CefKeyEvent& event) {
return false;
}
///
/// Called after the native/OS or Chrome theme for |window| has changed.
/// |chrome_theme| will be true if the notification is for a Chrome theme.
///
/// Native/OS theme colors are configured globally and do not need to be
/// customized for each Window individually. An example of a native/OS theme
/// change that triggers this callback is when the user switches between dark
/// and light mode during application lifespan. Native/OS theme changes can be
/// disabled by passing the `--force-dark-mode` or `--force-light-mode`
/// command-line flag.
///
/// Chrome theme colors will be applied and this callback will be triggered
/// if/when a BrowserView is added to the Window's component hierarchy. Chrome
/// theme colors can be configured on a per-RequestContext basis using
/// CefRequestContext::SetChromeColorScheme or (Chrome runtime only) by
/// visiting chrome://settings/manageProfile. Any theme changes using those
/// mechanisms will also trigger this callback. Chrome theme colors will be
/// persisted and restored from disk cache with the Chrome runtime, and with
/// the Alloy runtime if persist_user_preferences is set to true via
/// CefSettings or CefRequestContextSettings.
///
/// This callback is not triggered on Window creation so clients that wish to
/// customize the initial native/OS theme must call CefWindow::SetThemeColor
/// and CefWindow::ThemeChanged before showing the first Window.
///
/// Theme colors will be reset to standard values before this callback is
/// called for the first affected Window. Call CefWindow::SetThemeColor from
/// inside this callback to override a standard color or add a custom color.
/// CefViewDelegate::OnThemeChanged will be called after this callback for the
/// complete |window| component hierarchy.
///
/*--cef()--*/
virtual void OnThemeColorsChanged(CefRefPtr<CefWindow> window,
bool chrome_theme) {}
///
/// Optionally change the runtime style for this Window. See
/// cef_runtime_style_t documentation for details.
///
/*--cef(default_retval=CEF_RUNTIME_STYLE_DEFAULT)--*/
virtual cef_runtime_style_t GetWindowRuntimeStyle() {
return CEF_RUNTIME_STYLE_DEFAULT;
}
};
#endif // CEF_INCLUDE_VIEWS_CEF_WINDOW_DELEGATE_H_

View File

@@ -2,24 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/alloy/alloy_browser_context.h"
#include "libcef/browser/alloy/alloy_browser_context.h"
#include <map>
#include <memory>
#include <utility>
#include "libcef/browser/download_manager_delegate.h"
#include "libcef/browser/extensions/extension_system.h"
#include "libcef/browser/prefs/browser_prefs.h"
#include "libcef/browser/ssl_host_state_delegate.h"
#include "libcef/browser/thread_util.h"
#include "libcef/common/cef_switches.h"
#include "libcef/common/extensions/extensions_util.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "cef/libcef/browser/alloy/alloy_download_manager_delegate.h"
#include "cef/libcef/browser/extensions/extension_system.h"
#include "cef/libcef/browser/prefs/browser_prefs.h"
#include "cef/libcef/browser/ssl_host_state_delegate.h"
#include "cef/libcef/browser/thread_util.h"
#include "cef/libcef/common/cef_switches.h"
#include "cef/libcef/common/extensions/extensions_util.h"
#include "chrome/browser/font_family_cache.h"
#include "chrome/browser/permissions/permission_manager_factory.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
@@ -194,10 +195,6 @@ void AlloyBrowserContext::Shutdown() {
ChromePluginServiceFilter::GetInstance()->UnregisterProfile(this);
// Clear this reference before the associated KeyedServiceFactory is destroyed
// by PerformInterlockedTwoPhaseShutdown().
extension_system_ = nullptr;
// Remove any BrowserContextKeyedServiceFactory associations. This must be
// called before the ProxyService owned by AlloyBrowserContext is destroyed.
// The SimpleDependencyManager should always be passed after the
@@ -300,6 +297,15 @@ bool AlloyBrowserContext::UnloadExtension(const CefString& extension_id) {
return extension_system()->UnloadExtension(extension_id);
}
bool AlloyBrowserContext::IsPrintPreviewSupported() const {
CEF_REQUIRE_UIT();
if (!extensions::PrintPreviewEnabled()) {
return false;
}
return !GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled);
}
content::ClientHintsControllerDelegate*
AlloyBrowserContext::GetClientHintsControllerDelegate() {
return nullptr;
@@ -339,7 +345,7 @@ content::DownloadManagerDelegate*
AlloyBrowserContext::GetDownloadManagerDelegate() {
if (!download_manager_delegate_) {
download_manager_delegate_ =
std::make_unique<AlloyDownloadManagerDelegate>(GetDownloadManager());
std::make_unique<CefDownloadManagerDelegate>(GetDownloadManager());
}
return download_manager_delegate_.get();
}
@@ -432,11 +438,6 @@ AlloyBrowserContext::GetProfileCloudPolicyManager() {
return nullptr;
}
policy::CloudPolicyManager* AlloyBrowserContext::GetCloudPolicyManager() {
DCHECK(false);
return nullptr;
}
policy::ProfilePolicyConnector*
AlloyBrowserContext::GetProfilePolicyConnector() {
DCHECK(false);
@@ -460,12 +461,6 @@ void AlloyBrowserContext::RebuildTable(
enumerator->OnComplete(true);
}
void AlloyBrowserContext::BuildVisitedLinkTable(
const scoped_refptr<VisitedLinkEnumerator>& enumerator) {
// Called when visited links will not or cannot be loaded from disk.
enumerator->OnVisitedLinkComplete(true);
}
DownloadPrefs* AlloyBrowserContext::GetDownloadPrefs() {
CEF_REQUIRE_UIT();
if (!download_prefs_) {
@@ -474,13 +469,6 @@ DownloadPrefs* AlloyBrowserContext::GetDownloadPrefs() {
return download_prefs_.get();
}
void AlloyBrowserContext::AddVisitedURLs(
const GURL& url,
const std::vector<GURL>& redirect_chain,
ui::PageTransition /*transition*/) {
if (!redirect_chain.empty()) {
visitedlink_master_->AddURLs(redirect_chain);
} else {
visitedlink_master_->AddURL(url);
}
void AlloyBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) {
visitedlink_master_->AddURLs(urls);
}

View File

@@ -6,16 +6,16 @@
#define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_CONTEXT_H_
#pragma once
#include "base/memory/raw_ptr.h"
#include "cef/include/cef_request_context_handler.h"
#include "cef/libcef/browser/alloy/chrome_profile_alloy.h"
#include "cef/libcef/browser/browser_context.h"
#include "cef/libcef/browser/request_context_handler_map.h"
#include "include/cef_request_context_handler.h"
#include "libcef/browser/alloy/chrome_profile_alloy.h"
#include "libcef/browser/browser_context.h"
#include "libcef/browser/request_context_handler_map.h"
#include "chrome/browser/download/download_prefs.h"
#include "components/proxy_config/pref_proxy_config_tracker.h"
#include "components/visitedlink/browser/visitedlink_delegate.h"
class AlloyDownloadManagerDelegate;
class CefDownloadManagerDelegate;
class CefSSLHostStateDelegate;
class CefVisitedLinkListener;
class PrefService;
@@ -56,9 +56,7 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
bool GetExtensions(std::vector<CefString>& extension_ids) override;
CefRefPtr<CefExtension> GetExtension(const CefString& extension_id) override;
bool UnloadExtension(const CefString& extension_id) override;
void AddVisitedURLs(const GURL& url,
const std::vector<GURL>& redirect_chain,
ui::PageTransition transition) override;
bool IsPrintPreviewSupported() const override;
// content::BrowserContext overrides.
content::ClientHintsControllerDelegate* GetClientHintsControllerDelegate()
@@ -94,7 +92,6 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
policy::SchemaRegistryService* GetPolicySchemaRegistryService() override;
policy::UserCloudPolicyManager* GetUserCloudPolicyManager() override;
policy::ProfileCloudPolicyManager* GetProfileCloudPolicyManager() override;
policy::CloudPolicyManager* GetCloudPolicyManager() override;
policy::ProfilePolicyConnector* GetProfilePolicyConnector() override;
const policy::ProfilePolicyConnector* GetProfilePolicyConnector()
const override;
@@ -111,16 +108,17 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
// visitedlink::VisitedLinkDelegate methods.
void RebuildTable(const scoped_refptr<URLEnumerator>& enumerator) override;
void BuildVisitedLinkTable(
const scoped_refptr<VisitedLinkEnumerator>& enumerator) override;
// Manages extensions.
extensions::CefExtensionSystem* extension_system() const {
return extension_system_;
}
// Called from DownloadPrefs::FromBrowserContext via
// alloy::GetDownloadPrefsFromBrowserContext.
// Called from AlloyBrowserHostImpl::DidFinishNavigation to update the table
// of visited links.
void AddVisitedURLs(const std::vector<GURL>& urls);
// Called from DownloadPrefs::FromBrowserContext.
DownloadPrefs* GetDownloadPrefs();
private:
@@ -129,14 +127,14 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
std::unique_ptr<PrefService> pref_service_;
std::unique_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_;
std::unique_ptr<AlloyDownloadManagerDelegate> download_manager_delegate_;
std::unique_ptr<CefDownloadManagerDelegate> download_manager_delegate_;
std::unique_ptr<CefSSLHostStateDelegate> ssl_host_state_delegate_;
std::unique_ptr<visitedlink::VisitedLinkWriter> visitedlink_master_;
// |visitedlink_listener_| is owned by visitedlink_master_.
raw_ptr<CefVisitedLinkListener> visitedlink_listener_ = nullptr;
CefVisitedLinkListener* visitedlink_listener_ = nullptr;
// Owned by the KeyedService system.
raw_ptr<extensions::CefExtensionSystem> extension_system_ = nullptr;
extensions::CefExtensionSystem* extension_system_ = nullptr;
// The key to index KeyedService instances created by
// SimpleKeyedServiceFactory.

View File

@@ -3,35 +3,36 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include <memory>
#include <string>
#include <utility>
#include "libcef/browser/alloy/alloy_browser_context.h"
#include "libcef/browser/alloy/browser_platform_delegate_alloy.h"
#include "libcef/browser/audio_capturer.h"
#include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_info.h"
#include "libcef/browser/browser_info_manager.h"
#include "libcef/browser/browser_platform_delegate.h"
#include "libcef/browser/context.h"
#include "libcef/browser/devtools/devtools_manager.h"
#include "libcef/browser/media_access_query.h"
#include "libcef/browser/osr/osr_util.h"
#include "libcef/browser/request_context_impl.h"
#include "libcef/browser/thread_util.h"
#include "libcef/common/cef_switches.h"
#include "libcef/common/drag_data_impl.h"
#include "libcef/common/frame_util.h"
#include "libcef/common/net/url_util.h"
#include "libcef/common/request_impl.h"
#include "libcef/common/values_impl.h"
#include "libcef/features/runtime_checks.h"
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "cef/libcef/browser/alloy/browser_platform_delegate_alloy.h"
#include "cef/libcef/browser/audio_capturer.h"
#include "cef/libcef/browser/browser_context.h"
#include "cef/libcef/browser/browser_info.h"
#include "cef/libcef/browser/browser_info_manager.h"
#include "cef/libcef/browser/browser_platform_delegate.h"
#include "cef/libcef/browser/context.h"
#include "cef/libcef/browser/extensions/browser_extensions_util.h"
#include "cef/libcef/browser/hang_monitor.h"
#include "cef/libcef/browser/media_access_query.h"
#include "cef/libcef/browser/osr/osr_util.h"
#include "cef/libcef/browser/request_context_impl.h"
#include "cef/libcef/browser/thread_util.h"
#include "cef/libcef/common/cef_switches.h"
#include "cef/libcef/common/drag_data_impl.h"
#include "cef/libcef/common/frame_util.h"
#include "cef/libcef/common/net/url_util.h"
#include "cef/libcef/common/request_impl.h"
#include "cef/libcef/common/values_impl.h"
#include "cef/libcef/features/runtime.h"
#include "chrome/browser/file_select_helper.h"
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
#include "components/zoom/page_zoom.h"
@@ -49,13 +50,10 @@
#include "content/public/common/input/native_web_keyboard_event.h"
#include "content/public/common/url_constants.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "net/base/net_errors.h"
#include "ui/events/base_event_utils.h"
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
#include "extensions/common/extension.h"
#endif
using content::KeyboardEventProcessingResult;
namespace {
@@ -74,19 +72,11 @@ CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::Create(
CefBrowserPlatformDelegate::Create(create_params);
CHECK(platform_delegate);
// Expect runtime style to match.
CHECK(platform_delegate->IsAlloyStyle());
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
const bool is_devtools_popup = !!create_params.devtools_opener;
#else
const bool is_devtools_popup = false;
#endif
scoped_refptr<CefBrowserInfo> info =
CefBrowserInfoManager::GetInstance()->CreateBrowserInfo(
is_devtools_popup, platform_delegate->IsWindowless(),
platform_delegate->IsPrintPreviewSupported(),
create_params.extra_info);
bool own_web_contents = false;
@@ -98,7 +88,6 @@ CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::Create(
auto request_context_impl =
static_cast<CefRequestContextImpl*>(create_params.request_context.get());
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
CefRefPtr<CefExtension> cef_extension;
if (create_params.extension) {
auto cef_browser_context = request_context_impl->GetBrowserContext();
@@ -106,39 +95,25 @@ CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::Create(
cef_browser_context->GetExtension(create_params.extension->id());
CHECK(cef_extension);
}
#endif
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
auto platform_delegate_ptr = platform_delegate.get();
#endif
CefRefPtr<AlloyBrowserHostImpl> browser = CreateInternal(
create_params.settings, create_params.client, web_contents,
own_web_contents, info,
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
FromBaseChecked(create_params.devtools_opener),
#else
/*opener=*/nullptr,
#endif
is_devtools_popup, request_context_impl, std::move(platform_delegate)
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
,
cef_extension
#endif
);
static_cast<AlloyBrowserHostImpl*>(create_params.devtools_opener.get()),
is_devtools_popup, request_context_impl, std::move(platform_delegate),
cef_extension);
if (!browser) {
return nullptr;
}
GURL url = url_util::MakeGURL(create_params.url, /*fixup=*/true);
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
if (create_params.extension) {
platform_delegate_ptr->CreateExtensionHost(
create_params.extension, url, create_params.extension_host_type);
} else
#endif
if (!url.is_empty()) {
} else if (!url.is_empty()) {
content::OpenURLParams params(url, content::Referrer(),
WindowOpenDisposition::CURRENT_TAB,
CefFrameHostImpl::kPageTransitionExplicit,
@@ -159,12 +134,8 @@ CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::CreateInternal(
CefRefPtr<AlloyBrowserHostImpl> opener,
bool is_devtools_popup,
CefRefPtr<CefRequestContextImpl> request_context,
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
,
CefRefPtr<CefExtension> extension
#endif
) {
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate,
CefRefPtr<CefExtension> extension) {
CEF_REQUIRE_UIT();
DCHECK(web_contents);
DCHECK(browser_info);
@@ -195,12 +166,7 @@ CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::CreateInternal(
CefRefPtr<AlloyBrowserHostImpl> browser = new AlloyBrowserHostImpl(
settings, client, web_contents, browser_info, opener, request_context,
std::move(platform_delegate)
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
,
extension
#endif
);
std::move(platform_delegate), extension);
browser->InitializeBrowser();
if (!browser->CreateHostWindow()) {
@@ -214,8 +180,8 @@ CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::CreateInternal(
// 1. Notify the opener browser's platform delegate. With Views this will
// result in a call to CefBrowserViewDelegate::OnPopupBrowserViewCreated().
// Do this first for consistency with the Chrome runtime.
opener->platform_delegate_->PopupBrowserCreated(
browser->platform_delegate(), browser.get(), is_devtools_popup);
opener->platform_delegate_->PopupBrowserCreated(browser.get(),
is_devtools_popup);
}
// 2. Notify the browser's LifeSpanHandler. This must always be the first
@@ -233,38 +199,36 @@ CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::CreateInternal(
return browser;
}
// static
CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::FromBaseChecked(
CefRefPtr<CefBrowserHostBase> host_base) {
if (!host_base) {
return nullptr;
}
CHECK(host_base->IsAlloyStyle());
return static_cast<AlloyBrowserHostImpl*>(host_base.get());
}
// static
CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::GetBrowserForHost(
const content::RenderViewHost* host) {
return FromBaseChecked(CefBrowserHostBase::GetBrowserForHost(host));
REQUIRE_ALLOY_RUNTIME();
auto browser = CefBrowserHostBase::GetBrowserForHost(host);
return static_cast<AlloyBrowserHostImpl*>(browser.get());
}
// static
CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::GetBrowserForHost(
const content::RenderFrameHost* host) {
return FromBaseChecked(CefBrowserHostBase::GetBrowserForHost(host));
REQUIRE_ALLOY_RUNTIME();
auto browser = CefBrowserHostBase::GetBrowserForHost(host);
return static_cast<AlloyBrowserHostImpl*>(browser.get());
}
// static
CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::GetBrowserForContents(
const content::WebContents* contents) {
return FromBaseChecked(CefBrowserHostBase::GetBrowserForContents(contents));
REQUIRE_ALLOY_RUNTIME();
auto browser = CefBrowserHostBase::GetBrowserForContents(contents);
return static_cast<AlloyBrowserHostImpl*>(browser.get());
}
// static
CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::GetBrowserForGlobalId(
const content::GlobalRenderFrameHostId& global_id) {
return FromBaseChecked(CefBrowserHostBase::GetBrowserForGlobalId(global_id));
REQUIRE_ALLOY_RUNTIME();
auto browser = CefBrowserHostBase::GetBrowserForGlobalId(global_id);
return static_cast<AlloyBrowserHostImpl*>(browser.get());
}
// AlloyBrowserHostImpl methods.
@@ -368,6 +332,42 @@ void AlloyBrowserHostImpl::StopFinding(bool clearSelection) {
}
}
void AlloyBrowserHostImpl::ShowDevToolsOnUIThread(
std::unique_ptr<CefShowDevToolsParams> params) {
CEF_REQUIRE_UIT();
if (!EnsureDevToolsManager()) {
return;
}
devtools_manager_->ShowDevTools(params->window_info_, params->client_,
params->settings_,
params->inspect_element_at_);
}
void AlloyBrowserHostImpl::CloseDevTools() {
if (!CEF_CURRENTLY_ON_UIT()) {
CEF_POST_TASK(CEF_UIT,
base::BindOnce(&AlloyBrowserHostImpl::CloseDevTools, this));
return;
}
if (!devtools_manager_) {
return;
}
devtools_manager_->CloseDevTools();
}
bool AlloyBrowserHostImpl::HasDevTools() {
if (!CEF_CURRENTLY_ON_UIT()) {
DCHECK(false) << "called on invalid thread";
return false;
}
if (!devtools_manager_) {
return false;
}
return devtools_manager_->HasDevTools();
}
void AlloyBrowserHostImpl::SetAutoResizeEnabled(bool enabled,
const CefSize& min_size,
const CefSize& max_size) {
@@ -383,7 +383,6 @@ void AlloyBrowserHostImpl::SetAutoResizeEnabled(bool enabled,
}
}
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
CefRefPtr<CefExtension> AlloyBrowserHostImpl::GetExtension() {
return extension_;
}
@@ -391,7 +390,6 @@ CefRefPtr<CefExtension> AlloyBrowserHostImpl::GetExtension() {
bool AlloyBrowserHostImpl::IsBackgroundHost() {
return is_background_host_;
}
#endif
bool AlloyBrowserHostImpl::CanExecuteChromeCommand(int command_id) {
return false;
@@ -581,6 +579,17 @@ void AlloyBrowserHostImpl::DestroyBrowser() {
destruction_state_ = DESTRUCTION_STATE_COMPLETED;
// Notify that this browser has been destroyed. These must be delivered in
// the expected order.
// 1. Notify the platform delegate. With Views this will result in a call to
// CefBrowserViewDelegate::OnBrowserDestroyed().
platform_delegate_->NotifyBrowserDestroyed();
// 2. Notify the browser's LifeSpanHandler. This must always be the last
// notification for this browser.
OnBeforeClose();
// Destroy any platform constructs first.
if (javascript_dialog_manager_.get()) {
javascript_dialog_manager_->Destroy();
@@ -589,8 +598,16 @@ void AlloyBrowserHostImpl::DestroyBrowser() {
menu_manager_->Destroy();
}
// Disassociate the platform delegate from this browser. This will trigger
// WebContents destruction in most cases.
// Notify any observers that may have state associated with this browser.
OnBrowserDestroyed();
// If the WebContents still exists at this point, signal destruction before
// browser destruction.
if (web_contents()) {
WebContentsDestroyed();
}
// Disassociate the platform delegate from this browser.
platform_delegate_->BrowserDestroyed(this);
// Delete objects created by the platform delegate that may be referenced by
@@ -618,9 +635,8 @@ void AlloyBrowserHostImpl::CancelContextMenu() {
bool AlloyBrowserHostImpl::MaybeAllowNavigation(
content::RenderFrameHost* opener,
bool is_guest_view,
const content::OpenURLParams& params) {
const bool is_guest_view = extensions::IsBrowserPluginGuest(
content::WebContents::FromRenderFrameHost(opener));
if (is_guest_view && !params.is_pdf &&
!params.url.SchemeIs(extensions::kExtensionScheme) &&
!params.url.SchemeIs(content::kChromeUIScheme)) {
@@ -632,7 +648,7 @@ bool AlloyBrowserHostImpl::MaybeAllowNavigation(
CEF_POST_TASK(CEF_UIT,
base::BindOnce(
base::IgnoreResult(&AlloyBrowserHostImpl::OpenURLFromTab),
this, nullptr, params, base::NullCallback()));
this, nullptr, params));
return false;
}
@@ -640,13 +656,11 @@ bool AlloyBrowserHostImpl::MaybeAllowNavigation(
return true;
}
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
extensions::ExtensionHost* AlloyBrowserHostImpl::GetExtensionHost() const {
CEF_REQUIRE_UIT();
DCHECK(platform_delegate_);
return platform_delegate_->GetExtensionHost();
}
#endif
void AlloyBrowserHostImpl::OnSetFocus(cef_focus_source_t source) {
if (!CEF_CURRENTLY_ON_UIT()) {
@@ -942,11 +956,8 @@ bool AlloyBrowserHostImpl::IsAudioMuted() {
content::WebContents* AlloyBrowserHostImpl::OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params,
base::OnceCallback<void(content::NavigationHandle&)>
navigation_handle_callback) {
auto target_contents = contents_delegate_->OpenURLFromTabEx(
source, params, navigation_handle_callback);
const content::OpenURLParams& params) {
auto target_contents = contents_delegate_->OpenURLFromTab(source, params);
if (target_contents) {
// Start a navigation in the current browser that will result in the
// creation of a new render process.
@@ -958,13 +969,11 @@ content::WebContents* AlloyBrowserHostImpl::OpenURLFromTab(
return nullptr;
}
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
bool AlloyBrowserHostImpl::ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) {
return platform_delegate_->ShouldAllowRendererInitiatedCrossProcessNavigation(
is_main_frame_navigation);
}
#endif
void AlloyBrowserHostImpl::AddNewContents(
content::WebContents* source,
@@ -1106,13 +1115,11 @@ bool AlloyBrowserHostImpl::HandleKeyboardEvent(
return false;
}
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
bool AlloyBrowserHostImpl::PreHandleGestureEvent(
content::WebContents* source,
const blink::WebGestureEvent& event) {
return platform_delegate_->PreHandleGestureEvent(source, event);
}
#endif
bool AlloyBrowserHostImpl::CanDragEnter(content::WebContents* source,
const content::DropData& data,
@@ -1167,8 +1174,7 @@ void AlloyBrowserHostImpl::WebContentsCreated(
scoped_refptr<CefBrowserInfo> info =
CefBrowserInfoManager::GetInstance()->CreatePopupBrowserInfo(
new_contents, platform_delegate->IsWindowless(),
platform_delegate->IsPrintPreviewSupported(), extra_info);
new_contents, platform_delegate->IsWindowless(), extra_info);
CHECK(info.get());
CHECK(info->is_popup());
@@ -1184,33 +1190,19 @@ void AlloyBrowserHostImpl::WebContentsCreated(
// We don't officially own |new_contents| until AddNewContents() is called.
// However, we need to install observers/delegates here.
CefRefPtr<AlloyBrowserHostImpl> browser = CreateInternal(
settings, client, new_contents, /*own_web_contents=*/false, info, opener,
/*is_devtools_popup=*/false, request_context, std::move(platform_delegate)
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
,
/*extension=*/nullptr
#endif
);
}
void AlloyBrowserHostImpl::RendererUnresponsive(
content::WebContents* source,
content::RenderWidgetHost* render_widget_host,
base::RepeatingClosure hang_monitor_restarter) {
hang_monitor::RendererUnresponsive(this, render_widget_host,
hang_monitor_restarter);
}
void AlloyBrowserHostImpl::RendererResponsive(
content::WebContents* source,
content::RenderWidgetHost* render_widget_host) {
hang_monitor::RendererResponsive(this, render_widget_host);
CefRefPtr<AlloyBrowserHostImpl> browser =
CreateInternal(settings, client, new_contents, /*own_web_contents=*/false,
info, opener, /*is_devtools_popup=*/false, request_context,
std::move(platform_delegate), /*extension=*/nullptr);
}
content::JavaScriptDialogManager*
AlloyBrowserHostImpl::GetJavaScriptDialogManager(content::WebContents* source) {
return CefBrowserHostBase::GetJavaScriptDialogManager();
if (!javascript_dialog_manager_) {
javascript_dialog_manager_ =
std::make_unique<CefJavaScriptDialogManager>(this);
}
return javascript_dialog_manager_.get();
}
void AlloyBrowserHostImpl::RunFileChooser(
@@ -1275,12 +1267,10 @@ bool AlloyBrowserHostImpl::CheckMediaAccessPermission(
security_origin, type);
}
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
bool AlloyBrowserHostImpl::IsNeverComposited(
content::WebContents* web_contents) {
return platform_delegate_->IsNeverComposited(web_contents);
}
#endif
content::PictureInPictureResult AlloyBrowserHostImpl::EnterPictureInPicture(
content::WebContents* web_contents) {
@@ -1298,12 +1288,8 @@ void AlloyBrowserHostImpl::ExitPictureInPicture() {
}
bool AlloyBrowserHostImpl::IsBackForwardCacheSupported() {
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
return true;
#else
// Disabled with Alloy bootstrap due to issue #3237.
return cef::IsChromeRuntimeEnabled();
#endif
// Disabled due to issue #3237.
return false;
}
content::PreloadingEligibility AlloyBrowserHostImpl::IsPrerender2Supported(
@@ -1311,24 +1297,17 @@ content::PreloadingEligibility AlloyBrowserHostImpl::IsPrerender2Supported(
return content::PreloadingEligibility::kEligible;
}
void AlloyBrowserHostImpl::DraggableRegionsChanged(
const std::vector<blink::mojom::DraggableRegionPtr>& regions,
content::WebContents* contents) {
contents_delegate_->DraggableRegionsChanged(regions, contents);
}
// content::WebContentsObserver methods.
// -----------------------------------------------------------------------------
void AlloyBrowserHostImpl::DidFinishNavigation(
content::NavigationHandle* navigation_handle) {
if (web_contents()) {
auto cef_browser_context = CefBrowserContext::FromBrowserContext(
web_contents()->GetBrowserContext());
auto cef_browser_context =
static_cast<AlloyBrowserContext*>(web_contents()->GetBrowserContext());
if (cef_browser_context) {
cef_browser_context->AddVisitedURLs(
navigation_handle->GetURL(), navigation_handle->GetRedirectChain(),
navigation_handle->GetPageTransition());
navigation_handle->GetRedirectChain());
}
}
}
@@ -1361,46 +1340,34 @@ void AlloyBrowserHostImpl::OnRecentlyAudibleTimerFired() {
}
void AlloyBrowserHostImpl::AccessibilityEventReceived(
const ui::AXUpdatesAndEvents& details) {
const content::AXEventNotificationDetails& content_event_bundle) {
// Only needed in windowless mode.
if (IsWindowless()) {
if (!web_contents() || !platform_delegate_) {
return;
}
platform_delegate_->AccessibilityEventReceived(details);
platform_delegate_->AccessibilityEventReceived(content_event_bundle);
}
}
void AlloyBrowserHostImpl::AccessibilityLocationChangesReceived(
const std::vector<ui::AXLocationChanges>& details) {
const std::vector<content::AXLocationChangeNotificationDetails>& locData) {
// Only needed in windowless mode.
if (IsWindowless()) {
if (!web_contents() || !platform_delegate_) {
return;
}
platform_delegate_->AccessibilityLocationChangesReceived(details);
platform_delegate_->AccessibilityLocationChangesReceived(locData);
}
}
void AlloyBrowserHostImpl::WebContentsDestroyed() {
// In case we're notified before the CefBrowserContentsDelegate,
// reset it first for consistent state in DestroyWebContents.
if (GetWebContents()) {
contents_delegate_->WebContentsDestroyed();
}
auto wc = web_contents();
content::WebContentsObserver::Observe(nullptr);
DestroyWebContents(wc);
if (destruction_state_ < DESTRUCTION_STATE_COMPLETED) {
// We were not called via DestroyBrowser. This can occur when (for example)
// a pending popup WebContents is destroyed during parent WebContents
// destruction. Try to close the associated browser now.
CEF_POST_TASK(CEF_UIT, base::BindOnce(&AlloyBrowserHostImpl::CloseBrowser,
this, /*force_close=*/true));
if (platform_delegate_) {
platform_delegate_->WebContentsDestroyed(wc);
}
}
@@ -1437,12 +1404,8 @@ AlloyBrowserHostImpl::AlloyBrowserHostImpl(
scoped_refptr<CefBrowserInfo> browser_info,
CefRefPtr<AlloyBrowserHostImpl> opener,
CefRefPtr<CefRequestContextImpl> request_context,
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
,
CefRefPtr<CefExtension> extension
#endif
)
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate,
CefRefPtr<CefExtension> extension)
: CefBrowserHostBase(settings,
client,
std::move(platform_delegate),
@@ -1450,12 +1413,8 @@ AlloyBrowserHostImpl::AlloyBrowserHostImpl(
request_context),
content::WebContentsObserver(web_contents),
opener_(kNullWindowHandle),
is_windowless_(platform_delegate_->IsWindowless())
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
,
extension_(extension)
#endif
{
is_windowless_(platform_delegate_->IsWindowless()),
extension_(extension) {
contents_delegate_->ObserveWebContents(web_contents);
if (opener.get() && !is_views_hosted_) {

View File

@@ -11,22 +11,21 @@
#include <string>
#include <vector>
#include "include/cef_browser.h"
#include "include/cef_client.h"
#include "include/cef_frame.h"
#include "libcef/browser/browser_host_base.h"
#include "libcef/browser/browser_info.h"
#include "libcef/browser/frame_host_impl.h"
#include "libcef/browser/javascript_dialog_manager.h"
#include "libcef/browser/menu_manager.h"
#include "libcef/browser/request_context_impl.h"
#include "base/synchronization/lock.h"
#include "cef/include/cef_browser.h"
#include "cef/include/cef_client.h"
#include "cef/include/cef_frame.h"
#include "cef/libcef/browser/browser_host_base.h"
#include "cef/libcef/browser/browser_info.h"
#include "cef/libcef/browser/frame_host_impl.h"
#include "cef/libcef/browser/menu_manager.h"
#include "cef/libcef/browser/request_context_impl.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_observer.h"
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
#include "extensions/common/mojom/view_type.mojom-forward.h"
#endif
class CefAudioCapturer;
class CefBrowserInfo;
@@ -63,11 +62,6 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
static CefRefPtr<AlloyBrowserHostImpl> Create(
CefBrowserCreateParams& create_params);
// Safe (checked) conversion from CefBrowserHostBase to AlloyBrowserHostImpl.
// Use this method instead of static_cast.
static CefRefPtr<AlloyBrowserHostImpl> FromBaseChecked(
CefRefPtr<CefBrowserHostBase> host_base);
// Returns the browser associated with the specified RenderViewHost.
static CefRefPtr<AlloyBrowserHostImpl> GetBrowserForHost(
const content::RenderViewHost* host);
@@ -91,6 +85,8 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
bool matchCase,
bool findNext) override;
void StopFinding(bool clearSelection) override;
void CloseDevTools() override;
bool HasDevTools() override;
bool IsWindowRenderingDisabled() override;
void WasResized() override;
void WasHidden(bool hidden) override;
@@ -124,17 +120,15 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
void SetAutoResizeEnabled(bool enabled,
const CefSize& min_size,
const CefSize& max_size) override;
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
CefRefPtr<CefExtension> GetExtension() override;
bool IsBackgroundHost() override;
#endif
bool CanExecuteChromeCommand(int command_id) override;
void ExecuteChromeCommand(int command_id,
cef_window_open_disposition_t disposition) override;
// CefBrowserHostBase methods:
// Returns true if windowless rendering is enabled.
bool IsWindowless() const override;
bool IsAlloyStyle() const override { return true; }
bool IsVisible() const override;
// Returns true if this browser supports picture-in-picture.
@@ -153,6 +147,7 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
void CancelContextMenu();
bool MaybeAllowNavigation(content::RenderFrameHost* opener,
bool is_guest_view,
const content::OpenURLParams& params) override;
// Convert from view DIP coordinates to screen coordinates. If
@@ -169,10 +164,8 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
void UpdateDragOperation(ui::mojom::DragOperation operation,
bool document_is_handling_drag);
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
// Accessors that must be called on the UI thread.
extensions::ExtensionHost* GetExtensionHost() const;
#endif
void OnSetFocus(cef_focus_source_t source) override;
@@ -189,13 +182,9 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
// content::WebContentsDelegate methods.
content::WebContents* OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params,
base::OnceCallback<void(content::NavigationHandle&)>
navigation_handle_callback) override;
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
const content::OpenURLParams& params) override;
bool ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) override;
#endif
void AddNewContents(content::WebContents* source,
std::unique_ptr<content::WebContents> new_contents,
const GURL& target_url,
@@ -226,10 +215,8 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
bool HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
bool PreHandleGestureEvent(content::WebContents* source,
const blink::WebGestureEvent& event) override;
#endif
bool CanDragEnter(content::WebContents* source,
const content::DropData& data,
blink::DragOperationsMask operations_allowed) override;
@@ -246,13 +233,6 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents) override;
void RendererUnresponsive(
content::WebContents* source,
content::RenderWidgetHost* render_widget_host,
base::RepeatingClosure hang_monitor_restarter) override;
void RendererResponsive(
content::WebContents* source,
content::RenderWidgetHost* render_widget_host) override;
content::JavaScriptDialogManager* GetJavaScriptDialogManager(
content::WebContents* source) override;
void RunFileChooser(content::RenderFrameHost* render_frame_host,
@@ -283,18 +263,13 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
const url::Origin& security_origin,
blink::mojom::MediaStreamType type) override;
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
bool IsNeverComposited(content::WebContents* web_contents) override;
#endif
content::PictureInPictureResult EnterPictureInPicture(
content::WebContents* web_contents) override;
void ExitPictureInPicture() override;
bool IsBackForwardCacheSupported() override;
content::PreloadingEligibility IsPrerender2Supported(
content::WebContents& web_contents) override;
void DraggableRegionsChanged(
const std::vector<blink::mojom::DraggableRegionPtr>& regions,
content::WebContents* contents) override;
// content::WebContentsObserver methods.
using content::WebContentsObserver::BeforeUnloadFired;
@@ -302,11 +277,16 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
content::NavigationHandle* navigation_handle) override;
void OnAudioStateChanged(bool audible) override;
void AccessibilityEventReceived(
const ui::AXUpdatesAndEvents& details) override;
const content::AXEventNotificationDetails& content_event_bundle) override;
void AccessibilityLocationChangesReceived(
const std::vector<ui::AXLocationChanges>& details) override;
const std::vector<content::AXLocationChangeNotificationDetails>& locData)
override;
void WebContentsDestroyed() override;
protected:
void ShowDevToolsOnUIThread(
std::unique_ptr<CefShowDevToolsParams> params) override;
private:
friend class CefBrowserPlatformDelegateAlloy;
@@ -319,12 +299,8 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
CefRefPtr<AlloyBrowserHostImpl> opener,
bool is_devtools_popup,
CefRefPtr<CefRequestContextImpl> request_context,
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
,
CefRefPtr<CefExtension> extension
#endif
);
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate,
CefRefPtr<CefExtension> extension);
AlloyBrowserHostImpl(
const CefBrowserSettings& settings,
@@ -333,12 +309,8 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
scoped_refptr<CefBrowserInfo> browser_info,
CefRefPtr<AlloyBrowserHostImpl> opener,
CefRefPtr<CefRequestContextImpl> request_context,
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
,
CefRefPtr<CefExtension> extension
#endif
);
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate,
CefRefPtr<CefExtension> extension);
// Give the platform delegate an opportunity to create the host window.
bool CreateHostWindow();
@@ -349,10 +321,8 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
CefWindowHandle opener_;
const bool is_windowless_;
CefWindowHandle host_window_handle_ = kNullWindowHandle;
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
CefRefPtr<CefExtension> extension_;
bool is_background_host_ = false;
#endif
// Represents the current browser destruction state. Only accessed on the UI
// thread.
@@ -362,6 +332,9 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
// on the UI thread.
bool window_destroyed_ = false;
// Used for creating and managing JavaScript dialogs.
std::unique_ptr<CefJavaScriptDialogManager> javascript_dialog_manager_;
// Used for creating and managing context menus.
std::unique_ptr<CefMenuManager> menu_manager_;

View File

@@ -2,31 +2,32 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/alloy/alloy_browser_main.h"
#include "libcef/browser/alloy/alloy_browser_main.h"
#include <stdint.h>
#include <memory>
#include <string>
#include "libcef/browser/alloy/dialogs/alloy_constrained_window_views_client.h"
#include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_context_keyed_service_factories.h"
#include "libcef/browser/context.h"
#include "libcef/browser/devtools/devtools_manager_delegate.h"
#include "libcef/browser/extensions/extension_system_factory.h"
#include "libcef/browser/file_dialog_runner.h"
#include "libcef/browser/net/chrome_scheme_handler.h"
#include "libcef/browser/permission_prompt.h"
#include "libcef/browser/thread_util.h"
#include "libcef/common/app_manager.h"
#include "libcef/common/command_line_impl.h"
#include "libcef/common/extensions/extensions_util.h"
#include "libcef/common/net/net_resource_provider.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool.h"
#include "cef/libcef/browser/alloy/devtools/devtools_manager_delegate.h"
#include "cef/libcef/browser/alloy/dialogs/alloy_constrained_window_views_client.h"
#include "cef/libcef/browser/browser_context.h"
#include "cef/libcef/browser/browser_context_keyed_service_factories.h"
#include "cef/libcef/browser/context.h"
#include "cef/libcef/browser/extensions/extension_system_factory.h"
#include "cef/libcef/browser/file_dialog_runner.h"
#include "cef/libcef/browser/net/chrome_scheme_handler.h"
#include "cef/libcef/browser/permission_prompt.h"
#include "cef/libcef/browser/thread_util.h"
#include "cef/libcef/common/app_manager.h"
#include "cef/libcef/common/command_line_impl.h"
#include "cef/libcef/common/extensions/extensions_util.h"
#include "cef/libcef/common/net/net_resource_provider.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_process_singleton.h"
#include "chrome/browser/media/router/chrome_media_router_factory.h"
@@ -36,7 +37,6 @@
#include "chrome/browser/ui/ui_features.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "components/color/color_mixers.h"
#include "components/constrained_window/constrained_window_views.h"
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/browser/network_service_instance.h"
@@ -50,14 +50,10 @@
#include "ui/native_theme/native_theme.h"
#if BUILDFLAG(IS_LINUX)
#include "components/password_manager/core/browser/password_manager_switches.h"
#include "ui/base/ozone_buildflags.h"
#if defined(USE_AURA) && BUILDFLAG(IS_OZONE_X11)
#include "ui/events/devices/x11/touch_factory_x11.h"
#endif
#if defined(USE_DBUS)
#include "chrome/browser/ui/views/dark_mode_manager_linux.h"
#endif
#endif
#if defined(USE_AURA)
@@ -90,11 +86,11 @@
#if BUILDFLAG(IS_LINUX)
#include "base/path_service.h"
#include "cef/libcef/browser/printing/print_dialog_linux.h"
#include "chrome/browser/themes/theme_service_aura_linux.h"
#include "chrome/browser/ui/views/theme_profile_key.h"
#include "chrome/grit/branded_strings.h"
#include "components/os_crypt/sync/key_storage_config_linux.h"
#include "libcef/browser/printing/print_dialog_linux.h"
#include "ui/base/cursor/cursor_factory.h"
#include "ui/base/ime/input_method.h"
#include "ui/base/l10n/l10n_util.h"
@@ -130,10 +126,26 @@ class LinuxUiGetterImpl : public ui::LinuxUiGetter {
}
};
ui::LinuxUi* GetLinuxUI() {
// We can't use GtkUi in combination with multi-threaded-message-loop because
// Chromium's GTK implementation doesn't use GDK threads.
if (!!CefContext::Get()->settings().multi_threaded_message_loop) {
return nullptr;
}
// If the ozone backend hasn't provided a LinuxUiDelegate, don't try to create
// a LinuxUi instance as this may result in a crash in toolkit initialization.
if (!ui::LinuxUiDelegate::GetInstance()) {
return nullptr;
}
return ui::GetDefaultLinuxUi();
}
#endif // BUILDFLAG(IS_LINUX)
void ProcessSingletonNotificationCallbackImpl(
base::CommandLine command_line,
const base::CommandLine& command_line,
const base::FilePath& current_directory) {
// Drop the request if the browser process is already shutting down.
if (!CONTEXT_STATE_VALID()) {
@@ -160,7 +172,7 @@ void ProcessSingletonNotificationCallbackImpl(
// Based on ChromeBrowserMainParts::ProcessSingletonNotificationCallback.
bool ProcessSingletonNotificationCallback(
base::CommandLine command_line,
const base::CommandLine& command_line,
const base::FilePath& current_directory) {
// Drop the request if the browser process is already shutting down.
// Note that we're going to post an async task below. Even if the browser
@@ -179,7 +191,7 @@ bool ProcessSingletonNotificationCallback(
// So, we post a task to asynchronously finish the command line processing.
return base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE, base::BindOnce(&ProcessSingletonNotificationCallbackImpl,
std::move(command_line), current_directory));
command_line, current_directory));
}
} // namespace
@@ -191,8 +203,7 @@ AlloyBrowserMainParts::~AlloyBrowserMainParts() {
}
void AlloyBrowserMainParts::ToolkitInitialized() {
SetConstrainedWindowViewsClient(
CreateAlloyConstrainedWindowViewsClient(nullptr));
SetConstrainedWindowViewsClient(CreateAlloyConstrainedWindowViewsClient());
#if defined(USE_AURA)
CHECK(aura::Env::GetInstance());
@@ -208,9 +219,7 @@ void AlloyBrowserMainParts::ToolkitInitialized() {
#if BUILDFLAG(IS_LINUX)
// Based on chrome_browser_main_extra_parts_views_linux.cc
// |linux_ui| will be nullptr with multi-threaded-message-loop. See
// CefUiThread::InitializeBrowserRunner.
if (auto linux_ui = ui::GetDefaultLinuxUi()) {
if (auto linux_ui = GetLinuxUI()) {
linux_ui_getter_ = std::make_unique<LinuxUiGetterImpl>();
ui::LinuxUi::SetInstance(linux_ui);
@@ -219,13 +228,6 @@ void AlloyBrowserMainParts::ToolkitInitialized() {
ui::CursorFactory::GetInstance()->ObserveThemeChanges();
}
#if defined(USE_DBUS)
if (!ui::NativeTheme::IsForcedDarkMode() &&
!ui::NativeTheme::IsForcedLightMode()) {
dark_mode_manager_ = std::make_unique<ui::DarkModeManagerLinux>();
}
#endif
auto printing_delegate = new CefPrintingContextLinuxDelegate();
auto default_delegate =
ui::PrintingContextLinuxDelegate::SetInstance(printing_delegate);
@@ -244,8 +246,6 @@ void AlloyBrowserMainParts::ToolkitInitialized() {
// On GTK that builds the native theme that, in turn, adds the GTK core color
// mixer; core mixers should all be added before we add chrome mixers.
ui::ColorProviderManager::Get().AppendColorProviderInitializer(
base::BindRepeating(color::AddComponentsColorMixers));
ui::ColorProviderManager::Get().AppendColorProviderInitializer(
base::BindRepeating(AddChromeColorMixers));
}
@@ -284,13 +284,12 @@ void AlloyBrowserMainParts::PostCreateMainMessageLoop() {
std::unique_ptr<os_crypt::Config> config =
std::make_unique<os_crypt::Config>();
// Forward to os_crypt the flag to use a specific password store.
config->store =
command_line->GetSwitchValueASCII(password_manager::kPasswordStore);
// Forward the product name
config->store = command_line->GetSwitchValueASCII(switches::kPasswordStore);
// Forward the product name (defaults to "Chromium").
config->product_name = l10n_util::GetStringUTF8(IDS_PRODUCT_NAME);
// OSCrypt can be disabled in a special settings file.
config->should_use_preference =
command_line->HasSwitch(password_manager::kEnableEncryptionSelection);
command_line->HasSwitch(switches::kEnableEncryptionSelection);
base::PathService::Get(chrome::DIR_USER_DATA, &config->user_data_path);
DCHECK(!config->user_data_path.empty());
OSCrypt::SetConfig(std::move(config));

View File

@@ -6,12 +6,11 @@
#define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_MAIN_H_
#pragma once
#include <string_view>
#include "libcef/browser/request_context_impl.h"
#include "base/command_line.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/string_piece.h"
#include "build/build_config.h"
#include "cef/libcef/browser/request_context_impl.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_main_parts.h"
#include "ui/display/screen.h"
@@ -32,10 +31,7 @@ class LayoutProvider;
#if BUILDFLAG(IS_LINUX)
namespace ui {
class LinuxUiGetter;
#if defined(USE_DBUS)
class DarkModeManagerLinux;
#endif
} // namespace ui
}
#endif
class CefDevToolsDelegate;
@@ -80,7 +76,7 @@ class AlloyBrowserMainParts : public content::BrowserMainParts {
#endif // BUILDFLAG(IS_WIN)
CefRefPtr<CefRequestContextImpl> global_request_context_;
raw_ptr<CefDevToolsDelegate> devtools_delegate_ = nullptr; // Deletes itself.
CefDevToolsDelegate* devtools_delegate_ = nullptr; // Deletes itself.
// Blocking task runners exposed via CefTaskRunner. For consistency with
// previous named thread behavior always execute all pending tasks before
@@ -103,9 +99,6 @@ class AlloyBrowserMainParts : public content::BrowserMainParts {
#if BUILDFLAG(IS_LINUX)
std::unique_ptr<ui::LinuxUiGetter> linux_ui_getter_;
#if defined(USE_DBUS)
std::unique_ptr<ui::DarkModeManagerLinux> dark_mode_manager_;
#endif
#endif
};

View File

@@ -2,13 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/alloy/alloy_browser_main.h"
#include <Objbase.h>
#include <commctrl.h>
#include <windows.h>
#include <commctrl.h>
#include "libcef/browser/alloy/alloy_browser_main.h"
#include "base/logging.h"

View File

@@ -2,12 +2,48 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/alloy/alloy_content_browser_client.h"
#include "libcef/browser/alloy/alloy_content_browser_client.h"
#include <algorithm>
#include <tuple>
#include <utility>
#include "include/cef_version.h"
#include "libcef/browser/alloy/alloy_browser_context.h"
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/alloy/alloy_browser_main.h"
#include "libcef/browser/alloy/alloy_web_contents_view_delegate.h"
#include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_frame.h"
#include "libcef/browser/browser_info.h"
#include "libcef/browser/browser_info_manager.h"
#include "libcef/browser/browser_manager.h"
#include "libcef/browser/browser_platform_delegate.h"
#include "libcef/browser/certificate_query.h"
#include "libcef/browser/context.h"
#include "libcef/browser/devtools/devtools_manager_delegate.h"
#include "libcef/browser/extensions/extension_system.h"
#include "libcef/browser/extensions/extension_web_contents_observer.h"
#include "libcef/browser/media_capture_devices_dispatcher.h"
#include "libcef/browser/net/chrome_scheme_handler.h"
#include "libcef/browser/net/throttle_handler.h"
#include "libcef/browser/net_service/cookie_manager_impl.h"
#include "libcef/browser/net_service/login_delegate.h"
#include "libcef/browser/net_service/proxy_url_loader_factory.h"
#include "libcef/browser/net_service/resource_request_handler_wrapper.h"
#include "libcef/browser/prefs/renderer_prefs.h"
#include "libcef/browser/speech_recognition_manager_delegate.h"
#include "libcef/browser/thread_util.h"
#include "libcef/browser/x509_certificate_impl.h"
#include "libcef/common/alloy/alloy_content_client.h"
#include "libcef/common/app_manager.h"
#include "libcef/common/cef_switches.h"
#include "libcef/common/command_line_impl.h"
#include "libcef/common/extensions/extensions_util.h"
#include "libcef/common/frame_util.h"
#include "libcef/common/net/scheme_registration.h"
#include "libcef/common/request_impl.h"
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
@@ -16,41 +52,6 @@
#include "base/stl_util.h"
#include "base/threading/thread_restrictions.h"
#include "cef/grit/cef_resources.h"
#include "cef/include/cef_version.h"
#include "cef/libcef/browser/alloy/alloy_browser_context.h"
#include "cef/libcef/browser/alloy/alloy_browser_host_impl.h"
#include "cef/libcef/browser/alloy/alloy_browser_main.h"
#include "cef/libcef/browser/alloy/alloy_web_contents_view_delegate.h"
#include "cef/libcef/browser/alloy/devtools/devtools_manager_delegate.h"
#include "cef/libcef/browser/browser_context.h"
#include "cef/libcef/browser/browser_frame.h"
#include "cef/libcef/browser/browser_info.h"
#include "cef/libcef/browser/browser_info_manager.h"
#include "cef/libcef/browser/browser_manager.h"
#include "cef/libcef/browser/browser_platform_delegate.h"
#include "cef/libcef/browser/certificate_query.h"
#include "cef/libcef/browser/context.h"
#include "cef/libcef/browser/extensions/extension_system.h"
#include "cef/libcef/browser/extensions/extension_web_contents_observer.h"
#include "cef/libcef/browser/media_capture_devices_dispatcher.h"
#include "cef/libcef/browser/net/chrome_scheme_handler.h"
#include "cef/libcef/browser/net/throttle_handler.h"
#include "cef/libcef/browser/net_service/cookie_manager_impl.h"
#include "cef/libcef/browser/net_service/login_delegate.h"
#include "cef/libcef/browser/net_service/proxy_url_loader_factory.h"
#include "cef/libcef/browser/net_service/resource_request_handler_wrapper.h"
#include "cef/libcef/browser/prefs/renderer_prefs.h"
#include "cef/libcef/browser/speech_recognition_manager_delegate.h"
#include "cef/libcef/browser/thread_util.h"
#include "cef/libcef/browser/x509_certificate_impl.h"
#include "cef/libcef/common/alloy/alloy_content_client.h"
#include "cef/libcef/common/app_manager.h"
#include "cef/libcef/common/cef_switches.h"
#include "cef/libcef/common/command_line_impl.h"
#include "cef/libcef/common/extensions/extensions_util.h"
#include "cef/libcef/common/frame_util.h"
#include "cef/libcef/common/net/scheme_registration.h"
#include "cef/libcef/common/request_impl.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h"
@@ -90,8 +91,7 @@
#include "components/pdf/browser/pdf_document_helper.h"
#include "components/pdf/browser/pdf_navigation_throttle.h"
#include "components/pdf/browser/pdf_url_loader_request_interceptor.h"
#include "components/pdf/common/constants.h"
#include "components/pdf/common/pdf_util.h"
#include "components/pdf/common/internal_plugin_helpers.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "components/spellcheck/common/spellcheck.mojom.h"
#include "components/version_info/version_info.h"
@@ -118,6 +118,7 @@
#include "extensions/browser/api/automation_internal/automation_event_router.h"
#include "extensions/browser/api/mime_handler_private/mime_handler_private.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_message_filter.h"
#include "extensions/browser/extension_protocols.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_web_contents_observer.h"
@@ -160,10 +161,10 @@
#include "net/ssl/client_cert_store_mac.h"
#include "services/video_capture/public/mojom/constants.mojom.h"
#elif BUILDFLAG(IS_POSIX)
#include "cef/libcef/common/crash_reporting.h"
#include "components/crash/core/app/crash_switches.h"
#include "components/crash/core/app/crashpad.h"
#include "content/public/common/content_descriptors.h"
#include "libcef/common/crash_reporting.h"
#endif
#if BUILDFLAG(IS_WIN)
@@ -384,10 +385,6 @@ AlloyContentBrowserClient::AlloyContentBrowserClient() = default;
AlloyContentBrowserClient::~AlloyContentBrowserClient() = default;
void AlloyContentBrowserClient::CleanupOnUIThread() {
browser_main_parts_ = nullptr;
}
std::unique_ptr<content::BrowserMainParts>
AlloyContentBrowserClient::CreateBrowserMainParts(
bool /* is_integration_test */) {
@@ -400,6 +397,13 @@ void AlloyContentBrowserClient::RenderProcessWillLaunch(
content::RenderProcessHost* host) {
Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
#if BUILDFLAG(ENABLE_EXTENSIONS_LEGACY_IPC)
if (extensions::ExtensionsEnabled()) {
host->AddFilter(
new extensions::ExtensionMessageFilter(host->GetID(), profile));
}
#endif
// If the renderer process crashes then the host may already have
// CefBrowserInfoManager as an observer. Try to remove it first before adding
// to avoid DCHECKs.
@@ -453,7 +457,7 @@ bool AlloyContentBrowserClient::DoesSiteRequireDedicatedProcess(
}
bool AlloyContentBrowserClient::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(
std::string_view scheme,
base::StringPiece scheme,
bool is_embedded_origin_secure) {
// This is needed to bypass the normal SameSite rules for any chrome:// page
// embedding a secure origin, regardless of the registrable domains of any
@@ -474,7 +478,7 @@ bool AlloyContentBrowserClient::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(
bool AlloyContentBrowserClient::
ShouldIgnoreSameSiteCookieRestrictionsWhenTopLevel(
std::string_view scheme,
base::StringPiece scheme,
bool is_embedded_origin_secure) {
return is_embedded_origin_secure && scheme == content::kChromeUIScheme;
}
@@ -629,6 +633,10 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
process ? CefBrowserContext::FromBrowserContext(browser_context)
: nullptr;
if (cef_browser_context) {
if (cef_browser_context->IsPrintPreviewSupported()) {
command_line->AppendSwitch(switches::kEnablePrintPreview);
}
// Based on ChromeContentBrowserClientExtensionsPart::
// AppendExtraRendererCommandLineSwitches
if (extensions::ProcessMap::Get(browser_context)
@@ -873,6 +881,19 @@ void AlloyContentBrowserClient::ExposeInterfacesToRenderer(
associated_registry->AddInterface<extensions::mojom::RendererHost>(
base::BindRepeating(&extensions::RendererStartupHelper::BindForRenderer,
render_process_host->GetID()));
#if BUILDFLAG(ENABLE_EXTENSIONS_LEGACY_IPC)
associated_registry->AddInterface<extensions::mojom::EventRouter>(
base::BindRepeating(&extensions::EventRouter::BindForRenderer,
host->GetID()));
associated_registry->AddInterface<extensions::mojom::ServiceWorkerHost>(
base::BindRepeating(&extensions::ServiceWorkerHost::BindReceiver,
host->GetID()));
associated_registry
->AddInterface<extensions::mojom::RendererAutomationRegistry>(
base::BindRepeating(
&extensions::AutomationEventRouter::BindForRenderer,
host->GetID()));
#endif
}
}
@@ -889,6 +910,7 @@ void AlloyContentBrowserClient::
associated_registry.AddInterface<extensions::mojom::RendererHost>(
base::BindRepeating(&extensions::RendererStartupHelper::BindForRenderer,
service_worker_version_info.process_id));
#if !BUILDFLAG(ENABLE_EXTENSIONS_LEGACY_IPC)
associated_registry.AddInterface<extensions::mojom::ServiceWorkerHost>(
base::BindRepeating(&extensions::ServiceWorkerHost::BindReceiver,
service_worker_version_info.process_id));
@@ -900,6 +922,7 @@ void AlloyContentBrowserClient::
associated_registry.AddInterface<extensions::mojom::EventRouter>(
base::BindRepeating(&extensions::EventRouter::BindForRenderer,
service_worker_version_info.process_id));
#endif
}
}
@@ -917,10 +940,10 @@ void AlloyContentBrowserClient::
},
&render_frame_host));
associated_registry.AddInterface<pdf::mojom::PdfHost>(base::BindRepeating(
associated_registry.AddInterface<pdf::mojom::PdfService>(base::BindRepeating(
[](content::RenderFrameHost* render_frame_host,
mojo::PendingAssociatedReceiver<pdf::mojom::PdfHost> receiver) {
pdf::PDFDocumentHelper::BindPdfHost(
mojo::PendingAssociatedReceiver<pdf::mojom::PdfService> receiver) {
pdf::PDFDocumentHelper::BindPdfService(
std::move(receiver), render_frame_host,
std::make_unique<ChromePDFDocumentHelperClient>());
},
@@ -980,8 +1003,11 @@ AlloyContentBrowserClient::CreateThrottlesForNavigation(
throttles.push_back(std::move(pdf_iframe_throttle));
}
throttles.push_back(std::make_unique<pdf::PdfNavigationThrottle>(
navigation_handle, std::make_unique<ChromePdfStreamDelegate>()));
auto pdf_throttle = pdf::PdfNavigationThrottle::MaybeCreateThrottleFor(
navigation_handle, std::make_unique<ChromePdfStreamDelegate>());
if (pdf_throttle) {
throttles.push_back(std::move(pdf_throttle));
}
}
throttle::CreateThrottlesForNavigation(navigation_handle, throttles);
@@ -996,7 +1022,7 @@ AlloyContentBrowserClient::CreateURLLoaderThrottles(
const base::RepeatingCallback<content::WebContents*()>& wc_getter,
content::NavigationUIData* navigation_ui_data,
int frame_tree_node_id,
std::optional<int64_t> navigation_id) {
absl::optional<int64_t> navigation_id) {
std::vector<std::unique_ptr<blink::URLLoaderThrottle>> result;
// Used to substitute View ID for PDF contents when using the PDF plugin.
@@ -1097,27 +1123,20 @@ AlloyContentBrowserClient::CreateLoginDelegate(
std::move(auth_required_callback));
}
mojo::PendingRemote<network::mojom::URLLoaderFactory>
AlloyContentBrowserClient::CreateNonNetworkNavigationURLLoaderFactory(
const std::string& scheme,
int frame_tree_node_id) {
void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
int frame_tree_node_id,
NonNetworkURLLoaderFactoryMap* factories) {
if (!extensions::ExtensionsEnabled()) {
return {};
return;
}
content::WebContents* web_contents =
content::WebContents::FromFrameTreeNodeId(frame_tree_node_id);
content::BrowserContext* browser_context = web_contents->GetBrowserContext();
if (scheme == extensions::kExtensionScheme &&
!extensions::ChromeContentBrowserClientExtensionsPart::
AreExtensionsDisabledForProfile(browser_context)) {
return extensions::CreateExtensionNavigationURLLoaderFactory(
browser_context,
!!extensions::WebViewGuest::FromWebContents(web_contents));
}
return {};
factories->emplace(
extensions::kExtensionScheme,
extensions::CreateExtensionNavigationURLLoaderFactory(
web_contents->GetBrowserContext(),
!!extensions::WebViewGuest::FromWebContents(web_contents)));
}
void AlloyContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(
@@ -1177,16 +1196,15 @@ void AlloyContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(
}
}
void AlloyContentBrowserClient::WillCreateURLLoaderFactory(
bool AlloyContentBrowserClient::WillCreateURLLoaderFactory(
content::BrowserContext* browser_context,
content::RenderFrameHost* frame,
int render_process_id,
URLLoaderFactoryType type,
const url::Origin& request_initiator,
const net::IsolationInfo& isolation_info,
std::optional<int64_t> navigation_id,
ukm::SourceIdObj ukm_source_id,
network::URLLoaderFactoryBuilder& factory_builder,
mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
header_client,
bool* bypass_redirect_checks,
@@ -1199,8 +1217,9 @@ void AlloyContentBrowserClient::WillCreateURLLoaderFactory(
type == URLLoaderFactoryType::kDownload, request_initiator);
net_service::ProxyURLLoaderFactory::CreateProxy(
browser_context, factory_builder, header_client,
browser_context, factory_receiver, header_client,
std::move(request_handler));
return true;
}
void AlloyContentBrowserClient::OnNetworkServiceCreated(

View File

@@ -9,13 +9,12 @@
#include <string>
#include <utility>
#include "base/memory/raw_ptr.h"
#include "include/cef_request_context_handler.h"
#include "libcef/browser/request_context_impl.h"
#include "base/memory/ref_counted.h"
#include "build/build_config.h"
#include "cef/include/cef_request_context_handler.h"
#include "cef/libcef/browser/request_context_impl.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/web_contents.h"
#include "third_party/skia/include/core/SkColor.h"
class AlloyBrowserMainParts;
@@ -34,8 +33,6 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
AlloyContentBrowserClient();
~AlloyContentBrowserClient() override;
void CleanupOnUIThread();
// ContentBrowserClient implementation.
std::unique_ptr<content::BrowserMainParts> CreateBrowserMainParts(
bool is_integration_test) override;
@@ -47,10 +44,10 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
bool DoesSiteRequireDedicatedProcess(content::BrowserContext* browser_context,
const GURL& effective_site_url) override;
bool ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(
std::string_view scheme,
base::StringPiece scheme,
bool is_embedded_origin_secure) override;
bool ShouldIgnoreSameSiteCookieRestrictionsWhenTopLevel(
std::string_view scheme,
base::StringPiece scheme,
bool is_embedded_origin_secure) override;
void OverrideURLLoaderFactoryParams(
content::BrowserContext* browser_context,
@@ -140,7 +137,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
const base::RepeatingCallback<content::WebContents*()>& wc_getter,
content::NavigationUIData* navigation_ui_data,
int frame_tree_node_id,
std::optional<int64_t> navigation_id) override;
absl::optional<int64_t> navigation_id) override;
std::vector<std::unique_ptr<blink::URLLoaderThrottle>>
CreateURLLoaderThrottlesForKeepAlive(
const network::ResourceRequest& request,
@@ -174,24 +171,23 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
scoped_refptr<net::HttpResponseHeaders> response_headers,
bool first_auth_attempt,
LoginAuthRequiredCallback auth_required_callback) override;
mojo::PendingRemote<network::mojom::URLLoaderFactory>
CreateNonNetworkNavigationURLLoaderFactory(const std::string& scheme,
int frame_tree_node_id) override;
void RegisterNonNetworkNavigationURLLoaderFactories(
int frame_tree_node_id,
NonNetworkURLLoaderFactoryMap* factories) override;
void RegisterNonNetworkSubresourceURLLoaderFactories(
int render_process_id,
int render_frame_id,
const std::optional<url::Origin>& request_initiator_origin,
NonNetworkURLLoaderFactoryMap* factories) override;
void WillCreateURLLoaderFactory(
bool WillCreateURLLoaderFactory(
content::BrowserContext* browser_context,
content::RenderFrameHost* frame,
int render_process_id,
URLLoaderFactoryType type,
const url::Origin& request_initiator,
const net::IsolationInfo& isolation_info,
std::optional<int64_t> navigation_id,
ukm::SourceIdObj ukm_source_id,
network::URLLoaderFactoryBuilder& factory_builder,
mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
header_client,
bool* bypass_redirect_checks,
@@ -281,7 +277,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
const extensions::Extension* GetExtension(
content::SiteInstance* site_instance);
raw_ptr<AlloyBrowserMainParts> browser_main_parts_ = nullptr;
AlloyBrowserMainParts* browser_main_parts_ = nullptr;
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_CONTENT_BROWSER_CLIENT_H_

View File

@@ -1,22 +0,0 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/alloy/alloy_download_manager_delegate.h"
#include "chrome/common/chrome_constants.h"
#include "components/download/public/common/download_item.h"
AlloyDownloadManagerDelegate::AlloyDownloadManagerDelegate(
content::DownloadManager* manager)
: CefDownloadManagerDelegateImpl(manager, /*alloy_bootstrap=*/true) {}
void AlloyDownloadManagerDelegate::GetNextId(
content::DownloadIdCallback callback) {
static uint32_t next_id = download::DownloadItem::kInvalidId + 1;
std::move(callback).Run(next_id++);
}
std::string AlloyDownloadManagerDelegate::ApplicationClientIdForFileScanning() {
return std::string(chrome::kApplicationClientIDStringForAVScanning);
}

View File

@@ -1,26 +0,0 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DOWNLOAD_MANAGER_DELEGATE_H_
#define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DOWNLOAD_MANAGER_DELEGATE_H_
#pragma once
#include "cef/libcef/browser/download_manager_delegate_impl.h"
// Specialization for the Alloy bootstrap.
class AlloyDownloadManagerDelegate : public CefDownloadManagerDelegateImpl {
public:
explicit AlloyDownloadManagerDelegate(content::DownloadManager* manager);
AlloyDownloadManagerDelegate(const AlloyDownloadManagerDelegate&) = delete;
AlloyDownloadManagerDelegate& operator=(const AlloyDownloadManagerDelegate&) =
delete;
private:
// DownloadManagerDelegate methods.
void GetNextId(content::DownloadIdCallback callback) override;
std::string ApplicationClientIdForFileScanning() override;
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DOWNLOAD_MANAGER_DELEGATE_H_

View File

@@ -2,16 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
#include "cef/libcef/browser/alloy/alloy_download_util.h"
#include "libcef/browser/alloy/alloy_download_util.h"
#include "cef/libcef/browser/alloy/alloy_browser_context.h"
#include "libcef/browser/alloy/alloy_browser_context.h"
namespace alloy {
DownloadPrefs* GetDownloadPrefsFromBrowserContext(
content::BrowserContext* context) {
// This function is only called with Alloy bootstrap, so the static_cast is
// safe.
return static_cast<AlloyBrowserContext*>(context)->GetDownloadPrefs();
}

View File

@@ -6,8 +6,6 @@
#define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DOWNLOAD_UTIL_H_
#pragma once
#include "cef/libcef/features/features.h"
class DownloadPrefs;
namespace content {

View File

@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/alloy/alloy_web_contents_view_delegate.h"
#include "libcef/browser/alloy/alloy_web_contents_view_delegate.h"
#include "cef/libcef/browser/alloy/alloy_browser_host_impl.h"
#include "content/public/browser/web_contents.h"
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
AlloyWebContentsViewDelegate::AlloyWebContentsViewDelegate(
content::WebContents* web_contents)
: web_contents_(web_contents) {}

View File

@@ -6,8 +6,8 @@
#define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_WEB_CONTENTS_VIEW_DELEGATE_H_
#pragma once
#include "base/memory/raw_ptr.h"
#include "cef/include/internal/cef_ptr.h"
#include "include/internal/cef_ptr.h"
#include "content/public/browser/web_contents_view_delegate.h"
namespace content {
@@ -27,7 +27,7 @@ class AlloyWebContentsViewDelegate : public content::WebContentsViewDelegate {
const content::ContextMenuParams& params) override;
private:
const raw_ptr<content::WebContents> web_contents_;
content::WebContents* const web_contents_;
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_WEB_CONTENTS_VIEW_DELEGATE_H_

View File

@@ -2,66 +2,42 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/alloy/browser_platform_delegate_alloy.h"
#include "libcef/browser/alloy/browser_platform_delegate_alloy.h"
#include <memory>
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/alloy/dialogs/alloy_javascript_dialog_manager_delegate.h"
#include "libcef/browser/extensions/browser_extensions_util.h"
#include "libcef/browser/extensions/extension_background_host.h"
#include "libcef/browser/extensions/extension_system.h"
#include "libcef/browser/extensions/extension_view_host.h"
#include "libcef/browser/extensions/extension_web_contents_observer.h"
#include "libcef/common/extensions/extensions_util.h"
#include "libcef/common/net/url_util.h"
#include "libcef/features/runtime_checks.h"
#include "base/logging.h"
#include "cef/libcef/browser/alloy/alloy_browser_host_impl.h"
#include "cef/libcef/browser/extensions/extension_background_host.h"
#include "cef/libcef/browser/extensions/extension_system.h"
#include "cef/libcef/browser/extensions/extension_view_host.h"
#include "cef/libcef/browser/extensions/extension_web_contents_observer.h"
#include "cef/libcef/common/extensions/extensions_util.h"
#include "cef/libcef/common/net/url_util.h"
#include "cef/libcef/features/features.h"
#include "chrome/browser/task_manager/web_contents_tags.h"
#include "chrome/browser/ui/tab_helpers.h"
#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/ui/prefs/prefs_tab_helper.h"
#include "components/find_in_page/find_tab_helper.h"
#include "components/find_in_page/find_types.h"
#include "components/performance_manager/embedder/performance_manager_registry.h"
#include "components/javascript_dialogs/tab_modal_dialog_manager.h"
#include "components/permissions/permission_request_manager.h"
#include "components/zoom/zoom_controller.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/public/browser/render_view_host.h"
#include "extensions/browser/process_manager.h"
#include "pdf/pdf_features.h"
#include "third_party/blink/public/mojom/frame/find_in_page.mojom.h"
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
#include "cef/libcef/browser/alloy/dialogs/alloy_javascript_dialog_manager_delegate.h"
#include "cef/libcef/features/runtime_checks.h"
#include "chrome/browser/printing/printing_init.h"
#include "chrome/browser/ui/prefs/prefs_tab_helper.h"
#include "components/javascript_dialogs/tab_modal_dialog_manager.h"
#include "components/permissions/permission_request_manager.h"
#include "components/zoom/zoom_controller.h"
#include "extensions/browser/extension_registry.h"
#endif // BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
namespace {
const char kAttachedHelpersUserDataKey[] = "CefAttachedHelpers";
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
const extensions::Extension* GetExtensionForUrl(
content::BrowserContext* browser_context,
const GURL& url) {
auto* registry = extensions::ExtensionRegistry::Get(browser_context);
if (!registry) {
return nullptr;
}
std::string extension_id = url.host();
return registry->enabled_extensions().GetByID(extension_id);
}
#endif // BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
} // namespace
CefBrowserPlatformDelegateAlloy::CefBrowserPlatformDelegateAlloy()
: weak_ptr_factory_(this) {}
content::WebContents* CefBrowserPlatformDelegateAlloy::CreateWebContents(
CefBrowserCreateParams& create_params,
bool& own_web_contents) {
REQUIRE_ALLOY_RUNTIME();
DCHECK(primary_);
if (!create_params.request_context) {
@@ -74,13 +50,13 @@ content::WebContents* CefBrowserPlatformDelegateAlloy::CreateWebContents(
CHECK(browser_context);
scoped_refptr<content::SiteInstance> site_instance;
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
if (extensions::ExtensionsEnabled() && !create_params.url.empty()) {
GURL gurl = url_util::MakeGURL(create_params.url, /*fixup=*/true);
if (!create_params.extension) {
// We might be loading an extension app view where the extension URL is
// provided by the client.
create_params.extension = GetExtensionForUrl(browser_context, gurl);
create_params.extension =
extensions::GetExtensionForUrl(browser_context, gurl);
}
if (create_params.extension) {
if (create_params.extension_host_type ==
@@ -101,7 +77,6 @@ content::WebContents* CefBrowserPlatformDelegateAlloy::CreateWebContents(
DCHECK(site_instance);
}
}
#endif // BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
content::WebContents::CreateParams wc_create_params(browser_context,
site_instance);
@@ -125,7 +100,7 @@ void CefBrowserPlatformDelegateAlloy::WebContentsCreated(
CefBrowserPlatformDelegate::WebContentsCreated(web_contents, owned);
if (primary_) {
AttachHelpers(web_contents);
find_in_page::FindTabHelper::CreateForWebContents(web_contents);
if (owned) {
SetOwnedWebContents(web_contents);
@@ -143,6 +118,7 @@ void CefBrowserPlatformDelegateAlloy::AddNewContents(
const blink::mojom::WindowFeatures& window_features,
bool user_gesture,
bool* was_blocked) {
REQUIRE_ALLOY_RUNTIME();
DCHECK(primary_);
CefRefPtr<AlloyBrowserHostImpl> owner =
@@ -155,16 +131,13 @@ void CefBrowserPlatformDelegateAlloy::AddNewContents(
return;
}
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
if (extension_host_) {
extension_host_->AddNewContents(source, std::move(new_contents), target_url,
disposition, window_features, user_gesture,
was_blocked);
}
#endif
}
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
bool CefBrowserPlatformDelegateAlloy::
ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) {
@@ -174,7 +147,6 @@ bool CefBrowserPlatformDelegateAlloy::
}
return true;
}
#endif
void CefBrowserPlatformDelegateAlloy::RenderViewReady() {
ConfigureAutoResize();
@@ -190,17 +162,22 @@ void CefBrowserPlatformDelegateAlloy::BrowserCreated(
}
DCHECK(!web_contents_->GetDelegate());
web_contents_->SetDelegate(
AlloyBrowserHostImpl::FromBaseChecked(browser).get());
web_contents_->SetDelegate(static_cast<AlloyBrowserHostImpl*>(browser));
AttachHelpers(web_contents_);
permissions::PermissionRequestManager::CreateForWebContents(web_contents_);
PrefsTabHelper::CreateForWebContents(web_contents_);
printing::PrintViewManager::CreateForWebContents(web_contents_);
zoom::ZoomController::CreateForWebContents(web_contents_);
javascript_dialogs::TabModalDialogManager::CreateForWebContents(
web_contents_,
CreateAlloyJavaScriptTabModalDialogManagerDelegateDesktop(web_contents_));
// Used for print preview and JavaScript dialogs.
web_contents_dialog_helper_ =
std::make_unique<AlloyWebContentsDialogHelper>(web_contents_, this);
}
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
void CefBrowserPlatformDelegateAlloy::CreateExtensionHost(
const extensions::Extension* extension,
const GURL& url,
@@ -213,12 +190,12 @@ void CefBrowserPlatformDelegateAlloy::CreateExtensionHost(
DCHECK(browser_);
DCHECK(!extension_host_);
auto alloy_browser = AlloyBrowserHostImpl::FromBaseChecked(browser_.get());
auto alloy_browser = static_cast<AlloyBrowserHostImpl*>(browser_);
if (host_type == extensions::mojom::ViewType::kExtensionPopup) {
// Create an extension host that we own.
extension_host_ = new extensions::CefExtensionViewHost(
alloy_browser.get(), extension, web_contents_, url, host_type);
alloy_browser, extension, web_contents_, url, host_type);
// Trigger load of the extension URL.
extension_host_->CreateRendererSoon();
} else if (host_type ==
@@ -227,7 +204,7 @@ void CefBrowserPlatformDelegateAlloy::CreateExtensionHost(
alloy_browser->is_background_host_ = true;
// Create an extension host that will be owned by ProcessManager.
extension_host_ = new extensions::CefExtensionBackgroundHost(
alloy_browser.get(),
alloy_browser,
base::BindOnce(&CefBrowserPlatformDelegateAlloy::OnExtensionHostDeleted,
weak_ptr_factory_.GetWeakPtr()),
extension, web_contents_, url, host_type);
@@ -241,14 +218,11 @@ extensions::ExtensionHost* CefBrowserPlatformDelegateAlloy::GetExtensionHost()
const {
return extension_host_;
}
#endif // BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
void CefBrowserPlatformDelegateAlloy::BrowserDestroyed(
CefBrowserHostBase* browser) {
if (primary_) {
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
DestroyExtensionHost();
#endif
owned_web_contents_.reset();
}
@@ -290,7 +264,6 @@ void CefBrowserPlatformDelegateAlloy::NotifyMoveOrResizeStarted() {
}
#endif
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
bool CefBrowserPlatformDelegateAlloy::PreHandleGestureEvent(
content::WebContents* source,
const blink::WebGestureEvent& event) {
@@ -307,7 +280,6 @@ bool CefBrowserPlatformDelegateAlloy::IsNeverComposited(
}
return false;
}
#endif // BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
void CefBrowserPlatformDelegateAlloy::SetAutoResizeEnabled(
bool enabled,
@@ -340,6 +312,19 @@ void CefBrowserPlatformDelegateAlloy::ConfigureAutoResize() {
}
}
bool CefBrowserPlatformDelegateAlloy::IsPrintPreviewSupported() const {
REQUIRE_ALLOY_RUNTIME();
// Print preview is not currently supported with OSR.
if (IsWindowless()) {
return false;
}
auto cef_browser_context =
CefBrowserContext::FromBrowserContext(web_contents_->GetBrowserContext());
return cef_browser_context->IsPrintPreviewSupported();
}
void CefBrowserPlatformDelegateAlloy::Find(const CefString& searchText,
bool forward,
bool matchCase,
@@ -404,7 +389,6 @@ void CefBrowserPlatformDelegateAlloy::SetOwnedWebContents(
owned_web_contents_.reset(owned_contents);
}
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
void CefBrowserPlatformDelegateAlloy::DestroyExtensionHost() {
if (!extension_host_) {
return;
@@ -430,51 +414,3 @@ void CefBrowserPlatformDelegateAlloy::OnExtensionHostDeleted() {
DCHECK(extension_host_);
extension_host_ = nullptr;
}
#endif // BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
void CefBrowserPlatformDelegateAlloy::AttachHelpers(
content::WebContents* web_contents) {
// If already attached, nothing to be done.
base::SupportsUserData::Data* attached_tag =
web_contents->GetUserData(&kAttachedHelpersUserDataKey);
if (attached_tag) {
return;
}
// Mark as attached.
web_contents->SetUserData(&kAttachedHelpersUserDataKey,
std::make_unique<base::SupportsUserData::Data>());
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
// Create all the helpers.
if (cef::IsAlloyRuntimeEnabled()) {
find_in_page::FindTabHelper::CreateForWebContents(web_contents);
permissions::PermissionRequestManager::CreateForWebContents(web_contents);
PrefsTabHelper::CreateForWebContents(web_contents);
printing::InitializePrintingForWebContents(web_contents);
zoom::ZoomController::CreateForWebContents(web_contents);
javascript_dialogs::TabModalDialogManager::CreateForWebContents(
web_contents, CreateAlloyJavaScriptTabModalDialogManagerDelegateDesktop(
web_contents));
} else
#endif // BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
{
if (IsWindowless()) {
// Logic from ChromeContentBrowserClientCef::GetWebContentsViewDelegate
// which is not called for windowless browsers. Needs to be done before
// calling AttachTabHelpers.
if (auto* registry =
performance_manager::PerformanceManagerRegistry::GetInstance()) {
registry->MaybeCreatePageNodeForWebContents(web_contents);
}
}
// Adopt the WebContents now, so all observers are in place, as the network
// requests for its initial navigation will start immediately
TabHelpers::AttachTabHelpers(web_contents);
// Make the tab show up in the task manager.
task_manager::WebContentsTags::CreateForTabContents(web_contents);
}
}

View File

@@ -6,10 +6,10 @@
#ifndef CEF_LIBCEF_BROWSER_ALLOY_BROWSER_PLATFORM_DELEGATE_ALLOY_H_
#define CEF_LIBCEF_BROWSER_ALLOY_BROWSER_PLATFORM_DELEGATE_ALLOY_H_
#include "base/memory/raw_ptr.h"
#include "libcef/browser/alloy/dialogs/alloy_web_contents_dialog_helper.h"
#include "libcef/browser/browser_platform_delegate.h"
#include "base/memory/weak_ptr.h"
#include "cef/libcef/browser/alloy/dialogs/alloy_web_contents_dialog_helper.h"
#include "cef/libcef/browser/browser_platform_delegate.h"
#include "components/find_in_page/find_notification_details.h"
#include "content/public/browser/web_contents.h"
#include "ui/gfx/geometry/size.h"
@@ -33,18 +33,14 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
const blink::mojom::WindowFeatures& window_features,
bool user_gesture,
bool* was_blocked) override;
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
bool ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) override;
#endif
void RenderViewReady() override;
void BrowserCreated(CefBrowserHostBase* browser) override;
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
void CreateExtensionHost(const extensions::Extension* extension,
const GURL& url,
extensions::mojom::ViewType host_type) override;
extensions::ExtensionHost* GetExtensionHost() const override;
#endif
void BrowserDestroyed(CefBrowserHostBase* browser) override;
web_modal::WebContentsModalDialogHost* GetWebContentsModalDialogHost()
const override;
@@ -52,15 +48,13 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC))
void NotifyMoveOrResizeStarted() override;
#endif
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
bool PreHandleGestureEvent(content::WebContents* source,
const blink::WebGestureEvent& event) override;
bool IsNeverComposited(content::WebContents* web_contents) override;
#endif
bool IsAlloyStyle() const override { return true; }
void SetAutoResizeEnabled(bool enabled,
const CefSize& min_size,
const CefSize& max_size) override;
bool IsPrintPreviewSupported() const override;
void Find(const CefString& searchText,
bool forward,
bool matchCase,
@@ -89,17 +83,11 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
private:
void SetOwnedWebContents(content::WebContents* owned_contents);
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
void DestroyExtensionHost();
void OnExtensionHostDeleted();
#endif
void ConfigureAutoResize();
// Attach all the associated helpers that are needed for the WebContents. It
// is safe to call this on a WebContents that was already attached.
void AttachHelpers(content::WebContents* web_contents);
// Non-nullptr if this object owns the WebContents. Will be nullptr for popup
// browsers between the calls to WebContentsCreated() and AddNewContents(),
// and may never be set if the parent browser is destroyed during popup
@@ -113,11 +101,9 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
// matches, the find selection rectangle, etc.
find_in_page::FindNotificationDetails last_search_result_;
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
// Used when the browser is hosting an extension.
raw_ptr<extensions::ExtensionHost> extension_host_ = nullptr;
extensions::ExtensionHost* extension_host_ = nullptr;
bool is_background_host_ = false;
#endif
// Used with auto-resize.
bool auto_resize_enabled_ = false;

View File

@@ -3,21 +3,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/alloy/chrome_browser_process_alloy.h"
#include "libcef/browser/alloy/chrome_browser_process_alloy.h"
#include <memory>
#include "libcef/browser/alloy/chrome_profile_manager_alloy.h"
#include "libcef/browser/browser_context.h"
#include "libcef/browser/context.h"
#include "libcef/browser/extensions/extensions_browser_client.h"
#include "libcef/browser/prefs/browser_prefs.h"
#include "libcef/browser/thread_util.h"
#include "libcef/common/cef_switches.h"
#include "libcef/common/extensions/extensions_client.h"
#include "libcef/common/extensions/extensions_util.h"
#include "base/command_line.h"
#include "base/path_service.h"
#include "cef/libcef/browser/alloy/chrome_profile_manager_alloy.h"
#include "cef/libcef/browser/browser_context.h"
#include "cef/libcef/browser/context.h"
#include "cef/libcef/browser/extensions/extensions_browser_client.h"
#include "cef/libcef/browser/prefs/browser_prefs.h"
#include "cef/libcef/browser/thread_util.h"
#include "cef/libcef/common/cef_switches.h"
#include "cef/libcef/common/extensions/extensions_client.h"
#include "cef/libcef/common/extensions/extensions_util.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/component_updater/chrome_component_updater_configurator.h"
#include "chrome/browser/net/system_network_context_manager.h"
@@ -154,7 +155,6 @@ void ChromeBrowserProcessAlloy::CleanupOnUIThread() {
}
}
os_crypt_async_.reset();
local_state_.reset();
browser_policy_connector_.reset();
background_printing_manager_.reset();
@@ -370,12 +370,6 @@ ChromeBrowserProcessAlloy::subresource_filter_ruleset_service() {
return nullptr;
}
subresource_filter::RulesetService*
ChromeBrowserProcessAlloy::fingerprinting_protection_ruleset_service() {
DCHECK(false);
return nullptr;
}
StartupData* ChromeBrowserProcessAlloy::startup_data() {
DCHECK(false);
return nullptr;
@@ -445,12 +439,6 @@ os_crypt_async::OSCryptAsync* ChromeBrowserProcessAlloy::os_crypt_async() {
return os_crypt_async_.get();
}
void ChromeBrowserProcessAlloy::set_additional_os_crypt_async_provider_for_test(
size_t precedence,
std::unique_ptr<os_crypt_async::KeyProvider> provider) {
DCHECK(false);
}
BuildState* ChromeBrowserProcessAlloy::GetBuildState() {
DCHECK(false);
return nullptr;

View File

@@ -92,8 +92,6 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
safe_browsing::SafeBrowsingService* safe_browsing_service() override;
subresource_filter::RulesetService* subresource_filter_ruleset_service()
override;
subresource_filter::RulesetService*
fingerprinting_protection_ruleset_service() override;
StartupData* startup_data() override;
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
@@ -109,9 +107,6 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
resource_coordinator::ResourceCoordinatorParts* resource_coordinator_parts()
override;
os_crypt_async::OSCryptAsync* os_crypt_async() override;
void set_additional_os_crypt_async_provider_for_test(
size_t precedence,
std::unique_ptr<os_crypt_async::KeyProvider> provider) override;
BuildState* GetBuildState() override;
SerialPolicyAllowedPorts* serial_policy_allowed_ports() override;
HidSystemTrayIcon* hid_system_tray_icon() override;

View File

@@ -3,9 +3,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/alloy/chrome_profile_alloy.h"
#include "libcef/browser/alloy/chrome_profile_alloy.h"
#include "base/memory/raw_ptr.h"
#include "base/no_destructor.h"
#include "components/profile_metrics/browser_profile_type.h"
#include "components/variations/variations_client.h"
@@ -32,7 +31,7 @@ class CefVariationsClient : public variations::VariationsClient {
}
private:
raw_ptr<content::BrowserContext> browser_context_;
content::BrowserContext* browser_context_;
};
} // namespace

View File

@@ -3,11 +3,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/alloy/chrome_profile_manager_alloy.h"
#include "libcef/browser/alloy/chrome_profile_manager_alloy.h"
#include "cef/libcef/browser/browser_context.h"
#include "cef/libcef/browser/request_context_impl.h"
#include "cef/libcef/common/app_manager.h"
#include "libcef/browser/browser_context.h"
#include "libcef/browser/request_context_impl.h"
#include "libcef/common/app_manager.h"
namespace {

View File

@@ -1,46 +0,0 @@
// Copyright 2024 The Chromium Embedded Framework Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/alloy/devtools/alloy_devtools_window_runner.h"
#include "cef/libcef/browser/alloy/devtools/devtools_frontend.h"
#include "cef/libcef/browser/thread_util.h"
void AlloyDevToolsWindowRunner::ShowDevTools(
CefBrowserHostBase* opener,
std::unique_ptr<CefShowDevToolsParams> params) {
CEF_REQUIRE_UIT();
if (devtools_frontend_) {
if (!params->inspect_element_at_.IsEmpty()) {
devtools_frontend_->InspectElementAt(params->inspect_element_at_.x,
params->inspect_element_at_.y);
}
devtools_frontend_->Focus();
return;
}
auto alloy_browser = AlloyBrowserHostImpl::FromBaseChecked(opener);
devtools_frontend_ = CefDevToolsFrontend::Show(
alloy_browser.get(), params->window_info_, params->client_,
params->settings_, params->inspect_element_at_,
base::BindOnce(&AlloyDevToolsWindowRunner::OnFrontEndDestroyed,
weak_ptr_factory_.GetWeakPtr()));
}
void AlloyDevToolsWindowRunner::CloseDevTools() {
CEF_REQUIRE_UIT();
if (devtools_frontend_) {
devtools_frontend_->Close();
}
}
bool AlloyDevToolsWindowRunner::HasDevTools() {
CEF_REQUIRE_UIT();
return !!devtools_frontend_;
}
void AlloyDevToolsWindowRunner::OnFrontEndDestroyed() {
CEF_REQUIRE_UIT();
devtools_frontend_ = nullptr;
}

View File

@@ -1,40 +0,0 @@
// Copyright 2024 The Chromium Embedded Framework Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_ALLOY_DEVTOOLS_ALLOY_DEVTOOLS_WINDOW_RUNNER_H_
#define CEF_LIBCEF_BROWSER_ALLOY_DEVTOOLS_ALLOY_DEVTOOLS_WINDOW_RUNNER_H_
#pragma once
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "cef/libcef/browser/devtools/devtools_window_runner.h"
class CefDevToolsFrontend;
// Creates and runs a DevTools window instance. Only accessed on the UI thread.
class AlloyDevToolsWindowRunner : public CefDevToolsWindowRunner {
public:
AlloyDevToolsWindowRunner() = default;
AlloyDevToolsWindowRunner(const AlloyDevToolsWindowRunner&) = delete;
AlloyDevToolsWindowRunner& operator=(const AlloyDevToolsWindowRunner&) =
delete;
// CefDevToolsWindowRunner methods:
void ShowDevTools(CefBrowserHostBase* opener,
std::unique_ptr<CefShowDevToolsParams> params) override;
void CloseDevTools() override;
bool HasDevTools() override;
private:
void OnFrontEndDestroyed();
// CefDevToolsFrontend will delete itself when the frontend WebContents is
// destroyed.
raw_ptr<CefDevToolsFrontend> devtools_frontend_ = nullptr;
base::WeakPtrFactory<AlloyDevToolsWindowRunner> weak_ptr_factory_{this};
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_DEVTOOLS_ALLOY_DEVTOOLS_WINDOW_RUNNER_H_

View File

@@ -3,10 +3,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/alloy/dialogs/alloy_constrained_window_views_client.h"
#include "libcef/browser/alloy/dialogs/alloy_constrained_window_views_client.h"
#include "libcef/browser/browser_host_base.h"
#include "base/notreached.h"
#include "cef/libcef/browser/browser_host_base.h"
#include "components/web_modal/web_contents_modal_dialog_host.h"
namespace {
@@ -14,10 +15,7 @@ namespace {
class AlloyConstrainedWindowViewsClient
: public constrained_window::ConstrainedWindowViewsClient {
public:
explicit AlloyConstrainedWindowViewsClient(
std::unique_ptr<constrained_window::ConstrainedWindowViewsClient>
chrome_client)
: chrome_client_(std::move(chrome_client)) {}
AlloyConstrainedWindowViewsClient() = default;
AlloyConstrainedWindowViewsClient(const AlloyConstrainedWindowViewsClient&) =
delete;
@@ -28,12 +26,6 @@ class AlloyConstrainedWindowViewsClient
// ConstrainedWindowViewsClient methods:
web_modal::ModalDialogHost* GetModalDialogHost(
gfx::NativeWindow parent) override {
if (chrome_client_) {
if (auto dialog_host = chrome_client_->GetModalDialogHost(parent)) {
return dialog_host;
}
}
if (auto browser = GetPreferredBrowser(parent)) {
return browser->platform_delegate()->GetWebContentsModalDialogHost();
}
@@ -42,12 +34,6 @@ class AlloyConstrainedWindowViewsClient
}
gfx::NativeView GetDialogHostView(gfx::NativeWindow parent) override {
if (chrome_client_) {
if (auto host_view = chrome_client_->GetDialogHostView(parent)) {
return host_view;
}
}
if (auto dialog_host = GetModalDialogHost(parent)) {
return dialog_host->GetHostView();
}
@@ -80,17 +66,11 @@ class AlloyConstrainedWindowViewsClient
return browser;
}
std::unique_ptr<constrained_window::ConstrainedWindowViewsClient>
chrome_client_;
};
} // namespace
std::unique_ptr<constrained_window::ConstrainedWindowViewsClient>
CreateAlloyConstrainedWindowViewsClient(
std::unique_ptr<constrained_window::ConstrainedWindowViewsClient>
chrome_client) {
return std::make_unique<AlloyConstrainedWindowViewsClient>(
std::move(chrome_client));
CreateAlloyConstrainedWindowViewsClient() {
return std::make_unique<AlloyConstrainedWindowViewsClient>();
}

View File

@@ -12,8 +12,6 @@
// Creates a ConstrainedWindowViewsClient for the Chrome environment.
std::unique_ptr<constrained_window::ConstrainedWindowViewsClient>
CreateAlloyConstrainedWindowViewsClient(
std::unique_ptr<constrained_window::ConstrainedWindowViewsClient>
chrome_client);
CreateAlloyConstrainedWindowViewsClient();
#endif // CEF_LIBCEF_BROWSER_ALLOY_DIALOGS_ALLOY_CONSTRAINED_WINDOW_VIEWS_CLIENT_H_
#endif // CEF_LIBCEF_BROWSER_ALLOY_DIALOGS_ALLOY_CONSTRAINED_WINDOW_VIEWS_CLIENT_H_

View File

@@ -3,10 +3,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/alloy/dialogs/alloy_javascript_dialog_manager_delegate.h"
#include "libcef/browser/alloy/dialogs/alloy_javascript_dialog_manager_delegate.h"
#include "libcef/browser/browser_host_base.h"
#include "base/logging.h"
#include "cef/libcef/browser/browser_host_base.h"
namespace {

View File

@@ -15,4 +15,4 @@ std::unique_ptr<JavaScriptTabModalDialogManagerDelegateDesktop>
CreateAlloyJavaScriptTabModalDialogManagerDelegateDesktop(
content::WebContents* web_contents);
#endif // CEF_LIBCEF_BROWSER_ALLOY_DIALOGS_ALLOY_JAVASCRIPT_DIALOG_MANAGER_DELEGATE_H_
#endif // CEF_LIBCEF_BROWSER_ALLOY_DIALOGS_ALLOY_JAVASCRIPT_DIALOG_MANAGER_DELEGATE_H_

View File

@@ -2,10 +2,11 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "cef/libcef/browser/alloy/dialogs/alloy_web_contents_dialog_helper.h"
#include "libcef/browser/alloy/dialogs/alloy_web_contents_dialog_helper.h"
#include "libcef/browser/browser_platform_delegate.h"
#include "base/notreached.h"
#include "cef/libcef/browser/browser_platform_delegate.h"
#include "chrome/browser/platform_util.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "ui/views/widget/widget.h"
@@ -43,20 +44,14 @@ AlloyWebContentsDialogHelper::GetWebContentsModalDialogHost() {
gfx::NativeView AlloyWebContentsDialogHelper::GetHostView() const {
// Windowless rendering uses GetAcceleratedWidget() instead.
if (!browser_delegate_->IsWindowless()) {
#if BUILDFLAG(IS_MAC)
// This is supported with all configurations except MacOS with external
// parent because we can't provide a gfx::NativeView or a
// gfx::AcceleratedWidget on that platform (it's an arbitrary internal
// Chromium type). This code should not be reached in that case because
// print preview is disabled.
DCHECK(!browser_delegate_->HasExternalParent());
#endif
if (auto widget = browser_delegate_->GetWindowWidget()) {
return widget->GetNativeView();
}
if (browser_delegate_->IsWindowless()) {
return gfx::NativeView();
}
NOTIMPLEMENTED();
if (auto widget = browser_delegate_->GetWindowWidget()) {
return widget->GetNativeView();
}
DCHECK(false);
return gfx::NativeView();
}
@@ -64,13 +59,15 @@ gfx::AcceleratedWidget AlloyWebContentsDialogHelper::GetAcceleratedWidget()
const {
#if defined(USE_AURA)
// Windowed rendering uses GetHostView() instead.
if (browser_delegate_->IsWindowless()) {
if (auto parent_widget = browser_delegate_->GetHostWindowHandle()) {
return parent_widget;
}
if (!browser_delegate_->IsWindowless()) {
return gfx::kNullAcceleratedWidget;
}
if (auto parent_widget = browser_delegate_->GetHostWindowHandle()) {
return parent_widget;
}
#endif // defined(USE_AURA)
NOTIMPLEMENTED();
DCHECK(false);
return gfx::kNullAcceleratedWidget;
}

View File

@@ -7,7 +7,6 @@
#pragma once
#include "base/functional/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "components/web_modal/modal_dialog_host.h"
@@ -41,7 +40,7 @@ class AlloyWebContentsDialogHelper
private:
void OnBoundsChanged();
const raw_ptr<CefBrowserPlatformDelegate> browser_delegate_;
CefBrowserPlatformDelegate* const browser_delegate_;
// Used to notify WebContentsModalDialog.
base::ObserverList<web_modal::ModalDialogHostObserver>::Unchecked

View File

@@ -3,10 +3,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/audio_capturer.h"
#include "libcef/browser/audio_capturer.h"
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/audio_loopback_stream_creator.h"
#include "cef/libcef/browser/alloy/alloy_browser_host_impl.h"
#include "cef/libcef/browser/audio_loopback_stream_creator.h"
#include "components/mirroring/service/captured_audio_input.h"
#include "media/audio/audio_input_device.h"
@@ -97,7 +98,6 @@ void CefAudioCapturer::OnCaptureStarted() {
void CefAudioCapturer::Capture(const media::AudioBus* source,
base::TimeTicks audio_capture_time,
const media::AudioGlitchInfo& /*glitch_info*/,
double /*volume*/,
bool /*key_pressed*/) {
const int channels = source->channels();
@@ -116,10 +116,7 @@ void CefAudioCapturer::OnCaptureError(
media::AudioCapturerSource::ErrorCode code,
const std::string& message) {
audio_handler_->OnAudioStreamError(browser_, message);
if (code != media::AudioCapturerSource::ErrorCode::kSocketError) {
StopStream();
}
StopStream();
}
void CefAudioCapturer::StopStream() {
@@ -132,4 +129,4 @@ void CefAudioCapturer::StopStream() {
audio_input_device_ = nullptr;
capturing_ = false;
}
}

Some files were not shown because too many files have changed in this diff Show More