mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
88 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9bd638fc40 | ||
|
c712fb473a | ||
|
091246b436 | ||
|
30772e7742 | ||
|
ff7dcd851e | ||
|
a6e684abf1 | ||
|
fe315c5108 | ||
|
b6e819b329 | ||
|
6d871a1a27 | ||
|
77c1e82898 | ||
|
ccc63c9e55 | ||
|
e461d8f247 | ||
|
1482ffe749 | ||
|
c45f88643a | ||
|
e5bd17cd14 | ||
|
e011687449 | ||
|
6fafa6521f | ||
|
99cbd3571f | ||
|
326524d83f | ||
|
41036f7624 | ||
|
759cdc7584 | ||
|
8a9a766d6d | ||
|
7dbc1daaef | ||
|
e683ed880c | ||
|
54a9c26b92 | ||
|
6253e69b70 | ||
|
8ba22e9e11 | ||
|
19ba8b2b8d | ||
|
a13b6dc7f6 | ||
|
52dac91167 | ||
|
526e934a12 | ||
|
b8f91c5431 | ||
|
5e616b2df0 | ||
|
9b06b028dc | ||
|
d4cf19db29 | ||
|
2c5dd120c7 | ||
|
ffea0d9c4a | ||
|
8db08e657d | ||
|
706193f3d9 | ||
|
bfed26c5fc | ||
|
71c8b4b2bb | ||
|
ec122a9148 | ||
|
90775f149f | ||
|
f071a4a988 | ||
|
cc3d77eec5 | ||
|
a79981bf7f | ||
|
70471059cf | ||
|
5dc3cc13e7 | ||
|
da3899d142 | ||
|
69fd43f789 | ||
|
d3a483ef59 | ||
|
bdb070c85c | ||
|
57bad703ee | ||
|
47fe9f834a | ||
|
2f1e782f62 | ||
|
2a86a02bdd | ||
|
132ac7a180 | ||
|
a0446a3c8a | ||
|
a02d2ab3e6 | ||
|
4ea1b6f293 | ||
|
befa827da1 | ||
|
0a64bb6f9b | ||
|
9fd312ce04 | ||
|
468e55e553 | ||
|
f1fe098e09 | ||
|
5af6227a6f | ||
|
0d50d5a8c6 | ||
|
a097b62b6e | ||
|
ffc703276a | ||
|
3592d36808 | ||
|
deb4664038 | ||
|
9f6995f839 | ||
|
784302280b | ||
|
7c2bd75f7a | ||
|
3507249202 | ||
|
5a9b8e2bc4 | ||
|
9a45102db0 | ||
|
1f55d2e12f | ||
|
9dc7653ddc | ||
|
e4acacee18 | ||
|
206b7b1c95 | ||
|
262a93b2f7 | ||
|
80c65f25a3 | ||
|
2f0b00f8f5 | ||
|
be734efe68 | ||
|
0dd7dca229 | ||
|
5613af8f53 | ||
|
a25f89f9e4 |
57
BUILD.gn
57
BUILD.gn
@@ -390,10 +390,14 @@ source_set("libcef_static_unittested") {
|
||||
]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//ui/gfx/geometry",
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
# Support relative include paths.
|
||||
"//base",
|
||||
]
|
||||
|
||||
configs += [
|
||||
"libcef/features:config",
|
||||
"//build/config:precompiled_headers",
|
||||
@@ -616,6 +620,8 @@ 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",
|
||||
@@ -768,6 +774,8 @@ 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",
|
||||
@@ -803,7 +811,11 @@ 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",
|
||||
@@ -923,8 +935,8 @@ 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_dispatcher_delegate.cc",
|
||||
"libcef/renderer/extensions/extensions_dispatcher_delegate.h",
|
||||
"libcef/renderer/extensions/extensions_renderer_api_provider.cc",
|
||||
"libcef/renderer/extensions/extensions_renderer_api_provider.h",
|
||||
"libcef/renderer/extensions/extensions_renderer_client.cc",
|
||||
"libcef/renderer/extensions/extensions_renderer_client.h",
|
||||
"libcef/renderer/extensions/print_render_frame_helper_delegate.cc",
|
||||
@@ -964,6 +976,7 @@ source_set("libcef_static") {
|
||||
# Bring in feature flag defines.
|
||||
"//cef/libcef/features",
|
||||
# Support relative include paths.
|
||||
"//base",
|
||||
"//third_party/abseil-cpp:absl",
|
||||
]
|
||||
|
||||
@@ -981,7 +994,6 @@ source_set("libcef_static") {
|
||||
"libcef/common/extensions/api:extensions_features",
|
||||
|
||||
# Normal build dependencies. Should be sorted alphabetically.
|
||||
"//base",
|
||||
"//base:base_static",
|
||||
"//base/third_party/dynamic_annotations",
|
||||
"//cc",
|
||||
@@ -1117,22 +1129,23 @@ source_set("libcef_static") {
|
||||
"libcef/common/util_linux.cc",
|
||||
]
|
||||
|
||||
if (ozone_platform_x11) {
|
||||
sources += [
|
||||
"libcef/browser/native/window_x11.cc",
|
||||
"libcef/browser/native/window_x11.h",
|
||||
]
|
||||
}
|
||||
|
||||
deps += [
|
||||
"//build/config/freetype",
|
||||
"//third_party/fontconfig",
|
||||
]
|
||||
|
||||
if (is_linux && !ozone_platform_x11) {
|
||||
deps += [
|
||||
"//third_party/angle:libEGL",
|
||||
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" ]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1472,6 +1485,20 @@ action("make_config_header") {
|
||||
args = rebase_path(outputs + [ "$root_out_dir/args.gn" ], 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/include/cef_color_ids.h" ]
|
||||
|
||||
args = rebase_path(outputs + inputs, root_build_dir)
|
||||
}
|
||||
|
||||
# Generate pack files and associated CEF header files.
|
||||
group("cef_make_headers") {
|
||||
deps = [
|
||||
@@ -1480,6 +1507,7 @@ group("cef_make_headers") {
|
||||
":make_pack_header_command_ids",
|
||||
":make_api_hash_header",
|
||||
":make_config_header",
|
||||
":make_colorids_header",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1958,6 +1986,7 @@ if (is_mac) {
|
||||
]
|
||||
frameworks = [
|
||||
"AppKit.framework",
|
||||
"IOSurface.framework",
|
||||
"OpenGL.framework",
|
||||
]
|
||||
defines = [
|
||||
|
@@ -7,6 +7,6 @@
|
||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
|
||||
{
|
||||
'chromium_checkout': 'refs/tags/120.0.6099.234',
|
||||
'depot_tools_checkout': 'f01ca5848d'
|
||||
'chromium_checkout': 'refs/tags/124.0.6367.207',
|
||||
'depot_tools_checkout': '19199514e8'
|
||||
}
|
||||
|
@@ -38,7 +38,8 @@
|
||||
'chrome/common/extensions/api/*_features.json',
|
||||
'chrome/renderer/chrome_content_renderer_client.*',
|
||||
'chrome/renderer/extensions/chrome_extensions_renderer_client.*',
|
||||
'components/content_settings/core/common/content_settings_types.h',
|
||||
'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',
|
||||
|
@@ -8,7 +8,7 @@
|
||||
# by hand. See the translator.README.txt file in the tools directory for
|
||||
# more information.
|
||||
#
|
||||
# $hash=25599539f43226aac01bfcb74f19ac74217aee9a$
|
||||
# $hash=3b28f3236c16d2b776a44674ae3bae0a070e9f27$
|
||||
#
|
||||
|
||||
{
|
||||
@@ -85,6 +85,7 @@
|
||||
'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',
|
||||
@@ -189,6 +190,7 @@
|
||||
'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',
|
||||
@@ -508,6 +510,8 @@
|
||||
'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',
|
||||
@@ -836,6 +840,8 @@
|
||||
'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',
|
||||
|
@@ -29,6 +29,7 @@
|
||||
'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',
|
||||
@@ -53,6 +54,7 @@
|
||||
'include/internal/cef_time.h',
|
||||
'include/internal/cef_trace_event_internal.h',
|
||||
'include/internal/cef_types.h',
|
||||
'include/internal/cef_types_color.h',
|
||||
'include/internal/cef_types_content_settings.h',
|
||||
'include/internal/cef_types_geometry.h',
|
||||
],
|
||||
@@ -220,6 +222,8 @@
|
||||
'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',
|
||||
@@ -240,10 +244,11 @@
|
||||
'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',
|
||||
@@ -309,11 +314,12 @@
|
||||
'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',
|
||||
|
@@ -304,13 +304,14 @@ if(OS_MAC)
|
||||
# Standard libraries.
|
||||
set(CEF_STANDARD_LIBS
|
||||
-lpthread
|
||||
"-framework Cocoa"
|
||||
"-framework AppKit"
|
||||
"-framework Cocoa"
|
||||
"-framework IOSurface"
|
||||
)
|
||||
|
||||
# Find the newest available base SDK.
|
||||
execute_process(COMMAND xcode-select --print-path OUTPUT_VARIABLE XCODE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
foreach(OS_VERSION 10.15 10.14 10.13)
|
||||
foreach(OS_VERSION 14.2 14.0 10.15)
|
||||
set(SDK "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OS_VERSION}.sdk")
|
||||
if(NOT "${CMAKE_OSX_SYSROOT}" AND EXISTS "${SDK}" AND IS_DIRECTORY "${SDK}")
|
||||
set(CMAKE_OSX_SYSROOT ${SDK})
|
||||
@@ -318,7 +319,7 @@ if(OS_MAC)
|
||||
endforeach()
|
||||
|
||||
# Target SDK.
|
||||
set(CEF_TARGET_SDK "10.13")
|
||||
set(CEF_TARGET_SDK "10.15")
|
||||
list(APPEND CEF_COMPILER_FLAGS
|
||||
-mmacosx-version-min=${CEF_TARGET_SDK}
|
||||
)
|
||||
@@ -554,6 +555,13 @@ if(OS_WINDOWS)
|
||||
vulkan-1.dll
|
||||
)
|
||||
|
||||
if(PROJECT_ARCH STREQUAL "x86_64")
|
||||
list(APPEND CEF_BINARY_FILES
|
||||
dxil.dll
|
||||
dxcompiler.dll
|
||||
)
|
||||
endif()
|
||||
|
||||
# List of CEF resource files.
|
||||
set(CEF_RESOURCE_FILES
|
||||
chrome_100_percent.pak
|
||||
|
@@ -232,19 +232,19 @@
|
||||
|
||||
// Type detection for wchar_t.
|
||||
#if defined(OS_WIN)
|
||||
#define WCHAR_T_IS_UTF16
|
||||
#define WCHAR_T_IS_16_BIT
|
||||
#elif defined(OS_FUCHSIA)
|
||||
#define WCHAR_T_IS_UTF32
|
||||
#define WCHAR_T_IS_32_BIT
|
||||
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
|
||||
(__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
|
||||
#define WCHAR_T_IS_UTF32
|
||||
#define WCHAR_T_IS_32_BIT
|
||||
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
|
||||
(__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
|
||||
// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to
|
||||
// compile in this mode (in particular, Chrome doesn't). This is intended for
|
||||
// other projects using base who manage their own dependencies and make sure
|
||||
// short wchar works for them.
|
||||
#define WCHAR_T_IS_UTF16
|
||||
#define WCHAR_T_IS_16_BIT
|
||||
#else
|
||||
#error Please add support for your compiler in include/base/cef_build.h
|
||||
#endif
|
||||
|
@@ -723,9 +723,9 @@ std::ostream& operator<<(std::ostream& out, const wchar_t* wstr);
|
||||
inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
|
||||
return out << wstr.c_str();
|
||||
}
|
||||
#if defined(WCHAR_T_IS_UTF32)
|
||||
#if defined(WCHAR_T_IS_32_BIT)
|
||||
std::ostream& operator<<(std::ostream& out, const char16_t* wstr);
|
||||
#elif defined(WCHAR_T_IS_UTF16)
|
||||
#elif defined(WCHAR_T_IS_16_BIT)
|
||||
inline std::ostream& operator<<(std::ostream& out, const char16_t* wstr) {
|
||||
return operator<<(out, reinterpret_cast<const wchar_t*>(wstr));
|
||||
}
|
||||
|
50
include/base/internal/cef_color_id_macros.inc
Normal file
50
include/base/internal/cef_color_id_macros.inc
Normal file
@@ -0,0 +1,50 @@
|
||||
// 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)
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=b9a2bad4a30bcb99384197c9f7409116dc5b376e$
|
||||
// $hash=dfa0d4d2da319b2fd5e92324fd14301b500ceb5c$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
|
||||
@@ -137,15 +137,26 @@ 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. 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 except,
|
||||
/// optionally, CefGetErrorCode. 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
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=d23df6f606a96b432905c5c80f29ab72915b8e01$
|
||||
// $hash=abcb584dbf5965834f415a0f2daeda3e361696b2$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
|
||||
@@ -165,15 +165,16 @@ typedef struct _cef_browser_t {
|
||||
///
|
||||
/// Returns the frame with the specified identifier, or NULL if not found.
|
||||
///
|
||||
struct _cef_frame_t*(CEF_CALLBACK* get_frame_byident)(
|
||||
struct _cef_frame_t*(CEF_CALLBACK* get_frame_by_identifier)(
|
||||
struct _cef_browser_t* self,
|
||||
int64_t identifier);
|
||||
const cef_string_t* identifier);
|
||||
|
||||
///
|
||||
/// Returns the frame with the specified name, or NULL if not found.
|
||||
///
|
||||
struct _cef_frame_t*(CEF_CALLBACK* get_frame)(struct _cef_browser_t* self,
|
||||
const cef_string_t* name);
|
||||
struct _cef_frame_t*(CEF_CALLBACK* get_frame_by_name)(
|
||||
struct _cef_browser_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
/// Returns the number of frames that currently exist.
|
||||
@@ -184,8 +185,7 @@ typedef struct _cef_browser_t {
|
||||
/// Returns the identifiers of all existing frames.
|
||||
///
|
||||
void(CEF_CALLBACK* get_frame_identifiers)(struct _cef_browser_t* self,
|
||||
size_t* identifiersCount,
|
||||
int64_t* identifiers);
|
||||
cef_string_list_t identifiers);
|
||||
|
||||
///
|
||||
/// Returns the names of all existing frames.
|
||||
@@ -974,6 +974,17 @@ 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);
|
||||
} cef_browser_host_t;
|
||||
|
||||
///
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=f844d2a1e39d822129d0733f33c14d27481c36b7$
|
||||
// $hash=d958d5bed7f909f6313facef3440fb8ba07a5c01$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "include/capi/cef_client_capi.h"
|
||||
#include "include/capi/cef_command_line_capi.h"
|
||||
#include "include/capi/cef_preference_capi.h"
|
||||
#include "include/capi/cef_request_context_handler_capi.h"
|
||||
#include "include/capi/cef_values_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -147,14 +148,26 @@ typedef struct _cef_browser_process_handler_t {
|
||||
int64_t delay_ms);
|
||||
|
||||
///
|
||||
/// Return the default client for use with a newly created browser window. If
|
||||
/// null is returned the browser will be unmanaged (no callbacks will be
|
||||
/// executed for that browser) and application shutdown will be blocked until
|
||||
/// the browser window is closed manually. This function is currently only
|
||||
/// used with the chrome runtime.
|
||||
/// Return the default client for use with a newly created browser window
|
||||
/// (cef_browser_t object). If null is returned the cef_browser_t will be
|
||||
/// unmanaged (no callbacks will be executed for that cef_browser_t) and
|
||||
/// application shutdown will be blocked until the browser window is closed
|
||||
/// manually. This function is currently only used with the Chrome runtime
|
||||
/// when creating new browser windows via Chrome UI.
|
||||
///
|
||||
struct _cef_client_t*(CEF_CALLBACK* get_default_client)(
|
||||
struct _cef_browser_process_handler_t* self);
|
||||
|
||||
///
|
||||
/// Return the default handler for use with a new user or incognito profile
|
||||
/// (cef_request_context_t object). If null is returned the
|
||||
/// cef_request_context_t will be unmanaged (no callbacks will be executed for
|
||||
/// that cef_request_context_t). This function is currently only used with the
|
||||
/// Chrome runtime when creating new browser windows via Chrome UI.
|
||||
///
|
||||
struct _cef_request_context_handler_t*(
|
||||
CEF_CALLBACK* get_default_request_context_handler)(
|
||||
struct _cef_browser_process_handler_t* self);
|
||||
} cef_browser_process_handler_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=50e59e2d7038a1be0d3a2451c9b7073aee5156ef$
|
||||
// $hash=76ba2e59636aa71c8c6286093198a1e64d012c62$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
|
||||
@@ -126,8 +126,8 @@ typedef struct _cef_cookie_manager_t {
|
||||
/// cef_settings_t.cache_path if specified or in memory otherwise. If |callback|
|
||||
/// is non-NULL it will be executed asnychronously on the UI thread after the
|
||||
/// manager's storage has been initialized. Using this function is equivalent to
|
||||
/// calling cef_request_context_t::cef_request_context_get_global_context()->Get
|
||||
/// DefaultCookieManager().
|
||||
/// calling cef_request_context_t::cef_request_context_get_global_context()-
|
||||
/// >GetDefaultCookieManager().
|
||||
///
|
||||
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=7294486141b2377198e994048a768db4a7cb9cd0$
|
||||
// $hash=8f347a95168778ec0e686cdef93be3bc517e2f68$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
|
||||
@@ -178,10 +178,12 @@ typedef struct _cef_frame_t {
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
/// Returns the globally unique identifier for this frame or < 0 if the
|
||||
/// Returns the globally unique identifier for this frame or NULL if the
|
||||
/// underlying frame does not yet exist.
|
||||
///
|
||||
int64_t(CEF_CALLBACK* get_identifier)(struct _cef_frame_t* self);
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_identifier)(
|
||||
struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
/// Returns the parent of this frame or NULL if this is the main (top-level)
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=5f808dd18e66966b62a3b8980075e87a5109e23f$
|
||||
// $hash=fc6fbee765ce2b649f5293c8c4b076d36014e4aa$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_HANDLER_CAPI_H_
|
||||
@@ -53,48 +53,41 @@ extern "C" {
|
||||
/// The order of callbacks is:
|
||||
///
|
||||
/// (1) During initial cef_browser_host_t creation and navigation of the main
|
||||
/// frame: - cef_frame_handler_t::OnFrameCreated => The initial main frame
|
||||
/// object has been
|
||||
/// created. Any commands will be queued until the frame is attached.
|
||||
/// frame:
|
||||
/// - cef_frame_handler_t::OnFrameCreated => The initial main frame object has
|
||||
/// been created. Any commands will be queued until the frame is attached.
|
||||
/// - cef_frame_handler_t::OnMainFrameChanged => The initial main frame object
|
||||
/// has
|
||||
/// been assigned to the browser.
|
||||
/// has been assigned to the browser.
|
||||
/// - cef_life_span_handler_t::OnAfterCreated => The browser is now valid and
|
||||
/// can be
|
||||
/// used.
|
||||
/// can be used.
|
||||
/// - cef_frame_handler_t::OnFrameAttached => The initial main frame object is
|
||||
/// now
|
||||
/// connected to its peer in the renderer process. Commands can be routed.
|
||||
/// now connected to its peer in the renderer process. Commands can be routed.
|
||||
///
|
||||
/// (2) During further cef_browser_host_t navigation/loading of the main frame
|
||||
/// and/or sub-frames:
|
||||
/// - cef_frame_handler_t::OnFrameCreated => A new main frame or sub-frame
|
||||
/// object
|
||||
/// has been created. Any commands will be queued until the frame is attached.
|
||||
/// object has been created. Any commands will be queued until the frame is
|
||||
/// attached.
|
||||
/// - cef_frame_handler_t::OnFrameAttached => A new main frame or sub-frame
|
||||
/// object
|
||||
/// is now connected to its peer in the renderer process. Commands can be
|
||||
/// routed.
|
||||
/// object is now connected to its peer in the renderer process. Commands can
|
||||
/// be routed.
|
||||
/// - cef_frame_handler_t::OnFrameDetached => An existing main frame or sub-
|
||||
/// frame
|
||||
/// object has lost its connection to the renderer process. If multiple
|
||||
/// frame object has lost its connection to the renderer process. If multiple
|
||||
/// objects are detached at the same time then notifications will be sent for
|
||||
/// any sub-frame objects before the main frame object. Commands can no longer
|
||||
/// be routed and will be discarded.
|
||||
/// - cef_frame_handler_t::OnMainFrameChanged => A new main frame object has
|
||||
/// been
|
||||
/// assigned to the browser. This will only occur with cross-origin navigation
|
||||
/// or re-navigation after renderer process termination (due to crashes, etc).
|
||||
/// been assigned to the browser. This will only occur with cross-origin
|
||||
/// navigation or re-navigation after renderer process termination (due to
|
||||
/// crashes, etc).
|
||||
///
|
||||
/// (3) During final cef_browser_host_t destruction of the main frame: -
|
||||
/// cef_frame_handler_t::OnFrameDetached => Any sub-frame objects have lost
|
||||
/// their
|
||||
/// connection to the renderer process. Commands can no longer be routed and
|
||||
/// will be discarded.
|
||||
/// (3) During final cef_browser_host_t destruction of the main frame:
|
||||
/// - cef_frame_handler_t::OnFrameDetached => Any sub-frame objects have lost
|
||||
/// their connection to the renderer process. Commands can no longer be routed
|
||||
/// and will be discarded.
|
||||
/// - cef_life_span_handler_t::OnBeforeClose => The browser has been destroyed.
|
||||
/// - cef_frame_handler_t::OnFrameDetached => The main frame object have lost
|
||||
/// its
|
||||
/// connection to the renderer process. Notifications will be sent for any
|
||||
/// its connection to the renderer process. Notifications will be sent for any
|
||||
/// sub-frame objects before the main frame object. Commands can no longer be
|
||||
/// routed and will be discarded.
|
||||
/// - cef_frame_handler_t::OnMainFrameChanged => The final main frame object has
|
||||
@@ -111,7 +104,7 @@ extern "C" {
|
||||
/// will then be discarded after the real cross-origin sub-frame is created in
|
||||
/// the new/target renderer process. The client will receive cross-origin
|
||||
/// navigation callbacks (2) for the transition from the temporary sub-frame to
|
||||
/// the real sub-frame. The temporary sub-frame will not recieve or execute
|
||||
/// the real sub-frame. The temporary sub-frame will not receive or execute
|
||||
/// commands during this transitional period (any sent commands will be
|
||||
/// discarded).
|
||||
///
|
||||
@@ -119,7 +112,7 @@ extern "C" {
|
||||
/// browser, a temporary main frame object for the popup will first be created
|
||||
/// in the parent's renderer process. That temporary main frame will then be
|
||||
/// discarded after the real cross-origin main frame is created in the
|
||||
/// new/target renderer process. The client will recieve creation and initial
|
||||
/// new/target renderer process. The client will receive creation and initial
|
||||
/// navigation callbacks (1) for the temporary main frame, followed by cross-
|
||||
/// origin navigation callbacks (2) for the transition from the temporary main
|
||||
/// frame to the real main frame. The temporary main frame may receive and
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=5f2f1d43cf93b10ba58b2aa2716bc3638e58c97c$
|
||||
// $hash=54edf9e9c2a12acdc4cab55079a4a5cb8e2a1e43$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
|
||||
@@ -138,7 +138,7 @@ typedef struct _cef_life_span_handler_t {
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
/// Called when a browser has recieved a request to close. This may result
|
||||
/// Called when a browser has received a request to close. This may result
|
||||
/// directly from a call to cef_browser_host_t::*close_browser() or indirectly
|
||||
/// if the browser is parented to a top-level window created by CEF and the
|
||||
/// user attempts to close that window (by clicking the 'X', for example). The
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=401b881a3bd1d0c36f9646804260f129eb5f70d9$
|
||||
// $hash=8eec1100e8470cbe3ebc54d5962416d2fa4d57fb$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_
|
||||
@@ -114,8 +114,8 @@ typedef struct _cef_media_router_t {
|
||||
/// Returns the MediaRouter object associated with the global request context.
|
||||
/// If |callback| is non-NULL it will be executed asnychronously on the UI
|
||||
/// thread after the manager's storage has been initialized. Equivalent to
|
||||
/// calling cef_request_context_t::cef_request_context_get_global_context()->get
|
||||
/// _media_router().
|
||||
/// calling cef_request_context_t::cef_request_context_get_global_context()-
|
||||
/// >get_media_router().
|
||||
///
|
||||
CEF_EXPORT cef_media_router_t* cef_media_router_get_global(
|
||||
struct _cef_completion_callback_t* callback);
|
||||
@@ -156,7 +156,7 @@ typedef struct _cef_media_observer_t {
|
||||
cef_media_route_connection_state_t state);
|
||||
|
||||
///
|
||||
/// A message was recieved over |route|. |message| is only valid for the scope
|
||||
/// A message was received over |route|. |message| is only valid for the scope
|
||||
/// of this callback and should be copied if necessary.
|
||||
///
|
||||
void(CEF_CALLBACK* on_route_message_received)(
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=2dcd17d131deb011094b741024aa11249e3fa306$
|
||||
// $hash=5dae0b1a1271e79a5fd9b2c6e71e7a719a450161$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
|
||||
@@ -473,14 +473,15 @@ typedef struct _cef_menu_model_t {
|
||||
///
|
||||
/// Sets the font list for the specified |command_id|. If |font_list| is NULL
|
||||
/// the system font will be used. Returns true (1) on success. The format is
|
||||
/// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a
|
||||
/// comma-separated list of font family names, - STYLES is an optional space-
|
||||
/// separated list of style names
|
||||
/// (case-sensitive "Bold" and "Italic" are supported), and
|
||||
/// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where:
|
||||
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// - STYLES is an optional space-separated list of style names (case-
|
||||
/// sensitive "Bold" and "Italic" are supported), and
|
||||
/// - SIZE is an integer font size in pixels with the suffix "px".
|
||||
///
|
||||
/// Here are examples of valid font description strings: - "Arial, Helvetica,
|
||||
/// Bold Italic 14px" - "Arial, 14px"
|
||||
/// Here are examples of valid font description strings:
|
||||
/// - "Arial, Helvetica, Bold Italic 14px"
|
||||
/// - "Arial, 14px"
|
||||
///
|
||||
int(CEF_CALLBACK* set_font_list)(struct _cef_menu_model_t* self,
|
||||
int command_id,
|
||||
@@ -488,16 +489,15 @@ typedef struct _cef_menu_model_t {
|
||||
|
||||
///
|
||||
/// Sets the font list for the specified |index|. Specify an |index| value of
|
||||
/// -1 to set the default font. If |font_list| is NULL the system font will be
|
||||
/// used. Returns true (1) on success. The format is
|
||||
/// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a
|
||||
/// comma-separated list of font family names, - STYLES is an optional space-
|
||||
/// separated list of style names
|
||||
/// (case-sensitive "Bold" and "Italic" are supported), and
|
||||
/// - 1 to set the default font. If |font_list| is NULL the system font will
|
||||
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// - STYLES is an optional space-separated list of style names (case-
|
||||
/// sensitive "Bold" and "Italic" are supported), and
|
||||
/// - SIZE is an integer font size in pixels with the suffix "px".
|
||||
///
|
||||
/// Here are examples of valid font description strings: - "Arial, Helvetica,
|
||||
/// Bold Italic 14px" - "Arial, 14px"
|
||||
/// Here are examples of valid font description strings:
|
||||
/// - "Arial, Helvetica, Bold Italic 14px"
|
||||
/// - "Arial, 14px"
|
||||
///
|
||||
int(CEF_CALLBACK* set_font_list_at)(struct _cef_menu_model_t* self,
|
||||
int index,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=ddad43a2c40d34b50baab5c4542e17faec189ba6$
|
||||
// $hash=a61a639c7e53ecd9481eae363bac557055f0442e$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
|
||||
@@ -50,11 +50,11 @@ extern "C" {
|
||||
/// Launches the process specified via |command_line|. Returns true (1) upon
|
||||
/// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread.
|
||||
///
|
||||
/// Unix-specific notes: - All file descriptors open in the parent process will
|
||||
/// be closed in the
|
||||
/// Unix-specific notes:
|
||||
/// - All file descriptors open in the parent process will be closed in the
|
||||
/// child process except for stdin, stdout, and stderr.
|
||||
/// - If the first argument on the command line does not contain a slash,
|
||||
/// PATH will be searched. (See man execvp.)
|
||||
/// - If the first argument on the command line does not contain a slash, PATH
|
||||
/// will be searched. (See man execvp.)
|
||||
///
|
||||
CEF_EXPORT int cef_launch_process(struct _cef_command_line_t* command_line);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=5309b2f6da62526ed92c928c0918bc27898cf03b$
|
||||
// $hash=5151b6ea3c06e46a75f2cd7679044a2891063d29$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
|
||||
@@ -149,17 +149,27 @@ 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. |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.
|
||||
/// 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.
|
||||
///
|
||||
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);
|
||||
/// 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);
|
||||
|
||||
///
|
||||
/// Called to retrieve the size of the touch handle for the specified
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=23302ef6e4458aa3e7065aeaca3421a6f0b58361$
|
||||
// $hash=7df03921b2ee743fb059f13e545ccf89904eb060$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
|
||||
@@ -368,6 +368,39 @@ 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;
|
||||
|
||||
///
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=3b59c0bc014d773dedc24649071141ee2dd2125c$
|
||||
// $hash=2e8b5c5107f61e3d4c333dc02c76a9f30cd0cf83$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
|
||||
@@ -48,6 +48,7 @@
|
||||
#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
|
||||
@@ -222,14 +223,53 @@ 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.
|
||||
/// 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).
|
||||
///
|
||||
void(CEF_CALLBACK* on_render_process_terminated)(
|
||||
struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_termination_status_t status);
|
||||
cef_termination_status_t status,
|
||||
int error_code,
|
||||
const cef_string_t* error_string);
|
||||
|
||||
///
|
||||
/// Called on the browser process UI thread when the window.document object of
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=ba8011bd357e466a94acfd86597f44af00f096a3$
|
||||
// $hash=dd3f6003f9a8f59c2eb4320c382651a441086aee$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
|
||||
@@ -116,8 +116,8 @@ typedef struct _cef_scheme_handler_factory_t {
|
||||
/// matches the specified |scheme_name| and optional |domain_name|. Returns
|
||||
/// false (0) if an error occurs. This function may be called on any thread in
|
||||
/// the browser process. Using this function is equivalent to calling cef_reques
|
||||
/// t_context_t::cef_request_context_get_global_context()->register_scheme_handl
|
||||
/// er_factory().
|
||||
/// t_context_t::cef_request_context_get_global_context()-
|
||||
/// >register_scheme_handler_factory().
|
||||
///
|
||||
CEF_EXPORT int cef_register_scheme_handler_factory(
|
||||
const cef_string_t* scheme_name,
|
||||
@@ -128,8 +128,8 @@ CEF_EXPORT int cef_register_scheme_handler_factory(
|
||||
/// Clear all scheme handler factories registered with the global request
|
||||
/// context. Returns false (0) on error. This function may be called on any
|
||||
/// thread in the browser process. Using this function is equivalent to calling
|
||||
/// cef_request_context_t::cef_request_context_get_global_context()->clear_schem
|
||||
/// e_handler_factories().
|
||||
/// cef_request_context_t::cef_request_context_get_global_context()-
|
||||
/// >clear_scheme_handler_factories().
|
||||
///
|
||||
CEF_EXPORT int cef_clear_scheme_handler_factories(void);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=199e86ccf09d571a5dd24f39b23ff5cc2bd32129$
|
||||
// $hash=740d6eb5bea1bfc7c4ea413fefd3bf6586a81f20$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_
|
||||
@@ -80,8 +80,10 @@ typedef struct _cef_end_tracing_callback_t {
|
||||
/// have an optional '-' prefix to make it an excluded category. Having both
|
||||
/// included and excluded categories in the same list is not supported.
|
||||
///
|
||||
/// Examples: - "test_MyTest*" - "test_MyTest*,test_OtherStuff" -
|
||||
/// "-excluded_category1,-excluded_category2"
|
||||
/// Examples:
|
||||
/// - "test_MyTest*"
|
||||
/// - "test_MyTest*,test_OtherStuff"
|
||||
/// - "-excluded_category1,-excluded_category2"
|
||||
///
|
||||
/// This function must be called on the browser process UI thread.
|
||||
///
|
||||
|
74
include/capi/cef_unresponsive_process_callback_capi.h
Normal file
74
include/capi/cef_unresponsive_process_callback_capi.h
Normal file
@@ -0,0 +1,74 @@
|
||||
// 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_
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=1c029e99b4b81f39fba362e297e85ec9bfcf16fb$
|
||||
// $hash=06d17ed2939b57c97d73a0025e9f9ff65834b51a$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_LABEL_BUTTON_CAPI_H_
|
||||
@@ -113,14 +113,15 @@ typedef struct _cef_label_button_t {
|
||||
|
||||
///
|
||||
/// Sets the font list. The format is "<FONT_FAMILY_LIST>,[STYLES] <SIZE>",
|
||||
/// where: - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// where:
|
||||
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// - STYLES is an optional space-separated list of style names (case-
|
||||
/// sensitive
|
||||
/// "Bold" and "Italic" are supported), and
|
||||
/// sensitive "Bold" and "Italic" are supported), and
|
||||
/// - SIZE is an integer font size in pixels with the suffix "px".
|
||||
///
|
||||
/// Here are examples of valid font description strings: - "Arial, Helvetica,
|
||||
/// Bold Italic 14px" - "Arial, 14px"
|
||||
/// Here are examples of valid font description strings:
|
||||
/// - "Arial, Helvetica, Bold Italic 14px"
|
||||
/// - "Arial, 14px"
|
||||
///
|
||||
void(CEF_CALLBACK* set_font_list)(struct _cef_label_button_t* self,
|
||||
const cef_string_t* font_list);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=f8474005e8b9e20dfb390e4b6fe0cc023dcebe3c$
|
||||
// $hash=f47d33d79e9f321536aa87921d973745f6ec8b5e$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_CAPI_H_
|
||||
@@ -183,14 +183,15 @@ typedef struct _cef_textfield_t {
|
||||
|
||||
///
|
||||
/// Sets the font list. The format is "<FONT_FAMILY_LIST>,[STYLES] <SIZE>",
|
||||
/// where: - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// where:
|
||||
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// - STYLES is an optional space-separated list of style names (case-
|
||||
/// sensitive
|
||||
/// "Bold" and "Italic" are supported), and
|
||||
/// sensitive "Bold" and "Italic" are supported), and
|
||||
/// - SIZE is an integer font size in pixels with the suffix "px".
|
||||
///
|
||||
/// Here are examples of valid font description strings: - "Arial, Helvetica,
|
||||
/// Bold Italic 14px" - "Arial, 14px"
|
||||
/// Here are examples of valid font description strings:
|
||||
/// - "Arial, Helvetica, Bold Italic 14px"
|
||||
/// - "Arial, 14px"
|
||||
///
|
||||
void(CEF_CALLBACK* set_font_list)(struct _cef_textfield_t* self,
|
||||
const cef_string_t* font_list);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=afe2cd6a8c8af576d67cf099858c9920ded4a3c5$
|
||||
// $hash=c894c96b089861c183059c54876af9ed9382e349$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_DELEGATE_CAPI_H_
|
||||
@@ -60,7 +60,7 @@ typedef struct _cef_textfield_delegate_t {
|
||||
cef_view_delegate_t base;
|
||||
|
||||
///
|
||||
/// Called when |textfield| recieves a keyboard event. |event| contains
|
||||
/// Called when |textfield| receives a keyboard event. |event| contains
|
||||
/// information about the keyboard event. Return true (1) if the keyboard
|
||||
/// event was handled or false (0) otherwise for default handling.
|
||||
///
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=48df6ccac2c68f32c7024ae68c8a6b6a5f8ed914$
|
||||
// $hash=08f13de764f30261616372dfffb7f97c57957f73$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_CAPI_H_
|
||||
@@ -338,16 +338,30 @@ typedef struct _cef_view_t {
|
||||
void(CEF_CALLBACK* request_focus)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
/// Sets the background color for this View.
|
||||
/// Sets the background color for this View. The background color will be
|
||||
/// automatically reset when cef_view_delegate_t::OnThemeChanged is called.
|
||||
///
|
||||
void(CEF_CALLBACK* set_background_color)(struct _cef_view_t* self,
|
||||
cef_color_t color);
|
||||
|
||||
///
|
||||
/// Returns the background color for this View.
|
||||
/// 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.
|
||||
///
|
||||
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.
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=4e421d2d1e24df6e58f7a7c0c074056bc5284df4$
|
||||
// $hash=0f562c026f64ca19a32834dcc1e1cd3a98be2f1f$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_DELEGATE_CAPI_H_
|
||||
@@ -140,6 +140,28 @@ 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
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=6078993477d8e0570528593193ec06efbfd0843c$
|
||||
// $hash=2abb3759a22a95ffc0207f0538c645a74a5030c6$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_CAPI_H_
|
||||
@@ -220,8 +220,9 @@ typedef struct _cef_window_t {
|
||||
///
|
||||
/// Add a View that will be overlayed on the Window contents with absolute
|
||||
/// positioning and high z-order. Positioning is controlled by |docking_mode|
|
||||
/// as described below. The returned cef_overlay_controller_t object is used
|
||||
/// to control the overlay. Overlays are hidden by default.
|
||||
/// as described below. Setting |can_activate| to true (1) will allow the
|
||||
/// overlay view to receive input focus. The returned cef_overlay_controller_t
|
||||
/// object is used to control the overlay. Overlays are hidden by default.
|
||||
///
|
||||
/// With CEF_DOCKING_MODE_CUSTOM:
|
||||
/// 1. The overlay is initially hidden, sized to |view|'s preferred size,
|
||||
@@ -249,7 +250,8 @@ typedef struct _cef_window_t {
|
||||
struct _cef_overlay_controller_t*(CEF_CALLBACK* add_overlay_view)(
|
||||
struct _cef_window_t* self,
|
||||
struct _cef_view_t* view,
|
||||
cef_docking_mode_t docking_mode);
|
||||
cef_docking_mode_t docking_mode,
|
||||
int can_activate);
|
||||
|
||||
///
|
||||
/// Show a menu with contents |menu_model|. |screen_point| specifies the menu
|
||||
@@ -362,6 +364,43 @@ 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);
|
||||
} cef_window_t;
|
||||
|
||||
///
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=c1c2705cdef7d9189557b57531dc2d53e9f68d0c$
|
||||
// $hash=e6bbc33db1b5ed3832982f8799e14557204f4028$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_
|
||||
@@ -182,6 +182,20 @@ 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.
|
||||
///
|
||||
@@ -224,6 +238,43 @@ 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);
|
||||
} cef_window_delegate_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -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 "bbdc07e7c5ed2ae5398efdebdd1ed08801bc91ab"
|
||||
#define CEF_API_HASH_UNIVERSAL "35035b76d79ba0c7144aedb63d72b7988d372706"
|
||||
#if defined(OS_WIN)
|
||||
#define CEF_API_HASH_PLATFORM "002e3391fd68b0a444dbb6cd1b2a19a4c181d935"
|
||||
#define CEF_API_HASH_PLATFORM "9227cf2e0abf4f378e31e6095d503a91b2da59af"
|
||||
#elif defined(OS_MAC)
|
||||
#define CEF_API_HASH_PLATFORM "3e4f2433692dc8bb779314dce84b81d81d39d2c2"
|
||||
#define CEF_API_HASH_PLATFORM "fe0bdc49d209ee3cf108bdb72faec21316f9d0e0"
|
||||
#elif defined(OS_LINUX)
|
||||
#define CEF_API_HASH_PLATFORM "4e707370d08d4639c41e7c8aa8027c4a6090eace"
|
||||
#define CEF_API_HASH_PLATFORM "df471096e6600c025ac0655b5eaa9818f075b8ba"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -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. 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 except, optionally,
|
||||
/// CefGetErrorCode. 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,6 +82,18 @@ 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
|
||||
|
@@ -169,14 +169,15 @@ class CefBrowser : public virtual CefBaseRefCounted {
|
||||
///
|
||||
/// Returns the frame with the specified identifier, or NULL if not found.
|
||||
///
|
||||
/*--cef(capi_name=get_frame_byident)--*/
|
||||
virtual CefRefPtr<CefFrame> GetFrame(int64_t identifier) = 0;
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefFrame> GetFrameByIdentifier(
|
||||
const CefString& identifier) = 0;
|
||||
|
||||
///
|
||||
/// Returns the frame with the specified name, or NULL if not found.
|
||||
///
|
||||
/*--cef(optional_param=name)--*/
|
||||
virtual CefRefPtr<CefFrame> GetFrame(const CefString& name) = 0;
|
||||
virtual CefRefPtr<CefFrame> GetFrameByName(const CefString& name) = 0;
|
||||
|
||||
///
|
||||
/// Returns the number of frames that currently exist.
|
||||
@@ -188,7 +189,7 @@ class CefBrowser : public virtual CefBaseRefCounted {
|
||||
/// Returns the identifiers of all existing frames.
|
||||
///
|
||||
/*--cef(count_func=identifiers:GetFrameCount)--*/
|
||||
virtual void GetFrameIdentifiers(std::vector<int64_t>& identifiers) = 0;
|
||||
virtual void GetFrameIdentifiers(std::vector<CefString>& identifiers) = 0;
|
||||
|
||||
///
|
||||
/// Returns the names of all existing frames.
|
||||
@@ -1006,6 +1007,17 @@ 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;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_BROWSER_H_
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include "include/cef_client.h"
|
||||
#include "include/cef_command_line.h"
|
||||
#include "include/cef_preference.h"
|
||||
#include "include/cef_request_context_handler.h"
|
||||
#include "include/cef_values.h"
|
||||
|
||||
///
|
||||
@@ -139,14 +140,28 @@ class CefBrowserProcessHandler : public virtual CefBaseRefCounted {
|
||||
virtual void OnScheduleMessagePumpWork(int64_t delay_ms) {}
|
||||
|
||||
///
|
||||
/// Return the default client for use with a newly created browser window. If
|
||||
/// null is returned the browser will be unmanaged (no callbacks will be
|
||||
/// executed for that browser) and application shutdown will be blocked until
|
||||
/// the browser window is closed manually. This method is currently only used
|
||||
/// with the chrome runtime.
|
||||
/// Return the default client for use with a newly created browser window
|
||||
/// (CefBrowser object). If null is returned the CefBrowser will be unmanaged
|
||||
/// (no callbacks will be executed for that CefBrowser) and application
|
||||
/// shutdown will be blocked until the browser window is closed manually. This
|
||||
/// method is currently only used with the Chrome runtime when creating new
|
||||
/// browser windows via Chrome UI.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefClient> GetDefaultClient() { return nullptr; }
|
||||
|
||||
///
|
||||
/// Return the default handler for use with a new user or incognito profile
|
||||
/// (CefRequestContext object). If null is returned the CefRequestContext will
|
||||
/// be unmanaged (no callbacks will be executed for that CefRequestContext).
|
||||
/// This method is currently only used with the Chrome runtime when creating
|
||||
/// new browser windows via Chrome UI.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefRequestContextHandler>
|
||||
GetDefaultRequestContextHandler() {
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_BROWSER_PROCESS_HANDLER_H_
|
||||
|
@@ -180,11 +180,11 @@ class CefFrame : public virtual CefBaseRefCounted {
|
||||
virtual CefString GetName() = 0;
|
||||
|
||||
///
|
||||
/// Returns the globally unique identifier for this frame or < 0 if the
|
||||
/// Returns the globally unique identifier for this frame or empty if the
|
||||
/// underlying frame does not yet exist.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int64_t GetIdentifier() = 0;
|
||||
virtual CefString GetIdentifier() = 0;
|
||||
|
||||
///
|
||||
/// Returns the parent of this frame or NULL if this is the main (top-level)
|
||||
|
@@ -95,7 +95,7 @@
|
||||
/// will then be discarded after the real cross-origin sub-frame is created in
|
||||
/// the new/target renderer process. The client will receive cross-origin
|
||||
/// navigation callbacks (2) for the transition from the temporary sub-frame to
|
||||
/// the real sub-frame. The temporary sub-frame will not recieve or execute
|
||||
/// the real sub-frame. The temporary sub-frame will not receive or execute
|
||||
/// commands during this transitional period (any sent commands will be
|
||||
/// discarded).
|
||||
///
|
||||
@@ -103,7 +103,7 @@
|
||||
/// browser, a temporary main frame object for the popup will first be created
|
||||
/// in the parent's renderer process. That temporary main frame will then be
|
||||
/// discarded after the real cross-origin main frame is created in the
|
||||
/// new/target renderer process. The client will recieve creation and initial
|
||||
/// new/target renderer process. The client will receive creation and initial
|
||||
/// navigation callbacks (1) for the temporary main frame, followed by
|
||||
/// cross-origin navigation callbacks (2) for the transition from the temporary
|
||||
/// main frame to the real main frame. The temporary main frame may receive and
|
||||
|
@@ -131,7 +131,7 @@ class CefLifeSpanHandler : public virtual CefBaseRefCounted {
|
||||
virtual void OnAfterCreated(CefRefPtr<CefBrowser> browser) {}
|
||||
|
||||
///
|
||||
/// Called when a browser has recieved a request to close. This may result
|
||||
/// Called when a browser has received a request to close. This may result
|
||||
/// directly from a call to CefBrowserHost::*CloseBrowser() or indirectly if
|
||||
/// the browser is parented to a top-level window created by CEF and the user
|
||||
/// attempts to close that window (by clicking the 'X', for example). The
|
||||
|
@@ -145,7 +145,7 @@ class CefMediaObserver : public virtual CefBaseRefCounted {
|
||||
ConnectionState state) = 0;
|
||||
|
||||
///
|
||||
/// A message was recieved over |route|. |message| is only valid for
|
||||
/// A message was received over |route|. |message| is only valid for
|
||||
/// the scope of this callback and should be copied if necessary.
|
||||
///
|
||||
/*--cef()--*/
|
||||
|
@@ -152,16 +152,25 @@ 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. |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.
|
||||
/// 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.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnAcceleratedPaint(CefRefPtr<CefBrowser> browser,
|
||||
PaintElementType type,
|
||||
const RectList& dirtyRects,
|
||||
void* shared_handle) {}
|
||||
const CefAcceleratedPaintInfo& info) {}
|
||||
|
||||
///
|
||||
/// Called to retrieve the size of the touch handle for the specified
|
||||
|
@@ -381,6 +381,38 @@ 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_
|
||||
|
@@ -48,6 +48,7 @@
|
||||
#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"
|
||||
|
||||
///
|
||||
@@ -221,14 +222,52 @@ 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.
|
||||
/// 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).
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser,
|
||||
TerminationStatus status) {}
|
||||
TerminationStatus status,
|
||||
int error_code,
|
||||
const CefString& error_string) {}
|
||||
|
||||
///
|
||||
/// Called on the browser process UI thread when the window.document object of
|
||||
|
62
include/cef_unresponsive_process_callback.h
Normal file
62
include/cef_unresponsive_process_callback.h
Normal file
@@ -0,0 +1,62 @@
|
||||
// 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_
|
@@ -31,7 +31,7 @@
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_STRING_WRAPPERS_H_
|
||||
#pragma once
|
||||
|
||||
#include <memory.h>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
#include "include/internal/cef_string_types.h"
|
||||
@@ -99,7 +99,7 @@ struct CefStringTraitsWide {
|
||||
static inline bool from_wstring(const std::wstring& str, struct_type* s) {
|
||||
return from_wstring(str.data(), str.length(), s);
|
||||
}
|
||||
#if defined(WCHAR_T_IS_UTF32)
|
||||
#if defined(WCHAR_T_IS_32_BIT)
|
||||
static inline std::u16string to_string16(const struct_type* s) {
|
||||
cef_string_utf16_t cstr;
|
||||
memset(&cstr, 0, sizeof(cstr));
|
||||
@@ -120,7 +120,7 @@ struct CefStringTraitsWide {
|
||||
? true
|
||||
: false;
|
||||
}
|
||||
#else // WCHAR_T_IS_UTF32
|
||||
#elif defined(WCHAR_T_IS_16_BIT)
|
||||
static inline std::u16string to_string16(const struct_type* s) {
|
||||
return std::u16string(
|
||||
reinterpret_cast<const std::u16string::value_type*>(s->str), s->length);
|
||||
@@ -133,7 +133,7 @@ struct CefStringTraitsWide {
|
||||
? true
|
||||
: false;
|
||||
}
|
||||
#endif // WCHAR_T_IS_UTF32
|
||||
#endif // WCHAR_T_IS_16_BIT
|
||||
static inline bool from_string16(const std::u16string& str, struct_type* s) {
|
||||
return from_string16(str.data(), str.length(), s);
|
||||
}
|
||||
@@ -271,7 +271,7 @@ struct CefStringTraitsUTF16 {
|
||||
static inline bool from_string(const std::string& str, struct_type* s) {
|
||||
return from_string(str.data(), str.length(), s);
|
||||
}
|
||||
#if defined(WCHAR_T_IS_UTF32)
|
||||
#if defined(WCHAR_T_IS_32_BIT)
|
||||
static inline std::wstring to_wstring(const struct_type* s) {
|
||||
cef_string_wide_t cstr;
|
||||
memset(&cstr, 0, sizeof(cstr));
|
||||
@@ -288,7 +288,7 @@ struct CefStringTraitsUTF16 {
|
||||
struct_type* s) {
|
||||
return cef_string_wide_to_utf16(data, length, s) ? true : false;
|
||||
}
|
||||
#else // WCHAR_T_IS_UTF32
|
||||
#elif defined(WCHAR_T_IS_16_BIT)
|
||||
static inline std::wstring to_wstring(const struct_type* s) {
|
||||
return std::wstring(reinterpret_cast<wchar_t*>(s->str), s->length);
|
||||
}
|
||||
@@ -300,7 +300,7 @@ struct CefStringTraitsUTF16 {
|
||||
? true
|
||||
: false;
|
||||
}
|
||||
#endif // WCHAR_T_IS_UTF32
|
||||
#endif // WCHAR_T_IS_16_BIT
|
||||
static inline bool from_wstring(const std::wstring& str, struct_type* s) {
|
||||
return from_wstring(str.data(), str.length(), s);
|
||||
}
|
||||
|
@@ -433,10 +433,14 @@ typedef struct _cef_settings_t {
|
||||
///
|
||||
/// Set to a value between 1024 and 65535 to enable remote debugging on the
|
||||
/// specified port. Also configurable using the "remote-debugging-port"
|
||||
/// command-line switch. Remote debugging can be accessed by loading the
|
||||
/// chrome://inspect page in Google Chrome. Port numbers 9222 and 9229 are
|
||||
/// discoverable by default. Other port numbers may need to be configured via
|
||||
/// "Discover network targets" on the Devices tab.
|
||||
/// command-line switch. Specifying 0 via the command-line switch will result
|
||||
/// in the selection of an ephemeral port and the port number will be printed
|
||||
/// as part of the WebSocket endpoint URL to stderr. If a cache directory path
|
||||
/// is provided the port will also be written to the
|
||||
/// <cache-dir>/DevToolsActivePort file. Remote debugging can be accessed by
|
||||
/// loading the chrome://inspect page in Google Chrome. Port numbers 9222 and
|
||||
/// 9229 are discoverable by default. Other port numbers may need to be
|
||||
/// configured via "Discover network targets" on the Devices tab.
|
||||
///
|
||||
int remote_debugging_port;
|
||||
|
||||
@@ -913,6 +917,16 @@ 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;
|
||||
|
||||
///
|
||||
@@ -1023,6 +1037,100 @@ 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
|
||||
@@ -2332,6 +2440,7 @@ 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,
|
||||
@@ -2708,6 +2817,11 @@ typedef struct _cef_pdf_print_settings_t {
|
||||
/// Set to true (1) to generate tagged (accessible) PDF.
|
||||
///
|
||||
int generate_tagged_pdf;
|
||||
|
||||
///
|
||||
/// Set to true (1) to generate a document outline.
|
||||
///
|
||||
int generate_document_outline;
|
||||
} cef_pdf_print_settings_t;
|
||||
|
||||
///
|
||||
@@ -2811,21 +2925,6 @@ 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.
|
||||
///
|
||||
@@ -2858,51 +2957,22 @@ typedef enum {
|
||||
} cef_text_style_t;
|
||||
|
||||
///
|
||||
/// Specifies where along the main axis the CefBoxLayout child views should be
|
||||
/// laid out.
|
||||
/// Specifies where along the axis the CefBoxLayout child views should be laid
|
||||
/// out. Should be kept in sync with Chromium's views::LayoutAlignment type.
|
||||
///
|
||||
typedef enum {
|
||||
///
|
||||
/// Child views will be left-aligned.
|
||||
///
|
||||
CEF_MAIN_AXIS_ALIGNMENT_START,
|
||||
/// Child views will be left/top-aligned.
|
||||
CEF_AXIS_ALIGNMENT_START,
|
||||
|
||||
///
|
||||
/// Child views will be center-aligned.
|
||||
///
|
||||
CEF_MAIN_AXIS_ALIGNMENT_CENTER,
|
||||
CEF_AXIS_ALIGNMENT_CENTER,
|
||||
|
||||
///
|
||||
/// Child views will be right-aligned.
|
||||
///
|
||||
CEF_MAIN_AXIS_ALIGNMENT_END,
|
||||
} cef_main_axis_alignment_t;
|
||||
/// Child views will be right/bottom-aligned.
|
||||
CEF_AXIS_ALIGNMENT_END,
|
||||
|
||||
///
|
||||
/// Specifies where along the cross axis the CefBoxLayout child views should be
|
||||
/// laid out.
|
||||
///
|
||||
typedef enum {
|
||||
///
|
||||
/// Child views will be stretched to fit.
|
||||
///
|
||||
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;
|
||||
CEF_AXIS_ALIGNMENT_STRETCH,
|
||||
} cef_axis_alignment_t;
|
||||
|
||||
///
|
||||
/// Settings used when initializing a CefBoxLayout.
|
||||
@@ -2939,12 +3009,12 @@ typedef struct _cef_box_layout_settings_t {
|
||||
///
|
||||
/// Specifies where along the main axis the child views should be laid out.
|
||||
///
|
||||
cef_main_axis_alignment_t main_axis_alignment;
|
||||
cef_axis_alignment_t main_axis_alignment;
|
||||
|
||||
///
|
||||
/// Specifies where along the cross axis the child views should be laid out.
|
||||
///
|
||||
cef_cross_axis_alignment_t cross_axis_alignment;
|
||||
cef_axis_alignment_t cross_axis_alignment;
|
||||
|
||||
///
|
||||
/// Minimum cross axis size.
|
||||
@@ -3213,64 +3283,65 @@ 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, Side L, Side R, Back L, Back R
|
||||
/// Front L, Front R, Front C, Back L, Back R, Side L, Side R
|
||||
CEF_CHANNEL_LAYOUT_7_0 = 13,
|
||||
|
||||
/// Front L, Front R, Front C, LFE, Side L, Side R, Back L, Back R
|
||||
/// Front L, Front R, Front C, LFE, Back L, Back R, Side L, Side R
|
||||
CEF_CHANNEL_LAYOUT_7_1 = 14,
|
||||
|
||||
/// Front L, Front R, Front C, LFE, Side L, Side R, Front LofC, Front RofC
|
||||
/// Front L, Front R, Front C, LFE, Front LofC, Front RofC, Side L, Side R
|
||||
CEF_CHANNEL_LAYOUT_7_1_WIDE = 15,
|
||||
|
||||
/// Stereo L, Stereo R
|
||||
/// Front L, Front R
|
||||
CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX = 16,
|
||||
|
||||
/// Stereo L, Stereo R, LFE
|
||||
/// Front L, Front R, LFE
|
||||
CEF_CHANNEL_LAYOUT_2POINT1 = 17,
|
||||
|
||||
/// Stereo L, Stereo R, Front C, LFE
|
||||
/// Front L, Front R, Front C, LFE
|
||||
CEF_CHANNEL_LAYOUT_3_1 = 18,
|
||||
|
||||
/// Stereo L, Stereo R, Front C, Rear C, LFE
|
||||
/// Front L, Front R, Front C, LFE, Back C
|
||||
CEF_CHANNEL_LAYOUT_4_1 = 19,
|
||||
|
||||
/// Stereo L, Stereo R, Front C, Side L, Side R, Back C
|
||||
/// Front L, Front R, Front C, Back C, Side L, Side R
|
||||
CEF_CHANNEL_LAYOUT_6_0 = 20,
|
||||
|
||||
/// Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC
|
||||
/// Front L, Front R, Front LofC, Front RofC, Side L, Side R
|
||||
CEF_CHANNEL_LAYOUT_6_0_FRONT = 21,
|
||||
|
||||
/// Stereo L, Stereo R, Front C, Rear L, Rear R, Rear C
|
||||
/// Front L, Front R, Front C, Back L, Back R, Back C
|
||||
CEF_CHANNEL_LAYOUT_HEXAGONAL = 22,
|
||||
|
||||
/// Stereo L, Stereo R, Front C, LFE, Side L, Side R, Rear Center
|
||||
/// Front L, Front R, Front C, LFE, Back C, Side L, Side R
|
||||
CEF_CHANNEL_LAYOUT_6_1 = 23,
|
||||
|
||||
/// Stereo L, Stereo R, Front C, LFE, Back L, Back R, Rear Center
|
||||
/// Front L, Front R, Front C, LFE, Back L, Back R, Back C
|
||||
CEF_CHANNEL_LAYOUT_6_1_BACK = 24,
|
||||
|
||||
/// Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC, LFE
|
||||
/// Front L, Front R, LFE, Front LofC, Front RofC, Side L, Side R
|
||||
CEF_CHANNEL_LAYOUT_6_1_FRONT = 25,
|
||||
|
||||
/// Front L, Front R, Front C, Side L, Side R, Front LofC, Front RofC
|
||||
/// Front L, Front R, Front C, Front LofC, Front RofC, Side L, Side R
|
||||
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, Side L, Side R, Rear L, Back R, Back C.
|
||||
/// Front L, Front R, Front C, Back L, Back R, Back C, Side L, Side R
|
||||
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, Side L, Side R, LFE
|
||||
/// Front L, Front R, LFE, Side L, Side R
|
||||
CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE = 31,
|
||||
|
||||
/// Actual channel layout is specified in the bitstream and the actual channel
|
||||
@@ -3284,8 +3355,14 @@ 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_5_1_4_DOWNMIX
|
||||
CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_3_1_BACK
|
||||
} cef_channel_layout_t;
|
||||
|
||||
///
|
||||
@@ -3416,7 +3493,8 @@ typedef enum {
|
||||
CEF_CPAIT_SAVE_IBAN,
|
||||
CEF_CPAIT_MANDATORY_REAUTH,
|
||||
CEF_CPAIT_PRICE_INSIGHTS,
|
||||
CEF_CPAIT_MAX_VALUE = CEF_CPAIT_PRICE_INSIGHTS,
|
||||
CEF_CPAIT_PRICE_READ_ANYTHING,
|
||||
CEF_CPAIT_MAX_VALUE = CEF_CPAIT_PRICE_READ_ANYTHING,
|
||||
} cef_chrome_page_action_icon_type_t;
|
||||
|
||||
///
|
||||
@@ -3446,10 +3524,21 @@ typedef enum {
|
||||
/// Show states supported by CefWindowDelegate::GetInitialShowState.
|
||||
///
|
||||
typedef enum {
|
||||
// Show the window as normal.
|
||||
CEF_SHOW_STATE_NORMAL = 1,
|
||||
|
||||
// Show the window as minimized.
|
||||
CEF_SHOW_STATE_MINIMIZED,
|
||||
|
||||
// Show the window as maximized.
|
||||
CEF_SHOW_STATE_MAXIMIZED,
|
||||
|
||||
// Show the window as fullscreen.
|
||||
CEF_SHOW_STATE_FULLSCREEN,
|
||||
|
||||
// Show the window as hidden (no dock thumbnail).
|
||||
// Only supported on MacOS.
|
||||
CEF_SHOW_STATE_HIDDEN,
|
||||
} cef_show_state_t;
|
||||
|
||||
///
|
||||
@@ -3539,23 +3628,24 @@ typedef enum {
|
||||
CEF_PERMISSION_TYPE_AR_SESSION = 1 << 1,
|
||||
CEF_PERMISSION_TYPE_CAMERA_PAN_TILT_ZOOM = 1 << 2,
|
||||
CEF_PERMISSION_TYPE_CAMERA_STREAM = 1 << 3,
|
||||
CEF_PERMISSION_TYPE_CLIPBOARD = 1 << 4,
|
||||
CEF_PERMISSION_TYPE_TOP_LEVEL_STORAGE_ACCESS = 1 << 5,
|
||||
CEF_PERMISSION_TYPE_DISK_QUOTA = 1 << 6,
|
||||
CEF_PERMISSION_TYPE_LOCAL_FONTS = 1 << 7,
|
||||
CEF_PERMISSION_TYPE_GEOLOCATION = 1 << 8,
|
||||
CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 9,
|
||||
CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 10,
|
||||
CEF_PERMISSION_TYPE_MIDI = 1 << 11,
|
||||
CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 12,
|
||||
CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 13,
|
||||
CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 14,
|
||||
CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = 1 << 15,
|
||||
CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = 1 << 16,
|
||||
CEF_PERMISSION_TYPE_STORAGE_ACCESS = 1 << 17,
|
||||
CEF_PERMISSION_TYPE_VR_SESSION = 1 << 18,
|
||||
CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT = 1 << 19,
|
||||
CEF_PERMISSION_TYPE_FILE_SYSTEM_ACCESS = 1 << 20,
|
||||
CEF_PERMISSION_TYPE_CAPTURED_SURFACE_CONTROL = 1 << 4,
|
||||
CEF_PERMISSION_TYPE_CLIPBOARD = 1 << 5,
|
||||
CEF_PERMISSION_TYPE_TOP_LEVEL_STORAGE_ACCESS = 1 << 6,
|
||||
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_MIDI_SYSEX = 1 << 13,
|
||||
CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 14,
|
||||
CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 15,
|
||||
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;
|
||||
|
||||
///
|
||||
@@ -3749,6 +3839,20 @@ 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
|
||||
|
57
include/internal/cef_types_color.h
Normal file
57
include/internal/cef_types_color.h
Normal file
@@ -0,0 +1,57 @@
|
||||
// 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_COLOR_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_TYPES_COLOR_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
/// 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;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_COLOR_H_
|
@@ -251,8 +251,7 @@ typedef enum {
|
||||
/// use by the File System Access API.
|
||||
CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_LAST_PICKED_DIRECTORY,
|
||||
|
||||
/// Controls access to the getDisplayMedia API when {preferCurrentTab: true}
|
||||
/// is specified.
|
||||
/// Controls access to the getDisplayMedia API.
|
||||
CEF_CONTENT_SETTING_TYPE_DISPLAY_CAPTURE,
|
||||
|
||||
/// Website setting to store permissions metadata granted to paths on the
|
||||
@@ -289,7 +288,8 @@ typedef enum {
|
||||
/// a specified account. When this is present it allows access to session
|
||||
/// management capabilities between the sites. This setting is associated
|
||||
/// with the relying party's origin.
|
||||
CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_ACTIVE_SESSION,
|
||||
// Obsolete on Nov 2023.
|
||||
CEF_CONTENT_SETTING_TYPE_DEPRECATED_FEDERATED_IDENTITY_ACTIVE_SESSION,
|
||||
|
||||
/// Setting to indicate whether Chrome should automatically apply darkening to
|
||||
/// web content.
|
||||
@@ -362,29 +362,72 @@ typedef enum {
|
||||
/// Stores per origin metadata for cookie controls.
|
||||
CEF_CONTENT_SETTING_TYPE_COOKIE_CONTROLS_METADATA,
|
||||
|
||||
/// Content Setting for 3PC accesses granted via 3PC deprecation trial.
|
||||
CEF_CONTENT_SETTING_TYPE_TPCD_SUPPORT,
|
||||
|
||||
/// Content setting used to indicate whether entering picture-in-picture
|
||||
/// automatically should be enabled.
|
||||
CEF_CONTENT_SETTING_TYPE_AUTO_PICTURE_IN_PICTURE,
|
||||
/// Content Setting for temporary 3PC accesses granted by user behavior
|
||||
/// heuristics.
|
||||
CEF_CONTENT_SETTING_TYPE_TPCD_HEURISTICS_GRANTS,
|
||||
|
||||
/// Content Setting for 3PC accesses granted by metadata delivered via the
|
||||
/// component updater service. This type will only be used when
|
||||
/// `net::features::kTpcdMetadataGrants` is enabled.
|
||||
CEF_CONTENT_SETTING_TYPE_TPCD_METADATA_GRANTS,
|
||||
|
||||
/// Content Setting for 3PC accesses granted via 3PC deprecation trial.
|
||||
CEF_CONTENT_SETTING_TYPE_TPCD_TRIAL,
|
||||
|
||||
/// Content Setting for 3PC accesses granted via top-level 3PC deprecation
|
||||
/// trial. Similar to TPCD_TRIAL, but applicable at the page-level for the
|
||||
/// lifetime of the page that served the token, rather than being specific to
|
||||
/// a requesting-origin/top-level-site combination and persistent.
|
||||
CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_TPCD_TRIAL,
|
||||
|
||||
/// Content setting used to indicate whether entering picture-in-picture
|
||||
/// automatically should be enabled.
|
||||
CEF_CONTENT_SETTING_TYPE_AUTO_PICTURE_IN_PICTURE,
|
||||
|
||||
/// Whether user has opted into keeping file/directory permissions persistent
|
||||
/// between visits for a given origin. When enabled, permission metadata
|
||||
/// stored under |FILE_SYSTEM_ACCESS_CHOOSER_DATA| can auto-grant incoming
|
||||
/// permission request.
|
||||
CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_EXTENDED_PERMISSION,
|
||||
|
||||
/// Content Setting for temporary 3PC accesses granted by user behavior
|
||||
/// heuristics.
|
||||
CEF_CONTENT_SETTING_TYPE_TPCD_HEURISTICS_GRANTS,
|
||||
/// Whether the FSA Persistent Permissions restore prompt is eligible to be
|
||||
/// shown to the user, for a given origin.
|
||||
CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_RESTORE_PERMISSION,
|
||||
|
||||
CEF_CONTENT_SETTING_TYPE_NUM_TYPES,
|
||||
/// Whether an application capturing another tab, may scroll and zoom
|
||||
/// the captured tab.
|
||||
CEF_CONTENT_SETTING_TYPE_CAPTURED_SURFACE_CONTROL,
|
||||
|
||||
/// Content setting for access to smart card readers.
|
||||
/// The "guard" content setting stores whether to allow sites to access the
|
||||
/// Smart Card API.
|
||||
CEF_CONTENT_SETTING_TYPE_SMART_CARD_GUARD,
|
||||
CEF_CONTENT_SETTING_TYPE_SMART_CARD_DATA,
|
||||
|
||||
/// 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,
|
||||
} cef_content_setting_types_t;
|
||||
|
||||
///
|
||||
|
@@ -43,6 +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"
|
||||
|
||||
// Handle types.
|
||||
@@ -137,6 +138,56 @@ typedef struct _cef_window_info_t {
|
||||
cef_window_handle_t window;
|
||||
} 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
|
||||
|
@@ -35,6 +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"
|
||||
|
||||
// Handle types.
|
||||
@@ -44,6 +45,8 @@
|
||||
#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
|
||||
@@ -136,6 +139,23 @@ typedef struct _cef_window_info_t {
|
||||
cef_window_handle_t view;
|
||||
} 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
|
||||
|
@@ -37,12 +37,14 @@
|
||||
#include <windows.h>
|
||||
|
||||
#include "include/internal/cef_string.h"
|
||||
#include "include/internal/cef_types_color.h"
|
||||
#include "include/internal/cef_types_geometry.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
|
||||
@@ -104,6 +106,24 @@ typedef struct _cef_window_info_t {
|
||||
cef_window_handle_t window;
|
||||
} 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
|
||||
|
@@ -683,6 +683,7 @@ struct CefPdfPrintSettingsTraits {
|
||||
&target->footer_template, copy);
|
||||
|
||||
target->generate_tagged_pdf = src->generate_tagged_pdf;
|
||||
target->generate_document_outline = src->generate_document_outline;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -696,7 +697,9 @@ using CefPdfPrintSettings = CefStructBase<CefPdfPrintSettingsTraits>;
|
||||
///
|
||||
class CefBoxLayoutSettings : public cef_box_layout_settings_t {
|
||||
public:
|
||||
CefBoxLayoutSettings() : cef_box_layout_settings_t{} {}
|
||||
CefBoxLayoutSettings() : cef_box_layout_settings_t{} {
|
||||
cross_axis_alignment = CEF_AXIS_ALIGNMENT_STRETCH;
|
||||
}
|
||||
CefBoxLayoutSettings(const cef_box_layout_settings_t& r)
|
||||
: cef_box_layout_settings_t(r) {}
|
||||
};
|
||||
@@ -747,4 +750,14 @@ 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_
|
||||
|
@@ -115,8 +115,7 @@ class CefLabelButton : public CefButton {
|
||||
/// where:
|
||||
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// - STYLES is an optional space-separated list of style names
|
||||
/// (case-sensitive
|
||||
/// "Bold" and "Italic" are supported), and
|
||||
/// (case-sensitive "Bold" and "Italic" are supported), and
|
||||
/// - SIZE is an integer font size in pixels with the suffix "px".
|
||||
///
|
||||
/// Here are examples of valid font description strings:
|
||||
|
@@ -190,8 +190,7 @@ class CefTextfield : public CefView {
|
||||
/// where:
|
||||
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// - STYLES is an optional space-separated list of style names
|
||||
/// (case-sensitive
|
||||
/// "Bold" and "Italic" are supported), and
|
||||
/// (case-sensitive "Bold" and "Italic" are supported), and
|
||||
/// - SIZE is an integer font size in pixels with the suffix "px".
|
||||
///
|
||||
/// Here are examples of valid font description strings:
|
||||
|
@@ -51,7 +51,7 @@ class CefTextfield;
|
||||
class CefTextfieldDelegate : public CefViewDelegate {
|
||||
public:
|
||||
///
|
||||
/// Called when |textfield| recieves a keyboard event. |event| contains
|
||||
/// Called when |textfield| receives a keyboard event. |event| contains
|
||||
/// information about the keyboard event. Return true if the keyboard event
|
||||
/// was handled or false otherwise for default handling.
|
||||
///
|
||||
|
@@ -357,17 +357,31 @@ class CefView : public CefBaseRefCounted {
|
||||
virtual void RequestFocus() = 0;
|
||||
|
||||
///
|
||||
/// Sets the background color for this View.
|
||||
/// Sets the background color for this View. The background color will be
|
||||
/// automatically reset when CefViewDelegate::OnThemeChanged is called.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetBackgroundColor(cef_color_t color) = 0;
|
||||
|
||||
///
|
||||
/// Returns the background color for this View.
|
||||
/// 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.
|
||||
///
|
||||
/*--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.
|
||||
|
@@ -131,6 +131,27 @@ 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_
|
||||
|
@@ -233,8 +233,9 @@ class CefWindow : public CefPanel {
|
||||
///
|
||||
/// Add a View that will be overlayed on the Window contents with absolute
|
||||
/// positioning and high z-order. Positioning is controlled by |docking_mode|
|
||||
/// as described below. The returned CefOverlayController object is used to
|
||||
/// control the overlay. Overlays are hidden by default.
|
||||
/// as described below. Setting |can_activate| to true will allow the overlay
|
||||
/// view to receive input focus. The returned CefOverlayController object is
|
||||
/// used to control the overlay. Overlays are hidden by default.
|
||||
///
|
||||
/// With CEF_DOCKING_MODE_CUSTOM:
|
||||
/// 1. The overlay is initially hidden, sized to |view|'s preferred size,
|
||||
@@ -262,7 +263,8 @@ class CefWindow : public CefPanel {
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefOverlayController> AddOverlayView(
|
||||
CefRefPtr<CefView> view,
|
||||
cef_docking_mode_t docking_mode) = 0;
|
||||
cef_docking_mode_t docking_mode,
|
||||
bool can_activate) = 0;
|
||||
|
||||
///
|
||||
/// Show a menu with contents |menu_model|. |screen_point| specifies the menu
|
||||
@@ -375,6 +377,43 @@ 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;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_VIEWS_CEF_WINDOW_H_
|
||||
|
@@ -164,12 +164,11 @@ 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,
|
||||
@@ -177,6 +176,21 @@ 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.
|
||||
///
|
||||
@@ -222,6 +236,41 @@ 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) {}
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_VIEWS_CEF_WINDOW_DELEGATE_H_
|
||||
|
@@ -60,16 +60,16 @@ class CefByteReadHandler : public CefReadHandler {
|
||||
CefByteReadHandler& operator=(const CefByteReadHandler&) = delete;
|
||||
|
||||
// CefReadHandler methods.
|
||||
virtual size_t Read(void* ptr, size_t size, size_t n) override;
|
||||
virtual int Seek(int64_t offset, int whence) override;
|
||||
virtual int64_t Tell() override;
|
||||
virtual int Eof() override;
|
||||
virtual bool MayBlock() override { return false; }
|
||||
size_t Read(void* ptr, size_t size, size_t n) override;
|
||||
int Seek(int64_t offset, int whence) override;
|
||||
int64_t Tell() override;
|
||||
int Eof() override;
|
||||
bool MayBlock() override { return false; }
|
||||
|
||||
private:
|
||||
const unsigned char* bytes_;
|
||||
int64_t size_;
|
||||
int64_t offset_;
|
||||
int64_t offset_ = 0;
|
||||
CefRefPtr<CefBaseRefCounted> source_;
|
||||
|
||||
base::Lock lock_;
|
||||
|
@@ -144,7 +144,7 @@ class CefScopedArgArray {
|
||||
values_[i] = argv[i];
|
||||
array_[i] = const_cast<char*>(values_[i].c_str());
|
||||
}
|
||||
array_[argc] = NULL;
|
||||
array_[argc] = nullptr;
|
||||
}
|
||||
|
||||
CefScopedArgArray(const CefScopedArgArray&) = delete;
|
||||
|
@@ -347,7 +347,7 @@ class CefMessageRouterBrowserSide
|
||||
CefRefPtr<CefFrame> frame,
|
||||
int64_t query_id) {}
|
||||
|
||||
virtual ~Handler() {}
|
||||
virtual ~Handler() = default;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -435,7 +435,7 @@ class CefMessageRouterBrowserSide
|
||||
protected:
|
||||
// Protect against accidental deletion of this object.
|
||||
friend class base::RefCountedThreadSafe<CefMessageRouterBrowserSide>;
|
||||
virtual ~CefMessageRouterBrowserSide() {}
|
||||
virtual ~CefMessageRouterBrowserSide() = default;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -491,7 +491,7 @@ class CefMessageRouterRendererSide
|
||||
protected:
|
||||
// Protect against accidental deletion of this object.
|
||||
friend class base::RefCountedThreadSafe<CefMessageRouterRendererSide>;
|
||||
virtual ~CefMessageRouterRendererSide() {}
|
||||
virtual ~CefMessageRouterRendererSide() = default;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_WRAPPER_CEF_MESSAGE_ROUTER_H_
|
||||
|
@@ -206,7 +206,7 @@ class CefResourceManager
|
||||
///
|
||||
virtual void OnRequestCanceled(scoped_refptr<Request> request) {}
|
||||
|
||||
virtual ~Provider() {}
|
||||
virtual ~Provider() = default;
|
||||
};
|
||||
|
||||
CefResourceManager();
|
||||
|
@@ -184,7 +184,7 @@ class CefXmlObject : public base::RefCountedThreadSafe<CefXmlObject> {
|
||||
void SetParent(CefXmlObject* parent);
|
||||
|
||||
CefString name_;
|
||||
CefXmlObject* parent_;
|
||||
CefXmlObject* parent_ = nullptr;
|
||||
CefString value_;
|
||||
AttributeMap attributes_;
|
||||
ObjectVector children_;
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include "libcef/browser/alloy/alloy_browser_context.h"
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "libcef/browser/download_manager_delegate.h"
|
||||
@@ -112,12 +113,7 @@ AlloyBrowserContext::AlloyBrowserContext(
|
||||
const CefRequestContextSettings& settings)
|
||||
: CefBrowserContext(settings) {}
|
||||
|
||||
AlloyBrowserContext::~AlloyBrowserContext() {
|
||||
if (resource_context_) {
|
||||
content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE,
|
||||
resource_context_.release());
|
||||
}
|
||||
}
|
||||
AlloyBrowserContext::~AlloyBrowserContext() = default;
|
||||
|
||||
bool AlloyBrowserContext::IsInitialized() const {
|
||||
CEF_REQUIRE_UIT();
|
||||
@@ -167,15 +163,15 @@ void AlloyBrowserContext::Initialize() {
|
||||
visited_link_path = cache_path_.Append(FILE_PATH_LITERAL("Visited Links"));
|
||||
}
|
||||
visitedlink_listener_ = new CefVisitedLinkListener;
|
||||
visitedlink_master_.reset(new visitedlink::VisitedLinkWriter(
|
||||
visitedlink_master_ = std::make_unique<visitedlink::VisitedLinkWriter>(
|
||||
visitedlink_listener_, this, !visited_link_path.empty(), false,
|
||||
visited_link_path, 0));
|
||||
visited_link_path, 0);
|
||||
visitedlink_listener_->CreateListenerForContext(this);
|
||||
visitedlink_master_->Init();
|
||||
|
||||
// Initialize proxy configuration tracker.
|
||||
pref_proxy_config_tracker_.reset(new PrefProxyConfigTrackerImpl(
|
||||
GetPrefs(), content::GetIOThreadTaskRunner({})));
|
||||
pref_proxy_config_tracker_ = std::make_unique<PrefProxyConfigTrackerImpl>(
|
||||
GetPrefs(), content::GetIOThreadTaskRunner({}));
|
||||
|
||||
// Spell checking support and possibly other subsystems retrieve the
|
||||
// PrefService associated with a BrowserContext via UserPrefs::Get().
|
||||
@@ -310,13 +306,6 @@ bool AlloyBrowserContext::IsPrintPreviewSupported() const {
|
||||
return !GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled);
|
||||
}
|
||||
|
||||
content::ResourceContext* AlloyBrowserContext::GetResourceContext() {
|
||||
if (!resource_context_) {
|
||||
resource_context_ = std::make_unique<content::ResourceContext>();
|
||||
}
|
||||
return resource_context_.get();
|
||||
}
|
||||
|
||||
content::ClientHintsControllerDelegate*
|
||||
AlloyBrowserContext::GetClientHintsControllerDelegate() {
|
||||
return nullptr;
|
||||
@@ -355,8 +344,8 @@ AlloyBrowserContext::CreateZoomLevelDelegate(
|
||||
content::DownloadManagerDelegate*
|
||||
AlloyBrowserContext::GetDownloadManagerDelegate() {
|
||||
if (!download_manager_delegate_) {
|
||||
download_manager_delegate_.reset(
|
||||
new CefDownloadManagerDelegate(GetDownloadManager()));
|
||||
download_manager_delegate_ =
|
||||
std::make_unique<CefDownloadManagerDelegate>(GetDownloadManager());
|
||||
}
|
||||
return download_manager_delegate_.get();
|
||||
}
|
||||
@@ -388,7 +377,7 @@ AlloyBrowserContext::GetStorageNotificationService() {
|
||||
|
||||
content::SSLHostStateDelegate* AlloyBrowserContext::GetSSLHostStateDelegate() {
|
||||
if (!ssl_host_state_delegate_) {
|
||||
ssl_host_state_delegate_.reset(new CefSSLHostStateDelegate());
|
||||
ssl_host_state_delegate_ = std::make_unique<CefSSLHostStateDelegate>();
|
||||
}
|
||||
return ssl_host_state_delegate_.get();
|
||||
}
|
||||
@@ -475,7 +464,7 @@ void AlloyBrowserContext::RebuildTable(
|
||||
DownloadPrefs* AlloyBrowserContext::GetDownloadPrefs() {
|
||||
CEF_REQUIRE_UIT();
|
||||
if (!download_prefs_) {
|
||||
download_prefs_.reset(new DownloadPrefs(this));
|
||||
download_prefs_ = std::make_unique<DownloadPrefs>(this);
|
||||
}
|
||||
return download_prefs_.get();
|
||||
}
|
||||
|
@@ -59,7 +59,6 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
|
||||
bool IsPrintPreviewSupported() const override;
|
||||
|
||||
// content::BrowserContext overrides.
|
||||
content::ResourceContext* GetResourceContext() override;
|
||||
content::ClientHintsControllerDelegate* GetClientHintsControllerDelegate()
|
||||
override;
|
||||
base::FilePath GetPath() override;
|
||||
@@ -142,8 +141,6 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
|
||||
std::unique_ptr<ProfileKey> key_;
|
||||
|
||||
std::unique_ptr<DownloadPrefs> download_prefs_;
|
||||
|
||||
std::unique_ptr<content::ResourceContext> resource_context_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_CONTEXT_H_
|
||||
|
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@@ -17,6 +18,7 @@
|
||||
#include "libcef/browser/browser_platform_delegate.h"
|
||||
#include "libcef/browser/context.h"
|
||||
#include "libcef/browser/devtools/devtools_manager.h"
|
||||
#include "libcef/browser/hang_monitor.h"
|
||||
#include "libcef/browser/media_access_query.h"
|
||||
#include "libcef/browser/osr/osr_util.h"
|
||||
#include "libcef/browser/request_context_impl.h"
|
||||
@@ -233,7 +235,7 @@ CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::GetBrowserForGlobalId(
|
||||
// AlloyBrowserHostImpl methods.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
AlloyBrowserHostImpl::~AlloyBrowserHostImpl() {}
|
||||
AlloyBrowserHostImpl::~AlloyBrowserHostImpl() = default;
|
||||
|
||||
void AlloyBrowserHostImpl::CloseBrowser(bool force_close) {
|
||||
if (CEF_CURRENTLY_ON_UIT()) {
|
||||
@@ -367,20 +369,6 @@ bool AlloyBrowserHostImpl::HasDevTools() {
|
||||
return devtools_manager_->HasDevTools();
|
||||
}
|
||||
|
||||
void AlloyBrowserHostImpl::SetAccessibilityState(
|
||||
cef_state_t accessibility_state) {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::BindOnce(&AlloyBrowserHostImpl::SetAccessibilityState,
|
||||
this, accessibility_state));
|
||||
return;
|
||||
}
|
||||
|
||||
if (platform_delegate_) {
|
||||
platform_delegate_->SetAccessibilityState(accessibility_state);
|
||||
}
|
||||
}
|
||||
|
||||
void AlloyBrowserHostImpl::SetAutoResizeEnabled(bool enabled,
|
||||
const CefSize& min_size,
|
||||
const CefSize& max_size) {
|
||||
@@ -1206,13 +1194,28 @@ void AlloyBrowserHostImpl::WebContentsCreated(
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser =
|
||||
CreateInternal(settings, client, new_contents, /*own_web_contents=*/false,
|
||||
info, opener, /*is_devtools_popup=*/false, request_context,
|
||||
std::move(platform_delegate), /*cef_extension=*/nullptr);
|
||||
std::move(platform_delegate), /*extension=*/nullptr);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
content::JavaScriptDialogManager*
|
||||
AlloyBrowserHostImpl::GetJavaScriptDialogManager(content::WebContents* source) {
|
||||
if (!javascript_dialog_manager_) {
|
||||
javascript_dialog_manager_.reset(new CefJavaScriptDialogManager(this));
|
||||
javascript_dialog_manager_ =
|
||||
std::make_unique<CefJavaScriptDialogManager>(this);
|
||||
}
|
||||
return javascript_dialog_manager_.get();
|
||||
}
|
||||
@@ -1230,8 +1233,8 @@ bool AlloyBrowserHostImpl::ShowContextMenu(
|
||||
const content::ContextMenuParams& params) {
|
||||
CEF_REQUIRE_UIT();
|
||||
if (!menu_manager_.get() && platform_delegate_) {
|
||||
menu_manager_.reset(
|
||||
new CefMenuManager(this, platform_delegate_->CreateMenuRunner()));
|
||||
menu_manager_ = std::make_unique<CefMenuManager>(
|
||||
this, platform_delegate_->CreateMenuRunner());
|
||||
}
|
||||
return menu_manager_->CreateContextMenu(params);
|
||||
}
|
||||
@@ -1273,7 +1276,7 @@ void AlloyBrowserHostImpl::RequestMediaAccessPermission(
|
||||
|
||||
bool AlloyBrowserHostImpl::CheckMediaAccessPermission(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& security_origin,
|
||||
const url::Origin& security_origin,
|
||||
blink::mojom::MediaStreamType type) {
|
||||
return media_access_query::CheckMediaAccessPermission(this, render_frame_host,
|
||||
security_origin, type);
|
||||
@@ -1402,7 +1405,8 @@ void AlloyBrowserHostImpl::StartAudioCapturer() {
|
||||
return;
|
||||
}
|
||||
|
||||
audio_capturer_.reset(new CefAudioCapturer(params, this, audio_handler));
|
||||
audio_capturer_ =
|
||||
std::make_unique<CefAudioCapturer>(params, this, audio_handler);
|
||||
}
|
||||
|
||||
// AlloyBrowserHostImpl private methods.
|
||||
|
@@ -117,7 +117,6 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
|
||||
void DragSourceEndedAt(int x, int y, DragOperationsMask op) override;
|
||||
void SetAudioMuted(bool mute) override;
|
||||
bool IsAudioMuted() override;
|
||||
void SetAccessibilityState(cef_state_t accessibility_state) override;
|
||||
void SetAutoResizeEnabled(bool enabled,
|
||||
const CefSize& min_size,
|
||||
const CefSize& max_size) override;
|
||||
@@ -234,6 +233,13 @@ 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,
|
||||
@@ -262,7 +268,7 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
|
||||
const content::MediaStreamRequest& request,
|
||||
content::MediaResponseCallback callback) override;
|
||||
bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
|
||||
const GURL& security_origin,
|
||||
const url::Origin& security_origin,
|
||||
blink::mojom::MediaStreamType type) override;
|
||||
bool IsNeverComposited(content::WebContents* web_contents) override;
|
||||
content::PictureInPictureResult EnterPictureInPicture(
|
||||
|
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "libcef/browser/alloy/dialogs/alloy_constrained_window_views_client.h"
|
||||
@@ -36,6 +37,7 @@
|
||||
#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"
|
||||
@@ -49,10 +51,13 @@
|
||||
#include "ui/native_theme/native_theme.h"
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
#include "ui/ozone/buildflags.h"
|
||||
#if defined(USE_AURA) && BUILDFLAG(OZONE_PLATFORM_X11)
|
||||
#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)
|
||||
@@ -125,26 +130,10 @@ 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(
|
||||
const base::CommandLine& command_line,
|
||||
base::CommandLine command_line,
|
||||
const base::FilePath& current_directory) {
|
||||
// Drop the request if the browser process is already shutting down.
|
||||
if (!CONTEXT_STATE_VALID()) {
|
||||
@@ -171,7 +160,7 @@ void ProcessSingletonNotificationCallbackImpl(
|
||||
|
||||
// Based on ChromeBrowserMainParts::ProcessSingletonNotificationCallback.
|
||||
bool ProcessSingletonNotificationCallback(
|
||||
const base::CommandLine& command_line,
|
||||
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
|
||||
@@ -190,7 +179,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,
|
||||
command_line, current_directory));
|
||||
std::move(command_line), current_directory));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -206,7 +195,7 @@ void AlloyBrowserMainParts::ToolkitInitialized() {
|
||||
#if defined(USE_AURA)
|
||||
CHECK(aura::Env::GetInstance());
|
||||
|
||||
wm_state_.reset(new wm::WMState);
|
||||
wm_state_ = std::make_unique<wm::WMState>();
|
||||
#endif // defined(USE_AURA)
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
@@ -218,7 +207,9 @@ void AlloyBrowserMainParts::ToolkitInitialized() {
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
// Based on chrome_browser_main_extra_parts_views_linux.cc
|
||||
if (auto linux_ui = GetLinuxUI()) {
|
||||
// |linux_ui| will be nullptr with multi-threaded-message-loop. See
|
||||
// CefUiThread::InitializeBrowserRunner.
|
||||
if (auto linux_ui = ui::GetDefaultLinuxUi()) {
|
||||
linux_ui_getter_ = std::make_unique<LinuxUiGetterImpl>();
|
||||
ui::LinuxUi::SetInstance(linux_ui);
|
||||
|
||||
@@ -227,6 +218,13 @@ 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);
|
||||
@@ -245,13 +243,15 @@ 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));
|
||||
}
|
||||
|
||||
void AlloyBrowserMainParts::PreCreateMainMessageLoop() {
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
#if defined(USE_AURA) && BUILDFLAG(OZONE_PLATFORM_X11)
|
||||
#if defined(USE_AURA) && BUILDFLAG(IS_OZONE_X11)
|
||||
ui::TouchFactory::SetTouchDeviceListFromCommandLine();
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -31,7 +31,10 @@ class LayoutProvider;
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
namespace ui {
|
||||
class LinuxUiGetter;
|
||||
}
|
||||
#if defined(USE_DBUS)
|
||||
class DarkModeManagerLinux;
|
||||
#endif
|
||||
} // namespace ui
|
||||
#endif
|
||||
|
||||
class CefDevToolsDelegate;
|
||||
@@ -99,6 +102,9 @@ 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
|
||||
};
|
||||
|
||||
|
@@ -69,8 +69,8 @@
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/profiles/renderer_updater.h"
|
||||
#include "chrome/browser/profiles/renderer_updater_factory.h"
|
||||
#include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h"
|
||||
#include "chrome/browser/spellchecker/spell_check_host_chrome_impl.h"
|
||||
#include "chrome/browser/spellchecker/spell_check_initialization_host_impl.h"
|
||||
#include "chrome/browser/ui/chrome_select_file_policy.h"
|
||||
#include "chrome/browser/ui/pdf/chrome_pdf_document_helper_client.h"
|
||||
#include "chrome/common/chrome_content_client.h"
|
||||
@@ -91,14 +91,13 @@
|
||||
#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/internal_plugin_helpers.h"
|
||||
#include "components/pdf/common/constants.h"
|
||||
#include "components/policy/core/common/policy_pref_names.h"
|
||||
#include "components/spellcheck/common/spellcheck.mojom.h"
|
||||
#include "components/version_info/version_info.h"
|
||||
#include "content/browser/plugin_service_impl.h"
|
||||
#include "content/browser/renderer_host/render_frame_host_impl.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_ppapi_host.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/client_certificate_delegate.h"
|
||||
#include "content/public/browser/navigation_handle.h"
|
||||
@@ -109,24 +108,33 @@
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/render_widget_host.h"
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
#include "content/public/browser/service_worker_version_base_info.h"
|
||||
#include "content/public/browser/storage_partition.h"
|
||||
#include "content/public/browser/web_ui_url_loader_factory.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "content/public/common/url_constants.h"
|
||||
#include "content/public/common/user_agent.h"
|
||||
#include "crypto/crypto_buildflags.h"
|
||||
#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"
|
||||
#include "extensions/browser/extensions_browser_client.h"
|
||||
#include "extensions/browser/guest_view/extensions_guest_view.h"
|
||||
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h"
|
||||
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
|
||||
#include "extensions/browser/process_map.h"
|
||||
#include "extensions/browser/renderer_startup_helper.h"
|
||||
#include "extensions/browser/service_worker/service_worker_host.h"
|
||||
#include "extensions/browser/url_loader_factory_manager.h"
|
||||
#include "extensions/common/api/mime_handler.mojom.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "extensions/common/mojom/automation_registry.mojom.h"
|
||||
#include "extensions/common/mojom/event_router.mojom.h"
|
||||
#include "extensions/common/mojom/guest_view.mojom.h"
|
||||
#include "extensions/common/mojom/renderer_host.mojom.h"
|
||||
#include "extensions/common/switches.h"
|
||||
#include "mojo/public/cpp/bindings/remote.h"
|
||||
#include "mojo/public/cpp/bindings/self_owned_associated_receiver.h"
|
||||
@@ -134,7 +142,6 @@
|
||||
#include "net/ssl/ssl_cert_request_info.h"
|
||||
#include "net/ssl/ssl_private_key.h"
|
||||
#include "pdf/pdf_features.h"
|
||||
#include "ppapi/host/ppapi_host.h"
|
||||
#include "sandbox/policy/switches.h"
|
||||
#include "services/network/public/cpp/network_switches.h"
|
||||
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
|
||||
@@ -189,7 +196,7 @@ class CefSelectClientCertificateCallbackImpl
|
||||
CefSelectClientCertificateCallbackImpl& operator=(
|
||||
const CefSelectClientCertificateCallbackImpl&) = delete;
|
||||
|
||||
~CefSelectClientCertificateCallbackImpl() {
|
||||
~CefSelectClientCertificateCallbackImpl() override {
|
||||
// If Select has not been called, call it with NULL to continue without any
|
||||
// client certificate.
|
||||
if (delegate_) {
|
||||
@@ -303,6 +310,33 @@ void BindNetworkHintsHandler(
|
||||
predictors::NetworkHintsHandlerImpl::Create(frame_host, std::move(receiver));
|
||||
}
|
||||
|
||||
// From chrome/browser/chrome_browser_interface_binders.cc
|
||||
void BindMimeHandlerService(
|
||||
content::RenderFrameHost* frame_host,
|
||||
mojo::PendingReceiver<extensions::mime_handler::MimeHandlerService>
|
||||
receiver) {
|
||||
auto* guest_view =
|
||||
extensions::MimeHandlerViewGuest::FromRenderFrameHost(frame_host);
|
||||
if (!guest_view) {
|
||||
return;
|
||||
}
|
||||
extensions::MimeHandlerServiceImpl::Create(guest_view->GetStreamWeakPtr(),
|
||||
std::move(receiver));
|
||||
}
|
||||
|
||||
// From chrome/browser/chrome_browser_interface_binders.cc
|
||||
void BindBeforeUnloadControl(
|
||||
content::RenderFrameHost* frame_host,
|
||||
mojo::PendingReceiver<extensions::mime_handler::BeforeUnloadControl>
|
||||
receiver) {
|
||||
auto* guest_view =
|
||||
extensions::MimeHandlerViewGuest::FromRenderFrameHost(frame_host);
|
||||
if (!guest_view) {
|
||||
return;
|
||||
}
|
||||
guest_view->FuseBeforeUnloadControl(std::move(receiver));
|
||||
}
|
||||
|
||||
base::FilePath GetUserDataPath() {
|
||||
base::FilePath user_data_path;
|
||||
base::PathService::Get(chrome::DIR_USER_DATA, &user_data_path);
|
||||
@@ -362,13 +396,6 @@ 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.
|
||||
@@ -507,7 +534,7 @@ bool AlloyContentBrowserClient::IsHandledURL(const GURL& url) {
|
||||
return CefAppManager::Get()->HasCustomScheme(scheme);
|
||||
}
|
||||
|
||||
void AlloyContentBrowserClient::SiteInstanceGotProcess(
|
||||
void AlloyContentBrowserClient::SiteInstanceGotProcessAndSite(
|
||||
content::SiteInstance* site_instance) {
|
||||
if (!extensions::ExtensionsEnabled()) {
|
||||
return;
|
||||
@@ -536,9 +563,10 @@ void AlloyContentBrowserClient::SiteInstanceGotProcess(
|
||||
void AlloyContentBrowserClient::BindHostReceiverForRenderer(
|
||||
content::RenderProcessHost* render_process_host,
|
||||
mojo::GenericPendingReceiver receiver) {
|
||||
if (auto host_receiver = receiver.As<spellcheck::mojom::SpellCheckHost>()) {
|
||||
SpellCheckHostChromeImpl::Create(render_process_host->GetID(),
|
||||
std::move(host_receiver));
|
||||
if (auto host_receiver =
|
||||
receiver.As<spellcheck::mojom::SpellCheckInitializationHost>()) {
|
||||
SpellCheckInitializationHostImpl::Create(render_process_host->GetID(),
|
||||
std::move(host_receiver));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -561,17 +589,13 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
|
||||
// Propagate the following switches to all command lines (along with any
|
||||
// associated values) if present in the browser command line.
|
||||
static const char* const kSwitchNames[] = {
|
||||
switches::kDisablePackLoading,
|
||||
switches::kDisablePackLoading,
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
switches::kFrameworkDirPath,
|
||||
switches::kMainBundlePath,
|
||||
switches::kFrameworkDirPath, switches::kMainBundlePath,
|
||||
#endif
|
||||
switches::kLocalesDirPath,
|
||||
switches::kLogItems,
|
||||
switches::kLogSeverity,
|
||||
switches::kResourcesDirPath,
|
||||
embedder_support::kUserAgent,
|
||||
switches::kUserAgentProductAndVersion,
|
||||
switches::kLocalesDirPath, switches::kLogItems,
|
||||
switches::kLogSeverity, switches::kResourcesDirPath,
|
||||
embedder_support::kUserAgent, switches::kUserAgentProductAndVersion,
|
||||
};
|
||||
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames);
|
||||
}
|
||||
@@ -762,9 +786,8 @@ base::OnceClosure AlloyContentBrowserClient::SelectClientCertificate(
|
||||
}
|
||||
|
||||
CefRequestHandler::X509CertificateList certs;
|
||||
for (net::ClientCertIdentityList::iterator iter = client_certs.begin();
|
||||
iter != client_certs.end(); iter++) {
|
||||
certs.push_back(new CefX509CertificateImpl(std::move(*iter)));
|
||||
for (auto& client_cert : client_certs) {
|
||||
certs.push_back(new CefX509CertificateImpl(std::move(client_cert)));
|
||||
}
|
||||
|
||||
CefRefPtr<CefSelectClientCertificateCallbackImpl> callbackImpl(
|
||||
@@ -832,32 +855,58 @@ std::string AlloyContentBrowserClient::GetDefaultDownloadName() {
|
||||
return "download";
|
||||
}
|
||||
|
||||
void AlloyContentBrowserClient::DidCreatePpapiPlugin(
|
||||
content::BrowserPpapiHost* browser_host) {
|
||||
browser_host->GetPpapiHost()->AddHostFactoryFilter(
|
||||
std::unique_ptr<ppapi::host::HostFactory>(
|
||||
new ChromeBrowserPepperHostFactory(browser_host)));
|
||||
}
|
||||
|
||||
std::unique_ptr<content::DevToolsManagerDelegate>
|
||||
AlloyContentBrowserClient::CreateDevToolsManagerDelegate() {
|
||||
return std::make_unique<CefDevToolsManagerDelegate>();
|
||||
}
|
||||
|
||||
void AlloyContentBrowserClient::ExposeInterfacesToRenderer(
|
||||
service_manager::BinderRegistry* registry,
|
||||
blink::AssociatedInterfaceRegistry* associated_registry,
|
||||
content::RenderProcessHost* render_process_host) {
|
||||
CefBrowserManager::ExposeInterfacesToRenderer(registry, associated_registry,
|
||||
render_process_host);
|
||||
|
||||
if (extensions::ExtensionsEnabled()) {
|
||||
// From ChromeContentBrowserClientExtensionsPart::
|
||||
// ExposeInterfacesToRenderer
|
||||
associated_registry->AddInterface<extensions::mojom::RendererHost>(
|
||||
base::BindRepeating(&extensions::RendererStartupHelper::BindForRenderer,
|
||||
render_process_host->GetID()));
|
||||
}
|
||||
}
|
||||
|
||||
void AlloyContentBrowserClient::
|
||||
RegisterAssociatedInterfaceBindersForServiceWorker(
|
||||
const content::ServiceWorkerVersionBaseInfo&
|
||||
service_worker_version_info,
|
||||
blink::AssociatedInterfaceRegistry& associated_registry) {
|
||||
if (extensions::ExtensionsEnabled()) {
|
||||
// From ChromeContentBrowserClientExtensionsPart::
|
||||
// ExposeInterfacesToRendererForServiceWorker
|
||||
CHECK(service_worker_version_info.process_id !=
|
||||
content::ChildProcessHost::kInvalidUniqueID);
|
||||
associated_registry.AddInterface<extensions::mojom::RendererHost>(
|
||||
base::BindRepeating(&extensions::RendererStartupHelper::BindForRenderer,
|
||||
service_worker_version_info.process_id));
|
||||
associated_registry.AddInterface<extensions::mojom::ServiceWorkerHost>(
|
||||
base::BindRepeating(&extensions::ServiceWorkerHost::BindReceiver,
|
||||
service_worker_version_info.process_id));
|
||||
associated_registry
|
||||
.AddInterface<extensions::mojom::RendererAutomationRegistry>(
|
||||
base::BindRepeating(
|
||||
&extensions::AutomationEventRouter::BindForRenderer,
|
||||
service_worker_version_info.process_id));
|
||||
associated_registry.AddInterface<extensions::mojom::EventRouter>(
|
||||
base::BindRepeating(&extensions::EventRouter::BindForRenderer,
|
||||
service_worker_version_info.process_id));
|
||||
}
|
||||
}
|
||||
|
||||
void AlloyContentBrowserClient::
|
||||
RegisterAssociatedInterfaceBindersForRenderFrameHost(
|
||||
content::RenderFrameHost& render_frame_host,
|
||||
blink::AssociatedInterfaceRegistry& associated_registry) {
|
||||
associated_registry.AddInterface<extensions::mojom::LocalFrameHost>(
|
||||
base::BindRepeating(
|
||||
[](content::RenderFrameHost* render_frame_host,
|
||||
mojo::PendingAssociatedReceiver<extensions::mojom::LocalFrameHost>
|
||||
receiver) {
|
||||
extensions::ExtensionWebContentsObserver::BindLocalFrameHost(
|
||||
std::move(receiver), render_frame_host);
|
||||
},
|
||||
&render_frame_host));
|
||||
|
||||
associated_registry.AddInterface<printing::mojom::PrintManagerHost>(
|
||||
base::BindRepeating(
|
||||
[](content::RenderFrameHost* render_frame_host,
|
||||
@@ -876,6 +925,47 @@ void AlloyContentBrowserClient::
|
||||
std::make_unique<ChromePDFDocumentHelperClient>());
|
||||
},
|
||||
&render_frame_host));
|
||||
|
||||
associated_registry.AddInterface<chrome::mojom::PluginInfoHost>(
|
||||
base::BindRepeating(&BindPluginInfoHost,
|
||||
render_frame_host.GetProcess()->GetID()));
|
||||
|
||||
if (extensions::ExtensionsEnabled()) {
|
||||
// From ChromeContentBrowserClientExtensionsPart::
|
||||
// ExposeInterfacesToRendererForRenderFrameHost
|
||||
int render_process_id = render_frame_host.GetProcess()->GetID();
|
||||
associated_registry.AddInterface<extensions::mojom::RendererHost>(
|
||||
base::BindRepeating(&extensions::RendererStartupHelper::BindForRenderer,
|
||||
render_process_id));
|
||||
associated_registry
|
||||
.AddInterface<extensions::mojom::RendererAutomationRegistry>(
|
||||
base::BindRepeating(
|
||||
&extensions::AutomationEventRouter::BindForRenderer,
|
||||
render_process_id));
|
||||
associated_registry.AddInterface<extensions::mojom::EventRouter>(
|
||||
base::BindRepeating(&extensions::EventRouter::BindForRenderer,
|
||||
render_process_id));
|
||||
associated_registry.AddInterface<guest_view::mojom::GuestViewHost>(
|
||||
base::BindRepeating(
|
||||
&extensions::ExtensionsGuestView::CreateForComponents,
|
||||
render_frame_host.GetGlobalId()));
|
||||
associated_registry.AddInterface<extensions::mojom::GuestView>(
|
||||
base::BindRepeating(
|
||||
&extensions::ExtensionsGuestView::CreateForExtensions,
|
||||
render_frame_host.GetGlobalId()));
|
||||
|
||||
// From ChromeContentBrowserClient::
|
||||
// RegisterAssociatedInterfaceBindersForRenderFrameHost
|
||||
associated_registry.AddInterface<extensions::mojom::LocalFrameHost>(
|
||||
base::BindRepeating(
|
||||
[](content::RenderFrameHost* render_frame_host,
|
||||
mojo::PendingAssociatedReceiver<
|
||||
extensions::mojom::LocalFrameHost> receiver) {
|
||||
extensions::ExtensionWebContentsObserver::BindLocalFrameHost(
|
||||
std::move(receiver), render_frame_host);
|
||||
},
|
||||
&render_frame_host));
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::unique_ptr<content::NavigationThrottle>>
|
||||
@@ -890,11 +980,8 @@ AlloyContentBrowserClient::CreateThrottlesForNavigation(
|
||||
throttles.push_back(std::move(pdf_iframe_throttle));
|
||||
}
|
||||
|
||||
auto pdf_throttle = pdf::PdfNavigationThrottle::MaybeCreateThrottleFor(
|
||||
navigation_handle, std::make_unique<ChromePdfStreamDelegate>());
|
||||
if (pdf_throttle) {
|
||||
throttles.push_back(std::move(pdf_throttle));
|
||||
}
|
||||
throttles.push_back(std::make_unique<pdf::PdfNavigationThrottle>(
|
||||
navigation_handle, std::make_unique<ChromePdfStreamDelegate>()));
|
||||
}
|
||||
|
||||
throttle::CreateThrottlesForNavigation(navigation_handle, throttles);
|
||||
@@ -908,7 +995,8 @@ AlloyContentBrowserClient::CreateURLLoaderThrottles(
|
||||
content::BrowserContext* browser_context,
|
||||
const base::RepeatingCallback<content::WebContents*()>& wc_getter,
|
||||
content::NavigationUIData* navigation_ui_data,
|
||||
int frame_tree_node_id) {
|
||||
int frame_tree_node_id,
|
||||
std::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.
|
||||
@@ -976,34 +1064,6 @@ void AlloyContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
|
||||
}
|
||||
#endif // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
|
||||
|
||||
void AlloyContentBrowserClient::ExposeInterfacesToRenderer(
|
||||
service_manager::BinderRegistry* registry,
|
||||
blink::AssociatedInterfaceRegistry* associated_registry,
|
||||
content::RenderProcessHost* host) {
|
||||
associated_registry->AddInterface<chrome::mojom::PluginInfoHost>(
|
||||
base::BindRepeating(&BindPluginInfoHost, host->GetID()));
|
||||
|
||||
if (extensions::ExtensionsEnabled()) {
|
||||
associated_registry->AddInterface<extensions::mojom::EventRouter>(
|
||||
base::BindRepeating(&extensions::EventRouter::BindForRenderer,
|
||||
host->GetID()));
|
||||
associated_registry->AddInterface<guest_view::mojom::GuestViewHost>(
|
||||
base::BindRepeating(
|
||||
&extensions::ExtensionsGuestView::CreateForComponents,
|
||||
host->GetID()));
|
||||
associated_registry->AddInterface<extensions::mojom::GuestView>(
|
||||
base::BindRepeating(
|
||||
&extensions::ExtensionsGuestView::CreateForExtensions,
|
||||
host->GetID()));
|
||||
associated_registry->AddInterface<extensions::mojom::RendererHost>(
|
||||
base::BindRepeating(&extensions::RendererStartupHelper::BindForRenderer,
|
||||
host->GetID()));
|
||||
}
|
||||
|
||||
CefBrowserManager::ExposeInterfacesToRenderer(registry, associated_registry,
|
||||
host);
|
||||
}
|
||||
|
||||
std::unique_ptr<net::ClientCertStore>
|
||||
AlloyContentBrowserClient::CreateClientCertStore(
|
||||
content::BrowserContext* browser_context) {
|
||||
@@ -1025,6 +1085,7 @@ std::unique_ptr<content::LoginDelegate>
|
||||
AlloyContentBrowserClient::CreateLoginDelegate(
|
||||
const net::AuthChallengeInfo& auth_info,
|
||||
content::WebContents* web_contents,
|
||||
content::BrowserContext* browser_context,
|
||||
const content::GlobalRequestID& request_id,
|
||||
bool is_request_for_main_frame,
|
||||
const GURL& url,
|
||||
@@ -1036,27 +1097,33 @@ AlloyContentBrowserClient::CreateLoginDelegate(
|
||||
std::move(auth_required_callback));
|
||||
}
|
||||
|
||||
void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
|
||||
int frame_tree_node_id,
|
||||
ukm::SourceIdObj ukm_source_id,
|
||||
NonNetworkURLLoaderFactoryMap* factories) {
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory>
|
||||
AlloyContentBrowserClient::CreateNonNetworkNavigationURLLoaderFactory(
|
||||
const std::string& scheme,
|
||||
int frame_tree_node_id) {
|
||||
if (!extensions::ExtensionsEnabled()) {
|
||||
return;
|
||||
return {};
|
||||
}
|
||||
|
||||
content::WebContents* web_contents =
|
||||
content::WebContents::FromFrameTreeNodeId(frame_tree_node_id);
|
||||
factories->emplace(
|
||||
extensions::kExtensionScheme,
|
||||
extensions::CreateExtensionNavigationURLLoaderFactory(
|
||||
web_contents->GetBrowserContext(), ukm_source_id,
|
||||
!!extensions::WebViewGuest::FromWebContents(web_contents)));
|
||||
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 {};
|
||||
}
|
||||
|
||||
void AlloyContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(
|
||||
int render_process_id,
|
||||
int render_frame_id,
|
||||
const absl::optional<url::Origin>& request_initiator_origin,
|
||||
const std::optional<url::Origin>& request_initiator_origin,
|
||||
NonNetworkURLLoaderFactoryMap* factories) {
|
||||
if (!extensions::ExtensionsEnabled()) {
|
||||
return;
|
||||
@@ -1110,15 +1177,15 @@ void AlloyContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(
|
||||
}
|
||||
}
|
||||
|
||||
bool AlloyContentBrowserClient::WillCreateURLLoaderFactory(
|
||||
void AlloyContentBrowserClient::WillCreateURLLoaderFactory(
|
||||
content::BrowserContext* browser_context,
|
||||
content::RenderFrameHost* frame,
|
||||
int render_process_id,
|
||||
URLLoaderFactoryType type,
|
||||
const url::Origin& request_initiator,
|
||||
absl::optional<int64_t> navigation_id,
|
||||
std::optional<int64_t> navigation_id,
|
||||
ukm::SourceIdObj ukm_source_id,
|
||||
mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
|
||||
network::URLLoaderFactoryBuilder& factory_builder,
|
||||
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
|
||||
header_client,
|
||||
bool* bypass_redirect_checks,
|
||||
@@ -1131,9 +1198,8 @@ bool AlloyContentBrowserClient::WillCreateURLLoaderFactory(
|
||||
type == URLLoaderFactoryType::kDownload, request_initiator);
|
||||
|
||||
net_service::ProxyURLLoaderFactory::CreateProxy(
|
||||
browser_context, factory_receiver, header_client,
|
||||
browser_context, factory_builder, header_client,
|
||||
std::move(request_handler));
|
||||
return true;
|
||||
}
|
||||
|
||||
void AlloyContentBrowserClient::OnNetworkServiceCreated(
|
||||
@@ -1205,7 +1271,7 @@ bool AlloyContentBrowserClient::HandleExternalProtocol(
|
||||
network::mojom::WebSandboxFlags sandbox_flags,
|
||||
ui::PageTransition page_transition,
|
||||
bool has_user_gesture,
|
||||
const absl::optional<url::Origin>& initiating_origin,
|
||||
const std::optional<url::Origin>& initiating_origin,
|
||||
content::RenderFrameHost* initiator_document,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) {
|
||||
// Call the other HandleExternalProtocol variant.
|
||||
@@ -1220,7 +1286,7 @@ bool AlloyContentBrowserClient::HandleExternalProtocol(
|
||||
bool is_in_fenced_frame_tree,
|
||||
network::mojom::WebSandboxFlags sandbox_flags,
|
||||
const network::ResourceRequest& resource_request,
|
||||
const absl::optional<url::Origin>& initiating_origin,
|
||||
const std::optional<url::Origin>& initiating_origin,
|
||||
content::RenderFrameHost* initiator_document,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) {
|
||||
mojo::PendingReceiver<network::mojom::URLLoaderFactory> receiver =
|
||||
@@ -1264,10 +1330,22 @@ void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForFrame(
|
||||
map->Add<network_hints::mojom::NetworkHintsHandler>(
|
||||
base::BindRepeating(&BindNetworkHintsHandler));
|
||||
|
||||
map->Add<spellcheck::mojom::SpellCheckHost>(base::BindRepeating(
|
||||
[](content::RenderFrameHost* frame_host,
|
||||
mojo::PendingReceiver<spellcheck::mojom::SpellCheckHost> receiver) {
|
||||
SpellCheckHostChromeImpl::Create(frame_host->GetProcess()->GetID(),
|
||||
std::move(receiver));
|
||||
}));
|
||||
|
||||
if (!extensions::ExtensionsEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
map->Add<extensions::mime_handler::MimeHandlerService>(
|
||||
base::BindRepeating(&BindMimeHandlerService));
|
||||
map->Add<extensions::mime_handler::BeforeUnloadControl>(
|
||||
base::BindRepeating(&BindBeforeUnloadControl));
|
||||
|
||||
content::WebContents* web_contents =
|
||||
content::WebContents::FromRenderFrameHost(render_frame_host);
|
||||
if (!web_contents) {
|
||||
@@ -1326,7 +1404,7 @@ base::FilePath AlloyContentBrowserClient::GetFirstPartySetsDirectory() {
|
||||
return GetUserDataPath();
|
||||
}
|
||||
|
||||
absl::optional<base::FilePath>
|
||||
std::optional<base::FilePath>
|
||||
AlloyContentBrowserClient::GetLocalTracesDirectory() {
|
||||
return GetUserDataPath();
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "build/build_config.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;
|
||||
@@ -64,7 +65,8 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
|
||||
std::vector<std::string>* additional_allowed_schemes) override;
|
||||
bool IsWebUIAllowedToMakeNetworkRequests(const url::Origin& origin) override;
|
||||
bool IsHandledURL(const GURL& url) override;
|
||||
void SiteInstanceGotProcess(content::SiteInstance* site_instance) override;
|
||||
void SiteInstanceGotProcessAndSite(
|
||||
content::SiteInstance* site_instance) override;
|
||||
void BindHostReceiverForRenderer(
|
||||
content::RenderProcessHost* render_process_host,
|
||||
mojo::GenericPendingReceiver receiver) override;
|
||||
@@ -114,9 +116,15 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
|
||||
blink::web_pref::WebPreferences* prefs) override;
|
||||
void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) override;
|
||||
std::string GetDefaultDownloadName() override;
|
||||
void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override;
|
||||
std::unique_ptr<content::DevToolsManagerDelegate>
|
||||
CreateDevToolsManagerDelegate() override;
|
||||
void ExposeInterfacesToRenderer(
|
||||
service_manager::BinderRegistry* registry,
|
||||
blink::AssociatedInterfaceRegistry* associated_registry,
|
||||
content::RenderProcessHost* render_process_host) override;
|
||||
void RegisterAssociatedInterfaceBindersForServiceWorker(
|
||||
const content::ServiceWorkerVersionBaseInfo& service_worker_version_info,
|
||||
blink::AssociatedInterfaceRegistry& associated_registry) override;
|
||||
void RegisterAssociatedInterfaceBindersForRenderFrameHost(
|
||||
content::RenderFrameHost& render_frame_host,
|
||||
blink::AssociatedInterfaceRegistry& associated_registry) override;
|
||||
@@ -129,7 +137,8 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
|
||||
content::BrowserContext* browser_context,
|
||||
const base::RepeatingCallback<content::WebContents*()>& wc_getter,
|
||||
content::NavigationUIData* navigation_ui_data,
|
||||
int frame_tree_node_id) override;
|
||||
int frame_tree_node_id,
|
||||
std::optional<int64_t> navigation_id) override;
|
||||
std::vector<std::unique_ptr<blink::URLLoaderThrottle>>
|
||||
CreateURLLoaderThrottlesForKeepAlive(
|
||||
const network::ResourceRequest& request,
|
||||
@@ -151,39 +160,35 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
|
||||
content::PosixFileDescriptorInfo* mappings) override;
|
||||
#endif
|
||||
|
||||
void ExposeInterfacesToRenderer(
|
||||
service_manager::BinderRegistry* registry,
|
||||
blink::AssociatedInterfaceRegistry* associated_registry,
|
||||
content::RenderProcessHost* render_process_host) override;
|
||||
std::unique_ptr<net::ClientCertStore> CreateClientCertStore(
|
||||
content::BrowserContext* browser_context) override;
|
||||
std::unique_ptr<content::LoginDelegate> CreateLoginDelegate(
|
||||
const net::AuthChallengeInfo& auth_info,
|
||||
content::WebContents* web_contents,
|
||||
content::BrowserContext* browser_context,
|
||||
const content::GlobalRequestID& request_id,
|
||||
bool is_request_for_main_frame,
|
||||
const GURL& url,
|
||||
scoped_refptr<net::HttpResponseHeaders> response_headers,
|
||||
bool first_auth_attempt,
|
||||
LoginAuthRequiredCallback auth_required_callback) override;
|
||||
void RegisterNonNetworkNavigationURLLoaderFactories(
|
||||
int frame_tree_node_id,
|
||||
ukm::SourceIdObj ukm_source_id,
|
||||
NonNetworkURLLoaderFactoryMap* factories) override;
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory>
|
||||
CreateNonNetworkNavigationURLLoaderFactory(const std::string& scheme,
|
||||
int frame_tree_node_id) override;
|
||||
void RegisterNonNetworkSubresourceURLLoaderFactories(
|
||||
int render_process_id,
|
||||
int render_frame_id,
|
||||
const absl::optional<url::Origin>& request_initiator_origin,
|
||||
const std::optional<url::Origin>& request_initiator_origin,
|
||||
NonNetworkURLLoaderFactoryMap* factories) override;
|
||||
bool WillCreateURLLoaderFactory(
|
||||
void WillCreateURLLoaderFactory(
|
||||
content::BrowserContext* browser_context,
|
||||
content::RenderFrameHost* frame,
|
||||
int render_process_id,
|
||||
URLLoaderFactoryType type,
|
||||
const url::Origin& request_initiator,
|
||||
absl::optional<int64_t> navigation_id,
|
||||
std::optional<int64_t> navigation_id,
|
||||
ukm::SourceIdObj ukm_source_id,
|
||||
mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
|
||||
network::URLLoaderFactoryBuilder& factory_builder,
|
||||
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
|
||||
header_client,
|
||||
bool* bypass_redirect_checks,
|
||||
@@ -211,7 +216,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
|
||||
network::mojom::WebSandboxFlags sandbox_flags,
|
||||
ui::PageTransition page_transition,
|
||||
bool has_user_gesture,
|
||||
const absl::optional<url::Origin>& initiating_origin,
|
||||
const std::optional<url::Origin>& initiating_origin,
|
||||
content::RenderFrameHost* initiator_document,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory)
|
||||
override;
|
||||
@@ -223,7 +228,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
|
||||
bool is_in_fenced_frame_tree,
|
||||
network::mojom::WebSandboxFlags sandbox_flags,
|
||||
const network::ResourceRequest& request,
|
||||
const absl::optional<url::Origin>& initiating_origin,
|
||||
const std::optional<url::Origin>& initiating_origin,
|
||||
content::RenderFrameHost* initiator_document,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory)
|
||||
override;
|
||||
@@ -244,7 +249,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
|
||||
base::FilePath GetGraphiteDawnDiskCacheDirectory() override;
|
||||
base::FilePath GetNetLogDefaultDirectory() override;
|
||||
base::FilePath GetFirstPartySetsDirectory() override;
|
||||
absl::optional<base::FilePath> GetLocalTracesDirectory() override;
|
||||
std::optional<base::FilePath> GetLocalTracesDirectory() override;
|
||||
std::string GetProduct() override;
|
||||
std::string GetChromeProduct() override;
|
||||
std::string GetUserAgent() override;
|
||||
|
@@ -4,6 +4,8 @@
|
||||
|
||||
#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"
|
||||
@@ -24,7 +26,6 @@
|
||||
#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/browser/web_contents/web_contents_impl.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "extensions/browser/process_manager.h"
|
||||
#include "pdf/pdf_features.h"
|
||||
@@ -67,10 +68,10 @@ content::WebContents* CefBrowserPlatformDelegateAlloy::CreateWebContents(
|
||||
|
||||
// Extension resources will fail to load if we don't use a SiteInstance
|
||||
// associated with the extension.
|
||||
// (AlloyContentBrowserClient::SiteInstanceGotProcess won't find the
|
||||
// extension to register with InfoMap, and AllowExtensionResourceLoad in
|
||||
// ExtensionProtocolHandler::MaybeCreateJob will return false resulting in
|
||||
// ERR_BLOCKED_BY_CLIENT).
|
||||
// (AlloyContentBrowserClient::SiteInstanceGotProcessAndSite won't find
|
||||
// the extension to register with InfoMap, and AllowExtensionResourceLoad
|
||||
// in ExtensionProtocolHandler::MaybeCreateJob will return false resulting
|
||||
// in ERR_BLOCKED_BY_CLIENT).
|
||||
site_instance = extensions::ProcessManager::Get(browser_context)
|
||||
->GetSiteInstanceForURL(gurl);
|
||||
DCHECK(site_instance);
|
||||
@@ -173,8 +174,8 @@ void CefBrowserPlatformDelegateAlloy::BrowserCreated(
|
||||
CreateAlloyJavaScriptTabModalDialogManagerDelegateDesktop(web_contents_));
|
||||
|
||||
// Used for print preview and JavaScript dialogs.
|
||||
web_contents_dialog_helper_.reset(
|
||||
new AlloyWebContentsDialogHelper(web_contents_, this));
|
||||
web_contents_dialog_helper_ =
|
||||
std::make_unique<AlloyWebContentsDialogHelper>(web_contents_, this);
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateAlloy::CreateExtensionHost(
|
||||
@@ -311,31 +312,6 @@ void CefBrowserPlatformDelegateAlloy::ConfigureAutoResize() {
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateAlloy::SetAccessibilityState(
|
||||
cef_state_t accessibility_state) {
|
||||
// Do nothing if state is set to default. It'll be disabled by default and
|
||||
// controlled by the commmand-line flags "force-renderer-accessibility" and
|
||||
// "disable-renderer-accessibility".
|
||||
if (accessibility_state == STATE_DEFAULT) {
|
||||
return;
|
||||
}
|
||||
|
||||
content::WebContentsImpl* web_contents_impl =
|
||||
static_cast<content::WebContentsImpl*>(web_contents_);
|
||||
|
||||
if (!web_contents_impl) {
|
||||
return;
|
||||
}
|
||||
|
||||
ui::AXMode accMode;
|
||||
// In windowless mode set accessibility to TreeOnly mode. Else native
|
||||
// accessibility APIs, specific to each platform, are also created.
|
||||
if (accessibility_state == STATE_ENABLED) {
|
||||
accMode = IsWindowless() ? ui::kAXModeWebContentsOnly : ui::kAXModeComplete;
|
||||
}
|
||||
web_contents_impl->SetAccessibilityMode(accMode);
|
||||
}
|
||||
|
||||
bool CefBrowserPlatformDelegateAlloy::IsPrintPreviewSupported() const {
|
||||
REQUIRE_ALLOY_RUNTIME();
|
||||
|
||||
|
@@ -54,7 +54,6 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
|
||||
void SetAutoResizeEnabled(bool enabled,
|
||||
const CefSize& min_size,
|
||||
const CefSize& max_size) override;
|
||||
void SetAccessibilityState(cef_state_t accessibility_state) override;
|
||||
bool IsPrintPreviewSupported() const override;
|
||||
void Find(const CefString& searchText,
|
||||
bool forward,
|
||||
|
@@ -5,6 +5,8 @@
|
||||
|
||||
#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"
|
||||
@@ -17,6 +19,7 @@
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/path_service.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"
|
||||
#include "chrome/browser/permissions/chrome_permissions_client.h"
|
||||
@@ -29,6 +32,7 @@
|
||||
#include "components/component_updater/component_updater_service.h"
|
||||
#include "components/component_updater/timer_update_scheduler.h"
|
||||
#include "components/net_log/chrome_net_log.h"
|
||||
#include "components/os_crypt/async/browser/os_crypt_async.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "content/browser/startup_helper.h"
|
||||
#include "content/public/browser/network_service_instance.h"
|
||||
@@ -37,11 +41,11 @@
|
||||
#include "services/network/public/cpp/network_switches.h"
|
||||
#include "services/network/public/cpp/shared_url_loader_factory.h"
|
||||
|
||||
ChromeBrowserProcessAlloy::ChromeBrowserProcessAlloy()
|
||||
: initialized_(false),
|
||||
context_initialized_(false),
|
||||
shutdown_(false),
|
||||
locale_("en-US") {}
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
#include "components/os_crypt/async/browser/dpapi_key_provider.h"
|
||||
#endif
|
||||
|
||||
ChromeBrowserProcessAlloy::ChromeBrowserProcessAlloy() : locale_("en-US") {}
|
||||
|
||||
ChromeBrowserProcessAlloy::~ChromeBrowserProcessAlloy() {
|
||||
DCHECK((!initialized_ && !context_initialized_) || shutdown_);
|
||||
@@ -64,10 +68,10 @@ void ChromeBrowserProcessAlloy::Initialize() {
|
||||
if (extensions::ExtensionsEnabled()) {
|
||||
// Initialize extension global objects before creating the global
|
||||
// BrowserContext.
|
||||
extensions_client_.reset(new extensions::CefExtensionsClient());
|
||||
extensions_client_ = std::make_unique<extensions::CefExtensionsClient>();
|
||||
extensions::ExtensionsClient::Set(extensions_client_.get());
|
||||
extensions_browser_client_.reset(
|
||||
new extensions::CefExtensionsBrowserClient);
|
||||
extensions_browser_client_ =
|
||||
std::make_unique<extensions::CefExtensionsBrowserClient>();
|
||||
extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get());
|
||||
}
|
||||
|
||||
@@ -83,9 +87,33 @@ void ChromeBrowserProcessAlloy::OnContextInitialized() {
|
||||
DCHECK(!context_initialized_);
|
||||
DCHECK(!shutdown_);
|
||||
|
||||
// OSCryptAsync provider configuration. If empty, this delegates all
|
||||
// encryption operations to OSCrypt.
|
||||
std::vector<std::pair<size_t, std::unique_ptr<os_crypt_async::KeyProvider>>>
|
||||
providers;
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// TODO(crbug.com/1373092): For Windows, continue to add providers behind
|
||||
// features, as support for them is added.
|
||||
if (base::FeatureList::IsEnabled(features::kEnableDPAPIEncryptionProvider)) {
|
||||
// The DPAPI key provider requires OSCrypt::Init to have already been called
|
||||
// to initialize the key storage. This happens in
|
||||
// AlloyBrowserMainParts::PreCreateMainMessageLoop.
|
||||
providers.emplace_back(std::make_pair(
|
||||
/*precedence=*/10u,
|
||||
std::make_unique<os_crypt_async::DPAPIKeyProvider>(local_state())));
|
||||
}
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
os_crypt_async_ =
|
||||
std::make_unique<os_crypt_async::OSCryptAsync>(std::move(providers));
|
||||
|
||||
// Trigger async initialization of OSCrypt key providers.
|
||||
std::ignore = os_crypt_async_->GetInstance(base::DoNothing());
|
||||
|
||||
// Must be created after the NotificationService.
|
||||
print_job_manager_.reset(new printing::PrintJobManager());
|
||||
profile_manager_.reset(new ChromeProfileManagerAlloy());
|
||||
print_job_manager_ = std::make_unique<printing::PrintJobManager>();
|
||||
profile_manager_ = std::make_unique<ChromeProfileManagerAlloy>();
|
||||
event_router_forwarder_ = new extensions::EventRouterForwarder();
|
||||
context_initialized_ = true;
|
||||
}
|
||||
@@ -272,9 +300,9 @@ printing::PrintJobManager* ChromeBrowserProcessAlloy::print_job_manager() {
|
||||
|
||||
printing::PrintPreviewDialogController*
|
||||
ChromeBrowserProcessAlloy::print_preview_dialog_controller() {
|
||||
if (!print_preview_dialog_controller_.get()) {
|
||||
if (!print_preview_dialog_controller_) {
|
||||
print_preview_dialog_controller_ =
|
||||
new printing::PrintPreviewDialogController();
|
||||
std::make_unique<printing::PrintPreviewDialogController>();
|
||||
}
|
||||
return print_preview_dialog_controller_.get();
|
||||
}
|
||||
@@ -282,8 +310,8 @@ ChromeBrowserProcessAlloy::print_preview_dialog_controller() {
|
||||
printing::BackgroundPrintingManager*
|
||||
ChromeBrowserProcessAlloy::background_printing_manager() {
|
||||
if (!background_printing_manager_.get()) {
|
||||
background_printing_manager_.reset(
|
||||
new printing::BackgroundPrintingManager());
|
||||
background_printing_manager_ =
|
||||
std::make_unique<printing::BackgroundPrintingManager>();
|
||||
}
|
||||
return background_printing_manager_.get();
|
||||
}
|
||||
@@ -407,8 +435,8 @@ ChromeBrowserProcessAlloy::resource_coordinator_parts() {
|
||||
}
|
||||
|
||||
os_crypt_async::OSCryptAsync* ChromeBrowserProcessAlloy::os_crypt_async() {
|
||||
DCHECK(false);
|
||||
return nullptr;
|
||||
DCHECK(os_crypt_async_);
|
||||
return os_crypt_async_.get();
|
||||
}
|
||||
|
||||
BuildState* ChromeBrowserProcessAlloy::GetBuildState() {
|
||||
|
@@ -113,9 +113,9 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
|
||||
UsbSystemTrayIcon* usb_system_tray_icon() override;
|
||||
|
||||
private:
|
||||
bool initialized_;
|
||||
bool context_initialized_;
|
||||
bool shutdown_;
|
||||
bool initialized_ = false;
|
||||
bool context_initialized_ = false;
|
||||
bool shutdown_ = false;
|
||||
|
||||
std::unique_ptr<extensions::ExtensionsClient> extensions_client_;
|
||||
std::unique_ptr<extensions::ExtensionsBrowserClient>
|
||||
@@ -125,7 +125,7 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
|
||||
std::unique_ptr<printing::PrintJobManager> print_job_manager_;
|
||||
std::unique_ptr<ChromeProfileManagerAlloy> profile_manager_;
|
||||
scoped_refptr<extensions::EventRouterForwarder> event_router_forwarder_;
|
||||
scoped_refptr<printing::PrintPreviewDialogController>
|
||||
std::unique_ptr<printing::PrintPreviewDialogController>
|
||||
print_preview_dialog_controller_;
|
||||
std::unique_ptr<printing::BackgroundPrintingManager>
|
||||
background_printing_manager_;
|
||||
@@ -137,6 +137,8 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
|
||||
std::unique_ptr<base::FieldTrialList> field_trial_list_;
|
||||
|
||||
std::unique_ptr<component_updater::ComponentUpdateService> component_updater_;
|
||||
|
||||
std::unique_ptr<os_crypt_async::OSCryptAsync> os_crypt_async_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_BROWSER_PROCESS_ALLOY_H_
|
||||
|
@@ -41,7 +41,7 @@ ChromeProfileAlloy::ChromeProfileAlloy() {
|
||||
this, profile_metrics::BrowserProfileType::kRegular);
|
||||
}
|
||||
|
||||
ChromeProfileAlloy::~ChromeProfileAlloy() {}
|
||||
ChromeProfileAlloy::~ChromeProfileAlloy() = default;
|
||||
|
||||
bool ChromeProfileAlloy::IsOffTheRecord() {
|
||||
return false;
|
||||
|
@@ -32,7 +32,7 @@ CefBrowserContext* GetActiveBrowserContext() {
|
||||
ChromeProfileManagerAlloy::ChromeProfileManagerAlloy()
|
||||
: ProfileManager(base::FilePath()) {}
|
||||
|
||||
ChromeProfileManagerAlloy::~ChromeProfileManagerAlloy() {}
|
||||
ChromeProfileManagerAlloy::~ChromeProfileManagerAlloy() = default;
|
||||
|
||||
Profile* ChromeProfileManagerAlloy::GetProfile(
|
||||
const base::FilePath& profile_dir) {
|
||||
|
@@ -98,6 +98,7 @@ 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,7 +117,10 @@ void CefAudioCapturer::OnCaptureError(
|
||||
media::AudioCapturerSource::ErrorCode code,
|
||||
const std::string& message) {
|
||||
audio_handler_->OnAudioStreamError(browser_, message);
|
||||
StopStream();
|
||||
|
||||
if (code != media::AudioCapturerSource::ErrorCode::kSocketError) {
|
||||
StopStream();
|
||||
}
|
||||
}
|
||||
|
||||
void CefAudioCapturer::StopStream() {
|
||||
@@ -129,4 +133,4 @@ void CefAudioCapturer::StopStream() {
|
||||
|
||||
audio_input_device_ = nullptr;
|
||||
capturing_ = false;
|
||||
}
|
||||
}
|
||||
|
@@ -31,6 +31,7 @@ class CefAudioCapturer : public media::AudioCapturerSource::CaptureCallback {
|
||||
void OnCaptureStarted() override;
|
||||
void Capture(const media::AudioBus* audio_source,
|
||||
base::TimeTicks audio_capture_time,
|
||||
const media::AudioGlitchInfo& glitch_info,
|
||||
double volume,
|
||||
bool key_pressed) override;
|
||||
void OnCaptureError(media::AudioCapturerSource::ErrorCode code,
|
||||
@@ -48,4 +49,4 @@ class CefAudioCapturer : public media::AudioCapturerSource::CaptureCallback {
|
||||
int channels_ = 0;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_AUDIO_CAPTURER_H_
|
||||
#endif // CEF_LIBCEF_BROWSER_AUDIO_CAPTURER_H_
|
||||
|
@@ -39,7 +39,7 @@ class StreamCreatedCallbackAdapter final
|
||||
StreamCreatedCallbackAdapter& operator=(const StreamCreatedCallbackAdapter&) =
|
||||
delete;
|
||||
|
||||
~StreamCreatedCallbackAdapter() override {}
|
||||
~StreamCreatedCallbackAdapter() override = default;
|
||||
|
||||
// blink::mojom::RendererAudioInputStreamFactoryClient implementation.
|
||||
void StreamCreated(
|
||||
@@ -48,7 +48,7 @@ class StreamCreatedCallbackAdapter final
|
||||
client_receiver,
|
||||
media::mojom::ReadOnlyAudioDataPipePtr data_pipe,
|
||||
bool initially_muted,
|
||||
const absl::optional<base::UnguessableToken>& stream_id) override {
|
||||
const std::optional<base::UnguessableToken>& stream_id) override {
|
||||
DCHECK(!initially_muted); // Loopback streams shouldn't be started muted.
|
||||
callback_.Run(std::move(stream), std::move(client_receiver),
|
||||
std::move(data_pipe));
|
||||
|
@@ -10,23 +10,27 @@
|
||||
#include "libcef/browser/native/cursor_util.h"
|
||||
#include "libcef/common/frame_util.h"
|
||||
|
||||
#include "chrome/browser/ui/views/sad_tab_view.h"
|
||||
#include "chrome/common/chrome_result_codes.h"
|
||||
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
||||
#include "content/public/browser/focused_node_details.h"
|
||||
#include "content/public/browser/keyboard_event_processing_result.h"
|
||||
#include "content/public/browser/navigation_entry.h"
|
||||
#include "content/public/browser/navigation_handle.h"
|
||||
#include "content/public/browser/notification_details.h"
|
||||
#include "content/public/browser/notification_source.h"
|
||||
#include "content/public/browser/notification_types.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/render_widget_host.h"
|
||||
#include "content/public/browser/render_widget_host_observer.h"
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
#include "content/public/common/input/native_web_keyboard_event.h"
|
||||
#include "services/network/public/mojom/url_response_head.mojom.h"
|
||||
#include "third_party/blink/public/mojom/favicon/favicon_url.mojom.h"
|
||||
#include "third_party/blink/public/mojom/input/focus_type.mojom-blink.h"
|
||||
#include "third_party/blink/public/mojom/widget/platform_widget.mojom-test-utils.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include "sandbox/win/src/sandbox_types.h"
|
||||
#endif
|
||||
|
||||
using content::KeyboardEventProcessingResult;
|
||||
|
||||
namespace {
|
||||
@@ -86,17 +90,6 @@ void CefBrowserContentsDelegate::ObserveWebContents(
|
||||
WebContentsObserver::Observe(new_contents);
|
||||
|
||||
if (new_contents) {
|
||||
registrar_.reset(new content::NotificationRegistrar);
|
||||
|
||||
// When navigating through the history, the restored NavigationEntry's title
|
||||
// will be used. If the entry ends up having the same title after we return
|
||||
// to it, as will usually be the case, the
|
||||
// NOTIFICATION_WEB_CONTENTS_TITLE_UPDATED will then be suppressed, since
|
||||
// the NavigationEntry's title hasn't changed.
|
||||
registrar_->Add(this, content::NOTIFICATION_LOAD_STOP,
|
||||
content::Source<content::NavigationController>(
|
||||
&new_contents->GetController()));
|
||||
|
||||
// Make sure MaybeCreateFrame is called at least one time.
|
||||
// Create the frame representation before OnAfterCreated is called for a new
|
||||
// browser.
|
||||
@@ -106,8 +99,6 @@ void CefBrowserContentsDelegate::ObserveWebContents(
|
||||
// Make sure RenderWidgetCreated is called at least one time. This Observer
|
||||
// is registered too late to catch the initial creation.
|
||||
RenderWidgetCreated(new_contents->GetRenderViewHost()->GetWidget());
|
||||
} else {
|
||||
registrar_.reset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +120,9 @@ content::WebContents* CefBrowserContentsDelegate::OpenURLFromTab(
|
||||
if (auto c = client()) {
|
||||
if (auto handler = c->GetRequestHandler()) {
|
||||
// May return nullptr for omnibox navigations.
|
||||
auto frame = browser()->GetFrame(params.frame_tree_node_id);
|
||||
auto frame = browser_info_->browser()->GetFrameForHost(
|
||||
content::RenderFrameHost::FromID(params.source_render_process_id,
|
||||
params.source_render_frame_id));
|
||||
if (!frame) {
|
||||
frame = browser()->GetMainFrame();
|
||||
}
|
||||
@@ -339,11 +332,9 @@ void CefBrowserContentsDelegate::RenderFrameHostStateChanged(
|
||||
|
||||
void CefBrowserContentsDelegate::RenderFrameDeleted(
|
||||
content::RenderFrameHost* render_frame_host) {
|
||||
const auto frame_id =
|
||||
frame_util::MakeFrameId(render_frame_host->GetGlobalId());
|
||||
browser_info_->RemoveFrame(render_frame_host);
|
||||
|
||||
if (focused_frame_ && focused_frame_->GetIdentifier() == frame_id) {
|
||||
if (focused_frame_ && focused_frame_->IsSameFrame(render_frame_host)) {
|
||||
focused_frame_ = nullptr;
|
||||
OnStateChanged(State::kFocusedFrame);
|
||||
}
|
||||
@@ -366,6 +357,22 @@ void CefBrowserContentsDelegate::RenderViewReady() {
|
||||
|
||||
void CefBrowserContentsDelegate::PrimaryMainFrameRenderProcessGone(
|
||||
base::TerminationStatus status) {
|
||||
static_assert(static_cast<int>(CEF_RESULT_CODE_CHROME_FIRST) ==
|
||||
static_cast<int>(chrome::RESULT_CODE_CHROME_START),
|
||||
"enum mismatch");
|
||||
static_assert(static_cast<int>(CEF_RESULT_CODE_CHROME_LAST) ==
|
||||
static_cast<int>(chrome::RESULT_CODE_CHROME_LAST_CODE),
|
||||
"enum mismatch");
|
||||
|
||||
#if defined(OS_WIN)
|
||||
static_assert(static_cast<int>(CEF_RESULT_CODE_SANDBOX_FATAL_FIRST) ==
|
||||
static_cast<int>(sandbox::SBOX_FATAL_INTEGRITY),
|
||||
"enum mismatch");
|
||||
static_assert(static_cast<int>(CEF_RESULT_CODE_SANDBOX_FATAL_LAST) ==
|
||||
static_cast<int>(sandbox::SBOX_FATAL_LAST),
|
||||
"enum mismatch");
|
||||
#endif
|
||||
|
||||
cef_termination_status_t ts = TS_ABNORMAL_TERMINATION;
|
||||
if (status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED) {
|
||||
ts = TS_PROCESS_WAS_KILLED;
|
||||
@@ -373,14 +380,22 @@ void CefBrowserContentsDelegate::PrimaryMainFrameRenderProcessGone(
|
||||
ts = TS_PROCESS_CRASHED;
|
||||
} else if (status == base::TERMINATION_STATUS_OOM) {
|
||||
ts = TS_PROCESS_OOM;
|
||||
} else if (status == base::TERMINATION_STATUS_LAUNCH_FAILED) {
|
||||
ts = TS_LAUNCH_FAILED;
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
} else if (status == base::TERMINATION_STATUS_INTEGRITY_FAILURE) {
|
||||
ts = TS_INTEGRITY_FAILURE;
|
||||
#endif
|
||||
} else if (status != base::TERMINATION_STATUS_ABNORMAL_TERMINATION) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (auto c = client()) {
|
||||
if (auto handler = c->GetRequestHandler()) {
|
||||
int error_code = web_contents()->GetCrashedErrorCode();
|
||||
auto navigation_lock = browser_info_->CreateNavigationLock();
|
||||
handler->OnRenderProcessTerminated(browser(), ts);
|
||||
handler->OnRenderProcessTerminated(browser(), ts, error_code,
|
||||
SadTabView::ErrorToString(error_code));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -443,6 +458,8 @@ void CefBrowserContentsDelegate::DidStopLoading() {
|
||||
for (const auto& frame : browser_info_->GetAllFrames()) {
|
||||
frame->MaybeSendDidStopLoading();
|
||||
}
|
||||
|
||||
OnTitleChange(web_contents()->GetTitle());
|
||||
}
|
||||
|
||||
void CefBrowserContentsDelegate::DidFinishNavigation(
|
||||
@@ -532,8 +549,10 @@ void CefBrowserContentsDelegate::DidFinishLoad(
|
||||
frame->RefreshAttributes();
|
||||
|
||||
int http_status_code = 0;
|
||||
if (auto response_headers = render_frame_host->GetLastResponseHeaders()) {
|
||||
http_status_code = response_headers->response_code();
|
||||
if (auto response_head = render_frame_host->GetLastResponseHead()) {
|
||||
if (response_head->headers) {
|
||||
http_status_code = response_head->headers->response_code();
|
||||
}
|
||||
}
|
||||
|
||||
OnLoadEnd(frame, validated_url, http_status_code);
|
||||
@@ -591,17 +610,6 @@ void CefBrowserContentsDelegate::WebContentsDestroyed() {
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserContentsDelegate::Observe(
|
||||
int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
DCHECK_EQ(type, content::NOTIFICATION_LOAD_STOP);
|
||||
|
||||
if (type == content::NOTIFICATION_LOAD_STOP) {
|
||||
OnTitleChange(web_contents()->GetTitle());
|
||||
}
|
||||
}
|
||||
|
||||
bool CefBrowserContentsDelegate::OnSetFocus(cef_focus_source_t source) {
|
||||
// SetFocus() might be called while inside the OnSetFocus() callback. If
|
||||
// so, don't re-enter the callback.
|
||||
|
@@ -12,8 +12,6 @@
|
||||
|
||||
#include "base/callback_list.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "content/public/browser/notification_observer.h"
|
||||
#include "content/public/browser/notification_registrar.h"
|
||||
#include "content/public/browser/web_contents_delegate.h"
|
||||
#include "content/public/browser/web_contents_observer.h"
|
||||
|
||||
@@ -49,8 +47,7 @@ constexpr inline CefBrowserContentsState operator|(
|
||||
// Includes functionality that is shared by the alloy and chrome runtimes.
|
||||
// Only accessed on the UI thread.
|
||||
class CefBrowserContentsDelegate : public content::WebContentsDelegate,
|
||||
public content::WebContentsObserver,
|
||||
public content::NotificationObserver {
|
||||
public content::WebContentsObserver {
|
||||
public:
|
||||
using State = CefBrowserContentsState;
|
||||
|
||||
@@ -66,7 +63,7 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate,
|
||||
virtual void OnWebContentsDestroyed(content::WebContents* web_contents) = 0;
|
||||
|
||||
protected:
|
||||
~Observer() override {}
|
||||
~Observer() override = default;
|
||||
};
|
||||
|
||||
explicit CefBrowserContentsDelegate(
|
||||
@@ -143,11 +140,6 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate,
|
||||
void OnFocusChangedInPage(content::FocusedNodeDetails* details) override;
|
||||
void WebContentsDestroyed() override;
|
||||
|
||||
// NotificationObserver methods.
|
||||
void Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) override;
|
||||
|
||||
// Accessors for state information. Changes will be signaled to
|
||||
// Observer::OnStateChanged.
|
||||
bool is_loading() const { return is_loading_; }
|
||||
@@ -196,9 +188,6 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate,
|
||||
// Observers that want to be notified of changes to this object.
|
||||
base::ObserverList<Observer> observers_;
|
||||
|
||||
// Used for managing notification subscriptions.
|
||||
std::unique_ptr<content::NotificationRegistrar> registrar_;
|
||||
|
||||
// True if the focus is currently on an editable field on the page.
|
||||
bool focus_on_editable_field_ = false;
|
||||
};
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include "libcef/browser/browser_context.h"
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "libcef/browser/context.h"
|
||||
@@ -36,7 +37,7 @@ class ImplManager {
|
||||
public:
|
||||
using Vector = std::vector<CefBrowserContext*>;
|
||||
|
||||
ImplManager() {}
|
||||
ImplManager() = default;
|
||||
|
||||
ImplManager(const ImplManager&) = delete;
|
||||
ImplManager& operator=(const ImplManager&) = delete;
|
||||
@@ -157,7 +158,7 @@ CefBrowserContext::CookieableSchemes MakeSupportedSchemes(
|
||||
bool include_defaults) {
|
||||
if (schemes_list.empty() && include_defaults) {
|
||||
// No explicit registration of schemes.
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::vector<std::string> all_schemes;
|
||||
@@ -176,7 +177,7 @@ CefBrowserContext::CookieableSchemes MakeSupportedSchemes(
|
||||
all_schemes.push_back("wss");
|
||||
}
|
||||
|
||||
return absl::make_optional(all_schemes);
|
||||
return std::make_optional(all_schemes);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@@ -272,22 +273,7 @@ CefBrowserContext* CefBrowserContext::FromBrowserContext(
|
||||
|
||||
// static
|
||||
CefBrowserContext* CefBrowserContext::FromProfile(const Profile* profile) {
|
||||
auto* cef_context = FromBrowserContext(profile);
|
||||
if (cef_context) {
|
||||
return cef_context;
|
||||
}
|
||||
|
||||
if (cef::IsChromeRuntimeEnabled()) {
|
||||
auto* original_profile = profile->GetOriginalProfile();
|
||||
if (original_profile != profile) {
|
||||
// With the Chrome runtime if the user launches an incognito window via
|
||||
// the UI we might be associated with the original Profile instead of the
|
||||
// (current) incognito profile.
|
||||
return FromBrowserContext(original_profile);
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return FromBrowserContext(profile);
|
||||
}
|
||||
|
||||
// static
|
||||
@@ -423,11 +409,30 @@ network::mojom::NetworkContext* CefBrowserContext::GetNetworkContext() {
|
||||
CefMediaRouterManager* CefBrowserContext::GetMediaRouterManager() {
|
||||
CEF_REQUIRE_UIT();
|
||||
if (!media_router_manager_) {
|
||||
media_router_manager_.reset(new CefMediaRouterManager(AsBrowserContext()));
|
||||
media_router_manager_ =
|
||||
std::make_unique<CefMediaRouterManager>(AsBrowserContext());
|
||||
}
|
||||
return media_router_manager_.get();
|
||||
}
|
||||
|
||||
CefRefPtr<CefRequestContextImpl> CefBrowserContext::GetAnyRequestContext(
|
||||
bool prefer_no_handler) const {
|
||||
CEF_REQUIRE_UIT();
|
||||
if (request_context_set_.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (prefer_no_handler) {
|
||||
for (const auto& request_context : request_context_set_) {
|
||||
if (!request_context->GetHandler()) {
|
||||
return request_context;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return *request_context_set_.begin();
|
||||
}
|
||||
|
||||
CefBrowserContext::CookieableSchemes CefBrowserContext::GetCookieableSchemes()
|
||||
const {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#define CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_IMPL_H_
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
@@ -19,7 +20,6 @@
|
||||
#include "base/task/sequenced_task_runner_helpers.h"
|
||||
#include "chrome/common/plugin.mojom.h"
|
||||
#include "services/network/public/mojom/network_context.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
/*
|
||||
@@ -104,7 +104,7 @@ class CefBrowserContext {
|
||||
const content::GlobalRenderFrameHostId& global_id,
|
||||
bool require_frame_match);
|
||||
|
||||
// Returns the underlying CefBrowserContext if any.
|
||||
// Returns the underlying CefBrowserContext, if any.
|
||||
static CefBrowserContext* FromBrowserContext(
|
||||
const content::BrowserContext* context);
|
||||
static CefBrowserContext* FromProfile(const Profile* profile);
|
||||
@@ -179,7 +179,15 @@ class CefBrowserContext {
|
||||
|
||||
CefMediaRouterManager* GetMediaRouterManager();
|
||||
|
||||
using CookieableSchemes = absl::optional<std::vector<std::string>>;
|
||||
// Returns any CefRequestContext associated with this object, or nullptr if
|
||||
// none exist. If |prefer_no_handler| is true this method will try to return a
|
||||
// context without an associated CefRequestContextHandler. Use
|
||||
// CefRequestContextImpl::GetOrCreateForBrowserContext() instead of calling
|
||||
// this method directly.
|
||||
CefRefPtr<CefRequestContextImpl> GetAnyRequestContext(
|
||||
bool prefer_no_handler) const;
|
||||
|
||||
using CookieableSchemes = std::optional<std::vector<std::string>>;
|
||||
|
||||
// Returns the schemes associated with this context specifically, or the
|
||||
// global configuration if unset.
|
||||
|
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "base/feature_list.h"
|
||||
#include "chrome/browser/content_settings/cookie_settings_factory.h"
|
||||
#include "chrome/browser/first_party_sets/first_party_sets_policy_service_factory.h"
|
||||
#include "chrome/browser/media/router/chrome_media_router_factory.h"
|
||||
#include "chrome/browser/media/webrtc/media_device_salt_service_factory.h"
|
||||
#include "chrome/browser/plugins/plugin_prefs_factory.h"
|
||||
@@ -25,6 +26,7 @@ namespace cef {
|
||||
|
||||
void EnsureBrowserContextKeyedServiceFactoriesBuilt() {
|
||||
CookieSettingsFactory::GetInstance();
|
||||
first_party_sets::FirstPartySetsPolicyServiceFactory::GetInstance();
|
||||
MediaDeviceSaltServiceFactory::GetInstance();
|
||||
media_router::ChromeMediaRouterFactory::GetInstance();
|
||||
PluginPrefsFactory::GetInstance();
|
||||
|
@@ -63,7 +63,7 @@ void CefBrowserFrame::FrameAttached(
|
||||
}
|
||||
|
||||
void CefBrowserFrame::UpdateDraggableRegions(
|
||||
absl::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>> regions) {
|
||||
std::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>> regions) {
|
||||
if (auto host = GetFrameHost()) {
|
||||
host->UpdateDraggableRegions(std::move(regions));
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@ class CefBrowserFrame
|
||||
void FrameAttached(mojo::PendingRemote<cef::mojom::RenderFrame> render_frame,
|
||||
bool reattached) override;
|
||||
void UpdateDraggableRegions(
|
||||
absl::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>> regions)
|
||||
std::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>> regions)
|
||||
override;
|
||||
|
||||
// FrameServiceBase methods:
|
||||
|
@@ -9,6 +9,7 @@
|
||||
#include "libcef/browser/browser_info_manager.h"
|
||||
#include "libcef/browser/browser_platform_delegate.h"
|
||||
#include "libcef/browser/context.h"
|
||||
#include "libcef/browser/hang_monitor.h"
|
||||
#include "libcef/browser/image_impl.h"
|
||||
#include "libcef/browser/navigation_entry_impl.h"
|
||||
#include "libcef/browser/printing/print_util.h"
|
||||
@@ -31,6 +32,8 @@
|
||||
#include "content/public/browser/download_request_utils.h"
|
||||
#include "content/public/browser/file_select_listener.h"
|
||||
#include "content/public/browser/navigation_entry.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/render_widget_host.h"
|
||||
#include "ui/base/resource/resource_scale_factor.h"
|
||||
#include "ui/gfx/image/image_skia.h"
|
||||
#include "ui/shell_dialogs/select_file_policy.h"
|
||||
@@ -61,7 +64,7 @@ class WebContentsUserDataAdapter : public base::SupportsUserData::Data {
|
||||
}
|
||||
|
||||
private:
|
||||
WebContentsUserDataAdapter(CefRefPtr<CefBrowserHostBase> browser)
|
||||
explicit WebContentsUserDataAdapter(CefRefPtr<CefBrowserHostBase> browser)
|
||||
: browser_(browser) {
|
||||
auto web_contents = browser->GetWebContents();
|
||||
DCHECK(web_contents);
|
||||
@@ -148,6 +151,39 @@ CefRefPtr<CefBrowserHostBase> CefBrowserHostBase::GetBrowserForGlobalId(
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
CefRefPtr<CefBrowserHostBase> CefBrowserHostBase::GetBrowserForGlobalToken(
|
||||
const content::GlobalRenderFrameHostToken& global_token) {
|
||||
if (!frame_util::IsValidGlobalToken(global_token)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (CEF_CURRENTLY_ON_UIT()) {
|
||||
// Use the non-thread-safe but potentially faster approach.
|
||||
content::RenderFrameHost* render_frame_host =
|
||||
content::RenderFrameHost::FromFrameToken(global_token);
|
||||
if (!render_frame_host) {
|
||||
return nullptr;
|
||||
}
|
||||
return GetBrowserForHost(render_frame_host);
|
||||
} else {
|
||||
// Use the thread-safe approach.
|
||||
bool is_guest_view = false;
|
||||
auto info = CefBrowserInfoManager::GetInstance()->GetBrowserInfo(
|
||||
global_token, &is_guest_view);
|
||||
if (info && !is_guest_view) {
|
||||
auto browser = info->browser();
|
||||
if (!browser) {
|
||||
LOG(WARNING) << "Found browser id " << info->browser_id()
|
||||
<< " but no browser object matching frame "
|
||||
<< frame_util::GetFrameDebugString(global_token);
|
||||
}
|
||||
return browser;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
CefRefPtr<CefBrowserHostBase>
|
||||
CefBrowserHostBase::GetBrowserForTopLevelNativeWindow(
|
||||
@@ -223,6 +259,11 @@ void CefBrowserHostBase::DestroyBrowser() {
|
||||
contents_delegate_->RemoveObserver(this);
|
||||
contents_delegate_->ObserveWebContents(nullptr);
|
||||
|
||||
if (unresponsive_process_callback_) {
|
||||
hang_monitor::Detach(unresponsive_process_callback_);
|
||||
unresponsive_process_callback_.reset();
|
||||
}
|
||||
|
||||
CefBrowserInfoManager::GetInstance()->RemoveBrowserInfo(browser_info_);
|
||||
browser_info_->SetBrowser(nullptr);
|
||||
}
|
||||
@@ -674,6 +715,22 @@ void CefBrowserHostBase::ExitFullscreen(bool will_cause_resize) {
|
||||
}
|
||||
}
|
||||
|
||||
bool CefBrowserHostBase::IsRenderProcessUnresponsive() {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
DCHECK(false) << "called on invalid thread";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (auto* web_contents = GetWebContents()) {
|
||||
if (auto* rvh = web_contents->GetRenderViewHost()) {
|
||||
if (auto* rwh = rvh->GetWidget()) {
|
||||
return rwh->IsCurrentlyUnresponsive();
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void CefBrowserHostBase::ReplaceMisspelling(const CefString& word) {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
CEF_POST_TASK(
|
||||
@@ -905,32 +962,32 @@ bool CefBrowserHostBase::IsPopup() {
|
||||
}
|
||||
|
||||
CefRefPtr<CefFrame> CefBrowserHostBase::GetMainFrame() {
|
||||
return GetFrame(CefFrameHostImpl::kMainFrameId);
|
||||
return browser_info_->GetMainFrame();
|
||||
}
|
||||
|
||||
CefRefPtr<CefFrame> CefBrowserHostBase::GetFocusedFrame() {
|
||||
return GetFrame(CefFrameHostImpl::kFocusedFrameId);
|
||||
}
|
||||
|
||||
CefRefPtr<CefFrame> CefBrowserHostBase::GetFrame(int64_t identifier) {
|
||||
if (identifier == CefFrameHostImpl::kInvalidFrameId) {
|
||||
return nullptr;
|
||||
} else if (identifier == CefFrameHostImpl::kMainFrameId) {
|
||||
return browser_info_->GetMainFrame();
|
||||
} else if (identifier == CefFrameHostImpl::kFocusedFrameId) {
|
||||
{
|
||||
base::AutoLock lock_scope(state_lock_);
|
||||
if (!focused_frame_) {
|
||||
// The main frame is focused by default.
|
||||
return browser_info_->GetMainFrame();
|
||||
if (focused_frame_) {
|
||||
return focused_frame_;
|
||||
}
|
||||
return focused_frame_;
|
||||
}
|
||||
|
||||
return browser_info_->GetFrameForGlobalId(
|
||||
frame_util::MakeGlobalId(identifier));
|
||||
// The main frame is focused by default.
|
||||
return browser_info_->GetMainFrame();
|
||||
}
|
||||
|
||||
CefRefPtr<CefFrame> CefBrowserHostBase::GetFrame(const CefString& name) {
|
||||
CefRefPtr<CefFrame> CefBrowserHostBase::GetFrameByIdentifier(
|
||||
const CefString& identifier) {
|
||||
const auto& global_token = frame_util::ParseFrameIdentifier(identifier);
|
||||
if (!global_token) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return browser_info_->GetFrameForGlobalToken(*global_token);
|
||||
}
|
||||
|
||||
CefRefPtr<CefFrame> CefBrowserHostBase::GetFrameByName(const CefString& name) {
|
||||
for (const auto& frame : browser_info_->GetAllFrames()) {
|
||||
if (frame->GetName() == name) {
|
||||
return frame;
|
||||
@@ -944,7 +1001,7 @@ size_t CefBrowserHostBase::GetFrameCount() {
|
||||
}
|
||||
|
||||
void CefBrowserHostBase::GetFrameIdentifiers(
|
||||
std::vector<int64_t>& identifiers) {
|
||||
std::vector<CefString>& identifiers) {
|
||||
if (identifiers.size() > 0) {
|
||||
identifiers.clear();
|
||||
}
|
||||
@@ -976,6 +1033,20 @@ void CefBrowserHostBase::GetFrameNames(std::vector<CefString>& names) {
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserHostBase::SetAccessibilityState(
|
||||
cef_state_t accessibility_state) {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::BindOnce(&CefBrowserHostBase::SetAccessibilityState,
|
||||
this, accessibility_state));
|
||||
return;
|
||||
}
|
||||
|
||||
if (platform_delegate_) {
|
||||
platform_delegate_->SetAccessibilityState(accessibility_state);
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserHostBase::OnStateChanged(CefBrowserContentsState state_changed) {
|
||||
// Make sure that CefBrowser state is consistent before the associated
|
||||
// CefClient callback is executed.
|
||||
@@ -1018,6 +1089,11 @@ CefRefPtr<CefFrame> CefBrowserHostBase::GetFrameForGlobalId(
|
||||
return browser_info_->GetFrameForGlobalId(global_id, nullptr);
|
||||
}
|
||||
|
||||
CefRefPtr<CefFrame> CefBrowserHostBase::GetFrameForGlobalToken(
|
||||
const content::GlobalRenderFrameHostToken& global_token) {
|
||||
return browser_info_->GetFrameForGlobalToken(global_token, nullptr);
|
||||
}
|
||||
|
||||
void CefBrowserHostBase::AddObserver(Observer* observer) {
|
||||
CEF_REQUIRE_UIT();
|
||||
observers_.AddObserver(observer);
|
||||
|
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "include/cef_browser.h"
|
||||
#include "include/cef_client.h"
|
||||
#include "include/cef_unresponsive_process_callback.h"
|
||||
#include "include/views/cef_browser_view.h"
|
||||
#include "libcef/browser/browser_contents_delegate.h"
|
||||
#include "libcef/browser/browser_info.h"
|
||||
@@ -28,7 +29,7 @@ class Extension;
|
||||
|
||||
// Parameters that are passed to the runtime-specific Create methods.
|
||||
struct CefBrowserCreateParams {
|
||||
CefBrowserCreateParams() {}
|
||||
CefBrowserCreateParams() = default;
|
||||
|
||||
// Copy constructor used with the chrome runtime only.
|
||||
CefBrowserCreateParams(const CefBrowserCreateParams& that) {
|
||||
@@ -127,7 +128,7 @@ class CefBrowserHostBase : public CefBrowserHost,
|
||||
virtual void OnBrowserDestroyed(CefBrowserHostBase* browser) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~Observer() {}
|
||||
~Observer() override = default;
|
||||
};
|
||||
|
||||
// Create a new CefBrowserHost instance of the current runtime type with
|
||||
@@ -147,6 +148,9 @@ class CefBrowserHostBase : public CefBrowserHost,
|
||||
// Returns the browser associated with the specified global ID.
|
||||
static CefRefPtr<CefBrowserHostBase> GetBrowserForGlobalId(
|
||||
const content::GlobalRenderFrameHostId& global_id);
|
||||
// Returns the browser associated with the specified global token.
|
||||
static CefRefPtr<CefBrowserHostBase> GetBrowserForGlobalToken(
|
||||
const content::GlobalRenderFrameHostToken& global_token);
|
||||
// Returns the browser associated with the specified top-level window.
|
||||
static CefRefPtr<CefBrowserHostBase> GetBrowserForTopLevelNativeWindow(
|
||||
gfx::NativeWindow owning_window);
|
||||
@@ -235,6 +239,7 @@ class CefBrowserHostBase : public CefBrowserHost,
|
||||
void NotifyMoveOrResizeStarted() override;
|
||||
bool IsFullscreen() override;
|
||||
void ExitFullscreen(bool will_cause_resize) override;
|
||||
bool IsRenderProcessUnresponsive() override;
|
||||
|
||||
// CefBrowser methods:
|
||||
bool IsValid() override;
|
||||
@@ -253,11 +258,13 @@ class CefBrowserHostBase : public CefBrowserHost,
|
||||
bool IsPopup() override;
|
||||
CefRefPtr<CefFrame> GetMainFrame() override;
|
||||
CefRefPtr<CefFrame> GetFocusedFrame() override;
|
||||
CefRefPtr<CefFrame> GetFrame(int64_t identifier) override;
|
||||
CefRefPtr<CefFrame> GetFrame(const CefString& name) override;
|
||||
CefRefPtr<CefFrame> GetFrameByIdentifier(
|
||||
const CefString& identifier) override;
|
||||
CefRefPtr<CefFrame> GetFrameByName(const CefString& name) override;
|
||||
size_t GetFrameCount() override;
|
||||
void GetFrameIdentifiers(std::vector<int64_t>& identifiers) override;
|
||||
void GetFrameIdentifiers(std::vector<CefString>& identifiers) override;
|
||||
void GetFrameNames(std::vector<CefString>& names) override;
|
||||
void SetAccessibilityState(cef_state_t accessibility_state) override;
|
||||
|
||||
// CefBrowserContentsDelegate::Observer methods:
|
||||
void OnStateChanged(CefBrowserContentsState state_changed) override;
|
||||
@@ -266,11 +273,13 @@ class CefBrowserHostBase : public CefBrowserHost,
|
||||
// Returns the frame associated with the specified RenderFrameHost.
|
||||
CefRefPtr<CefFrame> GetFrameForHost(const content::RenderFrameHost* host);
|
||||
|
||||
// Returns the frame associated with the specified global ID. See
|
||||
// documentation on RenderFrameHost::GetFrameTreeNodeId() for why the global
|
||||
// ID is preferred.
|
||||
// Returns the frame associated with the specified global ID/token. See
|
||||
// documentation on RenderFrameHost::GetFrameTreeNodeId/Token() for why the
|
||||
// global ID/token is preferred.
|
||||
CefRefPtr<CefFrame> GetFrameForGlobalId(
|
||||
const content::GlobalRenderFrameHostId& global_id);
|
||||
CefRefPtr<CefFrame> GetFrameForGlobalToken(
|
||||
const content::GlobalRenderFrameHostToken& global_token);
|
||||
|
||||
// Manage observer objects. The observer must either outlive this object or
|
||||
// be removed before destruction. Must be called on the UI thread.
|
||||
@@ -334,6 +343,15 @@ class CefBrowserHostBase : public CefBrowserHost,
|
||||
}
|
||||
CefMediaStreamRegistrar* GetMediaStreamRegistrar();
|
||||
|
||||
CefRefPtr<CefUnresponsiveProcessCallback> unresponsive_process_callback()
|
||||
const {
|
||||
return unresponsive_process_callback_;
|
||||
}
|
||||
void set_unresponsive_process_callback(
|
||||
CefRefPtr<CefUnresponsiveProcessCallback> callback) {
|
||||
unresponsive_process_callback_ = callback;
|
||||
}
|
||||
|
||||
// Returns the Widget owner for the browser window. Only used with windowed
|
||||
// browsers.
|
||||
views::Widget* GetWindowWidget() const;
|
||||
@@ -384,6 +402,7 @@ class CefBrowserHostBase : public CefBrowserHost,
|
||||
|
||||
// Only accessed on the UI thread.
|
||||
std::unique_ptr<CefBrowserContentsDelegate> contents_delegate_;
|
||||
CefRefPtr<CefUnresponsiveProcessCallback> unresponsive_process_callback_;
|
||||
|
||||
// Observers that want to be notified of changes to this object.
|
||||
// Only accessed on the UI thread.
|
||||
|
@@ -4,6 +4,8 @@
|
||||
|
||||
#include "libcef/browser/browser_info.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "libcef/browser/browser_host_base.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
#include "libcef/common/frame_util.h"
|
||||
@@ -19,7 +21,7 @@ CefBrowserInfo::FrameInfo::~FrameInfo() {
|
||||
#if DCHECK_IS_ON()
|
||||
if (frame_ && !IsCurrentMainFrame()) {
|
||||
// Should already be Detached.
|
||||
DCHECK(!frame_->GetRenderFrameHost());
|
||||
DCHECK(frame_->IsDetached());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -152,8 +154,7 @@ void CefBrowserInfo::MaybeCreateFrame(content::RenderFrameHost* host,
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
// Check that the frame info hasn't changed unexpectedly.
|
||||
DCHECK_EQ(frame_util::MakeFrameId(global_id),
|
||||
frame_info->frame_->GetIdentifier());
|
||||
DCHECK(host->GetGlobalFrameToken() == *frame_info->frame_->frame_token());
|
||||
DCHECK_EQ(frame_info->is_main_frame_, frame_info->frame_->IsMain());
|
||||
#endif
|
||||
}
|
||||
@@ -163,6 +164,8 @@ void CefBrowserInfo::MaybeCreateFrame(content::RenderFrameHost* host,
|
||||
|
||||
// Populate the lookup maps.
|
||||
frame_id_map_.insert(std::make_pair(global_id, frame_info));
|
||||
frame_token_to_id_map_.insert(
|
||||
std::make_pair(host->GetGlobalFrameToken(), global_id));
|
||||
|
||||
// And finally set the ownership.
|
||||
frame_info_set_.insert(base::WrapUnique(frame_info));
|
||||
@@ -230,6 +233,12 @@ void CefBrowserInfo::RemoveFrame(content::RenderFrameHost* host) {
|
||||
// Remove from the lookup maps.
|
||||
frame_id_map_.erase(it);
|
||||
|
||||
{
|
||||
auto it2 = frame_token_to_id_map_.find(host->GetGlobalFrameToken());
|
||||
DCHECK(it2 != frame_token_to_id_map_.end());
|
||||
frame_token_to_id_map_.erase(it2);
|
||||
}
|
||||
|
||||
// And finally delete the frame info.
|
||||
{
|
||||
auto it2 = frame_info_set_.find(frame_info);
|
||||
@@ -265,7 +274,7 @@ CefRefPtr<CefFrameHostImpl> CefBrowserInfo::CreateTempSubFrame(
|
||||
parent = GetMainFrame();
|
||||
}
|
||||
// Intentionally not notifying for temporary frames.
|
||||
return new CefFrameHostImpl(this, parent->GetIdentifier());
|
||||
return new CefFrameHostImpl(this, parent->frame_token());
|
||||
}
|
||||
|
||||
CefRefPtr<CefFrameHostImpl> CefBrowserInfo::GetFrameForHost(
|
||||
@@ -327,6 +336,32 @@ CefRefPtr<CefFrameHostImpl> CefBrowserInfo::GetFrameForGlobalId(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CefRefPtr<CefFrameHostImpl> CefBrowserInfo::GetFrameForGlobalToken(
|
||||
const content::GlobalRenderFrameHostToken& global_token,
|
||||
bool* is_guest_view,
|
||||
bool prefer_speculative) const {
|
||||
if (is_guest_view) {
|
||||
*is_guest_view = false;
|
||||
}
|
||||
|
||||
if (!frame_util::IsValidGlobalToken(global_token)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
content::GlobalRenderFrameHostId global_id;
|
||||
|
||||
{
|
||||
base::AutoLock lock_scope(lock_);
|
||||
const auto it = frame_token_to_id_map_.find(global_token);
|
||||
if (it == frame_token_to_id_map_.end()) {
|
||||
return nullptr;
|
||||
}
|
||||
global_id = it->second;
|
||||
}
|
||||
|
||||
return GetFrameForGlobalId(global_id, is_guest_view, prefer_speculative);
|
||||
}
|
||||
|
||||
CefBrowserInfo::FrameHostList CefBrowserInfo::GetAllFrames() const {
|
||||
base::AutoLock lock_scope(lock_);
|
||||
FrameHostList frames;
|
||||
@@ -508,6 +543,7 @@ void CefBrowserInfo::RemoveAllFrames(
|
||||
|
||||
// Clear the lookup maps.
|
||||
frame_id_map_.clear();
|
||||
frame_token_to_id_map_.clear();
|
||||
|
||||
// Explicitly Detach everything but the current main frame.
|
||||
for (auto& info : frame_info_set_) {
|
||||
@@ -542,7 +578,8 @@ CefBrowserInfo::NotificationStateLock::NotificationStateLock(
|
||||
}
|
||||
|
||||
// Take the browser info state lock.
|
||||
browser_info_lock_scope_.reset(new base::AutoLock(browser_info_->lock_));
|
||||
browser_info_lock_scope_ =
|
||||
std::make_unique<base::AutoLock>(browser_info_->lock_);
|
||||
}
|
||||
|
||||
CefBrowserInfo::NotificationStateLock::~NotificationStateLock() {
|
||||
|
@@ -109,15 +109,19 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
|
||||
bool* is_guest_view = nullptr,
|
||||
bool prefer_speculative = false) const;
|
||||
|
||||
// Returns the frame object matching the specified ID or nullptr if no match
|
||||
// is found. Nullptr will also be returned if a guest view match is found
|
||||
// because we don't create frame objects for guest views. If |is_guest_view|
|
||||
// is non-nullptr it will be set to true in this case. Safe to call from any
|
||||
// thread.
|
||||
// Returns the frame object matching the specified ID/token or nullptr if no
|
||||
// match is found. Nullptr will also be returned if a guest view match is
|
||||
// found because we don't create frame objects for guest views. If
|
||||
// |is_guest_view| is non-nullptr it will be set to true in this case. Safe to
|
||||
// call from any thread.
|
||||
CefRefPtr<CefFrameHostImpl> GetFrameForGlobalId(
|
||||
const content::GlobalRenderFrameHostId& global_id,
|
||||
bool* is_guest_view = nullptr,
|
||||
bool prefer_speculative = false) const;
|
||||
CefRefPtr<CefFrameHostImpl> GetFrameForGlobalToken(
|
||||
const content::GlobalRenderFrameHostToken& global_token,
|
||||
bool* is_guest_view = nullptr,
|
||||
bool prefer_speculative = false) const;
|
||||
|
||||
// Returns all non-speculative frame objects that currently exist. Guest views
|
||||
// will be excluded because they don't have a frame object. Safe to call from
|
||||
@@ -130,7 +134,9 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
|
||||
friend class CefBrowserInfo;
|
||||
friend class base::RefCounted<NavigationLock>;
|
||||
|
||||
// All usage is via friend declaration. NOLINTNEXTLINE
|
||||
NavigationLock();
|
||||
// All usage is via friend declaration. NOLINTNEXTLINE
|
||||
~NavigationLock();
|
||||
|
||||
base::OnceClosure pending_action_;
|
||||
@@ -246,6 +252,11 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
|
||||
content::GlobalRenderFrameHostIdHasher>;
|
||||
FrameIDMap frame_id_map_;
|
||||
|
||||
// Map of global token to global ID.
|
||||
using FrameTokenToIdMap = std::map<content::GlobalRenderFrameHostToken,
|
||||
content::GlobalRenderFrameHostId>;
|
||||
FrameTokenToIdMap frame_token_to_id_map_;
|
||||
|
||||
// The current main frame.
|
||||
CefRefPtr<CefFrameHostImpl> main_frame_;
|
||||
|
||||
|
@@ -89,7 +89,8 @@ scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::CreatePopupBrowserInfo(
|
||||
browser_info_list_.push_back(browser_info);
|
||||
|
||||
// Continue any pending NewBrowserInfo request.
|
||||
auto it = pending_new_browser_info_map_.find(frame_host->GetGlobalId());
|
||||
auto it =
|
||||
pending_new_browser_info_map_.find(frame_host->GetGlobalFrameToken());
|
||||
if (it != pending_new_browser_info_map_.end()) {
|
||||
SendNewBrowserInfoResponse(browser_info, /*is_guest_view=*/false,
|
||||
std::move(it->second->callback),
|
||||
@@ -289,9 +290,9 @@ bool CefBrowserInfoManager::AddWebContents(content::WebContents* new_contents) {
|
||||
}
|
||||
|
||||
void CefBrowserInfoManager::OnGetNewBrowserInfo(
|
||||
const content::GlobalRenderFrameHostId& global_id,
|
||||
const content::GlobalRenderFrameHostToken& global_token,
|
||||
cef::mojom::BrowserManager::GetNewBrowserInfoCallback callback) {
|
||||
DCHECK(frame_util::IsValidGlobalId(global_id));
|
||||
DCHECK(frame_util::IsValidGlobalToken(global_token));
|
||||
DCHECK(callback);
|
||||
|
||||
auto callback_runner = base::SequencedTaskRunner::GetCurrentDefault();
|
||||
@@ -301,7 +302,7 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo(
|
||||
bool is_guest_view = false;
|
||||
|
||||
scoped_refptr<CefBrowserInfo> browser_info =
|
||||
GetBrowserInfoInternal(global_id, &is_guest_view);
|
||||
GetBrowserInfoInternal(global_token, &is_guest_view);
|
||||
|
||||
if (browser_info) {
|
||||
// Send the response immediately.
|
||||
@@ -311,19 +312,19 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo(
|
||||
}
|
||||
|
||||
// Verify that no request for the same route is currently queued.
|
||||
DCHECK(pending_new_browser_info_map_.find(global_id) ==
|
||||
DCHECK(pending_new_browser_info_map_.find(global_token) ==
|
||||
pending_new_browser_info_map_.end());
|
||||
|
||||
const int timeout_id = ++next_timeout_id_;
|
||||
|
||||
// Queue the request.
|
||||
std::unique_ptr<PendingNewBrowserInfo> pending(new PendingNewBrowserInfo());
|
||||
pending->global_id = global_id;
|
||||
pending->global_token = global_token;
|
||||
pending->timeout_id = timeout_id;
|
||||
pending->callback = std::move(callback);
|
||||
pending->callback_runner = callback_runner;
|
||||
pending_new_browser_info_map_.insert(
|
||||
std::make_pair(global_id, std::move(pending)));
|
||||
std::make_pair(global_token, std::move(pending)));
|
||||
|
||||
// Register a timeout for the pending response so that the renderer process
|
||||
// doesn't hang forever. With the Chrome runtime, timeouts may occur in cases
|
||||
@@ -334,7 +335,7 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo(
|
||||
CEF_POST_DELAYED_TASK(
|
||||
CEF_UIT,
|
||||
base::BindOnce(&CefBrowserInfoManager::TimeoutNewBrowserInfoResponse,
|
||||
global_id, timeout_id),
|
||||
global_token, timeout_id),
|
||||
kNewBrowserInfoResponseTimeoutMs);
|
||||
}
|
||||
}
|
||||
@@ -391,6 +392,13 @@ scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::GetBrowserInfo(
|
||||
return GetBrowserInfoInternal(global_id, is_guest_view);
|
||||
}
|
||||
|
||||
scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::GetBrowserInfo(
|
||||
const content::GlobalRenderFrameHostToken& global_token,
|
||||
bool* is_guest_view) {
|
||||
base::AutoLock lock_scope(browser_info_lock_);
|
||||
return GetBrowserInfoInternal(global_token, is_guest_view);
|
||||
}
|
||||
|
||||
bool CefBrowserInfoManager::MaybeAllowNavigation(
|
||||
content::RenderFrameHost* opener,
|
||||
const content::OpenURLParams& params,
|
||||
@@ -451,7 +459,7 @@ void CefBrowserInfoManager::RenderProcessHostDestroyed(
|
||||
pending_new_browser_info_map_.begin();
|
||||
while (it != pending_new_browser_info_map_.end()) {
|
||||
const auto& info = it->second;
|
||||
if (info->global_id.child_id == render_process_id) {
|
||||
if (info->global_token.child_id == render_process_id) {
|
||||
CancelNewBrowserInfoResponse(info.get());
|
||||
it = pending_new_browser_info_map_.erase(it);
|
||||
} else {
|
||||
@@ -553,6 +561,34 @@ scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::GetBrowserInfoInternal(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::GetBrowserInfoInternal(
|
||||
const content::GlobalRenderFrameHostToken& global_token,
|
||||
bool* is_guest_view) {
|
||||
browser_info_lock_.AssertAcquired();
|
||||
|
||||
if (is_guest_view) {
|
||||
*is_guest_view = false;
|
||||
}
|
||||
|
||||
if (!frame_util::IsValidGlobalToken(global_token)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (const auto& browser_info : browser_info_list_) {
|
||||
bool is_guest_view_tmp;
|
||||
auto frame =
|
||||
browser_info->GetFrameForGlobalToken(global_token, &is_guest_view_tmp);
|
||||
if (frame || is_guest_view_tmp) {
|
||||
if (is_guest_view) {
|
||||
*is_guest_view = is_guest_view_tmp;
|
||||
}
|
||||
return browser_info;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// static
|
||||
void CefBrowserInfoManager::SendNewBrowserInfoResponse(
|
||||
scoped_refptr<CefBrowserInfo> browser_info,
|
||||
@@ -601,7 +637,7 @@ void CefBrowserInfoManager::CancelNewBrowserInfoResponse(
|
||||
|
||||
// static
|
||||
void CefBrowserInfoManager::TimeoutNewBrowserInfoResponse(
|
||||
const content::GlobalRenderFrameHostId& global_id,
|
||||
const content::GlobalRenderFrameHostToken& global_token,
|
||||
int timeout_id) {
|
||||
CEF_REQUIRE_UIT();
|
||||
if (!g_info_manager) {
|
||||
@@ -611,7 +647,7 @@ void CefBrowserInfoManager::TimeoutNewBrowserInfoResponse(
|
||||
base::AutoLock lock_scope(g_info_manager->browser_info_lock_);
|
||||
|
||||
// Continue the NewBrowserInfo request if it's still pending.
|
||||
auto it = g_info_manager->pending_new_browser_info_map_.find(global_id);
|
||||
auto it = g_info_manager->pending_new_browser_info_map_.find(global_token);
|
||||
if (it != g_info_manager->pending_new_browser_info_map_.end()) {
|
||||
const auto& pending_info = it->second;
|
||||
// Don't accidentally timeout a new request for the same frame.
|
||||
@@ -622,12 +658,12 @@ void CefBrowserInfoManager::TimeoutNewBrowserInfoResponse(
|
||||
#if DCHECK_IS_ON()
|
||||
// This method should never be called for a PDF renderer.
|
||||
content::RenderProcessHost* process =
|
||||
content::RenderProcessHost::FromID(global_id.child_id);
|
||||
content::RenderProcessHost::FromID(global_token.child_id);
|
||||
DCHECK(!process || !process->IsPdf());
|
||||
#endif
|
||||
|
||||
LOG(ERROR) << "Timeout of new browser info response for frame "
|
||||
<< frame_util::GetFrameDebugString(global_id);
|
||||
<< frame_util::GetFrameDebugString(global_token);
|
||||
|
||||
CancelNewBrowserInfoResponse(pending_info.get());
|
||||
g_info_manager->pending_new_browser_info_map_.erase(it);
|
||||
|
@@ -112,7 +112,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
// already exist for traditional popup browsers depending on timing. See
|
||||
// comments on PendingPopup for more information.
|
||||
void OnGetNewBrowserInfo(
|
||||
const content::GlobalRenderFrameHostId& global_id,
|
||||
const content::GlobalRenderFrameHostToken& global_token,
|
||||
cef::mojom::BrowserManager::GetNewBrowserInfoCallback callback);
|
||||
|
||||
// Called from CefBrowserHostBase::DestroyBrowser() when a browser is
|
||||
@@ -122,15 +122,18 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
// Called from CefContext::FinishShutdownOnUIThread() to destroy all browsers.
|
||||
void DestroyAllBrowsers();
|
||||
|
||||
// Returns the CefBrowserInfo matching the specified ID or nullptr if no
|
||||
// Returns the CefBrowserInfo matching the specified ID/token or nullptr if no
|
||||
// match is found. It is allowed to add new callers of this method but
|
||||
// consider using CefBrowserHostBase::GetBrowserForGlobalId() or
|
||||
// consider using CefBrowserHostBase::GetBrowserForGlobalId/Token() or
|
||||
// extensions::GetOwnerBrowserForGlobalId() instead. If |is_guest_view| is
|
||||
// non-nullptr it will be set to true if the ID matches a guest view
|
||||
// non-nullptr it will be set to true if the ID/token matches a guest view
|
||||
// associated with the returned browser info instead of the browser itself.
|
||||
scoped_refptr<CefBrowserInfo> GetBrowserInfo(
|
||||
const content::GlobalRenderFrameHostId& global_id,
|
||||
bool* is_guest_view = nullptr);
|
||||
scoped_refptr<CefBrowserInfo> GetBrowserInfo(
|
||||
const content::GlobalRenderFrameHostToken& global_token,
|
||||
bool* is_guest_view = nullptr);
|
||||
|
||||
// Returns all existing CefBrowserInfo objects.
|
||||
using BrowserInfoList = std::list<scoped_refptr<CefBrowserInfo>>;
|
||||
@@ -213,10 +216,13 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
PendingPopup::Step previous_step,
|
||||
content::WebContents* new_contents);
|
||||
|
||||
// Retrieves the BrowserInfo matching the specified ID.
|
||||
// Retrieves the BrowserInfo matching the specified ID/token.
|
||||
scoped_refptr<CefBrowserInfo> GetBrowserInfoInternal(
|
||||
const content::GlobalRenderFrameHostId& global_id,
|
||||
bool* is_guest_view);
|
||||
scoped_refptr<CefBrowserInfo> GetBrowserInfoInternal(
|
||||
const content::GlobalRenderFrameHostToken& global_token,
|
||||
bool* is_guest_view);
|
||||
|
||||
// Send the response for a pending OnGetNewBrowserInfo request.
|
||||
static void SendNewBrowserInfoResponse(
|
||||
@@ -227,7 +233,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
|
||||
// Pending request for OnGetNewBrowserInfo.
|
||||
struct PendingNewBrowserInfo {
|
||||
content::GlobalRenderFrameHostId global_id;
|
||||
content::GlobalRenderFrameHostToken global_token;
|
||||
int timeout_id;
|
||||
cef::mojom::BrowserManager::GetNewBrowserInfoCallback callback;
|
||||
scoped_refptr<base::SequencedTaskRunner> callback_runner;
|
||||
@@ -238,7 +244,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
|
||||
// Time out a response if it's still pending.
|
||||
static void TimeoutNewBrowserInfoResponse(
|
||||
const content::GlobalRenderFrameHostId& global_id,
|
||||
const content::GlobalRenderFrameHostToken& global_token,
|
||||
int timeout_id);
|
||||
|
||||
mutable base::Lock browser_info_lock_;
|
||||
@@ -252,7 +258,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
// identify a RFH for its complete lifespan. See documentation on
|
||||
// RenderFrameHost::GetFrameTreeNodeId() for background.
|
||||
using PendingNewBrowserInfoMap =
|
||||
std::map<content::GlobalRenderFrameHostId,
|
||||
std::map<content::GlobalRenderFrameHostToken,
|
||||
std::unique_ptr<PendingNewBrowserInfo>>;
|
||||
PendingNewBrowserInfoMap pending_new_browser_info_map_;
|
||||
|
||||
|
@@ -50,9 +50,10 @@ void CefBrowserManager::GetNewRenderThreadInfo(
|
||||
}
|
||||
|
||||
void CefBrowserManager::GetNewBrowserInfo(
|
||||
int32_t render_frame_routing_id,
|
||||
const blink::LocalFrameToken& render_frame_token,
|
||||
cef::mojom::BrowserManager::GetNewBrowserInfoCallback callback) {
|
||||
CefBrowserInfoManager::GetInstance()->OnGetNewBrowserInfo(
|
||||
frame_util::MakeGlobalId(render_process_id_, render_frame_routing_id),
|
||||
content::GlobalRenderFrameHostToken(render_process_id_,
|
||||
render_frame_token),
|
||||
std::move(callback));
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ class CefBrowserManager : public cef::mojom::BrowserManager {
|
||||
cef::mojom::BrowserManager::GetNewRenderThreadInfoCallback callback)
|
||||
override;
|
||||
void GetNewBrowserInfo(
|
||||
int32_t render_frame_routing_id,
|
||||
const blink::LocalFrameToken& render_frame_token,
|
||||
cef::mojom::BrowserManager::GetNewBrowserInfoCallback callback) override;
|
||||
|
||||
// The process ID of the renderer.
|
||||
|
@@ -10,6 +10,7 @@
|
||||
#include "base/logging.h"
|
||||
#include "chrome/browser/platform_util.h"
|
||||
#include "chrome/browser/shell_integration.h"
|
||||
#include "content/browser/web_contents/web_contents_impl.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/render_widget_host.h"
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
@@ -264,9 +265,6 @@ std::unique_ptr<CefMenuRunner> CefBrowserPlatformDelegate::CreateMenuRunner() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegate::UpdateFindBarBoundingBox(
|
||||
gfx::Rect* bounds) const {}
|
||||
|
||||
bool CefBrowserPlatformDelegate::IsWindowless() const {
|
||||
return false;
|
||||
}
|
||||
@@ -412,7 +410,27 @@ void CefBrowserPlatformDelegate::SetAutoResizeEnabled(bool enabled,
|
||||
|
||||
void CefBrowserPlatformDelegate::SetAccessibilityState(
|
||||
cef_state_t accessibility_state) {
|
||||
NOTIMPLEMENTED();
|
||||
// Do nothing if state is set to default. It'll be disabled by default and
|
||||
// controlled by the command-line flags "force-renderer-accessibility" and
|
||||
// "disable-renderer-accessibility".
|
||||
if (accessibility_state == STATE_DEFAULT) {
|
||||
return;
|
||||
}
|
||||
|
||||
content::WebContentsImpl* web_contents_impl =
|
||||
static_cast<content::WebContentsImpl*>(web_contents_);
|
||||
|
||||
if (!web_contents_impl) {
|
||||
return;
|
||||
}
|
||||
|
||||
ui::AXMode accMode;
|
||||
// In windowless mode set accessibility to TreeOnly mode. Else native
|
||||
// accessibility APIs, specific to each platform, are also created.
|
||||
if (accessibility_state == STATE_ENABLED) {
|
||||
accMode = IsWindowless() ? ui::kAXModeWebContentsOnly : ui::kAXModeComplete;
|
||||
}
|
||||
web_contents_impl->SetAccessibilityMode(accMode);
|
||||
}
|
||||
|
||||
bool CefBrowserPlatformDelegate::IsPrintPreviewSupported() const {
|
||||
|
@@ -286,9 +286,6 @@ class CefBrowserPlatformDelegate {
|
||||
// Create the platform-specific menu runner.
|
||||
virtual std::unique_ptr<CefMenuRunner> CreateMenuRunner();
|
||||
|
||||
// Optionally modify the bounding box for the Chrome Find bar.
|
||||
virtual void UpdateFindBarBoundingBox(gfx::Rect* bounds) const;
|
||||
|
||||
// Returns true if this delegate implements windowless rendering. May be
|
||||
// called on multiple threads.
|
||||
virtual bool IsWindowless() const;
|
||||
|
@@ -59,10 +59,10 @@ std::unique_ptr<CefBrowserPlatformDelegateOsr> CreateOSRDelegate(
|
||||
std::move(native_delegate), use_shared_texture, use_external_begin_frame);
|
||||
#elif BUILDFLAG(IS_MAC)
|
||||
return std::make_unique<CefBrowserPlatformDelegateOsrMac>(
|
||||
std::move(native_delegate));
|
||||
std::move(native_delegate), use_shared_texture, use_external_begin_frame);
|
||||
#elif BUILDFLAG(IS_LINUX)
|
||||
return std::make_unique<CefBrowserPlatformDelegateOsrLinux>(
|
||||
std::move(native_delegate), use_external_begin_frame);
|
||||
std::move(native_delegate), use_shared_texture, use_external_begin_frame);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -32,7 +32,7 @@ class CefAllowCertificateErrorCallbackImpl : public CefCallback {
|
||||
CefAllowCertificateErrorCallbackImpl& operator=(
|
||||
const CefAllowCertificateErrorCallbackImpl&) = delete;
|
||||
|
||||
~CefAllowCertificateErrorCallbackImpl() {
|
||||
~CefAllowCertificateErrorCallbackImpl() override {
|
||||
if (!callback_.is_null()) {
|
||||
// The callback is still pending. Cancel it now.
|
||||
if (CEF_CURRENTLY_ON_UIT()) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user