Compare commits

...

54 Commits
4844 ... 4896

Author SHA1 Message Date
Marshall Greenblatt
0783cf8db5 Don't override Accept-Language header if set by the client (fixes issue #3139) 2022-04-20 15:14:53 -04:00
Marshall Greenblatt
a1e2187e83 Update to Chromium version 100.0.4896.127 2022-04-15 15:46:51 +00:00
Joshua Marler
4a1240db49 views: Fix ConvertPointFromPixel for fractional scaling (fixes issue #3312) 2022-04-14 20:23:27 -04:00
Marshall Greenblatt
bfd3c04811 views: Fix crash when clicking a draggable region (fixes issue #3311) 2022-04-14 15:22:54 -04:00
Marshall Greenblatt
d51f2327f7 alloy: win: Fix range check for system cursors (fixes issue #3270) 2022-04-14 15:22:47 -04:00
maikesiwu
cd1e7883ce Use Uint32::NewFromUnsigned for unsigned values 2022-04-13 15:55:09 -04:00
Marshall Greenblatt
c36c371f68 Fix unintentional state transfer in DetachToUserFree (fixes issue #3309)
Calling DetachToUserFree() on a CefString holding a reference should copy the
value instead of transferring ownership.

A new `StringTest.Ownership` test has been added for this behavior.
2022-04-13 14:55:50 -04:00
Marshall Greenblatt
579536b107 Fix dismissal of select popups on NotifyMoveOrResizeStarted (see issue #3294)
This impacts both Alloy and Chrome runtimes when using a native parent window.
2022-04-12 12:30:05 -04:00
Marshall Greenblatt
2bf4bd0acb mac/linux: Use python3 for .sh scripts
Newer OS versions no longer ship with Python 2 by default.
2022-04-12 12:30:05 -04:00
Marshall Greenblatt
9c61bb40fd Update to Chromium version 100.0.4896.88 2022-04-12 15:30:25 +00:00
Marshall Greenblatt
4e5ba66302 Update to Chromium version 100.0.4896.75 2022-04-05 14:23:21 +00:00
Marshall Greenblatt
e775505695 Set dcheck_always_on=false for cef_sandbox Release builds (fixes issue #3302) 2022-03-31 16:15:23 -04:00
Marshall Greenblatt
734f820344 Update to Chromium version 100.0.4896.60 2022-03-29 15:11:54 +00:00
Marshall Greenblatt
45b9728877 Update to Chromium version 100.0.4896.46 2022-03-17 16:17:53 +00:00
Marshall Greenblatt
fb37d1a223 Fix DevTools crash due to unknown .md mime type (fixes issue #3278) 2022-03-15 13:08:03 -04:00
Marshall Greenblatt
11015c63ab Update to Chromium version 100.0.4896.30 2022-03-11 21:41:24 +00:00
Marshall Greenblatt
c30e52c620 chrome: Fix shutdown crashes with multi-threaded-message-loop (fixes issue #3277) 2022-03-09 15:44:08 -05:00
Marshall Greenblatt
cfa9cb381f Fix shutdown crash in RenderProcessHostImpl::Cleanup (fixes issue #3276)
Execute all pending UI thread tasks at the beginning of the shutdown sequence.
2022-03-09 15:38:58 -05:00
Marshall Greenblatt
44f75f1a6b alloy: Fix PDF download 'With your changes' (fixes issue #3169) 2022-03-04 13:58:18 -05:00
Marshall Greenblatt
1495483172 alloy: Fix print preview Save as PDF (fixes issue #2867) 2022-03-04 13:58:12 -05:00
Marshall Greenblatt
edadb98b22 Update to Chromium version 100.0.4896.20 2022-03-04 15:10:20 +00:00
Cristian Amarie
eac16430da alloy: Fix crash when downloading a modified PDF form (see issue #3169)
Create a CefFileSystemDelegate based on the ShellFileSystemDelegate placeholder
implementation. An actual implementation will still be required to properly
support this download functionality.
2022-03-02 15:21:56 -05:00
Hunter Laux
318f46bf46 Fix std::result_of deprecation error in C++17 (fixes issue #3194) 2022-02-24 12:34:50 -05:00
Marshall Greenblatt
bda7a8f982 Update to Chromium version 100.0.4896.8 2022-02-22 19:45:55 -05:00
Marshall Greenblatt
d24ea7572f Disable histogram bad minimum warning (see https://crbug.com/1288842#c29) 2022-02-22 19:22:39 -05:00
Marshall Greenblatt
f97f0bbda6 Update to Chromium version 100.0.4896.0 (#972766) 2022-02-22 19:22:39 -05:00
Sergey Markelov
a2c621bf8b Fix documentation typo in cef_sandbox_win.h 2022-02-18 21:58:50 +00:00
Marshall Greenblatt
4014be78dc Include PDF resource IDs in cef_pack_resources.h (fixes issue #3172) 2022-02-18 16:56:15 -05:00
Marshall Greenblatt
bee82b6ac3 Update context menu type enums to match Chromium (fixes issue #3257) 2022-02-18 16:44:37 -05:00
Marshall Greenblatt
28c7f04001 Delete cef_web_plugin.h and plugin-related APIs (see issue #3047)
This functionality stopped being relevant after the removal of Flash support
in January 2021. The last remaining PPAPI plugin (PDF viewer) will switch to
a non-plugin implementation (PdfUnseasoned) in M100.
2022-02-18 16:23:11 -05:00
Marshall Greenblatt
dc0a45d429 alloy: Fix printing of PDF viewer (see issue #3047)
Match the logic for printing::StartPrint() used by Chrome.
2022-02-18 11:37:27 -05:00
Marshall Greenblatt
171d525aa4 alloy: Implement Find() using find_in_page::FindTabHelper (fixes issue #3098, see issue #3047)
The find behavior should now match Chrome.
2022-02-17 13:59:25 -05:00
Sergey Markelov
758022006a Update include/ files for strict C function prototypes 2022-02-17 12:54:16 -05:00
Sergey Markelov
8bfcbeaf48 Update generated files for strict C function prototypes 2022-02-17 12:46:38 -05:00
Sergey Markelov
8410b1383f Use strict C function prototypes
This fixes warnings when compiling with `-Wstrict-prototypes`.

Functions with empty parameter lists behave differently in C and C++:
- void func() in C is same as void func(...) in C++.
- void func() in C++ is same as void func(void) in C.
2022-02-17 12:46:38 -05:00
Sergey Markelov
ce891b57e1 Update generated files for check C API structure sizes (fixes issue #3238) 2022-02-17 12:46:38 -05:00
Sergey Markelov
5c0895e27f Check C API structure sizes before copying values to C++ classes (fixes issue #3238) 2022-02-17 12:46:38 -05:00
Marshall Greenblatt
db9298fd3e chrome: Disable Chrome WebUI factory registration (see issue #3047)
Disable the initial Chrome factory registration in ChromeBrowserMainParts
so that all WebUI loading goes through CefWebUIControllerFactory.
2022-02-16 18:28:15 -05:00
Marshall Greenblatt
d43c3091b2 Revert "chrome: Simplify WebUIControllerFactory registration (see issue #3047)"
Still need to unregister the Content-level factory to stop Alloy loading
unsupported pages.

This reverts commit a21d0c41a4.
2022-02-16 18:28:08 -05:00
Marshall Greenblatt
32ebbd60f9 chrome: Simplify WebUIControllerFactory registration (see issue #3047)
Disable the initial Chrome factory registration in ChromeBrowserMainParts
instead of trying to unregister those factories at a later point.
2022-02-16 18:11:45 -05:00
Marshall Greenblatt
883b4af51d Fix incorrect patch of constrained_web_dialog_ui.cc 2022-02-16 17:48:35 -05:00
Marshall Greenblatt
efc0a67e00 alloy: Add support for chrome-untrusted scheme (see issue #3047)
Lack of this functionality was causing print preview to fail with
PdfUnseasoned enabled.
2022-02-16 17:48:28 -05:00
Marshall Greenblatt
71727464b8 Add support for the chrome-untrusted scheme (see issue #3047)
Lack of this functionality was causing print preview to fail with
PdfUnseasoned enabled.
2022-02-16 17:48:20 -05:00
Marshall Greenblatt
5c1d5c1f06 Update remote-debugging-port documentation
Use chrome://inspect for remote debugging. The localhost server landing
page is currently deprecated and will be removed in M100 (see
https://crbug.com/1232509#c25).
2022-02-16 15:17:20 -05:00
Marshall Greenblatt
3d1bbaf54f Support reconnect of the mojo frame channel (fixes issue #3260)
The mojo channel used for frame communication may disconnect for a variety of
reasons including frame navigation, frame destruction, or insertion into the
BackForwardCache (when the browser-side frame representation is destroyed and
closes the connection). When disconnect occurs we now evaluate the situation
and reconnect if appropriate.

Connections are now initiated solely from the renderer process and the
RenderFrame is passed as an argument to FrameAttached() instead of being
retrieved independently. Messages are queued while the frame is disconnected
and sent only after FrameAttachedAck() is received from the browser process.
The renderer process will be crashed intentionally with a "connection retry
failure" message if the reconnect fails 3 times in a row.
2022-02-14 20:31:04 -05:00
Marshall Greenblatt
80caf947f3 Fix includes path for Linux ARM cross-compile (see issue #2926) 2022-02-09 16:54:54 -05:00
Jun Tseng
086848a7ad Fix incorrect then/than usage in docs 2022-02-09 16:54:49 +00:00
Marshall Greenblatt
a74b66352e Make cef_config.h discoverable from patched Chromium targets (see issue #2926)
Add the generated includes/ directory to CEF's "config" so that source files
included in patched Chromium targets (for example, blink_glue.cc) can find
cef_config.h which will be included via `include/internal/cef_types_linux.h`
on Linux.
2022-02-08 14:03:49 -05:00
Marshall Greenblatt
4f2b7f1829 Remove cef_config.h from cef_paths2.gypi (see issue #2926) 2022-02-05 00:47:45 +00:00
Marshall Greenblatt
eabf93f6cf Make cef_config.h generation a dependency of libcef_dll_wrapper (see issue #2926)
The libcef_dll_wrapper target may be built very early due to minimal
dependencies. Make sure that cef_config.h is generated first as it will be
included via `include/internal/cef_types_linux.h` on Linux.
2022-02-02 15:24:21 -05:00
Marshall Greenblatt
4adc23a52a alloy: Fix extension function registration for print preview dialog (fixes issue #3167) 2022-02-02 15:24:14 -05:00
Marshall Greenblatt
9667789621 Generate cef_config.h as a build-time step (fixes issue #2926) 2022-02-02 12:40:41 -05:00
Marshall Greenblatt
9eb0954cde alloy: Move ExtensionsBrowserClient ownership to BrowserProcess (fixes issue #3247)
Fixes a shutdown crash due to `ExtensionsBrowserClient::Set(nullptr)` being
called too early. Some code that may occasionally be triggered via
`content::ContentMainShutdown()` is expecting the extensions objects to still
be valid.

This new ownership pattern matches the code in chrome/.
2022-02-02 12:40:31 -05:00
Marshall Greenblatt
81e7748fb5 Remove DCHECK that triggers while loading DevTools resources
See https://crbug.com/1289230 for background.
2022-01-28 12:13:29 -05:00
282 changed files with 2291 additions and 3053 deletions

View File

@@ -489,6 +489,8 @@ static_library("libcef_static") {
"libcef/browser/download_manager_delegate.h",
"libcef/browser/extension_impl.cc",
"libcef/browser/extension_impl.h",
"libcef/browser/extensions/api/file_system/cef_file_system_delegate.cc",
"libcef/browser/extensions/api/file_system/cef_file_system_delegate.h",
"libcef/browser/extensions/api/storage/sync_value_store_cache.cc",
"libcef/browser/extensions/api/storage/sync_value_store_cache.h",
"libcef/browser/extensions/api/tabs/tabs_api.cc",
@@ -657,8 +659,6 @@ static_library("libcef_static") {
"libcef/browser/thread_util.h",
"libcef/browser/web_contents_dialog_helper.cc",
"libcef/browser/web_contents_dialog_helper.h",
"libcef/browser/web_plugin_impl.cc",
"libcef/browser/web_plugin_impl.h",
"libcef/browser/x509_certificate_impl.cc",
"libcef/browser/x509_certificate_impl.h",
"libcef/browser/x509_cert_principal_impl.cc",
@@ -848,7 +848,6 @@ static_library("libcef_static") {
"//components/content_settings/core/browser",
"//components/content_settings/core/common",
"//components/crx_file",
"//components/data_use_measurement/core",
"//components/google/core/common",
"//components/keyed_service/content:content",
"//components/keyed_service/core:core",
@@ -1291,6 +1290,8 @@ static_library("libcef_dll_wrapper") {
configs += [ ":libcef_dll_wrapper_config" ]
public_configs = [ ":libcef_dll_wrapper_config" ]
deps = [ ":cef_make_headers" ]
}
@@ -1329,7 +1330,7 @@ grit("cef_strings") {
outputs = [
"grit/cef_strings.h",
]
all_locales = locales + [ "fake-bidi" ]
all_locales = platform_pak_locales + [ "fake-bidi" ]
foreach(locale, all_locales) {
outputs += [ "cef_strings_${locale}.pak" ]
}
@@ -1377,6 +1378,7 @@ make_pack_header("resources") {
"$root_gen_dir/chrome/grit/common_resources.h",
"$root_gen_dir/chrome/grit/component_extension_resources.h",
"$root_gen_dir/chrome/grit/dev_ui_browser_resources.h",
"$root_gen_dir/chrome/grit/pdf_resources.h",
"$root_gen_dir/chrome/grit/renderer_resources.h",
"$root_gen_dir/components/grit/components_resources.h",
"$root_gen_dir/components/grit/dev_ui_components_resources.h",
@@ -1402,6 +1404,7 @@ make_pack_header("resources") {
"//chrome/browser:dev_ui_browser_resources",
"//chrome/browser:resources",
"//chrome/browser/resources:component_extension_resources",
"//chrome/browser/resources/pdf:resources",
"//chrome/common:resources",
"//chrome/renderer:resources",
"//components/resources:components_resources",
@@ -1483,12 +1486,22 @@ action("make_api_hash_header") {
args = rebase_path(outputs + include_dir, root_build_dir)
}
# Generate cef_config.h.
action("make_config_header") {
script = "tools/make_config_header.py"
outputs = [ "$root_out_dir/includes/include/cef_config.h" ]
args = rebase_path(outputs + [ "$root_out_dir/args.gn" ], root_build_dir)
}
# Generate pack files and associated CEF header files.
group("cef_make_headers") {
deps = [
":make_pack_header_resources",
":make_pack_header_strings",
":make_api_hash_header",
":make_config_header",
]
}

View File

@@ -7,5 +7,6 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/99.0.4844.0'
'chromium_checkout': 'refs/tags/100.0.4896.127',
'depot_tools_checkout': '32645dfee9'
}

View File

@@ -1,2 +1,2 @@
#!/bin/sh
python tools/gclient_hook.py
python3 tools/gclient_hook.py

View File

@@ -8,7 +8,7 @@
# by hand. See the translator.README.txt file in the tools directory for
# more information.
#
# $hash=872dedb7e5a2f36745446c3d0c9ad8bd5850adb7$
# $hash=3d75809bdc9a72a0df9df727981f0796b7ddbbc8$
#
{
@@ -84,7 +84,6 @@
'include/cef_v8.h',
'include/cef_values.h',
'include/cef_waitable_event.h',
'include/cef_web_plugin.h',
'include/cef_x509_certificate.h',
'include/cef_xml_reader.h',
'include/cef_zip_reader.h',
@@ -183,7 +182,6 @@
'include/capi/cef_v8_capi.h',
'include/capi/cef_values_capi.h',
'include/capi/cef_waitable_event_capi.h',
'include/capi/cef_web_plugin_capi.h',
'include/capi/cef_x509_certificate_capi.h',
'include/capi/cef_xml_reader_capi.h',
'include/capi/cef_zip_reader_capi.h',
@@ -500,12 +498,6 @@
'libcef_dll/ctocpp/views/view_delegate_ctocpp.h',
'libcef_dll/cpptoc/waitable_event_cpptoc.cc',
'libcef_dll/cpptoc/waitable_event_cpptoc.h',
'libcef_dll/cpptoc/web_plugin_info_cpptoc.cc',
'libcef_dll/cpptoc/web_plugin_info_cpptoc.h',
'libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc',
'libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h',
'libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc',
'libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h',
'libcef_dll/cpptoc/views/window_cpptoc.cc',
'libcef_dll/cpptoc/views/window_cpptoc.h',
'libcef_dll/ctocpp/views/window_delegate_ctocpp.cc',
@@ -810,12 +802,6 @@
'libcef_dll/cpptoc/views/view_delegate_cpptoc.h',
'libcef_dll/ctocpp/waitable_event_ctocpp.cc',
'libcef_dll/ctocpp/waitable_event_ctocpp.h',
'libcef_dll/ctocpp/web_plugin_info_ctocpp.cc',
'libcef_dll/ctocpp/web_plugin_info_ctocpp.h',
'libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc',
'libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h',
'libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc',
'libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h',
'libcef_dll/ctocpp/views/window_ctocpp.cc',
'libcef_dll/ctocpp/views/window_ctocpp.h',
'libcef_dll/cpptoc/views/window_delegate_cpptoc.cc',

View File

@@ -38,7 +38,6 @@
'include/base/internal/cef_thread_checker_impl.h',
'include/cef_api_hash.h',
'include/cef_base.h',
'include/cef_config.h',
'include/cef_version.h',
'include/internal/cef_export.h',
'include/internal/cef_ptr.h',
@@ -113,6 +112,7 @@
'libcef_dll/resource.h',
'libcef_dll/shutdown_checker.cc',
'libcef_dll/shutdown_checker.h',
'libcef_dll/template_util.h',
'libcef_dll/transfer_util.cc',
'libcef_dll/transfer_util.h',
'libcef_dll/wrapper_types.h',
@@ -139,6 +139,7 @@
'libcef_dll/ctocpp/ctocpp_scoped.h',
'libcef_dll/shutdown_checker.cc',
'libcef_dll/shutdown_checker.h',
'libcef_dll/template_util.h',
'libcef_dll/transfer_util.cc',
'libcef_dll/transfer_util.h',
'libcef_dll/wrapper_types.h',

View File

@@ -32,12 +32,7 @@
#define CEF_INCLUDE_BASE_CEF_COMPILER_SPECIFIC_H_
#pragma once
#if defined(BASE_COMPILER_SPECIFIC_H_)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts.
#elif defined(USING_CHROMIUM_INCLUDES)
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/compiler_specific.h"
#else // !USING_CHROMIUM_INCLUDES
@@ -76,23 +71,6 @@
#define __has_attribute(x) 0
#endif // !defined(__has_attribute)
// Annotate a variable indicating it's ok if the variable is not used.
// (Typically used to silence a compiler warning when the assignment
// is important for some other reason.)
// Use like:
// int x = ...;
// ALLOW_UNUSED_LOCAL(x);
#define ALLOW_UNUSED_LOCAL(x) (void)x
// Annotate a typedef or function indicating it's ok if it's not used.
// Use like:
// typedef Foo Bar ALLOW_UNUSED_TYPE;
#if defined(COMPILER_GCC) || defined(__clang__)
#define ALLOW_UNUSED_TYPE __attribute__((unused))
#else
#define ALLOW_UNUSED_TYPE
#endif
// Annotate a function indicating it should not be inlined.
// Use like:
// NOINLINE void DoStuff() { ... }
@@ -153,17 +131,6 @@
#define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment)))
#endif
// Annotate a function indicating the caller must examine the return value.
// Use like:
// int foo() WARN_UNUSED_RESULT;
// To explicitly ignore a result, use std::ignore from <tuple>.
#undef WARN_UNUSED_RESULT
#if defined(COMPILER_GCC) || defined(__clang__)
#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
#define WARN_UNUSED_RESULT
#endif
// In case the compiler supports it NO_UNIQUE_ADDRESS evaluates to the C++20
// attribute [[no_unique_address]]. This allows annotating data members so that
// they need not have an address distinct from all other non-static data members
@@ -420,4 +387,25 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) {
#endif // !USING_CHROMIUM_INCLUDES
// Annotate a function indicating the caller must examine the return value.
// Use like:
// int foo() WARN_UNUSED_RESULT;
// To explicitly ignore a result, use std::ignore from <tuple>.
// Alternately use `[[nodiscard]]` with code that supports C++17.
#undef WARN_UNUSED_RESULT
#if defined(COMPILER_GCC) || defined(__clang__)
#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
#define WARN_UNUSED_RESULT
#endif
// Annotate a variable indicating it's ok if the variable is not used.
// (Typically used to silence a compiler warning when the assignment
// is important for some other reason.)
// Use like:
// int x = ...;
// ALLOW_UNUSED_LOCAL(x);
// Alternately use `[[maybe_unused]]` with code that supports C++17.
#define ALLOW_UNUSED_LOCAL(x) (void)x
#endif // CEF_INCLUDE_BASE_CEF_COMPILER_SPECIFIC_H_

View File

@@ -113,7 +113,7 @@ template <typename T>
struct SupportsToString<T, decltype(void(std::declval<T>().ToString()))>
: std::true_type {};
// Used to detech whether the given type is an iterator. This is normally used
// Used to detect whether the given type is an iterator. This is normally used
// with std::enable_if to provide disambiguation for functions that take
// templatzed iterators as input.
template <typename T, typename = void>
@@ -276,8 +276,13 @@ struct negation : bool_constant<!static_cast<bool>(B::value)> {};
// References:
// [1] https://en.cppreference.com/w/cpp/types/result_of
// [2] https://wg21.link/meta.trans.other#lib:invoke_result
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
template <typename Functor, typename... Args>
using invoke_result = std::invoke_result<Functor, Args...>;
#else
template <typename Functor, typename... Args>
using invoke_result = std::result_of<Functor && (Args && ...)>;
#endif
// Implementation of C++17's std::invoke_result_t.
//

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=adfba3dd6479b96a95639c13ee1e07bed7b335d0$
// $hash=665709ecf3ebad59e85285d319eae72197b9766f$
//
#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
@@ -145,7 +145,7 @@ CEF_EXPORT int cef_initialize(const struct _cef_main_args_t* args,
// This function should be called on the main application thread to shut down
// the CEF browser process before the application exits.
///
CEF_EXPORT void cef_shutdown();
CEF_EXPORT void cef_shutdown(void);
///
// Perform a single iteration of CEF message loop processing. This function is
@@ -162,7 +162,7 @@ CEF_EXPORT void cef_shutdown();
// CefSettings.multi_threaded_message_loop value of false (0). This function
// will not block.
///
CEF_EXPORT void cef_do_message_loop_work();
CEF_EXPORT void cef_do_message_loop_work(void);
///
// Run the CEF message loop. Use this function instead of an application-
@@ -172,14 +172,14 @@ CEF_EXPORT void cef_do_message_loop_work();
// CefSettings.multi_threaded_message_loop value of false (0). This function
// will block until a quit message is received by the system.
///
CEF_EXPORT void cef_run_message_loop();
CEF_EXPORT void cef_run_message_loop(void);
///
// Quit the CEF message loop that was started by calling cef_run_message_loop().
// This function should only be called on the main application thread and only
// if cef_run_message_loop() was used.
///
CEF_EXPORT void cef_quit_message_loop();
CEF_EXPORT void cef_quit_message_loop(void);
///
// Set to true (1) before calling Windows APIs like TrackPopupMenu that enter a
@@ -192,7 +192,7 @@ CEF_EXPORT void cef_set_osmodal_loop(int osModalLoop);
// Older versions of Windows should be left DPI-unaware because they do not
// support DirectWrite and GDI fonts are kerned very badly.
///
CEF_EXPORT void cef_enable_highdpi_support();
CEF_EXPORT void cef_enable_highdpi_support(void);
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=8af93d03e0b2a6b50d7612b145599600285b76d4$
// $hash=b80e84c0039ab45d5c4562d64b67a84766c0dab3$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
@@ -450,18 +450,15 @@ typedef struct _cef_browser_host_t {
struct _cef_pdf_print_callback_t* callback);
///
// Search for |searchText|. |identifier| must be a unique ID and these IDs
// must strictly increase so that newer requests always have greater IDs than
// older requests. If |identifier| is zero or less than the previous ID value
// then it will be automatically assigned a new valid ID. |forward| indicates
// whether to search forward or backward within the page. |matchCase|
// indicates whether the search should be case-sensitive. |findNext| indicates
// whether this is the first request or a follow-up. The cef_find_handler_t
// instance, if any, returned via cef_client_t::GetFindHandler will be called
// to report find results.
// Search for |searchText|. |forward| indicates whether to search forward or
// backward within the page. |matchCase| indicates whether the search should
// be case-sensitive. |findNext| indicates whether this is the first request
// or a follow-up. The search will be restarted if |searchText| or |matchCase|
// change. The search will be stopped if |searchText| is NULL. The
// cef_find_handler_t instance, if any, returned via
// cef_client_t::GetFindHandler will be called to report find results.
///
void(CEF_CALLBACK* find)(struct _cef_browser_host_t* self,
int identifier,
const cef_string_t* searchText,
int forward,
int matchCase,

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=8c97f9b58c642c144cc37824ad820192640307cb$
// $hash=ad0a78715daff99c1ec987800b7e5d62196e7100$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
@@ -70,9 +70,9 @@ typedef struct _cef_browser_process_handler_t {
///
// Called before a child process is launched. Will be called on the browser
// process UI thread when launching a render process and on the browser
// process IO thread when launching a GPU or plugin process. Provides an
// opportunity to modify the child process command line. Do not keep a
// reference to |command_line| outside of this function.
// process IO thread when launching a GPU process. Provides an opportunity to
// modify the child process command line. Do not keep a reference to
// |command_line| outside of this function.
///
void(CEF_CALLBACK* on_before_child_process_launch)(
struct _cef_browser_process_handler_t* self,

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=93f3d769c0d48ed6e1d91ad8a8e2f95d4ee54287$
// $hash=3049c9960a95d32d61cc57ae998c0eba12820673$
//
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
@@ -200,13 +200,13 @@ typedef struct _cef_command_line_t {
///
// Create a new cef_command_line_t instance.
///
CEF_EXPORT cef_command_line_t* cef_command_line_create();
CEF_EXPORT cef_command_line_t* cef_command_line_create(void);
///
// Returns the singleton global cef_command_line_t object. The returned object
// will be read-only.
///
CEF_EXPORT cef_command_line_t* cef_command_line_get_global();
CEF_EXPORT cef_command_line_t* cef_command_line_get_global(void);
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=fd33ce439e4379d231b6be16bdc1786f314d98e4$
// $hash=d007b3dc26f3f049bf67623da8fae59dc75a193b$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
@@ -290,8 +290,7 @@ typedef struct _cef_context_menu_params_t {
///
// Returns true (1) if the context menu contains items specified by the
// renderer process (for example, plugin placeholder or pepper plugin menu
// items).
// renderer process.
///
int(CEF_CALLBACK* is_custom_menu)(struct _cef_context_menu_params_t* self);
} cef_context_menu_params_t;

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=0460e68eb7d1b1188706c42d14beafbf9a6f7126$
// $hash=5d111a67218403f78737f2c4dc92d2fd96dc125d$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
@@ -136,7 +136,7 @@ extern "C" {
// CefSetCrashKeyValue function. These key/value pairs will be sent to the crash
// server along with the crash dump file.
///
CEF_EXPORT int cef_crash_reporting_enabled();
CEF_EXPORT int cef_crash_reporting_enabled(void);
///
// Sets or clears a specific key-value pair from the crash metadata.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=b6e3236a062cd25ec26c3daeb1940d1e1bf0d96a$
// $hash=221973f3d5728478eeb0f8f5f55ca5e68b3afd8a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
@@ -219,7 +219,7 @@ typedef struct _cef_drag_data_t {
///
// Create a new cef_drag_data_t object.
///
CEF_EXPORT cef_drag_data_t* cef_drag_data_create();
CEF_EXPORT cef_drag_data_t* cef_drag_data_create(void);
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=b1fe7f7db5ab92c6ae64dc1288b6fd47c80f9423$
// $hash=f2e80b8637b07f19adea666e554269de4627e399$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
@@ -59,11 +59,12 @@ typedef struct _cef_find_handler_t {
///
// Called to report find results returned by cef_browser_host_t::find().
// |identifer| is the identifier passed to find(), |count| is the number of
// matches currently identified, |selectionRect| is the location of where the
// match was found (in window coordinates), |activeMatchOrdinal| is the
// current position in the search results, and |finalUpdate| is true (1) if
// this is the last find notification.
// |identifer| is a unique incremental identifier for the currently active
// search, |count| is the number of matches currently identified,
// |selectionRect| is the location of where the match was found (in window
// coordinates), |activeMatchOrdinal| is the current position in the search
// results, and |finalUpdate| is true (1) if this is the last find
// notification.
///
void(CEF_CALLBACK* on_find_result)(struct _cef_find_handler_t* self,
struct _cef_browser_t* browser,

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=b6168013910802cf6d7603892741385958026dcd$
// $hash=c063e5f0e0c9fef71bdb56e7cc3ea775de17a3ea$
//
#ifndef CEF_INCLUDE_CAPI_CEF_I18N_UTIL_CAPI_H_
@@ -49,7 +49,7 @@ extern "C" {
///
// Returns true (1) if the application text direction is right-to-left.
///
CEF_EXPORT int cef_is_rtl();
CEF_EXPORT int cef_is_rtl(void);
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=b5a36ef39ff250c9d3cb1e9a8c7ee38d7e0f8b3f$
// $hash=bbc87eb4ecaf92c900193afef7059caedbe8ab3a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
@@ -196,7 +196,7 @@ typedef struct _cef_image_t {
// Create a new cef_image_t. It will initially be NULL. Use the Add*() functions
// to add representations at different scale factors.
///
CEF_EXPORT cef_image_t* cef_image_create();
CEF_EXPORT cef_image_t* cef_image_create(void);
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=0939a44345bea8df7ca5f1dbd6afbe41972121f2$
// $hash=26fdd1f18f30d9e2a48aeeb5c69607d9d22d69ca$
//
#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
@@ -102,7 +102,7 @@ CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
// Remove all entries from the cross-origin access whitelist. Returns false (0)
// if the whitelist cannot be accessed.
///
CEF_EXPORT int cef_clear_cross_origin_whitelist();
CEF_EXPORT int cef_clear_cross_origin_whitelist(void);
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=fdbd26f9dd20dbd7813fc17a8c34650b2da19581$
// $hash=1a9b9718367ec8d575fbb39b73b1085b17eb0a2b$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
@@ -193,7 +193,7 @@ typedef struct _cef_print_settings_t {
///
// Create a new cef_print_settings_t object.
///
CEF_EXPORT cef_print_settings_t* cef_print_settings_create();
CEF_EXPORT cef_print_settings_t* cef_print_settings_create(void);
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=47b361878452f2a94e559782913d80beb0dba25a$
// $hash=246d07b9790ff6bd574c59b1c237c603deaf88bf$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
@@ -219,7 +219,7 @@ typedef struct _cef_request_t {
///
// Create a new cef_request_t object.
///
CEF_EXPORT cef_request_t* cef_request_create();
CEF_EXPORT cef_request_t* cef_request_create(void);
///
// Structure used to represent post data for a web request. The functions of
@@ -278,7 +278,7 @@ typedef struct _cef_post_data_t {
///
// Create a new cef_post_data_t object.
///
CEF_EXPORT cef_post_data_t* cef_post_data_create();
CEF_EXPORT cef_post_data_t* cef_post_data_create(void);
///
// Structure used to represent a single element in the request post data. The
@@ -344,7 +344,7 @@ typedef struct _cef_post_data_element_t {
///
// Create a new cef_post_data_element_t object.
///
CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create();
CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create(void);
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=89e64a2db658ad560e85ea5d3e564a6505d4e914$
// $hash=dcff1eaa0563cfb48e0232bf78786bb0126c4255$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
@@ -357,7 +357,7 @@ typedef struct _cef_request_context_t {
///
// Returns the global context object.
///
CEF_EXPORT cef_request_context_t* cef_request_context_get_global_context();
CEF_EXPORT cef_request_context_t* cef_request_context_get_global_context(void);
///
// Creates a new context object with the specified |settings| and optional

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=b44d320d5cceb5022543e8154170b8d276628c76$
// $hash=b2657a441a701c5ddaca68dc604fd94153a3220f$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
@@ -45,7 +45,6 @@
#include "include/capi/cef_frame_capi.h"
#include "include/capi/cef_request_capi.h"
#include "include/capi/cef_resource_request_handler_capi.h"
#include "include/capi/cef_web_plugin_capi.h"
#ifdef __cplusplus
extern "C" {

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=4a05a0a7cd4a279ccf8455a3cb2f77de581b597a$
// $hash=4e19e04de13949f20e63e44542bc0a0eeed46b43$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
@@ -228,14 +228,6 @@ typedef struct _cef_request_handler_t {
struct _cef_x509certificate_t* const* certificates,
struct _cef_select_client_certificate_callback_t* callback);
///
// Called on the browser process UI thread when a plugin has crashed.
// |plugin_path| is the path of the plugin that crashed.
///
void(CEF_CALLBACK* on_plugin_crashed)(struct _cef_request_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* plugin_path);
///
// Called on the browser process UI thread when the render view associated
// with |browser| is ready to receive/handle IPC messages in the render

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a9e35ca17785f77666db7650208cacfd9a85c3e0$
// $hash=6d8a7e3c0ed66cad10e8a0c59fed51431ec82ce5$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_
@@ -95,7 +95,7 @@ typedef struct _cef_resource_bundle_t {
///
// Returns the global resource bundle instance.
///
CEF_EXPORT cef_resource_bundle_t* cef_resource_bundle_get_global();
CEF_EXPORT cef_resource_bundle_t* cef_resource_bundle_get_global(void);
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=6ebf7adcdaee57772810c1528b27140ae95966d0$
// $hash=ab8832420572dae95a601fb3170fcd3693473619$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_
@@ -168,7 +168,7 @@ typedef struct _cef_response_t {
///
// Create a new cef_response_t object.
///
CEF_EXPORT cef_response_t* cef_response_create();
CEF_EXPORT cef_response_t* cef_response_create(void);
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=df8c46dd19ef6a3964c49d79e770de6e4245e208$
// $hash=83cbe91e85d7ab2413f733b75457ce6689d3d0ae$
//
#ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
@@ -131,7 +131,7 @@ CEF_EXPORT int cef_register_scheme_handler_factory(
// ef_request_context_t::cef_request_context_get_global_context()->clear_scheme_
// handler_factories().
///
CEF_EXPORT int cef_clear_scheme_handler_factories();
CEF_EXPORT int cef_clear_scheme_handler_factories(void);
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=e943dd2af818e5a5f19f6cbd1648896684c666c6$
// $hash=2502258e69820d070a9f094d5e587a38e96cc930$
//
#ifndef CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_
@@ -122,7 +122,7 @@ typedef struct _cef_task_runner_t {
// task runners. An NULL reference will be returned if this function is called
// on an invalid thread.
///
CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_current_thread();
CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_current_thread(void);
///
// Returns the task runner for the specified CEF thread.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a7b4410e0a35eb0aba747014665419fb6b6fcb67$
// $hash=0a206b1c12637c8b04b2815cb3b50f212768ba01$
//
#ifndef CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_
@@ -109,7 +109,7 @@ CEF_EXPORT int cef_end_tracing(const cef_string_t* tracing_file,
// high-res time. Can be used by clients to synchronize with the time
// information in trace events.
///
CEF_EXPORT int64 cef_now_from_system_trace_time();
CEF_EXPORT int64 cef_now_from_system_trace_time(void);
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=2bdcad7f8e3c03285a5e5ddb9a02a5a2182f254c$
// $hash=b7dd2429f492a8f2dd978f9500c63dd0e01035d4$
//
#ifndef CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_
@@ -143,17 +143,17 @@ typedef struct _cef_v8context_t {
///
// Returns the current (top) context object in the V8 context stack.
///
CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context();
CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context(void);
///
// Returns the entered (bottom) context object in the V8 context stack.
///
CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context();
CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context(void);
///
// Returns true (1) if V8 is currently inside a context.
///
CEF_EXPORT int cef_v8context_in_context();
CEF_EXPORT int cef_v8context_in_context(void);
///
// Structure that should be implemented to handle V8 function calls. The
@@ -733,12 +733,12 @@ typedef struct _cef_v8value_t {
///
// Create a new cef_v8value_t object of type undefined.
///
CEF_EXPORT cef_v8value_t* cef_v8value_create_undefined();
CEF_EXPORT cef_v8value_t* cef_v8value_create_undefined(void);
///
// Create a new cef_v8value_t object of type null.
///
CEF_EXPORT cef_v8value_t* cef_v8value_create_null();
CEF_EXPORT cef_v8value_t* cef_v8value_create_null(void);
///
// Create a new cef_v8value_t object of type bool.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=c557496bdc1403b25b22ca9354a942478131c7ce$
// $hash=ee899158c4f61cc3f85176174d6fd9cbe2a3db4c$
//
#ifndef CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_
@@ -219,7 +219,7 @@ typedef struct _cef_value_t {
///
// Creates a new object.
///
CEF_EXPORT cef_value_t* cef_value_create();
CEF_EXPORT cef_value_t* cef_value_create(void);
///
// Structure representing a binary value. Can be used on any process and thread.
@@ -523,7 +523,7 @@ typedef struct _cef_dictionary_value_t {
///
// Creates a new object that is not owned by any other object.
///
CEF_EXPORT cef_dictionary_value_t* cef_dictionary_value_create();
CEF_EXPORT cef_dictionary_value_t* cef_dictionary_value_create(void);
///
// Structure representing a list value. Can be used on any process and thread.
@@ -744,7 +744,7 @@ typedef struct _cef_list_value_t {
///
// Creates a new object that is not owned by any other object.
///
CEF_EXPORT cef_list_value_t* cef_list_value_create();
CEF_EXPORT cef_list_value_t* cef_list_value_create(void);
#ifdef __cplusplus
}

View File

@@ -1,171 +0,0 @@
// Copyright (c) 2022 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=51060280dee57104eaef7b774e4b4895970c0057$
//
#ifndef CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_browser_t;
///
// Information about a specific web plugin.
///
typedef struct _cef_web_plugin_info_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Returns the plugin name.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_name)(
struct _cef_web_plugin_info_t* self);
///
// Returns the plugin file path (DLL/bundle/library).
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_path)(
struct _cef_web_plugin_info_t* self);
///
// Returns the version of the plugin (may be OS-specific).
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_version)(
struct _cef_web_plugin_info_t* self);
///
// Returns a description of the plugin from the version information.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_description)(
struct _cef_web_plugin_info_t* self);
} cef_web_plugin_info_t;
///
// Structure to implement for visiting web plugin information. The functions of
// this structure will be called on the browser process UI thread.
///
typedef struct _cef_web_plugin_info_visitor_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Method that will be called once for each plugin. |count| is the 0-based
// index for the current plugin. |total| is the total number of plugins.
// Return false (0) to stop visiting plugins. This function may never be
// called if no plugins are found.
///
int(CEF_CALLBACK* visit)(struct _cef_web_plugin_info_visitor_t* self,
struct _cef_web_plugin_info_t* info,
int count,
int total);
} cef_web_plugin_info_visitor_t;
///
// Structure to implement for receiving unstable plugin information. The
// functions of this structure will be called on the browser process IO thread.
///
typedef struct _cef_web_plugin_unstable_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Method that will be called for the requested plugin. |unstable| will be
// true (1) if the plugin has reached the crash count threshold of 3 times in
// 120 seconds.
///
void(CEF_CALLBACK* is_unstable)(
struct _cef_web_plugin_unstable_callback_t* self,
const cef_string_t* path,
int unstable);
} cef_web_plugin_unstable_callback_t;
///
// Visit web plugin information. Can be called on any thread in the browser
// process.
///
CEF_EXPORT void cef_visit_web_plugin_info(
cef_web_plugin_info_visitor_t* visitor);
///
// Cause the plugin list to refresh the next time it is accessed regardless of
// whether it has already been loaded. Can be called on any thread in the
// browser process.
///
CEF_EXPORT void cef_refresh_web_plugins();
///
// Unregister an internal plugin. This may be undone the next time
// cef_refresh_web_plugins() is called. Can be called on any thread in the
// browser process.
///
CEF_EXPORT void cef_unregister_internal_web_plugin(const cef_string_t* path);
///
// Register a plugin crash. Can be called on any thread in the browser process
// but will be executed on the IO thread.
///
CEF_EXPORT void cef_register_web_plugin_crash(const cef_string_t* path);
///
// Query if a plugin is unstable. Can be called on any thread in the browser
// process.
///
CEF_EXPORT void cef_is_web_plugin_unstable(
const cef_string_t* path,
cef_web_plugin_unstable_callback_t* callback);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d70d5b74890e3ca91f01333ebdb4f3298caeb619$
// $hash=33a684b03178472bdf93e70043304cce8bc32d05$
//
#ifndef CEF_INCLUDE_CAPI_TEST_CEF_TRANSLATOR_TEST_CAPI_H_
@@ -530,7 +530,7 @@ typedef struct _cef_translator_test_t {
///
// Create the test object.
///
CEF_EXPORT cef_translator_test_t* cef_translator_test_create();
CEF_EXPORT cef_translator_test_t* cef_translator_test_create(void);
///
// Library-side test object for RefPtr.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=2fd0db428ce5902d59a7802c901e1c13b2367b5a$
// $hash=5e383d792ce9dc1809d3d3fdeabb9c60fb9ff1ba$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_DISPLAY_CAPI_H_
@@ -108,7 +108,7 @@ typedef struct _cef_display_t {
///
// Returns the primary Display.
///
CEF_EXPORT cef_display_t* cef_display_get_primary();
CEF_EXPORT cef_display_t* cef_display_get_primary(void);
///
// Returns the Display nearest |point|. Set |input_pixel_coords| to true (1) if
@@ -131,7 +131,7 @@ CEF_EXPORT cef_display_t* cef_display_get_matching_bounds(
// Returns the total number of Displays. Mirrored displays are excluded; this
// function is intended to return the number of distinct, usable displays.
///
CEF_EXPORT size_t cef_display_get_count();
CEF_EXPORT size_t cef_display_get_count(void);
///
// Returns all Displays. Mirrored displays are excluded; this function is

View File

@@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "6f6a9c0f3b420cd3120cf4f5924cbc91f5095abd"
#define CEF_API_HASH_UNIVERSAL "c32d3ae315c5991d1bd81c412635d95a3fd353f8"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "5835e67ed251fec96837b475df44248a286e422f"
#define CEF_API_HASH_PLATFORM "cb1d823e15caa7e7b6074e3e612d111145b374d1"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "b8187d9f99b028d767dfd6a40490190c25a3d901"
#define CEF_API_HASH_PLATFORM "7e3a768a3b73a514763ce9902afb85775ca8c83d"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "d7199dfd396052e1517e55f18ea75d3d61336538"
#define CEF_API_HASH_PLATFORM "bc9260335c9493beb100645dbccd587e62925b9e"
#endif
#ifdef __cplusplus

View File

@@ -479,19 +479,16 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
CefRefPtr<CefPdfPrintCallback> callback) = 0;
///
// Search for |searchText|. |identifier| must be a unique ID and these IDs
// must strictly increase so that newer requests always have greater IDs than
// older requests. If |identifier| is zero or less than the previous ID value
// then it will be automatically assigned a new valid ID. |forward| indicates
// whether to search forward or backward within the page. |matchCase|
// indicates whether the search should be case-sensitive. |findNext| indicates
// whether this is the first request or a follow-up. The CefFindHandler
// instance, if any, returned via CefClient::GetFindHandler will be called to
// report find results.
// Search for |searchText|. |forward| indicates whether to search forward or
// backward within the page. |matchCase| indicates whether the search should
// be case-sensitive. |findNext| indicates whether this is the first request
// or a follow-up. The search will be restarted if |searchText| or |matchCase|
// change. The search will be stopped if |searchText| is empty. The
// CefFindHandler instance, if any, returned via CefClient::GetFindHandler
// will be called to report find results.
///
/*--cef()--*/
virtual void Find(int identifier,
const CefString& searchText,
virtual void Find(const CefString& searchText,
bool forward,
bool matchCase,
bool findNext) = 0;

View File

@@ -60,9 +60,9 @@ class CefBrowserProcessHandler : public virtual CefBaseRefCounted {
///
// Called before a child process is launched. Will be called on the browser
// process UI thread when launching a render process and on the browser
// process IO thread when launching a GPU or plugin process. Provides an
// opportunity to modify the child process command line. Do not keep a
// reference to |command_line| outside of this method.
// process IO thread when launching a GPU process. Provides an opportunity to
// modify the child process command line. Do not keep a reference to
// |command_line| outside of this method.
///
/*--cef()--*/
virtual void OnBeforeChildProcessLaunch(

View File

@@ -277,7 +277,7 @@ class CefContextMenuParams : public virtual CefBaseRefCounted {
///
// Returns true if the context menu contains items specified by the renderer
// process (for example, plugin placeholder or pepper plugin menu items).
// process.
///
/*--cef()--*/
virtual bool IsCustomMenu() = 0;

View File

@@ -50,11 +50,11 @@ class CefFindHandler : public virtual CefBaseRefCounted {
public:
///
// Called to report find results returned by CefBrowserHost::Find().
// |identifer| is the identifier passed to Find(), |count| is the number of
// matches currently identified, |selectionRect| is the location of where the
// match was found (in window coordinates), |activeMatchOrdinal| is the
// current position in the search results, and |finalUpdate| is true if this
// is the last find notification.
// |identifer| is a unique incremental identifier for the currently active
// search, |count| is the number of matches currently identified,
// |selectionRect| is the location of where the match was found (in window
// coordinates), |activeMatchOrdinal| is the current position in the search
// results, and |finalUpdate| is true if this is the last find notification.
///
/*--cef()--*/
virtual void OnFindResult(CefRefPtr<CefBrowser> browser,

View File

@@ -43,7 +43,6 @@
#include "include/cef_frame.h"
#include "include/cef_request.h"
#include "include/cef_resource_request_handler.h"
#include "include/cef_web_plugin.h"
///
// Implement this interface to provide handler implementations. The handler
@@ -53,8 +52,6 @@
/*--cef(source=client,no_debugct_check)--*/
class CefRequestContextHandler : public virtual CefBaseRefCounted {
public:
typedef cef_plugin_policy_t PluginPolicy;
///
// Called on the browser process UI thread immediately after the request
// context has been initialized.

View File

@@ -228,14 +228,6 @@ class CefRequestHandler : public virtual CefBaseRefCounted {
return false;
}
///
// Called on the browser process UI thread when a plugin has crashed.
// |plugin_path| is the path of the plugin that crashed.
///
/*--cef()--*/
virtual void OnPluginCrashed(CefRefPtr<CefBrowser> browser,
const CefString& plugin_path) {}
///
// Called on the browser process UI thread when the render view associated
// with |browser| is ready to receive/handle IPC messages in the render

View File

@@ -40,11 +40,11 @@
extern "C" {
#endif
// The sandbox is used to restrict sub-processes (renderer, plugin, GPU, etc)
// from directly accessing system resources. This helps to protect the user
// from untrusted and potentially malicious Web content.
// See http://www.chromium.org/developers/design-documents/sandbox for
// complete details.
// The sandbox is used to restrict sub-processes (renderer, GPU, etc) from
// directly accessing system resources. This helps to protect the user from
// untrusted and potentially malicious Web content. See
// http://www.chromium.org/developers/design-documents/sandbox for complete
// details.
//
// To enable the sandbox on macOS the following requirements must be met:
// 1. Link the helper process executable with the cef_sandbox static library.

View File

@@ -39,26 +39,26 @@
extern "C" {
#endif
// The sandbox is used to restrict sub-processes (renderer, plugin, GPU, etc)
// from directly accessing system resources. This helps to protect the user
// from untrusted and potentially malicious Web content.
// See http://www.chromium.org/developers/design-documents/sandbox for
// complete details.
// The sandbox is used to restrict sub-processes (renderer, GPU, etc) from
// directly accessing system resources. This helps to protect the user from
// untrusted and potentially malicious Web content. See
// http://www.chromium.org/developers/design-documents/sandbox for complete
// details.
//
// To enable the sandbox on Windows the following requirements must be met:
// 1. Use the same executable for the browser process and all sub-processes.
// 2. Link the executable with the cef_sandbox static library.
// 3. Call the cef_sandbox_info_create() function from within the executable
// (not from a separate DLL) and pass the resulting pointer into both the
// CefExecutProcess() and CefInitialize() functions via the
// CefExecuteProcess() and CefInitialize() functions via the
// |windows_sandbox_info| parameter.
///
// Create the sandbox information object for this process. It is safe to create
// multiple of this object and to destroy the object immediately after passing
// into the CefExecutProcess() and/or CefInitialize() functions.
// into the CefExecuteProcess() and/or CefInitialize() functions.
///
void* cef_sandbox_info_create();
void* cef_sandbox_info_create(void);
///
// Destroy the specified sandbox information object.

View File

@@ -1,148 +0,0 @@
// Copyright (c) 2012 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_WEB_PLUGIN_H_
#define CEF_INCLUDE_CEF_WEB_PLUGIN_H_
#include "include/cef_base.h"
class CefBrowser;
///
// Information about a specific web plugin.
///
/*--cef(source=library)--*/
class CefWebPluginInfo : public virtual CefBaseRefCounted {
public:
///
// Returns the plugin name.
///
/*--cef()--*/
virtual CefString GetName() = 0;
///
// Returns the plugin file path (DLL/bundle/library).
///
/*--cef()--*/
virtual CefString GetPath() = 0;
///
// Returns the version of the plugin (may be OS-specific).
///
/*--cef()--*/
virtual CefString GetVersion() = 0;
///
// Returns a description of the plugin from the version information.
///
/*--cef()--*/
virtual CefString GetDescription() = 0;
};
///
// Interface to implement for visiting web plugin information. The methods of
// this class will be called on the browser process UI thread.
///
/*--cef(source=client)--*/
class CefWebPluginInfoVisitor : public virtual CefBaseRefCounted {
public:
///
// Method that will be called once for each plugin. |count| is the 0-based
// index for the current plugin. |total| is the total number of plugins.
// Return false to stop visiting plugins. This method may never be called if
// no plugins are found.
///
/*--cef()--*/
virtual bool Visit(CefRefPtr<CefWebPluginInfo> info,
int count,
int total) = 0;
};
///
// Visit web plugin information. Can be called on any thread in the browser
// process.
///
/*--cef()--*/
void CefVisitWebPluginInfo(CefRefPtr<CefWebPluginInfoVisitor> visitor);
///
// Cause the plugin list to refresh the next time it is accessed regardless
// of whether it has already been loaded. Can be called on any thread in the
// browser process.
///
/*--cef()--*/
void CefRefreshWebPlugins();
///
// Unregister an internal plugin. This may be undone the next time
// CefRefreshWebPlugins() is called. Can be called on any thread in the browser
// process.
///
/*--cef()--*/
void CefUnregisterInternalWebPlugin(const CefString& path);
///
// Register a plugin crash. Can be called on any thread in the browser process
// but will be executed on the IO thread.
///
/*--cef()--*/
void CefRegisterWebPluginCrash(const CefString& path);
///
// Interface to implement for receiving unstable plugin information. The methods
// of this class will be called on the browser process IO thread.
///
/*--cef(source=client)--*/
class CefWebPluginUnstableCallback : public virtual CefBaseRefCounted {
public:
///
// Method that will be called for the requested plugin. |unstable| will be
// true if the plugin has reached the crash count threshold of 3 times in 120
// seconds.
///
/*--cef()--*/
virtual void IsUnstable(const CefString& path, bool unstable) = 0;
};
///
// Query if a plugin is unstable. Can be called on any thread in the browser
// process.
///
/*--cef()--*/
void CefIsWebPluginUnstable(const CefString& path,
CefRefPtr<CefWebPluginUnstableCallback> callback);
#endif // CEF_INCLUDE_CEF_WEB_PLUGIN_H_

View File

@@ -44,7 +44,7 @@ extern "C" {
///
// Gets the current log level.
///
CEF_EXPORT int cef_get_min_log_level();
CEF_EXPORT int cef_get_min_log_level(void);
///
// Gets the current vlog level for the given file (usually taken from

View File

@@ -46,7 +46,7 @@ typedef void* cef_string_list_t;
///
// Allocate a new string map.
///
CEF_EXPORT cef_string_list_t cef_string_list_alloc();
CEF_EXPORT cef_string_list_t cef_string_list_alloc(void);
///
// Return the number of elements in the string list.

View File

@@ -46,7 +46,7 @@ typedef void* cef_string_map_t;
///
// Allocate a new string map.
///
CEF_EXPORT cef_string_map_t cef_string_map_alloc();
CEF_EXPORT cef_string_map_t cef_string_map_alloc(void);
///
// Return the number of elements in the string map.

View File

@@ -47,7 +47,7 @@ typedef void* cef_string_multimap_t;
///
// Allocate a new string multimap.
///
CEF_EXPORT cef_string_multimap_t cef_string_multimap_alloc();
CEF_EXPORT cef_string_multimap_t cef_string_multimap_alloc(void);
///
// Return the number of elements in the string multimap.

View File

@@ -175,9 +175,9 @@ typedef cef_string_utf16_t* cef_string_userfree_utf16_t;
// calling the associated free function.
///
CEF_EXPORT cef_string_userfree_wide_t cef_string_userfree_wide_alloc();
CEF_EXPORT cef_string_userfree_utf8_t cef_string_userfree_utf8_alloc();
CEF_EXPORT cef_string_userfree_utf16_t cef_string_userfree_utf16_alloc();
CEF_EXPORT cef_string_userfree_wide_t cef_string_userfree_wide_alloc(void);
CEF_EXPORT cef_string_userfree_utf8_t cef_string_userfree_utf8_alloc(void);
CEF_EXPORT cef_string_userfree_utf16_t cef_string_userfree_utf16_alloc(void);
///
// These functions free the string structure allocated by the associated

View File

@@ -584,10 +584,16 @@ class CefStringBase {
return NULL;
userfree_struct_type str = traits::userfree_alloc();
memcpy(str, string_, sizeof(struct_type));
if (owner_) {
// Transfer ownership of the data to |str|.
memcpy(str, string_, sizeof(struct_type));
// Free this class' structure but not the data.
memset(string_, 0, sizeof(struct_type));
} else {
// Copy the data to |str|.
traits::set(string_->str, string_->length, str, /*copy=*/true);
}
// Free this class' structure but not the data.
memset(string_, 0, sizeof(struct_type));
ClearAndFree();
return str;

View File

@@ -55,7 +55,7 @@ typedef pid_t cef_platform_thread_id_t;
///
// Returns the current platform thread ID.
///
CEF_EXPORT cef_platform_thread_id_t cef_get_current_platform_thread_id();
CEF_EXPORT cef_platform_thread_id_t cef_get_current_platform_thread_id(void);
#if defined(OS_WIN)
typedef DWORD cef_platform_thread_handle_t;
@@ -69,7 +69,7 @@ typedef pthread_t cef_platform_thread_handle_t;
// Returns the current platform thread handle.
///
CEF_EXPORT cef_platform_thread_handle_t
cef_get_current_platform_thread_handle();
cef_get_current_platform_thread_handle(void);
#ifdef __cplusplus
}

View File

@@ -202,7 +202,7 @@ typedef struct _cef_settings_t {
///
// Set to true (1) to have the browser process message loop run in a separate
// thread. If false (0) than the CefDoMessageLoopWork() function must be
// thread. If false (0) then the CefDoMessageLoopWork() function must be
// called from your application message loop. This option is only supported on
// Windows and Linux.
///
@@ -374,10 +374,11 @@ typedef struct _cef_settings_t {
///
// Set to a value between 1024 and 65535 to enable remote debugging on the
// specified port. For example, if 8080 is specified the remote debugging URL
// will be http://localhost:8080. CEF can be remotely debugged from any CEF or
// Chrome browser window. Also configurable using the "remote-debugging-port"
// command-line switch.
// 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.
///
int remote_debugging_port;
@@ -576,12 +577,6 @@ typedef struct _cef_browser_settings_t {
///
cef_state_t javascript_dom_paste;
///
// Controls whether any plugins will be loaded. Also configurable using the
// "disable-plugins" command-line switch.
///
cef_state_t plugins;
///
// Controls whether image URLs will be loaded from the network. A cached image
// will still be rendered if requested. Also configurable using the
@@ -1028,7 +1023,8 @@ typedef enum {
} cef_postdataelement_type_t;
///
// Resource type for a request.
// Resource type for a request. These constants match their equivalents in
// Chromium's ResourceType and should not be renumbered.
///
typedef enum {
///
@@ -1616,8 +1612,7 @@ typedef enum {
MENU_ID_NO_SPELLING_SUGGESTIONS = 205,
MENU_ID_ADD_TO_DICTIONARY = 206,
// Custom menu items originating from the renderer process. For example,
// plugin placeholder menu items.
// Custom menu items originating from the renderer process.
MENU_ID_CUSTOM_FIRST = 220,
MENU_ID_CUSTOM_LAST = 250,
@@ -1819,7 +1814,8 @@ typedef enum {
} cef_context_menu_type_flags_t;
///
// Supported context menu media types.
// Supported context menu media types. These constants match their equivalents
// in Chromium's ContextMenuDataMediaType and should not be renumbered.
///
typedef enum {
///
@@ -1839,6 +1835,10 @@ typedef enum {
///
CM_MEDIATYPE_AUDIO,
///
// An canvas node is selected.
///
CM_MEDIATYPE_CANVAS,
///
// A file node is selected.
///
CM_MEDIATYPE_FILE,
@@ -1849,24 +1849,31 @@ typedef enum {
} cef_context_menu_media_type_t;
///
// Supported context menu media state bit flags.
// Supported context menu media state bit flags. These constants match their
// equivalents in Chromium's ContextMenuData::MediaFlags and should not be
// renumbered.
///
typedef enum {
CM_MEDIAFLAG_NONE = 0,
CM_MEDIAFLAG_ERROR = 1 << 0,
CM_MEDIAFLAG_IN_ERROR = 1 << 0,
CM_MEDIAFLAG_PAUSED = 1 << 1,
CM_MEDIAFLAG_MUTED = 1 << 2,
CM_MEDIAFLAG_LOOP = 1 << 3,
CM_MEDIAFLAG_CAN_SAVE = 1 << 4,
CM_MEDIAFLAG_HAS_AUDIO = 1 << 5,
CM_MEDIAFLAG_HAS_VIDEO = 1 << 6,
CM_MEDIAFLAG_CONTROL_ROOT_ELEMENT = 1 << 7,
CM_MEDIAFLAG_CAN_TOGGLE_CONTROLS = 1 << 6,
CM_MEDIAFLAG_CONTROLS = 1 << 7,
CM_MEDIAFLAG_CAN_PRINT = 1 << 8,
CM_MEDIAFLAG_CAN_ROTATE = 1 << 9,
CM_MEDIAFLAG_CAN_PICTURE_IN_PICTURE = 1 << 10,
CM_MEDIAFLAG_PICTURE_IN_PICTURE = 1 << 11,
CM_MEDIAFLAG_CAN_LOOP = 1 << 12,
} cef_context_menu_media_state_flags_t;
///
// Supported context menu edit state bit flags.
// Supported context menu edit state bit flags. These constants match their
// equivalents in Chromium's ContextMenuDataEditFlags and should not be
// renumbered.
///
typedef enum {
CM_EDITFLAG_NONE = 0,
@@ -1878,6 +1885,7 @@ typedef enum {
CM_EDITFLAG_CAN_DELETE = 1 << 5,
CM_EDITFLAG_CAN_SELECT_ALL = 1 << 6,
CM_EDITFLAG_CAN_TRANSLATE = 1 << 7,
CM_EDITFLAG_CAN_EDIT_RICHLY = 1 << 8,
} cef_context_menu_edit_state_flags_t;
///
@@ -2458,32 +2466,6 @@ typedef enum {
SCALE_FACTOR_300P,
} cef_scale_factor_t;
///
// Plugin policies supported by CefRequestContextHandler::OnBeforePluginLoad.
///
typedef enum {
///
// Allow the content.
///
PLUGIN_POLICY_ALLOW,
///
// Allow important content and block unimportant content based on heuristics.
// The user can manually load blocked content.
///
PLUGIN_POLICY_DETECT_IMPORTANT,
///
// Block the content. The user can manually load blocked content.
///
PLUGIN_POLICY_BLOCK,
///
// Disable the content. The user cannot load disabled content.
///
PLUGIN_POLICY_DISABLE,
} cef_plugin_policy_t;
///
// Policy for how the Referrer HTTP header value will be sent during navigation.
// If the `--no-referrers` command-line flag is specified then the policy value

View File

@@ -69,7 +69,7 @@ extern "C" {
// thread-safe and must only be accessed on the browser process UI thread.
///
#if defined(CEF_X11)
CEF_EXPORT XDisplay* cef_get_xdisplay();
CEF_EXPORT XDisplay* cef_get_xdisplay(void);
#endif
///

View File

@@ -704,7 +704,6 @@ struct CefBrowserSettingsTraits {
target->javascript_close_windows = src->javascript_close_windows;
target->javascript_access_clipboard = src->javascript_access_clipboard;
target->javascript_dom_paste = src->javascript_dom_paste;
target->plugins = src->plugins;
target->image_loading = src->image_loading;
target->image_shrink_standalone_to_fit =
src->image_shrink_standalone_to_fit;

View File

@@ -49,7 +49,7 @@ int cef_load_library(const char* path);
// Unload the CEF library that was previously loaded. Returns true (1)
// on success and false (0) on failure.
///
int cef_unload_library();
int cef_unload_library(void);
#ifdef __cplusplus
}

View File

@@ -78,7 +78,7 @@
// with an error code of -1.
//
// Queries can be either persistent or non-persistent. If the query is
// persistent than the callbacks will remain registered until one of the
// persistent then the callbacks will remain registered until one of the
// following conditions are met:
//
// A. The query is canceled in JavaScript using the |window.cefQueryCancel|

View File

@@ -9,6 +9,7 @@
#include <utility>
#include "libcef/browser/alloy/alloy_browser_context.h"
#include "libcef/browser/alloy/browser_platform_delegate_alloy.h"
#include "libcef/browser/audio_capturer.h"
#include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_info.h"
@@ -450,21 +451,19 @@ void AlloyBrowserHostImpl::PrintToPDF(const CefString& path,
}
}
void AlloyBrowserHostImpl::Find(int identifier,
const CefString& searchText,
void AlloyBrowserHostImpl::Find(const CefString& searchText,
bool forward,
bool matchCase,
bool findNext) {
if (!CEF_CURRENTLY_ON_UIT()) {
CEF_POST_TASK(CEF_UIT,
base::BindOnce(&AlloyBrowserHostImpl::Find, this, identifier,
searchText, forward, matchCase, findNext));
base::BindOnce(&AlloyBrowserHostImpl::Find, this, searchText,
forward, matchCase, findNext));
return;
}
if (platform_delegate_) {
platform_delegate_->Find(identifier, searchText, forward, matchCase,
findNext);
platform_delegate_->Find(searchText, forward, matchCase, findNext);
}
}
@@ -860,13 +859,21 @@ void AlloyBrowserHostImpl::FindReply(content::WebContents* web_contents,
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update) {
if (client_.get()) {
CefRefPtr<CefFindHandler> handler = client_->GetFindHandler();
if (handler.get()) {
CefRect rect(selection_rect.x(), selection_rect.y(),
selection_rect.width(), selection_rect.height());
handler->OnFindResult(this, request_id, number_of_matches, rect,
active_match_ordinal, final_update);
auto alloy_delegate =
static_cast<CefBrowserPlatformDelegateAlloy*>(platform_delegate());
if (alloy_delegate->HandleFindReply(request_id, number_of_matches,
selection_rect, active_match_ordinal,
final_update)) {
if (client_) {
if (auto handler = client_->GetFindHandler()) {
const auto& details = alloy_delegate->last_search_result();
CefRect rect(details.selection_rect().x(), details.selection_rect().y(),
details.selection_rect().width(),
details.selection_rect().height());
handler->OnFindResult(
this, details.request_id(), details.number_of_matches(), rect,
details.active_match_ordinal(), details.final_update());
}
}
}
}
@@ -1449,15 +1456,13 @@ bool AlloyBrowserHostImpl::IsNeverComposited(
}
content::PictureInPictureResult AlloyBrowserHostImpl::EnterPictureInPicture(
content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) {
content::WebContents* web_contents) {
if (!IsPictureInPictureSupported()) {
return content::PictureInPictureResult::kNotSupported;
}
return PictureInPictureWindowManager::GetInstance()->EnterPictureInPicture(
web_contents, surface_id, natural_size);
return PictureInPictureWindowManager::GetInstance()
->EnterVideoPictureInPicture(web_contents);
}
void AlloyBrowserHostImpl::ExitPictureInPicture() {
@@ -1470,7 +1475,8 @@ bool AlloyBrowserHostImpl::IsBackForwardCacheSupported() {
return false;
}
bool AlloyBrowserHostImpl::IsPrerender2Supported() {
bool AlloyBrowserHostImpl::IsPrerender2Supported(
content::WebContents& web_contents) {
return true;
}

View File

@@ -94,8 +94,7 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
void PrintToPDF(const CefString& path,
const CefPdfPrintSettings& settings,
CefRefPtr<CefPdfPrintCallback> callback) override;
void Find(int identifier,
const CefString& searchText,
void Find(const CefString& searchText,
bool forward,
bool matchCase,
bool findNext) override;
@@ -284,12 +283,10 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
blink::mojom::MediaStreamType type) override;
bool IsNeverComposited(content::WebContents* web_contents) override;
content::PictureInPictureResult EnterPictureInPicture(
content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) override;
content::WebContents* web_contents) override;
void ExitPictureInPicture() override;
bool IsBackForwardCacheSupported() override;
bool IsPrerender2Supported() override;
bool IsPrerender2Supported(content::WebContents& web_contents) override;
// content::WebContentsObserver methods.
using content::WebContentsObserver::BeforeUnloadFired;

View File

@@ -13,12 +13,10 @@
#include "libcef/browser/context.h"
#include "libcef/browser/devtools/devtools_manager_delegate.h"
#include "libcef/browser/extensions/extension_system_factory.h"
#include "libcef/browser/extensions/extensions_browser_client.h"
#include "libcef/browser/net/chrome_scheme_handler.h"
#include "libcef/browser/printing/constrained_window_views_client.h"
#include "libcef/browser/thread_util.h"
#include "libcef/common/app_manager.h"
#include "libcef/common/extensions/extensions_client.h"
#include "libcef/common/extensions/extensions_util.h"
#include "libcef/common/net/net_resource_provider.h"
@@ -35,7 +33,7 @@
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/browser/network_service_instance.h"
#include "content/public/common/result_codes.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/common/constants.h"
#include "net/base/net_module.h"
#include "third_party/widevine/cdm/buildflags.h"
@@ -205,14 +203,10 @@ int AlloyBrowserMainParts::PreMainMessageLoopRun() {
#endif
if (extensions::ExtensionsEnabled()) {
// This should be set in ChromeBrowserProcessAlloy::Initialize.
DCHECK(extensions::ExtensionsBrowserClient::Get());
// Initialize extension global objects before creating the global
// BrowserContext.
extensions_client_.reset(new extensions::CefExtensionsClient());
extensions::ExtensionsClient::Set(extensions_client_.get());
extensions_browser_client_.reset(
new extensions::CefExtensionsBrowserClient);
extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get());
extensions::CefExtensionSystemFactory::GetInstance();
}
@@ -283,11 +277,6 @@ void AlloyBrowserMainParts::PostMainMessageLoopRun() {
}
void AlloyBrowserMainParts::PostDestroyThreads() {
if (extensions::ExtensionsEnabled()) {
extensions::ExtensionsBrowserClient::Set(nullptr);
extensions_browser_client_.reset();
}
#if defined(TOOLKIT_VIEWS)
views_delegate_.reset();
#if BUILDFLAG(IS_MAC)

View File

@@ -15,11 +15,6 @@
#include "content/public/browser/browser_main_parts.h"
#include "content/public/common/main_function_params.h"
namespace extensions {
class ExtensionsBrowserClient;
class ExtensionsClient;
} // namespace extensions
#if defined(USE_AURA)
namespace display {
class Screen;
@@ -84,10 +79,6 @@ class AlloyBrowserMainParts : public content::BrowserMainParts {
CefRefPtr<CefRequestContextImpl> global_request_context_;
CefDevToolsDelegate* devtools_delegate_ = nullptr; // Deletes itself.
std::unique_ptr<extensions::ExtensionsClient> extensions_client_;
std::unique_ptr<extensions::ExtensionsBrowserClient>
extensions_browser_client_;
// Blocking task runners exposed via CefTaskRunner. For consistency with
// previous named thread behavior always execute all pending tasks before
// shutdown (e.g. to make sure critical data is saved to disk).

View File

@@ -115,7 +115,7 @@
#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_message_filter.h"
#include "extensions/browser/guest_view/extensions_guest_view.h"
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
#include "extensions/browser/info_map.h"
#include "extensions/browser/process_map.h"
@@ -197,7 +197,7 @@ class CefQuotaCallbackImpl : public CefCallback {
void Cancel() override { ContinueNow(false); }
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
[[nodiscard]] CallbackType Disconnect() { return std::move(callback_); }
private:
void ContinueNow(bool allow) {
@@ -255,7 +255,7 @@ class CefAllowCertificateErrorCallbackImpl : public CefCallback {
void Cancel() override { ContinueNow(false); }
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
[[nodiscard]] CallbackType Disconnect() { return std::move(callback_); }
private:
void ContinueNow(bool allow) {
@@ -521,8 +521,6 @@ void AlloyContentBrowserClient::RenderProcessWillLaunch(
if (extensions::ExtensionsEnabled()) {
host->AddFilter(new extensions::ExtensionMessageFilter(id, profile));
host->AddFilter(
new extensions::ExtensionsGuestViewMessageFilter(id, profile));
}
// If the renderer process crashes then the host may already have
@@ -633,6 +631,7 @@ void AlloyContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem(
additional_allowed_schemes);
additional_allowed_schemes->push_back(content::kChromeDevToolsScheme);
additional_allowed_schemes->push_back(content::kChromeUIScheme);
additional_allowed_schemes->push_back(content::kChromeUIUntrustedScheme);
}
bool AlloyContentBrowserClient::IsWebUIAllowedToMakeNetworkRequests(
@@ -751,7 +750,6 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
static const char* const kSwitchNames[] = {
switches::kDisableExtensions,
switches::kDisablePdfExtension,
switches::kDisablePlugins,
switches::kDisablePrintPreview,
switches::kDisableScrollBounce,
switches::kDisableSpellChecking,
@@ -765,14 +763,6 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
if (extensions::ExtensionsEnabled()) {
content::RenderProcessHost* process =
content::RenderProcessHost::FromID(child_process_id);
#if !BUILDFLAG(IS_WIN)
// kPdfRenderer will be set for Windows in
// RenderProcessHostImpl::AppendRendererCommandLine.
if (process && process->IsPdf()) {
command_line->AppendSwitch(switches::kPdfRenderer);
}
#endif // !BUILDFLAG(IS_WIN)
auto browser_context = process->GetBrowserContext();
CefBrowserContext* cef_browser_context =
process ? CefBrowserContext::FromBrowserContext(browser_context)
@@ -1164,6 +1154,10 @@ void AlloyContentBrowserClient::ExposeInterfacesToRenderer(
if (extensions::ExtensionsEnabled()) {
associated_registry->AddInterface(base::BindRepeating(
&extensions::EventRouter::BindForRenderer, host->GetID()));
associated_registry->AddInterface(base::BindRepeating(
&extensions::ExtensionsGuestView::CreateForComponents, host->GetID()));
associated_registry->AddInterface(base::BindRepeating(
&extensions::ExtensionsGuestView::CreateForExtensions, host->GetID()));
}
CefBrowserManager::ExposeInterfacesToRenderer(registry, associated_registry,
@@ -1406,19 +1400,29 @@ bool AlloyContentBrowserClient::HandleExternalProtocol(
web_contents_getter, std::move(receiver), std::move(request_handler));
return true;
}
std::unique_ptr<content::OverlayWindow>
AlloyContentBrowserClient::CreateWindowForPictureInPicture(
content::PictureInPictureWindowController* controller) {
// Note: content::OverlayWindow::Create() is defined by platform-specific
std::unique_ptr<content::VideoOverlayWindow>
AlloyContentBrowserClient::CreateWindowForVideoPictureInPicture(
content::VideoPictureInPictureWindowController* controller) {
// Note: content::VideoOverlayWindow::Create() is defined by platform-specific
// implementation in chrome/browser/ui/views. This layering hack, which goes
// through //content and ContentBrowserClient, allows us to work around the
// dependency constraints that disallow directly calling
// chrome/browser/ui/views code either from here or from other code in
// chrome/browser.
return content::OverlayWindow::Create(controller);
return content::VideoOverlayWindow::Create(controller);
}
std::unique_ptr<content::DocumentOverlayWindow>
AlloyContentBrowserClient::CreateWindowForDocumentPictureInPicture(
content::DocumentPictureInPictureWindowController* controller) {
// Note: content::DocumentOverlayWindow::Create() is defined by
// platform-specific implementation in chrome/browser/ui/views. This layering
// hack, which goes through //content and ContentBrowserClient, allows us to
// work around the dependency constraints that disallow directly calling
// chrome/browser/ui/views code either from here or from other code in
// chrome/browser.
return content::DocumentOverlayWindow::Create(controller);
}
void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForFrame(
content::RenderFrameHost* render_frame_host,
mojo::BinderMapWithContext<content::RenderFrameHost*>* map) {
@@ -1466,6 +1470,10 @@ std::string AlloyContentBrowserClient::GetUserAgent() {
return embedder_support::GetUserAgent();
}
std::string AlloyContentBrowserClient::GetFullUserAgent() {
return embedder_support::GetFullUserAgent();
}
std::string AlloyContentBrowserClient::GetReducedUserAgent() {
return embedder_support::GetReducedUserAgent();
}
@@ -1518,6 +1526,18 @@ bool AlloyContentBrowserClient::ShouldAllowPluginCreation(
return true;
}
void AlloyContentBrowserClient::OnWebContentsCreated(
content::WebContents* web_contents) {
// Attach universal WebContentsObservers. These are quite rare, and in most
// cases CefBrowserPlatformDelegateAlloy::BrowserCreated and/or
// CefExtensionsAPIClient::AttachWebContentsHelpers should be used instead.
if (extensions::ExtensionsEnabled()) {
extensions::CefExtensionWebContentsObserver::CreateForWebContents(
web_contents);
}
}
bool AlloyContentBrowserClient::IsFindInPageDisabledForOrigin(
const url::Origin& origin) {
// For PDF viewing with the PPAPI-free PDF Viewer, find-in-page should only

View File

@@ -216,8 +216,12 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
content::RenderFrameHost* initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory)
override;
std::unique_ptr<content::OverlayWindow> CreateWindowForPictureInPicture(
content::PictureInPictureWindowController* controller) override;
std::unique_ptr<content::VideoOverlayWindow>
CreateWindowForVideoPictureInPicture(
content::VideoPictureInPictureWindowController* controller) override;
std::unique_ptr<content::DocumentOverlayWindow>
CreateWindowForDocumentPictureInPicture(
content::DocumentPictureInPictureWindowController* controller) override;
void RegisterBrowserInterfaceBindersForFrame(
content::RenderFrameHost* render_frame_host,
mojo::BinderMapWithContext<content::RenderFrameHost*>* map) override;
@@ -225,6 +229,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
std::string GetProduct() override;
std::string GetChromeProduct() override;
std::string GetUserAgent() override;
std::string GetFullUserAgent() override;
std::string GetReducedUserAgent() override;
blink::UserAgentMetadata GetUserAgentMetadata() override;
base::flat_set<std::string> GetPluginMimeTypesWithExternalHandlers(
@@ -237,6 +242,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
bool ShouldAllowPluginCreation(
const url::Origin& embedder_origin,
const content::PepperPluginInfo& plugin_info) override;
void OnWebContentsCreated(content::WebContents* web_contents) override;
bool IsFindInPageDisabledForOrigin(const url::Origin& origin) override;
CefRefPtr<CefRequestContextImpl> request_context() const;

View File

@@ -5,6 +5,8 @@
#include "libcef/browser/alloy/alloy_dialog_util.h"
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/extensions/browser_extensions_util.h"
#include "libcef/browser/file_dialog_runner.h"
#include "base/strings/utf_string_conversions.h"
@@ -13,9 +15,12 @@ namespace alloy {
void RunFileChooser(content::WebContents* web_contents,
const blink::mojom::FileChooserParams& params,
RunFileChooserCallback callback) {
CefRefPtr<AlloyBrowserHostImpl> browser =
AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
CefRefPtr<AlloyBrowserHostImpl> browser = static_cast<AlloyBrowserHostImpl*>(
extensions::GetOwnerBrowserForHost(web_contents->GetRenderViewHost(),
nullptr)
.get());
if (!browser) {
LOG(ERROR) << "Failed to identify browser; canceling file dialog";
std::move(callback).Run(-1, {});
return;
}

View File

@@ -17,13 +17,17 @@
#include "base/logging.h"
#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/printing/print_view_manager_common.h"
#include "chrome/browser/ui/prefs/prefs_tab_helper.h"
#include "components/find_in_page/find_tab_helper.h"
#include "components/find_in_page/find_types.h"
#include "components/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 "content/public/browser/render_widget_host.h"
#include "extensions/browser/process_manager.h"
#include "pdf/pdf_features.h"
#include "printing/mojom/print.mojom.h"
#include "third_party/blink/public/mojom/frame/find_in_page.mojom.h"
@@ -108,6 +112,7 @@ void CefBrowserPlatformDelegateAlloy::WebContentsCreated(
content::WebContents* web_contents,
bool owned) {
CefBrowserPlatformDelegate::WebContentsCreated(web_contents, owned);
find_in_page::FindTabHelper::CreateForWebContents(web_contents);
if (owned) {
SetOwnedWebContents(web_contents);
@@ -179,9 +184,6 @@ void CefBrowserPlatformDelegateAlloy::BrowserCreated(
printing::CefPrintViewManager::CreateForWebContents(web_contents_);
if (extensions::ExtensionsEnabled()) {
extensions::CefExtensionWebContentsObserver::CreateForWebContents(
web_contents_);
// Used by the tabs extension API.
zoom::ZoomController::CreateForWebContents(web_contents_);
}
@@ -259,14 +261,11 @@ void CefBrowserPlatformDelegateAlloy::SendCaptureLostEvent() {
#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC))
void CefBrowserPlatformDelegateAlloy::NotifyMoveOrResizeStarted() {
if (!browser_)
if (!web_contents_)
return;
// Dismiss any existing popups.
auto frame = browser_->GetMainFrame();
if (frame && frame->IsValid()) {
static_cast<CefFrameHostImpl*>(frame.get())->NotifyMoveOrResizeStarted();
}
web_contents_->ClearFocusedElement();
}
#endif
@@ -341,33 +340,30 @@ void CefBrowserPlatformDelegateAlloy::SetAccessibilityState(
bool CefBrowserPlatformDelegateAlloy::IsPrintPreviewSupported() const {
REQUIRE_ALLOY_RUNTIME();
auto actionable_contents = GetActionableWebContents();
if (!actionable_contents)
return false;
auto cef_browser_context = CefBrowserContext::FromBrowserContext(
actionable_contents->GetBrowserContext());
if (!cef_browser_context->IsPrintPreviewSupported()) {
return false;
}
// Print preview is not currently supported with OSR.
return !IsWindowless();
if (IsWindowless())
return false;
auto cef_browser_context =
CefBrowserContext::FromBrowserContext(web_contents_->GetBrowserContext());
return cef_browser_context->IsPrintPreviewSupported();
}
void CefBrowserPlatformDelegateAlloy::Print() {
REQUIRE_ALLOY_RUNTIME();
auto actionable_contents = GetActionableWebContents();
if (!actionable_contents)
auto contents_to_use = printing::GetWebContentsToUse(web_contents_);
if (!contents_to_use)
return;
auto rfh = actionable_contents->GetMainFrame();
auto rfh_to_use = printing::GetRenderFrameHostToUse(contents_to_use);
if (!rfh_to_use)
return;
if (IsPrintPreviewSupported()) {
GetPrintViewManager(actionable_contents)->PrintPreviewNow(rfh, false);
GetPrintViewManager(contents_to_use)->PrintPreviewNow(rfh_to_use, false);
} else {
GetPrintViewManager(actionable_contents)->PrintNow(rfh);
GetPrintViewManager(contents_to_use)->PrintNow(rfh_to_use);
}
}
@@ -377,50 +373,65 @@ void CefBrowserPlatformDelegateAlloy::PrintToPDF(
CefRefPtr<CefPdfPrintCallback> callback) {
REQUIRE_ALLOY_RUNTIME();
content::WebContents* actionable_contents = GetActionableWebContents();
if (!actionable_contents)
auto contents_to_use = printing::GetWebContentsToUse(web_contents_);
if (!contents_to_use)
return;
auto rfh_to_use = printing::GetRenderFrameHostToUse(contents_to_use);
if (!rfh_to_use)
return;
printing::CefPrintViewManager::PdfPrintCallback pdf_callback;
if (callback.get()) {
pdf_callback = base::BindOnce(&CefPdfPrintCallback::OnPdfPrintFinished,
callback.get(), path);
}
GetPrintViewManager(actionable_contents)
->PrintToPDF(actionable_contents->GetMainFrame(), base::FilePath(path),
settings, std::move(pdf_callback));
GetPrintViewManager(contents_to_use)
->PrintToPDF(rfh_to_use, base::FilePath(path), settings,
std::move(pdf_callback));
}
void CefBrowserPlatformDelegateAlloy::Find(int identifier,
const CefString& searchText,
void CefBrowserPlatformDelegateAlloy::Find(const CefString& searchText,
bool forward,
bool matchCase,
bool findNext) {
if (!web_contents_)
return;
// Every find request must have a unique ID and these IDs must strictly
// increase so that newer requests always have greater IDs than older
// requests.
if (identifier <= find_request_id_counter_)
identifier = ++find_request_id_counter_;
else
find_request_id_counter_ = identifier;
auto options = blink::mojom::FindOptions::New();
options->forward = forward;
options->match_case = matchCase;
options->find_match = findNext;
web_contents_->Find(identifier, searchText, std::move(options));
find_in_page::FindTabHelper::FromWebContents(web_contents_)
->StartFinding(searchText.ToString16(), forward, matchCase, findNext,
/*run_synchronously_for_testing=*/false);
}
void CefBrowserPlatformDelegateAlloy::StopFinding(bool clearSelection) {
if (!web_contents_)
return;
content::StopFindAction action =
clearSelection ? content::STOP_FIND_ACTION_CLEAR_SELECTION
: content::STOP_FIND_ACTION_KEEP_SELECTION;
web_contents_->StopFinding(action);
last_search_result_ = find_in_page::FindNotificationDetails();
find_in_page::FindTabHelper::FromWebContents(web_contents_)
->StopFinding(clearSelection ? find_in_page::SelectionAction::kClear
: find_in_page::SelectionAction::kKeep);
}
bool CefBrowserPlatformDelegateAlloy::HandleFindReply(
int request_id,
int number_of_matches,
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update) {
if (!web_contents_)
return false;
auto find_in_page =
find_in_page::FindTabHelper::FromWebContents(web_contents_);
find_in_page->HandleFindReply(request_id, number_of_matches, selection_rect,
active_match_ordinal, final_update);
if (!(find_in_page->find_result() == last_search_result_)) {
last_search_result_ = find_in_page->find_result();
return true;
}
return false;
}
base::RepeatingClosure
@@ -432,17 +443,6 @@ CefBrowserPlatformDelegateAlloy::GetBoundsChangedCallback() {
return base::RepeatingClosure();
}
content::WebContents*
CefBrowserPlatformDelegateAlloy::GetActionableWebContents() const {
if (web_contents_ && extensions::ExtensionsEnabled()) {
content::WebContents* guest_contents =
extensions::GetFullPageGuestForOwnerContents(web_contents_);
if (guest_contents)
return guest_contents;
}
return web_contents_;
}
void CefBrowserPlatformDelegateAlloy::SetOwnedWebContents(
content::WebContents* owned_contents) {
DCHECK(primary_);

View File

@@ -10,6 +10,7 @@
#include "libcef/browser/web_contents_dialog_helper.h"
#include "base/memory/weak_ptr.h"
#include "components/find_in_page/find_notification_details.h"
#include "content/public/browser/web_contents.h"
#include "ui/gfx/geometry/size.h"
@@ -58,24 +59,28 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
void PrintToPDF(const CefString& path,
const CefPdfPrintSettings& settings,
CefRefPtr<CefPdfPrintCallback> callback) override;
void Find(int identifier,
const CefString& searchText,
void Find(const CefString& searchText,
bool forward,
bool matchCase,
bool findNext) override;
void StopFinding(bool clearSelection) override;
// Called from AlloyBrowserHostImpl::FindReply().
bool HandleFindReply(int request_id,
int number_of_matches,
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update);
const find_in_page::FindNotificationDetails& last_search_result() const {
return last_search_result_;
}
protected:
CefBrowserPlatformDelegateAlloy();
base::RepeatingClosure GetBoundsChangedCallback();
// Returns the WebContents most likely to handle an action. If extensions are
// enabled and this browser has a full-page guest (for example, a full-page
// PDF viewer extension) then the guest's WebContents will be returned.
// Otherwise, the browser's WebContents will be returned.
content::WebContents* GetActionableWebContents() const;
// Called from BrowserPlatformDelegateNative::set_windowless_handler().
void set_as_secondary() { primary_ = false; }
@@ -96,8 +101,9 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
// Used for the print preview dialog.
std::unique_ptr<CefWebContentsDialogHelper> web_contents_dialog_helper_;
// Used to provide unique incremental IDs for each find request.
int find_request_id_counter_ = 0;
// The last find result. This object contains details about the number of
// matches, the find selection rectangle, etc.
find_in_page::FindNotificationDetails last_search_result_;
// Used when the browser is hosting an extension.
extensions::ExtensionHost* extension_host_ = nullptr;

View File

@@ -8,9 +8,12 @@
#include "libcef/browser/alloy/chrome_profile_manager_alloy.h"
#include "libcef/browser/browser_context.h"
#include "libcef/browser/context.h"
#include "libcef/browser/extensions/extensions_browser_client.h"
#include "libcef/browser/prefs/browser_prefs.h"
#include "libcef/browser/thread_util.h"
#include "libcef/common/cef_switches.h"
#include "libcef/common/extensions/extensions_client.h"
#include "libcef/common/extensions/extensions_util.h"
#include "base/command_line.h"
#include "chrome/browser/component_updater/chrome_component_updater_configurator.h"
@@ -38,6 +41,11 @@ ChromeBrowserProcessAlloy::ChromeBrowserProcessAlloy()
ChromeBrowserProcessAlloy::~ChromeBrowserProcessAlloy() {
DCHECK((!initialized_ && !context_initialized_) || shutdown_);
if (extensions::ExtensionsEnabled()) {
extensions::ExtensionsBrowserClient::Set(nullptr);
extensions_browser_client_.reset();
}
}
void ChromeBrowserProcessAlloy::Initialize() {
@@ -49,6 +57,16 @@ void ChromeBrowserProcessAlloy::Initialize() {
// Initialize this early before any code tries to check feature flags.
field_trial_list_ = content::SetUpFieldTrialsAndFeatureList();
if (extensions::ExtensionsEnabled()) {
// Initialize extension global objects before creating the global
// BrowserContext.
extensions_client_.reset(new extensions::CefExtensionsClient());
extensions::ExtensionsClient::Set(extensions_client_.get());
extensions_browser_client_.reset(
new extensions::CefExtensionsBrowserClient);
extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get());
}
initialized_ = true;
}
@@ -311,12 +329,6 @@ ChromeBrowserProcessAlloy::subresource_filter_ruleset_service() {
return nullptr;
}
federated_learning::FlocSortingLshClustersService*
ChromeBrowserProcessAlloy::floc_sorting_lsh_clusters_service() {
NOTREACHED();
return nullptr;
}
StartupData* ChromeBrowserProcessAlloy::startup_data() {
NOTREACHED();
return nullptr;
@@ -391,6 +403,12 @@ ChromeBrowserProcessAlloy::serial_policy_allowed_ports() {
return nullptr;
}
HidPolicyAllowedDevices*
ChromeBrowserProcessAlloy::hid_policy_allowed_devices() {
NOTREACHED();
return nullptr;
}
breadcrumbs::BreadcrumbPersistentStorageManager*
ChromeBrowserProcessAlloy::GetBreadcrumbPersistentStorageManager() {
NOTREACHED();

View File

@@ -12,12 +12,16 @@
#include <memory>
#include <string>
#include "base/compiler_specific.h"
#include "base/metrics/field_trial.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/event_router_forwarder.h"
#include "media/media_buildflags.h"
namespace extensions {
class ExtensionsBrowserClient;
class ExtensionsClient;
} // namespace extensions
class ChromeProfileManagerAlloy;
class BackgroundModeManager {
@@ -86,8 +90,6 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
safe_browsing::SafeBrowsingService* safe_browsing_service() override;
subresource_filter::RulesetService* subresource_filter_ruleset_service()
override;
federated_learning::FlocSortingLshClustersService*
floc_sorting_lsh_clusters_service() override;
StartupData* startup_data() override;
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
@@ -104,6 +106,7 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
override;
BuildState* GetBuildState() override;
SerialPolicyAllowedPorts* serial_policy_allowed_ports() override;
HidPolicyAllowedDevices* hid_policy_allowed_devices() override;
breadcrumbs::BreadcrumbPersistentStorageManager*
GetBreadcrumbPersistentStorageManager() override;
@@ -112,6 +115,10 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
bool context_initialized_;
bool shutdown_;
std::unique_ptr<extensions::ExtensionsClient> extensions_client_;
std::unique_ptr<extensions::ExtensionsBrowserClient>
extensions_browser_client_;
std::string locale_;
std::unique_ptr<printing::PrintJobManager> print_job_manager_;
std::unique_ptr<ChromeProfileManagerAlloy> profile_manager_;

View File

@@ -83,7 +83,8 @@ void CreateSystemWideLoopbackStreamHelper(
const bool enable_agc = false;
factory->CreateInputStream(
-1, -1, media::AudioDeviceDescription::kLoopbackWithMuteDeviceId, params,
total_segments, enable_agc, std::move(client_remote));
total_segments, enable_agc, media::mojom::AudioProcessingConfigPtr(),
std::move(client_remote));
}
} // namespace

View File

@@ -331,8 +331,7 @@ void CefBrowserContentsDelegate::OnFrameFocused(
OnStateChanged(State::kFocusedFrame);
}
void CefBrowserContentsDelegate::DocumentAvailableInMainFrame(
content::RenderFrameHost* render_frame_host) {
void CefBrowserContentsDelegate::PrimaryMainDocumentElementAvailable() {
has_document_ = true;
OnStateChanged(State::kDocument);
@@ -441,16 +440,6 @@ void CefBrowserContentsDelegate::TitleWasSet(content::NavigationEntry* entry) {
OnTitleChange(web_contents()->GetTitle());
}
void CefBrowserContentsDelegate::PluginCrashed(
const base::FilePath& plugin_path,
base::ProcessId plugin_pid) {
if (auto c = client()) {
if (auto handler = c->GetRequestHandler()) {
handler->OnPluginCrashed(browser(), plugin_path.value());
}
}
}
void CefBrowserContentsDelegate::DidUpdateFaviconURL(
content::RenderFrameHost* render_frame_host,
const std::vector<blink::mojom::FaviconURLPtr>& candidates) {

View File

@@ -121,8 +121,7 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate,
void PrimaryMainFrameRenderProcessGone(
base::TerminationStatus status) override;
void OnFrameFocused(content::RenderFrameHost* render_frame_host) override;
void DocumentAvailableInMainFrame(
content::RenderFrameHost* render_frame_host) override;
void PrimaryMainDocumentElementAvailable() override;
void LoadProgressChanged(double progress) override;
void DidStopLoading() override;
void DidFinishNavigation(
@@ -131,8 +130,6 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate,
const GURL& validated_url,
int error_code) override;
void TitleWasSet(content::NavigationEntry* entry) override;
void PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) override;
void DidUpdateFaviconURL(
content::RenderFrameHost* render_frame_host,
const std::vector<blink::mojom::FaviconURLPtr>& candidates) override;

View File

@@ -35,18 +35,20 @@ void CefBrowserFrame::RegisterBrowserInterfaceBindersForFrame(
void CefBrowserFrame::SendMessage(const std::string& name,
base::Value arguments) {
// Always associate with the newly created RFH, which may be speculative when
// Always send to the newly created RFH, which may be speculative when
// navigating cross-origin.
if (auto host = GetFrameHost(/*prefer_speculative=*/true)) {
host->SendMessage(name, std::move(arguments));
}
}
void CefBrowserFrame::FrameAttached() {
void CefBrowserFrame::FrameAttached(
mojo::PendingRemote<cef::mojom::RenderFrame> render_frame,
bool reattached) {
// Always send to the newly created RFH, which may be speculative when
// navigating cross-origin.
if (auto host = GetFrameHost(/*prefer_speculative=*/true)) {
host->FrameAttached();
host->FrameAttached(std::move(render_frame), reattached);
}
}

View File

@@ -36,7 +36,8 @@ class CefBrowserFrame
private:
// cef::mojom::BrowserFrame methods:
void SendMessage(const std::string& name, base::Value arguments) override;
void FrameAttached() override;
void FrameAttached(mojo::PendingRemote<cef::mojom::RenderFrame> render_frame,
bool reattached) override;
void DidFinishFrameLoad(const GURL& validated_url,
int32_t http_status_code) override;
void UpdateDraggableRegions(

View File

@@ -168,10 +168,13 @@ void CefBrowserInfo::FrameHostStateChanged(
content::RenderFrameHost::LifecycleState::kInBackForwardCache) &&
new_state == content::RenderFrameHost::LifecycleState::kActive) {
if (auto frame = GetFrameForHost(host)) {
// Should only occur for the main frame.
CHECK(frame->IsMain());
// Update the associated RFH, which may have changed.
frame->MaybeReAttach(this, host);
if (frame->IsMain()) {
{
// Update the main frame object.
NotificationStateLock lock_scope(this);
SetMainFrame(browser_, frame);

View File

@@ -381,8 +381,7 @@ void CefBrowserPlatformDelegate::PrintToPDF(
NOTIMPLEMENTED();
}
void CefBrowserPlatformDelegate::Find(int identifier,
const CefString& searchText,
void CefBrowserPlatformDelegate::Find(const CefString& searchText,
bool forward,
bool matchCase,
bool findNext) {

View File

@@ -353,8 +353,7 @@ class CefBrowserPlatformDelegate {
virtual void PrintToPDF(const CefString& path,
const CefPdfPrintSettings& settings,
CefRefPtr<CefPdfPrintCallback> callback);
virtual void Find(int identifier,
const CefString& searchText,
virtual void Find(const CefString& searchText,
bool forward,
bool matchCase,
bool findNext);

View File

@@ -215,8 +215,7 @@ void ChromeBrowserHostImpl::PrintToPDF(
callback->OnPdfPrintFinished(CefString(), false);
}
void ChromeBrowserHostImpl::Find(int identifier,
const CefString& searchText,
void ChromeBrowserHostImpl::Find(const CefString& searchText,
bool forward,
bool matchCase,
bool findNext) {

View File

@@ -74,8 +74,7 @@ class ChromeBrowserHostImpl : public CefBrowserHostBase {
void PrintToPDF(const CefString& path,
const CefPdfPrintSettings& settings,
CefRefPtr<CefPdfPrintCallback> callback) override;
void Find(int identifier,
const CefString& searchText,
void Find(const CefString& searchText,
bool forward,
bool matchCase,
bool findNext) override;

View File

@@ -127,16 +127,6 @@ void ChromeContentBrowserClientCef::AppendExtraCommandLineSwitches(
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
base::size(kSwitchNames));
#if !BUILDFLAG(IS_WIN)
// kPdfRenderer will be set for Windows in
// RenderProcessHostImpl::AppendRendererCommandLine.
content::RenderProcessHost* process =
content::RenderProcessHost::FromID(child_process_id);
if (process && process->IsPdf()) {
command_line->AppendSwitch(switches::kPdfRenderer);
}
#endif // !BUILDFLAG(IS_WIN)
}
CefRefPtr<CefApp> app = CefAppManager::Get()->GetApplication();

View File

@@ -339,8 +339,7 @@ void CefDevToolsFrontend::ReadyToCommitNavigation(
content::DevToolsFrontendHost::SetupExtensionsAPI(frame, script);
}
void CefDevToolsFrontend::DocumentAvailableInMainFrame(
content::RenderFrameHost* render_frame_host) {
void CefDevToolsFrontend::PrimaryMainDocumentElementAvailable() {
// Don't call AttachClient multiple times for the same DevToolsAgentHost.
// Otherwise it will call AgentHostClosed which closes the DevTools window.
// This may happen in cases where the DevTools content fails to load.
@@ -381,7 +380,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
// Since we've received message by value, we can take the list.
base::Value::ListStorage params;
if (params_value) {
params = std::move(*params_value).TakeList();
params = std::move(*params_value).TakeListDeprecated();
}
if (*method == "dispatchProtocolMessage") {

View File

@@ -10,7 +10,6 @@
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/devtools/devtools_file_manager.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
@@ -81,8 +80,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
// WebContentsObserver overrides
void ReadyToCommitNavigation(
content::NavigationHandle* navigation_handle) override;
void DocumentAvailableInMainFrame(
content::RenderFrameHost* render_frame_host) override;
void PrimaryMainDocumentElementAvailable() override;
void WebContentsDestroyed() override;
void SendMessageAck(int request_id, base::Value arg);

View File

@@ -5,7 +5,6 @@
#ifndef CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_DELEGATE_H_
#define CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_DELEGATE_H_
#include "base/compiler_specific.h"
#include "content/public/browser/devtools_manager_delegate.h"
namespace content {

View File

@@ -10,7 +10,6 @@
#include "libcef/browser/browser_host_base.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "components/download/public/common/download_item.h"
#include "content/public/browser/download_manager.h"

View File

@@ -86,10 +86,10 @@ void CefExtensionImpl::Unload() {
// flag, so set it here.
unloaded_ = true;
const bool result = static_cast<CefRequestContextImpl*>(loader_context_)
->GetBrowserContext()
->UnloadExtension(id_);
ALLOW_UNUSED_LOCAL(result);
[[maybe_unused]] const bool result =
static_cast<CefRequestContextImpl*>(loader_context_)
->GetBrowserContext()
->UnloadExtension(id_);
DCHECK(result);
}

View File

@@ -0,0 +1,134 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "libcef/browser/extensions/api/file_system/cef_file_system_delegate.h"
#include "libcef/browser/alloy/alloy_dialog_util.h"
#include "apps/saved_files_service.h"
#include "base/callback.h"
#include "base/callback_forward.h"
#include "base/files/file_path.h"
#include "chrome/grit/generated_resources.h"
#include "extensions/common/api/file_system.h"
#include "extensions/common/extension.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
using blink::mojom::FileChooserParams;
namespace extensions {
namespace cef {
CefFileSystemDelegate::CefFileSystemDelegate() = default;
CefFileSystemDelegate::~CefFileSystemDelegate() = default;
base::FilePath CefFileSystemDelegate::GetDefaultDirectory() {
return base::FilePath();
}
base::FilePath CefFileSystemDelegate::GetManagedSaveAsDirectory(
content::BrowserContext* browser_context,
const Extension& extension) {
return base::FilePath();
}
bool CefFileSystemDelegate::ShowSelectFileDialog(
scoped_refptr<ExtensionFunction> extension_function,
ui::SelectFileDialog::Type type,
const base::FilePath& default_path,
const ui::SelectFileDialog::FileTypeInfo* file_types,
FileSystemDelegate::FilesSelectedCallback files_selected_callback,
base::OnceClosure file_selection_canceled_callback) {
auto web_contents = extension_function->GetSenderWebContents();
if (!web_contents) {
return false;
}
absl::optional<FileChooserParams::Mode> mode;
switch (type) {
case ui::SelectFileDialog::Type::SELECT_UPLOAD_FOLDER:
mode = FileChooserParams::Mode::kUploadFolder;
break;
case ui::SelectFileDialog::Type::SELECT_SAVEAS_FILE:
mode = FileChooserParams::Mode::kSave;
break;
case ui::SelectFileDialog::Type::SELECT_OPEN_FILE:
mode = FileChooserParams::Mode::kOpen;
break;
case ui::SelectFileDialog::Type::SELECT_OPEN_MULTI_FILE:
mode = FileChooserParams::Mode::kOpenMultiple;
break;
default:
NOTIMPLEMENTED();
return false;
}
FileChooserParams params;
params.mode = *mode;
params.default_file_name = default_path;
if (file_types) {
// A list of allowed extensions. For example, it might be
// { { "htm", "html" }, { "txt" } }
for (auto& vec : file_types->extensions) {
for (auto& ext : vec) {
params.accept_types.push_back(
alloy::FilePathTypeToString16(FILE_PATH_LITERAL(".") + ext));
}
}
}
alloy::RunFileChooser(
web_contents, params,
base::BindOnce(&CefFileSystemDelegate::FileDialogDismissed,
weak_ptr_factory_.GetWeakPtr(),
std::move(files_selected_callback),
std::move(file_selection_canceled_callback)));
return true;
}
void CefFileSystemDelegate::FileDialogDismissed(
FileSystemDelegate::FilesSelectedCallback files_selected_callback,
base::OnceClosure file_selection_canceled_callback,
int selected_accept_filter,
const std::vector<base::FilePath>& file_paths) {
if (!file_paths.empty()) {
std::move(files_selected_callback).Run(file_paths);
} else {
std::move(file_selection_canceled_callback).Run();
}
}
void CefFileSystemDelegate::ConfirmSensitiveDirectoryAccess(
bool has_write_permission,
const std::u16string& app_name,
content::WebContents* web_contents,
base::OnceClosure on_accept,
base::OnceClosure on_cancel) {
NOTIMPLEMENTED();
// Run the cancel callback by default.
std::move(on_cancel).Run();
}
// Based on ChromeFileSystemDelegate::GetDescriptionIdForAcceptType.
int CefFileSystemDelegate::GetDescriptionIdForAcceptType(
const std::string& accept_type) {
if (accept_type == "image/*")
return IDS_IMAGE_FILES;
if (accept_type == "audio/*")
return IDS_AUDIO_FILES;
if (accept_type == "video/*")
return IDS_VIDEO_FILES;
return 0;
}
SavedFilesServiceInterface* CefFileSystemDelegate::GetSavedFilesService(
content::BrowserContext* browser_context) {
return apps::SavedFilesService::Get(browser_context);
}
} // namespace cef
} // namespace extensions

View File

@@ -0,0 +1,68 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_DELEGATE_H_
#define CEF_LIBCEF_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_DELEGATE_H_
#include <memory>
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "extensions/browser/api/execute_code_function.h"
#include "extensions/browser/api/file_system/file_system_delegate.h"
#include "extensions/browser/extension_function.h"
namespace content {
class WebContents;
}
namespace extensions {
namespace cef {
class CefFileSystemDelegate : public FileSystemDelegate {
public:
CefFileSystemDelegate();
CefFileSystemDelegate(const CefFileSystemDelegate&) = delete;
CefFileSystemDelegate& operator=(const CefFileSystemDelegate&) = delete;
~CefFileSystemDelegate() override;
// FileSystemDelegate
base::FilePath GetDefaultDirectory() override;
base::FilePath GetManagedSaveAsDirectory(
content::BrowserContext* browser_context,
const Extension& extension) override;
bool ShowSelectFileDialog(
scoped_refptr<ExtensionFunction> extension_function,
ui::SelectFileDialog::Type type,
const base::FilePath& default_path,
const ui::SelectFileDialog::FileTypeInfo* file_types,
FileSystemDelegate::FilesSelectedCallback files_selected_callback,
base::OnceClosure file_selection_canceled_callback) override;
void ConfirmSensitiveDirectoryAccess(bool has_write_permission,
const std::u16string& app_name,
content::WebContents* web_contents,
base::OnceClosure on_accept,
base::OnceClosure on_cancel) override;
int GetDescriptionIdForAcceptType(const std::string& accept_type) override;
SavedFilesServiceInterface* GetSavedFilesService(
content::BrowserContext* browser_context) override;
private:
void FileDialogDismissed(
FileSystemDelegate::FilesSelectedCallback files_selected_callback,
base::OnceClosure file_selection_canceled_callback,
int selected_accept_filter,
const std::vector<base::FilePath>& file_paths);
base::WeakPtrFactory<CefFileSystemDelegate> weak_ptr_factory_{this};
};
} // namespace cef
} // namespace extensions
#endif // CEF_LIBCEF_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_DELEGATE_H_

View File

@@ -8,7 +8,6 @@
#include <memory>
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "extensions/browser/api/storage/settings_storage_quota_enforcer.h"
#include "extensions/browser/api/storage/value_store_cache.h"

View File

@@ -15,7 +15,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/printing/print_preview_dialog_controller.h"
#include "content/browser/browser_plugin/browser_plugin_embedder.h"
#include "content/browser/browser_plugin/browser_plugin_guest.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/browser_context.h"
@@ -36,21 +35,6 @@ bool InsertWebContents(std::vector<content::WebContents*>* vector,
} // namespace
content::WebContents* GetFullPageGuestForOwnerContents(
content::WebContents* owner) {
content::WebContentsImpl* owner_impl =
static_cast<content::WebContentsImpl*>(owner);
content::BrowserPluginEmbedder* plugin_embedder =
owner_impl->GetBrowserPluginEmbedder();
if (plugin_embedder) {
content::BrowserPluginGuest* plugin_guest =
plugin_embedder->GetFullPageGuest();
if (plugin_guest)
return plugin_guest->web_contents();
}
return nullptr;
}
void GetAllGuestsForOwnerContents(content::WebContents* owner,
std::vector<content::WebContents*>* guests) {
content::BrowserPluginGuestManager* plugin_guest_manager =

View File

@@ -26,10 +26,6 @@ namespace extensions {
class Extension;
// Returns the full-page guest WebContents for the specified |owner|, if any.
content::WebContents* GetFullPageGuestForOwnerContents(
content::WebContents* owner);
// Populates |guests| with all guest WebContents with the specified |owner|.
void GetAllGuestsForOwnerContents(content::WebContents* owner,
std::vector<content::WebContents*>* guests);

View File

@@ -60,9 +60,7 @@ bool CefExtensionHostDelegate::CheckMediaAccessPermission(
}
content::PictureInPictureResult CefExtensionHostDelegate::EnterPictureInPicture(
content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) {
content::WebContents* web_contents) {
NOTREACHED();
return content::PictureInPictureResult::kNotSupported;
}

View File

@@ -38,9 +38,7 @@ class CefExtensionHostDelegate : public ExtensionHostDelegate {
blink::mojom::MediaStreamType type,
const Extension* extension) override;
content::PictureInPictureResult EnterPictureInPicture(
content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) override;
content::WebContents* web_contents) override;
void ExitPictureInPicture() override;
};

View File

@@ -466,11 +466,10 @@ void CefExtensionSystem::RegisterExtensionWithRequestContexts(
// Implementation based on
// ExtensionSystemImpl::UnregisterExtensionWithRequestContexts.
void CefExtensionSystem::UnregisterExtensionWithRequestContexts(
const std::string& extension_id,
const UnloadedExtensionReason reason) {
const std::string& extension_id) {
content::GetIOThreadTaskRunner({})->PostTask(
FROM_HERE, base::BindOnce(&InfoMap::RemoveExtension, info_map(),
extension_id, reason));
FROM_HERE,
base::BindOnce(&InfoMap::RemoveExtension, info_map(), extension_id));
}
const base::OneShotEvent& CefExtensionSystem::ready() const {
@@ -611,7 +610,7 @@ void CefExtensionSystem::UnloadExtension(const std::string& extension_id,
if (!extension.get()) {
// In case the extension may have crashed/uninstalled. Allow the profile to
// clean up its RequestContexts.
UnregisterExtensionWithRequestContexts(extension_id, reason);
UnregisterExtensionWithRequestContexts(extension_id);
return;
}
@@ -620,7 +619,7 @@ void CefExtensionSystem::UnloadExtension(const std::string& extension_id,
// Make sure the profile cleans up its RequestContexts when an already
// disabled extension is unloaded (since they are also tracking the disabled
// extensions).
UnregisterExtensionWithRequestContexts(extension_id, reason);
UnregisterExtensionWithRequestContexts(extension_id);
// Don't send the unloaded notification. It was sent when the extension
// was disabled.
} else {
@@ -712,7 +711,7 @@ void CefExtensionSystem::NotifyExtensionUnloaded(
// Tell renderers about the unloaded extension.
renderer_helper_->OnExtensionUnloaded(*extension);
UnregisterExtensionWithRequestContexts(extension->id(), reason);
UnregisterExtensionWithRequestContexts(extension->id());
}
} // namespace extensions

View File

@@ -12,7 +12,6 @@
#include "include/cef_extension_handler.h"
#include "include/cef_request_context.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "base/one_shot_event.h"
#include "extensions/browser/extension_system.h"
@@ -102,8 +101,7 @@ class CefExtensionSystem : public ExtensionSystem {
const Extension* extension,
base::OnceClosure callback) override;
void UnregisterExtensionWithRequestContexts(
const std::string& extension_id,
const UnloadedExtensionReason reason) override;
const std::string& extension_id) override;
const base::OneShotEvent& ready() const override;
bool is_ready() const override;
ContentVerifier* content_verifier() override;

View File

@@ -7,6 +7,7 @@
#include "include/internal/cef_types_wrappers.h"
#include "libcef/browser/browser_context.h"
#include "libcef/browser/extensions/api/file_system/cef_file_system_delegate.h"
#include "libcef/browser/extensions/api/storage/sync_value_store_cache.h"
#include "libcef/browser/extensions/extension_web_contents_observer.h"
#include "libcef/browser/extensions/mime_handler_view_guest_delegate.h"
@@ -52,8 +53,6 @@ void CefExtensionsAPIClient::AttachWebContentsHelpers(
PrefsTabHelper::CreateForWebContents(web_contents);
printing::CefPrintViewManager::CreateForWebContents(web_contents);
CefExtensionWebContentsObserver::CreateForWebContents(web_contents);
// Used by the PDF extension.
pdf::PDFWebContentsHelper::CreateForWebContentsWithClient(
web_contents, std::unique_ptr<pdf::PDFWebContentsHelperClient>(
@@ -76,4 +75,10 @@ void CefExtensionsAPIClient::AddAdditionalValueStoreCaches(
(*caches)[settings_namespace::SYNC] = new cef::SyncValueStoreCache(factory);
}
FileSystemDelegate* CefExtensionsAPIClient::GetFileSystemDelegate() {
if (!file_system_delegate_)
file_system_delegate_ = std::make_unique<cef::CefFileSystemDelegate>();
return file_system_delegate_.get();
}
} // namespace extensions

View File

@@ -25,6 +25,7 @@ class CefExtensionsAPIClient : public ExtensionsAPIClient {
MimeHandlerViewGuest* guest) const override;
void AttachWebContentsHelpers(
content::WebContents* web_contents) const override;
FileSystemDelegate* GetFileSystemDelegate() override;
// Storage API support.
@@ -37,6 +38,9 @@ class CefExtensionsAPIClient : public ExtensionsAPIClient {
observers,
std::map<settings_namespace::Namespace, ValueStoreCache*>* caches)
override;
private:
std::unique_ptr<FileSystemDelegate> file_system_delegate_;
};
} // namespace extensions

View File

@@ -6,7 +6,6 @@
#ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_BROWSER_CLIENT_H_
#define CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_BROWSER_CLIENT_H_
#include "base/compiler_specific.h"
#include "extensions/browser/extensions_browser_client.h"
namespace extensions {

View File

@@ -11,7 +11,6 @@
#include <string>
#include <vector>
#include "base/compiler_specific.h"
#include "components/value_store/value_store.h"
namespace value_store {

View File

@@ -67,7 +67,7 @@ class CefFileDialogCallbackImpl : public CefFileDialogCallback {
}
}
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
[[nodiscard]] CallbackType Disconnect() { return std::move(callback_); }
private:
static void CancelNow(CallbackType callback) {

View File

@@ -10,7 +10,6 @@
#include "include/cef_browser.h"
#include "libcef/browser/file_dialog_runner.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/web_contents_observer.h"

View File

@@ -283,13 +283,6 @@ void CefFrameHostImpl::RefreshAttributes() {
}
}
void CefFrameHostImpl::NotifyMoveOrResizeStarted() {
SendToRenderFrame(__FUNCTION__,
base::BindOnce([](const RenderFrameType& render_frame) {
render_frame->MoveOrResizeStarted();
}));
}
void CefFrameHostImpl::LoadRequest(cef::mojom::RequestParamsPtr params) {
if (!url_util::FixupGURL(params->url))
return;
@@ -449,13 +442,12 @@ bool CefFrameHostImpl::Detach() {
}
// In case we never attached, clean up.
while (!queued_actions_.empty()) {
queued_actions_.pop();
while (!queued_renderer_actions_.empty()) {
queued_renderer_actions_.pop();
}
render_frame_.reset();
render_frame_host_ = nullptr;
is_attached_ = false;
return first_detach;
}
@@ -464,14 +456,14 @@ void CefFrameHostImpl::MaybeReAttach(
scoped_refptr<CefBrowserInfo> browser_info,
content::RenderFrameHost* render_frame_host) {
CEF_REQUIRE_UIT();
if (is_attached_ && render_frame_host_ == render_frame_host) {
if (render_frame_.is_bound() && render_frame_host_ == render_frame_host) {
// Nothing to do here.
return;
}
// We expect that Detach() was called previously.
CHECK(!is_temporary());
CHECK(!is_attached_);
CHECK(!render_frame_.is_bound());
CHECK(!render_frame_host_);
// The RFH may change but the GlobalId should remain the same.
@@ -486,8 +478,7 @@ void CefFrameHostImpl::MaybeReAttach(
render_frame_host_ = render_frame_host;
RefreshAttributes();
// Restore the RenderFrame connection.
FrameAttachedInternal(/*reattached=*/true);
// We expect a reconnect to be triggered via FrameAttached().
}
// kMainFrameId must be -1 to align with renderer expectations.
@@ -517,20 +508,6 @@ CefRefPtr<CefBrowserHostBase> CefFrameHostImpl::GetBrowserHostBase() const {
return nullptr;
}
const mojo::Remote<cef::mojom::RenderFrame>&
CefFrameHostImpl::GetRenderFrame() {
CEF_REQUIRE_UIT();
DCHECK(is_attached_);
if (!render_frame_.is_bound() && render_frame_host_ &&
render_frame_host_->GetRemoteInterfaces()) {
// Connects to a CefFrameImpl that already exists in the renderer process.
render_frame_host_->GetRemoteInterfaces()->GetInterface(
render_frame_.BindNewPipeAndPassReceiver());
}
return render_frame_;
}
void CefFrameHostImpl::SendToRenderFrame(const std::string& function_name,
RenderFrameAction action) {
if (!CEF_CURRENTLY_ON_UIT()) {
@@ -553,18 +530,22 @@ void CefFrameHostImpl::SendToRenderFrame(const std::string& function_name,
return;
}
if (!is_attached_) {
if (!render_frame_.is_bound()) {
// Queue actions until we're notified by the renderer that it's ready to
// handle them.
queued_actions_.push(std::make_pair(function_name, std::move(action)));
queued_renderer_actions_.push(
std::make_pair(function_name, std::move(action)));
return;
}
auto& render_frame = GetRenderFrame();
if (!render_frame)
return;
std::move(action).Run(render_frame_);
}
std::move(action).Run(render_frame);
void CefFrameHostImpl::OnRenderFrameDisconnect() {
CEF_REQUIRE_UIT();
// Reconnect, if any, will be triggered via FrameAttached().
render_frame_.reset();
}
void CefFrameHostImpl::SendMessage(const std::string& name,
@@ -581,12 +562,11 @@ void CefFrameHostImpl::SendMessage(const std::string& name,
}
}
void CefFrameHostImpl::FrameAttached() {
FrameAttachedInternal(/*reattached=*/false);
}
void CefFrameHostImpl::FrameAttachedInternal(bool reattached) {
void CefFrameHostImpl::FrameAttached(
mojo::PendingRemote<cef::mojom::RenderFrame> render_frame_remote,
bool reattached) {
CEF_REQUIRE_UIT();
CHECK(render_frame_remote);
auto browser_info = GetBrowserInfo();
if (!browser_info) {
@@ -594,27 +574,32 @@ void CefFrameHostImpl::FrameAttachedInternal(bool reattached) {
return;
}
DCHECK(!is_attached_);
if (!is_attached_) {
is_attached_ = true;
auto& render_frame = GetRenderFrame();
while (!queued_actions_.empty()) {
if (render_frame) {
std::move(queued_actions_.front().second).Run(render_frame);
}
queued_actions_.pop();
}
browser_info->MaybeExecuteFrameNotification(base::BindOnce(
[](CefRefPtr<CefFrameHostImpl> self, bool reattached,
CefRefPtr<CefFrameHandler> handler) {
if (auto browser = self->GetBrowserHostBase()) {
handler->OnFrameAttached(browser, self, reattached);
}
},
CefRefPtr<CefFrameHostImpl>(this), reattached));
if (reattached) {
LOG(INFO) << (is_main_frame_ ? "main" : "sub") << "frame "
<< frame_util::GetFrameDebugString(frame_id_)
<< " has reconnected";
}
render_frame_.Bind(std::move(render_frame_remote));
render_frame_.set_disconnect_handler(
base::BindOnce(&CefFrameHostImpl::OnRenderFrameDisconnect, this));
// Notify the renderer process that it can start sending messages.
render_frame_->FrameAttachedAck();
while (!queued_renderer_actions_.empty()) {
std::move(queued_renderer_actions_.front().second).Run(render_frame_);
queued_renderer_actions_.pop();
}
browser_info->MaybeExecuteFrameNotification(base::BindOnce(
[](CefRefPtr<CefFrameHostImpl> self, bool reattached,
CefRefPtr<CefFrameHandler> handler) {
if (auto browser = self->GetBrowserHostBase()) {
handler->OnFrameAttached(browser, self, reattached);
}
},
CefRefPtr<CefFrameHostImpl>(this), reattached));
}
void CefFrameHostImpl::DidFinishFrameLoad(const GURL& validated_url,

View File

@@ -82,10 +82,6 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
void SetFocused(bool focused);
void RefreshAttributes();
// Notification that a move or resize of the renderer's containing window has
// started. Used on Windows and Linux with the Alloy runtime.
void NotifyMoveOrResizeStarted();
// Load the specified request.
void LoadRequest(cef::mojom::RequestParamsPtr params);
@@ -130,7 +126,8 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
// cef::mojom::BrowserFrame methods forwarded from CefBrowserFrame.
void SendMessage(const std::string& name, base::Value arguments) override;
void FrameAttached() override;
void FrameAttached(mojo::PendingRemote<cef::mojom::RenderFrame> render_frame,
bool reattached) override;
void DidFinishFrameLoad(const GURL& validated_url,
int32_t http_status_code) override;
void UpdateDraggableRegions(
@@ -152,17 +149,14 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
scoped_refptr<CefBrowserInfo> GetBrowserInfo() const;
CefRefPtr<CefBrowserHostBase> GetBrowserHostBase() const;
// Returns the remote RenderFrame object.
using RenderFrameType = mojo::Remote<cef::mojom::RenderFrame>;
const RenderFrameType& GetRenderFrame();
// Send an action to the remote RenderFrame. This will queue the action if the
// remote frame is not yet attached.
using RenderFrameType = mojo::Remote<cef::mojom::RenderFrame>;
using RenderFrameAction = base::OnceCallback<void(const RenderFrameType&)>;
void SendToRenderFrame(const std::string& function_name,
RenderFrameAction action);
void FrameAttachedInternal(bool reattached);
void OnRenderFrameDisconnect();
const bool is_main_frame_;
@@ -179,9 +173,8 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
// The following members are only accessed on the UI thread.
content::RenderFrameHost* render_frame_host_ = nullptr;
bool is_attached_ = false;
std::queue<std::pair<std::string, RenderFrameAction>> queued_actions_;
std::queue<std::pair<std::string, RenderFrameAction>>
queued_renderer_actions_;
mojo::Remote<cef::mojom::RenderFrame> render_frame_;

View File

@@ -47,7 +47,7 @@ class CefJSDialogCallbackImpl : public CefJSDialogCallback {
}
}
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
[[nodiscard]] CallbackType Disconnect() { return std::move(callback_); }
private:
static void CancelNow(CallbackType callback) {

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