mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
47 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4d3b0b471a | ||
|
9cda95325a | ||
|
5c4a81b6da | ||
|
e7d470d7fa | ||
|
2a5115d714 | ||
|
e881df93e2 | ||
|
1e0a38f97a | ||
|
6992d44e70 | ||
|
82c7c57f46 | ||
|
bbcaed404c | ||
|
016ec9c313 | ||
|
2af7b91155 | ||
|
c6b2e4d3d2 | ||
|
ce31761f51 | ||
|
c4cb1d9fb5 | ||
|
7769a62c96 | ||
|
88ff72fbfe | ||
|
9cfc2240ce | ||
|
db52e363d3 | ||
|
a44b59f98d | ||
|
e2be512668 | ||
|
b98db30da2 | ||
|
fbb8dbbc80 | ||
|
b5d542d38d | ||
|
9ec3172ffa | ||
|
a6c32e1b47 | ||
|
4080d513c3 | ||
|
79f4ad960d | ||
|
fe119b9d65 | ||
|
e696c22afb | ||
|
3837cce584 | ||
|
6d1b699385 | ||
|
33542810c6 | ||
|
092056ce2d | ||
|
2a9696c162 | ||
|
fcbf3c4ec3 | ||
|
033c246f5c | ||
|
2201028eaf | ||
|
7a4b55f970 | ||
|
206b7b1c95 | ||
|
262a93b2f7 | ||
|
80c65f25a3 | ||
|
2f0b00f8f5 | ||
|
be734efe68 | ||
|
0dd7dca229 | ||
|
5613af8f53 | ||
|
a25f89f9e4 |
8
BUILD.gn
8
BUILD.gn
@@ -390,10 +390,14 @@ source_set("libcef_static_unittested") {
|
||||
]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//ui/gfx/geometry",
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
# Support relative include paths.
|
||||
"//base",
|
||||
]
|
||||
|
||||
configs += [
|
||||
"libcef/features:config",
|
||||
"//build/config:precompiled_headers",
|
||||
@@ -964,6 +968,7 @@ source_set("libcef_static") {
|
||||
# Bring in feature flag defines.
|
||||
"//cef/libcef/features",
|
||||
# Support relative include paths.
|
||||
"//base",
|
||||
"//third_party/abseil-cpp:absl",
|
||||
]
|
||||
|
||||
@@ -981,7 +986,6 @@ source_set("libcef_static") {
|
||||
"libcef/common/extensions/api:extensions_features",
|
||||
|
||||
# Normal build dependencies. Should be sorted alphabetically.
|
||||
"//base",
|
||||
"//base:base_static",
|
||||
"//base/third_party/dynamic_annotations",
|
||||
"//cc",
|
||||
|
@@ -7,6 +7,6 @@
|
||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
|
||||
{
|
||||
'chromium_checkout': 'refs/tags/120.0.6099.234',
|
||||
'depot_tools_checkout': 'f01ca5848d'
|
||||
'chromium_checkout': 'refs/tags/121.0.6167.184',
|
||||
'depot_tools_checkout': '6444de14d1'
|
||||
}
|
||||
|
@@ -310,7 +310,7 @@ if(OS_MAC)
|
||||
|
||||
# Find the newest available base SDK.
|
||||
execute_process(COMMAND xcode-select --print-path OUTPUT_VARIABLE XCODE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
foreach(OS_VERSION 10.15 10.14 10.13)
|
||||
foreach(OS_VERSION 14.2 14.0 10.15)
|
||||
set(SDK "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OS_VERSION}.sdk")
|
||||
if(NOT "${CMAKE_OSX_SYSROOT}" AND EXISTS "${SDK}" AND IS_DIRECTORY "${SDK}")
|
||||
set(CMAKE_OSX_SYSROOT ${SDK})
|
||||
@@ -318,7 +318,7 @@ if(OS_MAC)
|
||||
endforeach()
|
||||
|
||||
# Target SDK.
|
||||
set(CEF_TARGET_SDK "10.13")
|
||||
set(CEF_TARGET_SDK "10.15")
|
||||
list(APPEND CEF_COMPILER_FLAGS
|
||||
-mmacosx-version-min=${CEF_TARGET_SDK}
|
||||
)
|
||||
@@ -554,6 +554,13 @@ if(OS_WINDOWS)
|
||||
vulkan-1.dll
|
||||
)
|
||||
|
||||
if(PROJECT_ARCH STREQUAL "x86_64")
|
||||
list(APPEND CEF_BINARY_FILES
|
||||
dxil.dll
|
||||
dxcompiler.dll
|
||||
)
|
||||
endif()
|
||||
|
||||
# List of CEF resource files.
|
||||
set(CEF_RESOURCE_FILES
|
||||
chrome_100_percent.pak
|
||||
|
@@ -232,19 +232,19 @@
|
||||
|
||||
// Type detection for wchar_t.
|
||||
#if defined(OS_WIN)
|
||||
#define WCHAR_T_IS_UTF16
|
||||
#define WCHAR_T_IS_16_BIT
|
||||
#elif defined(OS_FUCHSIA)
|
||||
#define WCHAR_T_IS_UTF32
|
||||
#define WCHAR_T_IS_32_BIT
|
||||
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
|
||||
(__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
|
||||
#define WCHAR_T_IS_UTF32
|
||||
#define WCHAR_T_IS_32_BIT
|
||||
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
|
||||
(__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
|
||||
// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to
|
||||
// compile in this mode (in particular, Chrome doesn't). This is intended for
|
||||
// other projects using base who manage their own dependencies and make sure
|
||||
// short wchar works for them.
|
||||
#define WCHAR_T_IS_UTF16
|
||||
#define WCHAR_T_IS_16_BIT
|
||||
#else
|
||||
#error Please add support for your compiler in include/base/cef_build.h
|
||||
#endif
|
||||
|
@@ -723,9 +723,9 @@ std::ostream& operator<<(std::ostream& out, const wchar_t* wstr);
|
||||
inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
|
||||
return out << wstr.c_str();
|
||||
}
|
||||
#if defined(WCHAR_T_IS_UTF32)
|
||||
#if defined(WCHAR_T_IS_32_BIT)
|
||||
std::ostream& operator<<(std::ostream& out, const char16_t* wstr);
|
||||
#elif defined(WCHAR_T_IS_UTF16)
|
||||
#elif defined(WCHAR_T_IS_16_BIT)
|
||||
inline std::ostream& operator<<(std::ostream& out, const char16_t* wstr) {
|
||||
return operator<<(out, reinterpret_cast<const wchar_t*>(wstr));
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=5f808dd18e66966b62a3b8980075e87a5109e23f$
|
||||
// $hash=fc6fbee765ce2b649f5293c8c4b076d36014e4aa$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_HANDLER_CAPI_H_
|
||||
@@ -53,48 +53,41 @@ extern "C" {
|
||||
/// The order of callbacks is:
|
||||
///
|
||||
/// (1) During initial cef_browser_host_t creation and navigation of the main
|
||||
/// frame: - cef_frame_handler_t::OnFrameCreated => The initial main frame
|
||||
/// object has been
|
||||
/// created. Any commands will be queued until the frame is attached.
|
||||
/// frame:
|
||||
/// - cef_frame_handler_t::OnFrameCreated => The initial main frame object has
|
||||
/// been created. Any commands will be queued until the frame is attached.
|
||||
/// - cef_frame_handler_t::OnMainFrameChanged => The initial main frame object
|
||||
/// has
|
||||
/// been assigned to the browser.
|
||||
/// has been assigned to the browser.
|
||||
/// - cef_life_span_handler_t::OnAfterCreated => The browser is now valid and
|
||||
/// can be
|
||||
/// used.
|
||||
/// can be used.
|
||||
/// - cef_frame_handler_t::OnFrameAttached => The initial main frame object is
|
||||
/// now
|
||||
/// connected to its peer in the renderer process. Commands can be routed.
|
||||
/// now connected to its peer in the renderer process. Commands can be routed.
|
||||
///
|
||||
/// (2) During further cef_browser_host_t navigation/loading of the main frame
|
||||
/// and/or sub-frames:
|
||||
/// - cef_frame_handler_t::OnFrameCreated => A new main frame or sub-frame
|
||||
/// object
|
||||
/// has been created. Any commands will be queued until the frame is attached.
|
||||
/// object has been created. Any commands will be queued until the frame is
|
||||
/// attached.
|
||||
/// - cef_frame_handler_t::OnFrameAttached => A new main frame or sub-frame
|
||||
/// object
|
||||
/// is now connected to its peer in the renderer process. Commands can be
|
||||
/// routed.
|
||||
/// object is now connected to its peer in the renderer process. Commands can
|
||||
/// be routed.
|
||||
/// - cef_frame_handler_t::OnFrameDetached => An existing main frame or sub-
|
||||
/// frame
|
||||
/// object has lost its connection to the renderer process. If multiple
|
||||
/// frame object has lost its connection to the renderer process. If multiple
|
||||
/// objects are detached at the same time then notifications will be sent for
|
||||
/// any sub-frame objects before the main frame object. Commands can no longer
|
||||
/// be routed and will be discarded.
|
||||
/// - cef_frame_handler_t::OnMainFrameChanged => A new main frame object has
|
||||
/// been
|
||||
/// assigned to the browser. This will only occur with cross-origin navigation
|
||||
/// or re-navigation after renderer process termination (due to crashes, etc).
|
||||
/// been assigned to the browser. This will only occur with cross-origin
|
||||
/// navigation or re-navigation after renderer process termination (due to
|
||||
/// crashes, etc).
|
||||
///
|
||||
/// (3) During final cef_browser_host_t destruction of the main frame: -
|
||||
/// cef_frame_handler_t::OnFrameDetached => Any sub-frame objects have lost
|
||||
/// their
|
||||
/// connection to the renderer process. Commands can no longer be routed and
|
||||
/// will be discarded.
|
||||
/// (3) During final cef_browser_host_t destruction of the main frame:
|
||||
/// - cef_frame_handler_t::OnFrameDetached => Any sub-frame objects have lost
|
||||
/// their connection to the renderer process. Commands can no longer be routed
|
||||
/// and will be discarded.
|
||||
/// - cef_life_span_handler_t::OnBeforeClose => The browser has been destroyed.
|
||||
/// - cef_frame_handler_t::OnFrameDetached => The main frame object have lost
|
||||
/// its
|
||||
/// connection to the renderer process. Notifications will be sent for any
|
||||
/// its connection to the renderer process. Notifications will be sent for any
|
||||
/// sub-frame objects before the main frame object. Commands can no longer be
|
||||
/// routed and will be discarded.
|
||||
/// - cef_frame_handler_t::OnMainFrameChanged => The final main frame object has
|
||||
@@ -111,7 +104,7 @@ extern "C" {
|
||||
/// will then be discarded after the real cross-origin sub-frame is created in
|
||||
/// the new/target renderer process. The client will receive cross-origin
|
||||
/// navigation callbacks (2) for the transition from the temporary sub-frame to
|
||||
/// the real sub-frame. The temporary sub-frame will not recieve or execute
|
||||
/// the real sub-frame. The temporary sub-frame will not receive or execute
|
||||
/// commands during this transitional period (any sent commands will be
|
||||
/// discarded).
|
||||
///
|
||||
@@ -119,7 +112,7 @@ extern "C" {
|
||||
/// browser, a temporary main frame object for the popup will first be created
|
||||
/// in the parent's renderer process. That temporary main frame will then be
|
||||
/// discarded after the real cross-origin main frame is created in the
|
||||
/// new/target renderer process. The client will recieve creation and initial
|
||||
/// new/target renderer process. The client will receive creation and initial
|
||||
/// navigation callbacks (1) for the temporary main frame, followed by cross-
|
||||
/// origin navigation callbacks (2) for the transition from the temporary main
|
||||
/// frame to the real main frame. The temporary main frame may receive and
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=5f2f1d43cf93b10ba58b2aa2716bc3638e58c97c$
|
||||
// $hash=54edf9e9c2a12acdc4cab55079a4a5cb8e2a1e43$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
|
||||
@@ -138,7 +138,7 @@ typedef struct _cef_life_span_handler_t {
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
/// Called when a browser has recieved a request to close. This may result
|
||||
/// Called when a browser has received a request to close. This may result
|
||||
/// directly from a call to cef_browser_host_t::*close_browser() or indirectly
|
||||
/// if the browser is parented to a top-level window created by CEF and the
|
||||
/// user attempts to close that window (by clicking the 'X', for example). The
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=401b881a3bd1d0c36f9646804260f129eb5f70d9$
|
||||
// $hash=62e7e781f3fef0d332b6a921d48a192fd0115295$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_
|
||||
@@ -156,7 +156,7 @@ typedef struct _cef_media_observer_t {
|
||||
cef_media_route_connection_state_t state);
|
||||
|
||||
///
|
||||
/// A message was recieved over |route|. |message| is only valid for the scope
|
||||
/// A message was received over |route|. |message| is only valid for the scope
|
||||
/// of this callback and should be copied if necessary.
|
||||
///
|
||||
void(CEF_CALLBACK* on_route_message_received)(
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=2dcd17d131deb011094b741024aa11249e3fa306$
|
||||
// $hash=5dae0b1a1271e79a5fd9b2c6e71e7a719a450161$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
|
||||
@@ -473,14 +473,15 @@ typedef struct _cef_menu_model_t {
|
||||
///
|
||||
/// Sets the font list for the specified |command_id|. If |font_list| is NULL
|
||||
/// the system font will be used. Returns true (1) on success. The format is
|
||||
/// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a
|
||||
/// comma-separated list of font family names, - STYLES is an optional space-
|
||||
/// separated list of style names
|
||||
/// (case-sensitive "Bold" and "Italic" are supported), and
|
||||
/// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where:
|
||||
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// - STYLES is an optional space-separated list of style names (case-
|
||||
/// sensitive "Bold" and "Italic" are supported), and
|
||||
/// - SIZE is an integer font size in pixels with the suffix "px".
|
||||
///
|
||||
/// Here are examples of valid font description strings: - "Arial, Helvetica,
|
||||
/// Bold Italic 14px" - "Arial, 14px"
|
||||
/// Here are examples of valid font description strings:
|
||||
/// - "Arial, Helvetica, Bold Italic 14px"
|
||||
/// - "Arial, 14px"
|
||||
///
|
||||
int(CEF_CALLBACK* set_font_list)(struct _cef_menu_model_t* self,
|
||||
int command_id,
|
||||
@@ -488,16 +489,15 @@ typedef struct _cef_menu_model_t {
|
||||
|
||||
///
|
||||
/// Sets the font list for the specified |index|. Specify an |index| value of
|
||||
/// -1 to set the default font. If |font_list| is NULL the system font will be
|
||||
/// used. Returns true (1) on success. The format is
|
||||
/// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a
|
||||
/// comma-separated list of font family names, - STYLES is an optional space-
|
||||
/// separated list of style names
|
||||
/// (case-sensitive "Bold" and "Italic" are supported), and
|
||||
/// - 1 to set the default font. If |font_list| is NULL the system font will
|
||||
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// - STYLES is an optional space-separated list of style names (case-
|
||||
/// sensitive "Bold" and "Italic" are supported), and
|
||||
/// - SIZE is an integer font size in pixels with the suffix "px".
|
||||
///
|
||||
/// Here are examples of valid font description strings: - "Arial, Helvetica,
|
||||
/// Bold Italic 14px" - "Arial, 14px"
|
||||
/// Here are examples of valid font description strings:
|
||||
/// - "Arial, Helvetica, Bold Italic 14px"
|
||||
/// - "Arial, 14px"
|
||||
///
|
||||
int(CEF_CALLBACK* set_font_list_at)(struct _cef_menu_model_t* self,
|
||||
int index,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=ddad43a2c40d34b50baab5c4542e17faec189ba6$
|
||||
// $hash=a61a639c7e53ecd9481eae363bac557055f0442e$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
|
||||
@@ -50,11 +50,11 @@ extern "C" {
|
||||
/// Launches the process specified via |command_line|. Returns true (1) upon
|
||||
/// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread.
|
||||
///
|
||||
/// Unix-specific notes: - All file descriptors open in the parent process will
|
||||
/// be closed in the
|
||||
/// Unix-specific notes:
|
||||
/// - All file descriptors open in the parent process will be closed in the
|
||||
/// child process except for stdin, stdout, and stderr.
|
||||
/// - If the first argument on the command line does not contain a slash,
|
||||
/// PATH will be searched. (See man execvp.)
|
||||
/// - If the first argument on the command line does not contain a slash, PATH
|
||||
/// will be searched. (See man execvp.)
|
||||
///
|
||||
CEF_EXPORT int cef_launch_process(struct _cef_command_line_t* command_line);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=199e86ccf09d571a5dd24f39b23ff5cc2bd32129$
|
||||
// $hash=740d6eb5bea1bfc7c4ea413fefd3bf6586a81f20$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_
|
||||
@@ -80,8 +80,10 @@ typedef struct _cef_end_tracing_callback_t {
|
||||
/// have an optional '-' prefix to make it an excluded category. Having both
|
||||
/// included and excluded categories in the same list is not supported.
|
||||
///
|
||||
/// Examples: - "test_MyTest*" - "test_MyTest*,test_OtherStuff" -
|
||||
/// "-excluded_category1,-excluded_category2"
|
||||
/// Examples:
|
||||
/// - "test_MyTest*"
|
||||
/// - "test_MyTest*,test_OtherStuff"
|
||||
/// - "-excluded_category1,-excluded_category2"
|
||||
///
|
||||
/// This function must be called on the browser process UI thread.
|
||||
///
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=1c029e99b4b81f39fba362e297e85ec9bfcf16fb$
|
||||
// $hash=06d17ed2939b57c97d73a0025e9f9ff65834b51a$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_LABEL_BUTTON_CAPI_H_
|
||||
@@ -113,14 +113,15 @@ typedef struct _cef_label_button_t {
|
||||
|
||||
///
|
||||
/// Sets the font list. The format is "<FONT_FAMILY_LIST>,[STYLES] <SIZE>",
|
||||
/// where: - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// where:
|
||||
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// - STYLES is an optional space-separated list of style names (case-
|
||||
/// sensitive
|
||||
/// "Bold" and "Italic" are supported), and
|
||||
/// sensitive "Bold" and "Italic" are supported), and
|
||||
/// - SIZE is an integer font size in pixels with the suffix "px".
|
||||
///
|
||||
/// Here are examples of valid font description strings: - "Arial, Helvetica,
|
||||
/// Bold Italic 14px" - "Arial, 14px"
|
||||
/// Here are examples of valid font description strings:
|
||||
/// - "Arial, Helvetica, Bold Italic 14px"
|
||||
/// - "Arial, 14px"
|
||||
///
|
||||
void(CEF_CALLBACK* set_font_list)(struct _cef_label_button_t* self,
|
||||
const cef_string_t* font_list);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=f8474005e8b9e20dfb390e4b6fe0cc023dcebe3c$
|
||||
// $hash=f47d33d79e9f321536aa87921d973745f6ec8b5e$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_CAPI_H_
|
||||
@@ -183,14 +183,15 @@ typedef struct _cef_textfield_t {
|
||||
|
||||
///
|
||||
/// Sets the font list. The format is "<FONT_FAMILY_LIST>,[STYLES] <SIZE>",
|
||||
/// where: - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// where:
|
||||
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// - STYLES is an optional space-separated list of style names (case-
|
||||
/// sensitive
|
||||
/// "Bold" and "Italic" are supported), and
|
||||
/// sensitive "Bold" and "Italic" are supported), and
|
||||
/// - SIZE is an integer font size in pixels with the suffix "px".
|
||||
///
|
||||
/// Here are examples of valid font description strings: - "Arial, Helvetica,
|
||||
/// Bold Italic 14px" - "Arial, 14px"
|
||||
/// Here are examples of valid font description strings:
|
||||
/// - "Arial, Helvetica, Bold Italic 14px"
|
||||
/// - "Arial, 14px"
|
||||
///
|
||||
void(CEF_CALLBACK* set_font_list)(struct _cef_textfield_t* self,
|
||||
const cef_string_t* font_list);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=afe2cd6a8c8af576d67cf099858c9920ded4a3c5$
|
||||
// $hash=c894c96b089861c183059c54876af9ed9382e349$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_DELEGATE_CAPI_H_
|
||||
@@ -60,7 +60,7 @@ typedef struct _cef_textfield_delegate_t {
|
||||
cef_view_delegate_t base;
|
||||
|
||||
///
|
||||
/// Called when |textfield| recieves a keyboard event. |event| contains
|
||||
/// Called when |textfield| receives a keyboard event. |event| contains
|
||||
/// information about the keyboard event. Return true (1) if the keyboard
|
||||
/// event was handled or false (0) otherwise for default handling.
|
||||
///
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=6078993477d8e0570528593193ec06efbfd0843c$
|
||||
// $hash=dbe89dfdd14eb114e3f2d16fbfc55624bb91e7ce$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_CAPI_H_
|
||||
@@ -220,8 +220,9 @@ typedef struct _cef_window_t {
|
||||
///
|
||||
/// Add a View that will be overlayed on the Window contents with absolute
|
||||
/// positioning and high z-order. Positioning is controlled by |docking_mode|
|
||||
/// as described below. The returned cef_overlay_controller_t object is used
|
||||
/// to control the overlay. Overlays are hidden by default.
|
||||
/// as described below. Setting |can_activate| to true (1) will allow the
|
||||
/// overlay view to receive input focus. The returned cef_overlay_controller_t
|
||||
/// object is used to control the overlay. Overlays are hidden by default.
|
||||
///
|
||||
/// With CEF_DOCKING_MODE_CUSTOM:
|
||||
/// 1. The overlay is initially hidden, sized to |view|'s preferred size,
|
||||
@@ -249,7 +250,8 @@ typedef struct _cef_window_t {
|
||||
struct _cef_overlay_controller_t*(CEF_CALLBACK* add_overlay_view)(
|
||||
struct _cef_window_t* self,
|
||||
struct _cef_view_t* view,
|
||||
cef_docking_mode_t docking_mode);
|
||||
cef_docking_mode_t docking_mode,
|
||||
int can_activate);
|
||||
|
||||
///
|
||||
/// Show a menu with contents |menu_model|. |screen_point| specifies the menu
|
||||
|
@@ -42,13 +42,13 @@
|
||||
// way that may cause binary incompatibility with other builds. The universal
|
||||
// hash value will change if any platform is affected whereas the platform hash
|
||||
// values will change only if that particular platform is affected.
|
||||
#define CEF_API_HASH_UNIVERSAL "bbdc07e7c5ed2ae5398efdebdd1ed08801bc91ab"
|
||||
#define CEF_API_HASH_UNIVERSAL "b0a002df95199c8a91e5b14159ff2a800c435ed9"
|
||||
#if defined(OS_WIN)
|
||||
#define CEF_API_HASH_PLATFORM "002e3391fd68b0a444dbb6cd1b2a19a4c181d935"
|
||||
#define CEF_API_HASH_PLATFORM "6e111c21cbae8da266044efde3d196dcd84e1d62"
|
||||
#elif defined(OS_MAC)
|
||||
#define CEF_API_HASH_PLATFORM "3e4f2433692dc8bb779314dce84b81d81d39d2c2"
|
||||
#define CEF_API_HASH_PLATFORM "ea607f152a2b887b83e2f860992d1c922524049e"
|
||||
#elif defined(OS_LINUX)
|
||||
#define CEF_API_HASH_PLATFORM "4e707370d08d4639c41e7c8aa8027c4a6090eace"
|
||||
#define CEF_API_HASH_PLATFORM "28cde5b61a2fa3fe1a39923ef750d176ba8f58b3"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -95,7 +95,7 @@
|
||||
/// will then be discarded after the real cross-origin sub-frame is created in
|
||||
/// the new/target renderer process. The client will receive cross-origin
|
||||
/// navigation callbacks (2) for the transition from the temporary sub-frame to
|
||||
/// the real sub-frame. The temporary sub-frame will not recieve or execute
|
||||
/// the real sub-frame. The temporary sub-frame will not receive or execute
|
||||
/// commands during this transitional period (any sent commands will be
|
||||
/// discarded).
|
||||
///
|
||||
@@ -103,7 +103,7 @@
|
||||
/// browser, a temporary main frame object for the popup will first be created
|
||||
/// in the parent's renderer process. That temporary main frame will then be
|
||||
/// discarded after the real cross-origin main frame is created in the
|
||||
/// new/target renderer process. The client will recieve creation and initial
|
||||
/// new/target renderer process. The client will receive creation and initial
|
||||
/// navigation callbacks (1) for the temporary main frame, followed by
|
||||
/// cross-origin navigation callbacks (2) for the transition from the temporary
|
||||
/// main frame to the real main frame. The temporary main frame may receive and
|
||||
|
@@ -131,7 +131,7 @@ class CefLifeSpanHandler : public virtual CefBaseRefCounted {
|
||||
virtual void OnAfterCreated(CefRefPtr<CefBrowser> browser) {}
|
||||
|
||||
///
|
||||
/// Called when a browser has recieved a request to close. This may result
|
||||
/// Called when a browser has received a request to close. This may result
|
||||
/// directly from a call to CefBrowserHost::*CloseBrowser() or indirectly if
|
||||
/// the browser is parented to a top-level window created by CEF and the user
|
||||
/// attempts to close that window (by clicking the 'X', for example). The
|
||||
|
@@ -145,7 +145,7 @@ class CefMediaObserver : public virtual CefBaseRefCounted {
|
||||
ConnectionState state) = 0;
|
||||
|
||||
///
|
||||
/// A message was recieved over |route|. |message| is only valid for
|
||||
/// A message was received over |route|. |message| is only valid for
|
||||
/// the scope of this callback and should be copied if necessary.
|
||||
///
|
||||
/*--cef()--*/
|
||||
|
@@ -99,7 +99,7 @@ struct CefStringTraitsWide {
|
||||
static inline bool from_wstring(const std::wstring& str, struct_type* s) {
|
||||
return from_wstring(str.data(), str.length(), s);
|
||||
}
|
||||
#if defined(WCHAR_T_IS_UTF32)
|
||||
#if defined(WCHAR_T_IS_32_BIT)
|
||||
static inline std::u16string to_string16(const struct_type* s) {
|
||||
cef_string_utf16_t cstr;
|
||||
memset(&cstr, 0, sizeof(cstr));
|
||||
@@ -120,7 +120,7 @@ struct CefStringTraitsWide {
|
||||
? true
|
||||
: false;
|
||||
}
|
||||
#else // WCHAR_T_IS_UTF32
|
||||
#elif defined(WCHAR_T_IS_16_BIT)
|
||||
static inline std::u16string to_string16(const struct_type* s) {
|
||||
return std::u16string(
|
||||
reinterpret_cast<const std::u16string::value_type*>(s->str), s->length);
|
||||
@@ -133,7 +133,7 @@ struct CefStringTraitsWide {
|
||||
? true
|
||||
: false;
|
||||
}
|
||||
#endif // WCHAR_T_IS_UTF32
|
||||
#endif // WCHAR_T_IS_16_BIT
|
||||
static inline bool from_string16(const std::u16string& str, struct_type* s) {
|
||||
return from_string16(str.data(), str.length(), s);
|
||||
}
|
||||
@@ -271,7 +271,7 @@ struct CefStringTraitsUTF16 {
|
||||
static inline bool from_string(const std::string& str, struct_type* s) {
|
||||
return from_string(str.data(), str.length(), s);
|
||||
}
|
||||
#if defined(WCHAR_T_IS_UTF32)
|
||||
#if defined(WCHAR_T_IS_32_BIT)
|
||||
static inline std::wstring to_wstring(const struct_type* s) {
|
||||
cef_string_wide_t cstr;
|
||||
memset(&cstr, 0, sizeof(cstr));
|
||||
@@ -288,7 +288,7 @@ struct CefStringTraitsUTF16 {
|
||||
struct_type* s) {
|
||||
return cef_string_wide_to_utf16(data, length, s) ? true : false;
|
||||
}
|
||||
#else // WCHAR_T_IS_UTF32
|
||||
#elif defined(WCHAR_T_IS_16_BIT)
|
||||
static inline std::wstring to_wstring(const struct_type* s) {
|
||||
return std::wstring(reinterpret_cast<wchar_t*>(s->str), s->length);
|
||||
}
|
||||
@@ -300,7 +300,7 @@ struct CefStringTraitsUTF16 {
|
||||
? true
|
||||
: false;
|
||||
}
|
||||
#endif // WCHAR_T_IS_UTF32
|
||||
#endif // WCHAR_T_IS_16_BIT
|
||||
static inline bool from_wstring(const std::wstring& str, struct_type* s) {
|
||||
return from_wstring(str.data(), str.length(), s);
|
||||
}
|
||||
|
@@ -2708,6 +2708,11 @@ typedef struct _cef_pdf_print_settings_t {
|
||||
/// Set to true (1) to generate tagged (accessible) PDF.
|
||||
///
|
||||
int generate_tagged_pdf;
|
||||
|
||||
///
|
||||
/// Set to true (1) to generate a document outline.
|
||||
///
|
||||
int generate_document_outline;
|
||||
} cef_pdf_print_settings_t;
|
||||
|
||||
///
|
||||
@@ -3416,7 +3421,8 @@ typedef enum {
|
||||
CEF_CPAIT_SAVE_IBAN,
|
||||
CEF_CPAIT_MANDATORY_REAUTH,
|
||||
CEF_CPAIT_PRICE_INSIGHTS,
|
||||
CEF_CPAIT_MAX_VALUE = CEF_CPAIT_PRICE_INSIGHTS,
|
||||
CEF_CPAIT_PRICE_READ_ANYTHING,
|
||||
CEF_CPAIT_MAX_VALUE = CEF_CPAIT_PRICE_READ_ANYTHING,
|
||||
} cef_chrome_page_action_icon_type_t;
|
||||
|
||||
///
|
||||
@@ -3446,10 +3452,21 @@ typedef enum {
|
||||
/// Show states supported by CefWindowDelegate::GetInitialShowState.
|
||||
///
|
||||
typedef enum {
|
||||
// Show the window as normal.
|
||||
CEF_SHOW_STATE_NORMAL = 1,
|
||||
|
||||
// Show the window as minimized.
|
||||
CEF_SHOW_STATE_MINIMIZED,
|
||||
|
||||
// Show the window as maximized.
|
||||
CEF_SHOW_STATE_MAXIMIZED,
|
||||
|
||||
// Show the window as fullscreen.
|
||||
CEF_SHOW_STATE_FULLSCREEN,
|
||||
|
||||
// Show the window as hidden (no dock thumbnail).
|
||||
// Only supported on MacOS.
|
||||
CEF_SHOW_STATE_HIDDEN,
|
||||
} cef_show_state_t;
|
||||
|
||||
///
|
||||
|
@@ -251,8 +251,7 @@ typedef enum {
|
||||
/// use by the File System Access API.
|
||||
CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_LAST_PICKED_DIRECTORY,
|
||||
|
||||
/// Controls access to the getDisplayMedia API when {preferCurrentTab: true}
|
||||
/// is specified.
|
||||
/// Controls access to the getDisplayMedia API.
|
||||
CEF_CONTENT_SETTING_TYPE_DISPLAY_CAPTURE,
|
||||
|
||||
/// Website setting to store permissions metadata granted to paths on the
|
||||
@@ -289,7 +288,8 @@ typedef enum {
|
||||
/// a specified account. When this is present it allows access to session
|
||||
/// management capabilities between the sites. This setting is associated
|
||||
/// with the relying party's origin.
|
||||
CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_ACTIVE_SESSION,
|
||||
// Obsolete on Nov 2023.
|
||||
CEF_CONTENT_SETTING_TYPE_DEPRECATED_FEDERATED_IDENTITY_ACTIVE_SESSION,
|
||||
|
||||
/// Setting to indicate whether Chrome should automatically apply darkening to
|
||||
/// web content.
|
||||
@@ -384,6 +384,10 @@ typedef enum {
|
||||
/// heuristics.
|
||||
CEF_CONTENT_SETTING_TYPE_TPCD_HEURISTICS_GRANTS,
|
||||
|
||||
/// Whether the FSA Persistent Permissions restore prompt is eligible to be
|
||||
/// shown to the user, for a given origin.
|
||||
CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_RESTORE_PERMISSION,
|
||||
|
||||
CEF_CONTENT_SETTING_TYPE_NUM_TYPES,
|
||||
} cef_content_setting_types_t;
|
||||
|
||||
|
@@ -683,6 +683,7 @@ struct CefPdfPrintSettingsTraits {
|
||||
&target->footer_template, copy);
|
||||
|
||||
target->generate_tagged_pdf = src->generate_tagged_pdf;
|
||||
target->generate_document_outline = src->generate_document_outline;
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -115,8 +115,7 @@ class CefLabelButton : public CefButton {
|
||||
/// where:
|
||||
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// - STYLES is an optional space-separated list of style names
|
||||
/// (case-sensitive
|
||||
/// "Bold" and "Italic" are supported), and
|
||||
/// (case-sensitive "Bold" and "Italic" are supported), and
|
||||
/// - SIZE is an integer font size in pixels with the suffix "px".
|
||||
///
|
||||
/// Here are examples of valid font description strings:
|
||||
|
@@ -190,8 +190,7 @@ class CefTextfield : public CefView {
|
||||
/// where:
|
||||
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
||||
/// - STYLES is an optional space-separated list of style names
|
||||
/// (case-sensitive
|
||||
/// "Bold" and "Italic" are supported), and
|
||||
/// (case-sensitive "Bold" and "Italic" are supported), and
|
||||
/// - SIZE is an integer font size in pixels with the suffix "px".
|
||||
///
|
||||
/// Here are examples of valid font description strings:
|
||||
|
@@ -51,7 +51,7 @@ class CefTextfield;
|
||||
class CefTextfieldDelegate : public CefViewDelegate {
|
||||
public:
|
||||
///
|
||||
/// Called when |textfield| recieves a keyboard event. |event| contains
|
||||
/// Called when |textfield| receives a keyboard event. |event| contains
|
||||
/// information about the keyboard event. Return true if the keyboard event
|
||||
/// was handled or false otherwise for default handling.
|
||||
///
|
||||
|
@@ -233,8 +233,9 @@ class CefWindow : public CefPanel {
|
||||
///
|
||||
/// Add a View that will be overlayed on the Window contents with absolute
|
||||
/// positioning and high z-order. Positioning is controlled by |docking_mode|
|
||||
/// as described below. The returned CefOverlayController object is used to
|
||||
/// control the overlay. Overlays are hidden by default.
|
||||
/// as described below. Setting |can_activate| to true will allow the overlay
|
||||
/// view to receive input focus. The returned CefOverlayController object is
|
||||
/// used to control the overlay. Overlays are hidden by default.
|
||||
///
|
||||
/// With CEF_DOCKING_MODE_CUSTOM:
|
||||
/// 1. The overlay is initially hidden, sized to |view|'s preferred size,
|
||||
@@ -262,7 +263,8 @@ class CefWindow : public CefPanel {
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefOverlayController> AddOverlayView(
|
||||
CefRefPtr<CefView> view,
|
||||
cef_docking_mode_t docking_mode) = 0;
|
||||
cef_docking_mode_t docking_mode,
|
||||
bool can_activate) = 0;
|
||||
|
||||
///
|
||||
/// Show a menu with contents |menu_model|. |screen_point| specifies the menu
|
||||
|
@@ -367,20 +367,6 @@ bool AlloyBrowserHostImpl::HasDevTools() {
|
||||
return devtools_manager_->HasDevTools();
|
||||
}
|
||||
|
||||
void AlloyBrowserHostImpl::SetAccessibilityState(
|
||||
cef_state_t accessibility_state) {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::BindOnce(&AlloyBrowserHostImpl::SetAccessibilityState,
|
||||
this, accessibility_state));
|
||||
return;
|
||||
}
|
||||
|
||||
if (platform_delegate_) {
|
||||
platform_delegate_->SetAccessibilityState(accessibility_state);
|
||||
}
|
||||
}
|
||||
|
||||
void AlloyBrowserHostImpl::SetAutoResizeEnabled(bool enabled,
|
||||
const CefSize& min_size,
|
||||
const CefSize& max_size) {
|
||||
@@ -1273,7 +1259,7 @@ void AlloyBrowserHostImpl::RequestMediaAccessPermission(
|
||||
|
||||
bool AlloyBrowserHostImpl::CheckMediaAccessPermission(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& security_origin,
|
||||
const url::Origin& security_origin,
|
||||
blink::mojom::MediaStreamType type) {
|
||||
return media_access_query::CheckMediaAccessPermission(this, render_frame_host,
|
||||
security_origin, type);
|
||||
|
@@ -117,7 +117,6 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
|
||||
void DragSourceEndedAt(int x, int y, DragOperationsMask op) override;
|
||||
void SetAudioMuted(bool mute) override;
|
||||
bool IsAudioMuted() override;
|
||||
void SetAccessibilityState(cef_state_t accessibility_state) override;
|
||||
void SetAutoResizeEnabled(bool enabled,
|
||||
const CefSize& min_size,
|
||||
const CefSize& max_size) override;
|
||||
@@ -262,7 +261,7 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
|
||||
const content::MediaStreamRequest& request,
|
||||
content::MediaResponseCallback callback) override;
|
||||
bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
|
||||
const GURL& security_origin,
|
||||
const url::Origin& security_origin,
|
||||
blink::mojom::MediaStreamType type) override;
|
||||
bool IsNeverComposited(content::WebContents* web_contents) override;
|
||||
content::PictureInPictureResult EnterPictureInPicture(
|
||||
|
@@ -69,7 +69,6 @@
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/profiles/renderer_updater.h"
|
||||
#include "chrome/browser/profiles/renderer_updater_factory.h"
|
||||
#include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h"
|
||||
#include "chrome/browser/spellchecker/spell_check_host_chrome_impl.h"
|
||||
#include "chrome/browser/ui/chrome_select_file_policy.h"
|
||||
#include "chrome/browser/ui/pdf/chrome_pdf_document_helper_client.h"
|
||||
@@ -98,7 +97,6 @@
|
||||
#include "content/browser/plugin_service_impl.h"
|
||||
#include "content/browser/renderer_host/render_frame_host_impl.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_ppapi_host.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/client_certificate_delegate.h"
|
||||
#include "content/public/browser/navigation_handle.h"
|
||||
@@ -134,7 +132,6 @@
|
||||
#include "net/ssl/ssl_cert_request_info.h"
|
||||
#include "net/ssl/ssl_private_key.h"
|
||||
#include "pdf/pdf_features.h"
|
||||
#include "ppapi/host/ppapi_host.h"
|
||||
#include "sandbox/policy/switches.h"
|
||||
#include "services/network/public/cpp/network_switches.h"
|
||||
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
|
||||
@@ -561,17 +558,13 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
|
||||
// Propagate the following switches to all command lines (along with any
|
||||
// associated values) if present in the browser command line.
|
||||
static const char* const kSwitchNames[] = {
|
||||
switches::kDisablePackLoading,
|
||||
switches::kDisablePackLoading,
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
switches::kFrameworkDirPath,
|
||||
switches::kMainBundlePath,
|
||||
switches::kFrameworkDirPath, switches::kMainBundlePath,
|
||||
#endif
|
||||
switches::kLocalesDirPath,
|
||||
switches::kLogItems,
|
||||
switches::kLogSeverity,
|
||||
switches::kResourcesDirPath,
|
||||
embedder_support::kUserAgent,
|
||||
switches::kUserAgentProductAndVersion,
|
||||
switches::kLocalesDirPath, switches::kLogItems,
|
||||
switches::kLogSeverity, switches::kResourcesDirPath,
|
||||
embedder_support::kUserAgent, switches::kUserAgentProductAndVersion,
|
||||
};
|
||||
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames);
|
||||
}
|
||||
@@ -832,13 +825,6 @@ std::string AlloyContentBrowserClient::GetDefaultDownloadName() {
|
||||
return "download";
|
||||
}
|
||||
|
||||
void AlloyContentBrowserClient::DidCreatePpapiPlugin(
|
||||
content::BrowserPpapiHost* browser_host) {
|
||||
browser_host->GetPpapiHost()->AddHostFactoryFilter(
|
||||
std::unique_ptr<ppapi::host::HostFactory>(
|
||||
new ChromeBrowserPepperHostFactory(browser_host)));
|
||||
}
|
||||
|
||||
std::unique_ptr<content::DevToolsManagerDelegate>
|
||||
AlloyContentBrowserClient::CreateDevToolsManagerDelegate() {
|
||||
return std::make_unique<CefDevToolsManagerDelegate>();
|
||||
@@ -848,16 +834,6 @@ void AlloyContentBrowserClient::
|
||||
RegisterAssociatedInterfaceBindersForRenderFrameHost(
|
||||
content::RenderFrameHost& render_frame_host,
|
||||
blink::AssociatedInterfaceRegistry& associated_registry) {
|
||||
associated_registry.AddInterface<extensions::mojom::LocalFrameHost>(
|
||||
base::BindRepeating(
|
||||
[](content::RenderFrameHost* render_frame_host,
|
||||
mojo::PendingAssociatedReceiver<extensions::mojom::LocalFrameHost>
|
||||
receiver) {
|
||||
extensions::ExtensionWebContentsObserver::BindLocalFrameHost(
|
||||
std::move(receiver), render_frame_host);
|
||||
},
|
||||
&render_frame_host));
|
||||
|
||||
associated_registry.AddInterface<printing::mojom::PrintManagerHost>(
|
||||
base::BindRepeating(
|
||||
[](content::RenderFrameHost* render_frame_host,
|
||||
@@ -876,6 +852,37 @@ void AlloyContentBrowserClient::
|
||||
std::make_unique<ChromePDFDocumentHelperClient>());
|
||||
},
|
||||
&render_frame_host));
|
||||
|
||||
associated_registry.AddInterface<chrome::mojom::PluginInfoHost>(
|
||||
base::BindRepeating(&BindPluginInfoHost,
|
||||
render_frame_host.GetProcess()->GetID()));
|
||||
|
||||
if (extensions::ExtensionsEnabled()) {
|
||||
int render_process_id = render_frame_host.GetProcess()->GetID();
|
||||
associated_registry.AddInterface<extensions::mojom::EventRouter>(
|
||||
base::BindRepeating(&extensions::EventRouter::BindForRenderer,
|
||||
render_process_id));
|
||||
associated_registry.AddInterface<extensions::mojom::RendererHost>(
|
||||
base::BindRepeating(&extensions::RendererStartupHelper::BindForRenderer,
|
||||
render_process_id));
|
||||
associated_registry.AddInterface<extensions::mojom::LocalFrameHost>(
|
||||
base::BindRepeating(
|
||||
[](content::RenderFrameHost* render_frame_host,
|
||||
mojo::PendingAssociatedReceiver<
|
||||
extensions::mojom::LocalFrameHost> receiver) {
|
||||
extensions::ExtensionWebContentsObserver::BindLocalFrameHost(
|
||||
std::move(receiver), render_frame_host);
|
||||
},
|
||||
&render_frame_host));
|
||||
associated_registry.AddInterface<guest_view::mojom::GuestViewHost>(
|
||||
base::BindRepeating(
|
||||
&extensions::ExtensionsGuestView::CreateForComponents,
|
||||
render_frame_host.GetGlobalId()));
|
||||
associated_registry.AddInterface<extensions::mojom::GuestView>(
|
||||
base::BindRepeating(
|
||||
&extensions::ExtensionsGuestView::CreateForExtensions,
|
||||
render_frame_host.GetGlobalId()));
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::unique_ptr<content::NavigationThrottle>>
|
||||
@@ -980,26 +987,6 @@ void AlloyContentBrowserClient::ExposeInterfacesToRenderer(
|
||||
service_manager::BinderRegistry* registry,
|
||||
blink::AssociatedInterfaceRegistry* associated_registry,
|
||||
content::RenderProcessHost* host) {
|
||||
associated_registry->AddInterface<chrome::mojom::PluginInfoHost>(
|
||||
base::BindRepeating(&BindPluginInfoHost, host->GetID()));
|
||||
|
||||
if (extensions::ExtensionsEnabled()) {
|
||||
associated_registry->AddInterface<extensions::mojom::EventRouter>(
|
||||
base::BindRepeating(&extensions::EventRouter::BindForRenderer,
|
||||
host->GetID()));
|
||||
associated_registry->AddInterface<guest_view::mojom::GuestViewHost>(
|
||||
base::BindRepeating(
|
||||
&extensions::ExtensionsGuestView::CreateForComponents,
|
||||
host->GetID()));
|
||||
associated_registry->AddInterface<extensions::mojom::GuestView>(
|
||||
base::BindRepeating(
|
||||
&extensions::ExtensionsGuestView::CreateForExtensions,
|
||||
host->GetID()));
|
||||
associated_registry->AddInterface<extensions::mojom::RendererHost>(
|
||||
base::BindRepeating(&extensions::RendererStartupHelper::BindForRenderer,
|
||||
host->GetID()));
|
||||
}
|
||||
|
||||
CefBrowserManager::ExposeInterfacesToRenderer(registry, associated_registry,
|
||||
host);
|
||||
}
|
||||
@@ -1038,7 +1025,6 @@ AlloyContentBrowserClient::CreateLoginDelegate(
|
||||
|
||||
void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
|
||||
int frame_tree_node_id,
|
||||
ukm::SourceIdObj ukm_source_id,
|
||||
NonNetworkURLLoaderFactoryMap* factories) {
|
||||
if (!extensions::ExtensionsEnabled()) {
|
||||
return;
|
||||
@@ -1049,7 +1035,7 @@ void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
|
||||
factories->emplace(
|
||||
extensions::kExtensionScheme,
|
||||
extensions::CreateExtensionNavigationURLLoaderFactory(
|
||||
web_contents->GetBrowserContext(), ukm_source_id,
|
||||
web_contents->GetBrowserContext(),
|
||||
!!extensions::WebViewGuest::FromWebContents(web_contents)));
|
||||
}
|
||||
|
||||
@@ -1116,7 +1102,7 @@ bool AlloyContentBrowserClient::WillCreateURLLoaderFactory(
|
||||
int render_process_id,
|
||||
URLLoaderFactoryType type,
|
||||
const url::Origin& request_initiator,
|
||||
absl::optional<int64_t> navigation_id,
|
||||
std::optional<int64_t> navigation_id,
|
||||
ukm::SourceIdObj ukm_source_id,
|
||||
mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
|
||||
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
|
||||
@@ -1205,7 +1191,7 @@ bool AlloyContentBrowserClient::HandleExternalProtocol(
|
||||
network::mojom::WebSandboxFlags sandbox_flags,
|
||||
ui::PageTransition page_transition,
|
||||
bool has_user_gesture,
|
||||
const absl::optional<url::Origin>& initiating_origin,
|
||||
const std::optional<url::Origin>& initiating_origin,
|
||||
content::RenderFrameHost* initiator_document,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) {
|
||||
// Call the other HandleExternalProtocol variant.
|
||||
@@ -1220,7 +1206,7 @@ bool AlloyContentBrowserClient::HandleExternalProtocol(
|
||||
bool is_in_fenced_frame_tree,
|
||||
network::mojom::WebSandboxFlags sandbox_flags,
|
||||
const network::ResourceRequest& resource_request,
|
||||
const absl::optional<url::Origin>& initiating_origin,
|
||||
const std::optional<url::Origin>& initiating_origin,
|
||||
content::RenderFrameHost* initiator_document,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) {
|
||||
mojo::PendingReceiver<network::mojom::URLLoaderFactory> receiver =
|
||||
@@ -1326,7 +1312,7 @@ base::FilePath AlloyContentBrowserClient::GetFirstPartySetsDirectory() {
|
||||
return GetUserDataPath();
|
||||
}
|
||||
|
||||
absl::optional<base::FilePath>
|
||||
std::optional<base::FilePath>
|
||||
AlloyContentBrowserClient::GetLocalTracesDirectory() {
|
||||
return GetUserDataPath();
|
||||
}
|
||||
|
@@ -114,7 +114,6 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
|
||||
blink::web_pref::WebPreferences* prefs) override;
|
||||
void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) override;
|
||||
std::string GetDefaultDownloadName() override;
|
||||
void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override;
|
||||
std::unique_ptr<content::DevToolsManagerDelegate>
|
||||
CreateDevToolsManagerDelegate() override;
|
||||
void RegisterAssociatedInterfaceBindersForRenderFrameHost(
|
||||
@@ -168,7 +167,6 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
|
||||
LoginAuthRequiredCallback auth_required_callback) override;
|
||||
void RegisterNonNetworkNavigationURLLoaderFactories(
|
||||
int frame_tree_node_id,
|
||||
ukm::SourceIdObj ukm_source_id,
|
||||
NonNetworkURLLoaderFactoryMap* factories) override;
|
||||
void RegisterNonNetworkSubresourceURLLoaderFactories(
|
||||
int render_process_id,
|
||||
@@ -181,7 +179,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
|
||||
int render_process_id,
|
||||
URLLoaderFactoryType type,
|
||||
const url::Origin& request_initiator,
|
||||
absl::optional<int64_t> navigation_id,
|
||||
std::optional<int64_t> navigation_id,
|
||||
ukm::SourceIdObj ukm_source_id,
|
||||
mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
|
||||
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
|
||||
@@ -211,7 +209,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
|
||||
network::mojom::WebSandboxFlags sandbox_flags,
|
||||
ui::PageTransition page_transition,
|
||||
bool has_user_gesture,
|
||||
const absl::optional<url::Origin>& initiating_origin,
|
||||
const std::optional<url::Origin>& initiating_origin,
|
||||
content::RenderFrameHost* initiator_document,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory)
|
||||
override;
|
||||
@@ -223,7 +221,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
|
||||
bool is_in_fenced_frame_tree,
|
||||
network::mojom::WebSandboxFlags sandbox_flags,
|
||||
const network::ResourceRequest& request,
|
||||
const absl::optional<url::Origin>& initiating_origin,
|
||||
const std::optional<url::Origin>& initiating_origin,
|
||||
content::RenderFrameHost* initiator_document,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory)
|
||||
override;
|
||||
@@ -244,7 +242,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
|
||||
base::FilePath GetGraphiteDawnDiskCacheDirectory() override;
|
||||
base::FilePath GetNetLogDefaultDirectory() override;
|
||||
base::FilePath GetFirstPartySetsDirectory() override;
|
||||
absl::optional<base::FilePath> GetLocalTracesDirectory() override;
|
||||
std::optional<base::FilePath> GetLocalTracesDirectory() override;
|
||||
std::string GetProduct() override;
|
||||
std::string GetChromeProduct() override;
|
||||
std::string GetUserAgent() override;
|
||||
|
@@ -24,7 +24,6 @@
|
||||
#include "components/permissions/permission_request_manager.h"
|
||||
#include "components/zoom/zoom_controller.h"
|
||||
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
||||
#include "content/browser/web_contents/web_contents_impl.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "extensions/browser/process_manager.h"
|
||||
#include "pdf/pdf_features.h"
|
||||
@@ -311,31 +310,6 @@ void CefBrowserPlatformDelegateAlloy::ConfigureAutoResize() {
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateAlloy::SetAccessibilityState(
|
||||
cef_state_t accessibility_state) {
|
||||
// Do nothing if state is set to default. It'll be disabled by default and
|
||||
// controlled by the commmand-line flags "force-renderer-accessibility" and
|
||||
// "disable-renderer-accessibility".
|
||||
if (accessibility_state == STATE_DEFAULT) {
|
||||
return;
|
||||
}
|
||||
|
||||
content::WebContentsImpl* web_contents_impl =
|
||||
static_cast<content::WebContentsImpl*>(web_contents_);
|
||||
|
||||
if (!web_contents_impl) {
|
||||
return;
|
||||
}
|
||||
|
||||
ui::AXMode accMode;
|
||||
// In windowless mode set accessibility to TreeOnly mode. Else native
|
||||
// accessibility APIs, specific to each platform, are also created.
|
||||
if (accessibility_state == STATE_ENABLED) {
|
||||
accMode = IsWindowless() ? ui::kAXModeWebContentsOnly : ui::kAXModeComplete;
|
||||
}
|
||||
web_contents_impl->SetAccessibilityMode(accMode);
|
||||
}
|
||||
|
||||
bool CefBrowserPlatformDelegateAlloy::IsPrintPreviewSupported() const {
|
||||
REQUIRE_ALLOY_RUNTIME();
|
||||
|
||||
|
@@ -54,7 +54,6 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
|
||||
void SetAutoResizeEnabled(bool enabled,
|
||||
const CefSize& min_size,
|
||||
const CefSize& max_size) override;
|
||||
void SetAccessibilityState(cef_state_t accessibility_state) override;
|
||||
bool IsPrintPreviewSupported() const override;
|
||||
void Find(const CefString& searchText,
|
||||
bool forward,
|
||||
|
@@ -15,14 +15,12 @@
|
||||
#include "content/public/browser/keyboard_event_processing_result.h"
|
||||
#include "content/public/browser/navigation_entry.h"
|
||||
#include "content/public/browser/navigation_handle.h"
|
||||
#include "content/public/browser/notification_details.h"
|
||||
#include "content/public/browser/notification_source.h"
|
||||
#include "content/public/browser/notification_types.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/render_widget_host.h"
|
||||
#include "content/public/browser/render_widget_host_observer.h"
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
#include "content/public/common/input/native_web_keyboard_event.h"
|
||||
#include "services/network/public/mojom/url_response_head.mojom.h"
|
||||
#include "third_party/blink/public/mojom/favicon/favicon_url.mojom.h"
|
||||
#include "third_party/blink/public/mojom/input/focus_type.mojom-blink.h"
|
||||
#include "third_party/blink/public/mojom/widget/platform_widget.mojom-test-utils.h"
|
||||
@@ -86,17 +84,6 @@ void CefBrowserContentsDelegate::ObserveWebContents(
|
||||
WebContentsObserver::Observe(new_contents);
|
||||
|
||||
if (new_contents) {
|
||||
registrar_.reset(new content::NotificationRegistrar);
|
||||
|
||||
// When navigating through the history, the restored NavigationEntry's title
|
||||
// will be used. If the entry ends up having the same title after we return
|
||||
// to it, as will usually be the case, the
|
||||
// NOTIFICATION_WEB_CONTENTS_TITLE_UPDATED will then be suppressed, since
|
||||
// the NavigationEntry's title hasn't changed.
|
||||
registrar_->Add(this, content::NOTIFICATION_LOAD_STOP,
|
||||
content::Source<content::NavigationController>(
|
||||
&new_contents->GetController()));
|
||||
|
||||
// Make sure MaybeCreateFrame is called at least one time.
|
||||
// Create the frame representation before OnAfterCreated is called for a new
|
||||
// browser.
|
||||
@@ -106,8 +93,6 @@ void CefBrowserContentsDelegate::ObserveWebContents(
|
||||
// Make sure RenderWidgetCreated is called at least one time. This Observer
|
||||
// is registered too late to catch the initial creation.
|
||||
RenderWidgetCreated(new_contents->GetRenderViewHost()->GetWidget());
|
||||
} else {
|
||||
registrar_.reset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,6 +428,8 @@ void CefBrowserContentsDelegate::DidStopLoading() {
|
||||
for (const auto& frame : browser_info_->GetAllFrames()) {
|
||||
frame->MaybeSendDidStopLoading();
|
||||
}
|
||||
|
||||
OnTitleChange(web_contents()->GetTitle());
|
||||
}
|
||||
|
||||
void CefBrowserContentsDelegate::DidFinishNavigation(
|
||||
@@ -532,8 +519,10 @@ void CefBrowserContentsDelegate::DidFinishLoad(
|
||||
frame->RefreshAttributes();
|
||||
|
||||
int http_status_code = 0;
|
||||
if (auto response_headers = render_frame_host->GetLastResponseHeaders()) {
|
||||
http_status_code = response_headers->response_code();
|
||||
if (auto response_head = render_frame_host->GetLastResponseHead()) {
|
||||
if (response_head->headers) {
|
||||
http_status_code = response_head->headers->response_code();
|
||||
}
|
||||
}
|
||||
|
||||
OnLoadEnd(frame, validated_url, http_status_code);
|
||||
@@ -591,17 +580,6 @@ void CefBrowserContentsDelegate::WebContentsDestroyed() {
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserContentsDelegate::Observe(
|
||||
int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
DCHECK_EQ(type, content::NOTIFICATION_LOAD_STOP);
|
||||
|
||||
if (type == content::NOTIFICATION_LOAD_STOP) {
|
||||
OnTitleChange(web_contents()->GetTitle());
|
||||
}
|
||||
}
|
||||
|
||||
bool CefBrowserContentsDelegate::OnSetFocus(cef_focus_source_t source) {
|
||||
// SetFocus() might be called while inside the OnSetFocus() callback. If
|
||||
// so, don't re-enter the callback.
|
||||
|
@@ -12,8 +12,6 @@
|
||||
|
||||
#include "base/callback_list.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "content/public/browser/notification_observer.h"
|
||||
#include "content/public/browser/notification_registrar.h"
|
||||
#include "content/public/browser/web_contents_delegate.h"
|
||||
#include "content/public/browser/web_contents_observer.h"
|
||||
|
||||
@@ -49,8 +47,7 @@ constexpr inline CefBrowserContentsState operator|(
|
||||
// Includes functionality that is shared by the alloy and chrome runtimes.
|
||||
// Only accessed on the UI thread.
|
||||
class CefBrowserContentsDelegate : public content::WebContentsDelegate,
|
||||
public content::WebContentsObserver,
|
||||
public content::NotificationObserver {
|
||||
public content::WebContentsObserver {
|
||||
public:
|
||||
using State = CefBrowserContentsState;
|
||||
|
||||
@@ -143,11 +140,6 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate,
|
||||
void OnFocusChangedInPage(content::FocusedNodeDetails* details) override;
|
||||
void WebContentsDestroyed() override;
|
||||
|
||||
// NotificationObserver methods.
|
||||
void Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) override;
|
||||
|
||||
// Accessors for state information. Changes will be signaled to
|
||||
// Observer::OnStateChanged.
|
||||
bool is_loading() const { return is_loading_; }
|
||||
@@ -196,9 +188,6 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate,
|
||||
// Observers that want to be notified of changes to this object.
|
||||
base::ObserverList<Observer> observers_;
|
||||
|
||||
// Used for managing notification subscriptions.
|
||||
std::unique_ptr<content::NotificationRegistrar> registrar_;
|
||||
|
||||
// True if the focus is currently on an editable field on the page.
|
||||
bool focus_on_editable_field_ = false;
|
||||
};
|
||||
|
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "base/feature_list.h"
|
||||
#include "chrome/browser/content_settings/cookie_settings_factory.h"
|
||||
#include "chrome/browser/first_party_sets/first_party_sets_policy_service_factory.h"
|
||||
#include "chrome/browser/media/router/chrome_media_router_factory.h"
|
||||
#include "chrome/browser/media/webrtc/media_device_salt_service_factory.h"
|
||||
#include "chrome/browser/plugins/plugin_prefs_factory.h"
|
||||
@@ -25,6 +26,7 @@ namespace cef {
|
||||
|
||||
void EnsureBrowserContextKeyedServiceFactoriesBuilt() {
|
||||
CookieSettingsFactory::GetInstance();
|
||||
first_party_sets::FirstPartySetsPolicyServiceFactory::GetInstance();
|
||||
MediaDeviceSaltServiceFactory::GetInstance();
|
||||
media_router::ChromeMediaRouterFactory::GetInstance();
|
||||
PluginPrefsFactory::GetInstance();
|
||||
|
@@ -976,6 +976,20 @@ void CefBrowserHostBase::GetFrameNames(std::vector<CefString>& names) {
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserHostBase::SetAccessibilityState(
|
||||
cef_state_t accessibility_state) {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::BindOnce(&CefBrowserHostBase::SetAccessibilityState,
|
||||
this, accessibility_state));
|
||||
return;
|
||||
}
|
||||
|
||||
if (platform_delegate_) {
|
||||
platform_delegate_->SetAccessibilityState(accessibility_state);
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserHostBase::OnStateChanged(CefBrowserContentsState state_changed) {
|
||||
// Make sure that CefBrowser state is consistent before the associated
|
||||
// CefClient callback is executed.
|
||||
|
@@ -258,6 +258,7 @@ class CefBrowserHostBase : public CefBrowserHost,
|
||||
size_t GetFrameCount() override;
|
||||
void GetFrameIdentifiers(std::vector<int64_t>& identifiers) override;
|
||||
void GetFrameNames(std::vector<CefString>& names) override;
|
||||
void SetAccessibilityState(cef_state_t accessibility_state) override;
|
||||
|
||||
// CefBrowserContentsDelegate::Observer methods:
|
||||
void OnStateChanged(CefBrowserContentsState state_changed) override;
|
||||
|
@@ -10,6 +10,7 @@
|
||||
#include "base/logging.h"
|
||||
#include "chrome/browser/platform_util.h"
|
||||
#include "chrome/browser/shell_integration.h"
|
||||
#include "content/browser/web_contents/web_contents_impl.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/render_widget_host.h"
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
@@ -264,9 +265,6 @@ std::unique_ptr<CefMenuRunner> CefBrowserPlatformDelegate::CreateMenuRunner() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegate::UpdateFindBarBoundingBox(
|
||||
gfx::Rect* bounds) const {}
|
||||
|
||||
bool CefBrowserPlatformDelegate::IsWindowless() const {
|
||||
return false;
|
||||
}
|
||||
@@ -412,7 +410,27 @@ void CefBrowserPlatformDelegate::SetAutoResizeEnabled(bool enabled,
|
||||
|
||||
void CefBrowserPlatformDelegate::SetAccessibilityState(
|
||||
cef_state_t accessibility_state) {
|
||||
NOTIMPLEMENTED();
|
||||
// Do nothing if state is set to default. It'll be disabled by default and
|
||||
// controlled by the command-line flags "force-renderer-accessibility" and
|
||||
// "disable-renderer-accessibility".
|
||||
if (accessibility_state == STATE_DEFAULT) {
|
||||
return;
|
||||
}
|
||||
|
||||
content::WebContentsImpl* web_contents_impl =
|
||||
static_cast<content::WebContentsImpl*>(web_contents_);
|
||||
|
||||
if (!web_contents_impl) {
|
||||
return;
|
||||
}
|
||||
|
||||
ui::AXMode accMode;
|
||||
// In windowless mode set accessibility to TreeOnly mode. Else native
|
||||
// accessibility APIs, specific to each platform, are also created.
|
||||
if (accessibility_state == STATE_ENABLED) {
|
||||
accMode = IsWindowless() ? ui::kAXModeWebContentsOnly : ui::kAXModeComplete;
|
||||
}
|
||||
web_contents_impl->SetAccessibilityMode(accMode);
|
||||
}
|
||||
|
||||
bool CefBrowserPlatformDelegate::IsPrintPreviewSupported() const {
|
||||
|
@@ -286,9 +286,6 @@ class CefBrowserPlatformDelegate {
|
||||
// Create the platform-specific menu runner.
|
||||
virtual std::unique_ptr<CefMenuRunner> CreateMenuRunner();
|
||||
|
||||
// Optionally modify the bounding box for the Chrome Find bar.
|
||||
virtual void UpdateFindBarBoundingBox(gfx::Rect* bounds) const;
|
||||
|
||||
// Returns true if this delegate implements windowless rendering. May be
|
||||
// called on multiple threads.
|
||||
virtual bool IsWindowless() const;
|
||||
|
@@ -7,11 +7,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
#include "base/memory/scoped_refptr.h"
|
||||
#include "chrome/browser/ui/page_action/page_action_icon_type.h"
|
||||
#include "content/public/browser/web_contents_delegate.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/skia/include/core/SkRegion.h"
|
||||
#include "ui/base/window_open_disposition.h"
|
||||
|
||||
@@ -107,6 +107,9 @@ class BrowserDelegate : public content::WebContentsDelegate {
|
||||
// Optionally modify the bounding box for the Find bar.
|
||||
virtual void UpdateFindBarBoundingBox(gfx::Rect* bounds) {}
|
||||
|
||||
// Optionally modify the top inset for dialogs.
|
||||
virtual void UpdateDialogTopInset(int* dialog_top_y) {}
|
||||
|
||||
// Same as RequestMediaAccessPermission but returning |callback| if the
|
||||
// request is unhandled.
|
||||
[[nodiscard]] virtual content::MediaResponseCallback
|
||||
@@ -118,8 +121,8 @@ class BrowserDelegate : public content::WebContentsDelegate {
|
||||
|
||||
// Optionally override support for the specified window feature of type
|
||||
// Browser::WindowFeature.
|
||||
virtual absl::optional<bool> SupportsWindowFeature(int feature) const {
|
||||
return absl::nullopt;
|
||||
virtual std::optional<bool> SupportsWindowFeature(int feature) const {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// Returns true if draggable regions are supported.
|
||||
@@ -128,8 +131,8 @@ class BrowserDelegate : public content::WebContentsDelegate {
|
||||
// Returns the draggable region, if any, relative to the web contents.
|
||||
// Called from PictureInPictureBrowserFrameView::NonClientHitTest and
|
||||
// BrowserView::ShouldDescendIntoChildForEventHandling.
|
||||
virtual const absl::optional<SkRegion> GetDraggableRegion() const {
|
||||
return absl::nullopt;
|
||||
virtual const std::optional<SkRegion> GetDraggableRegion() const {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// Set the draggable region relative to web contents.
|
||||
@@ -138,6 +141,10 @@ class BrowserDelegate : public content::WebContentsDelegate {
|
||||
|
||||
// Called at the end of a fullscreen transition.
|
||||
virtual void WindowFullscreenStateChanged() {}
|
||||
|
||||
// Returns true if this browser has a Views-hosted opener. Only
|
||||
// applicable for Browsers of type picture_in_picture and devtools.
|
||||
virtual bool HasViewsHostedOpener() const { return false; }
|
||||
};
|
||||
|
||||
} // namespace cef
|
||||
|
@@ -336,8 +336,16 @@ bool ChromeBrowserDelegate::IsToolbarButtonVisible(
|
||||
}
|
||||
|
||||
void ChromeBrowserDelegate::UpdateFindBarBoundingBox(gfx::Rect* bounds) {
|
||||
if (auto browser = ChromeBrowserHostImpl::GetBrowserForBrowser(browser_)) {
|
||||
browser->platform_delegate()->UpdateFindBarBoundingBox(bounds);
|
||||
if (auto cef_window_view = GetCefWindowView()) {
|
||||
cef_window_view->UpdateFindBarBoundingBox(bounds);
|
||||
}
|
||||
}
|
||||
|
||||
void ChromeBrowserDelegate::UpdateDialogTopInset(int* dialog_top_y) {
|
||||
// This may be called during Browser initialization (before Tab/WebContents
|
||||
// creation), so we can't route through the ChromeBrowserHostImpl.
|
||||
if (auto cef_window_view = GetCefWindowView()) {
|
||||
cef_window_view->UpdateDialogTopInset(dialog_top_y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -377,7 +385,7 @@ bool ChromeBrowserDelegate::SupportsFramelessPictureInPicture() const {
|
||||
return *frameless_pip_;
|
||||
}
|
||||
|
||||
absl::optional<bool> ChromeBrowserDelegate::SupportsWindowFeature(
|
||||
std::optional<bool> ChromeBrowserDelegate::SupportsWindowFeature(
|
||||
int feature) const {
|
||||
// Override the default value from
|
||||
// Browser::PictureInPictureBrowserSupportsWindowFeature.
|
||||
@@ -386,14 +394,14 @@ absl::optional<bool> ChromeBrowserDelegate::SupportsWindowFeature(
|
||||
// Return false to hide titlebar and enable draggable regions.
|
||||
return !SupportsFramelessPictureInPicture();
|
||||
}
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool ChromeBrowserDelegate::SupportsDraggableRegion() const {
|
||||
return SupportsFramelessPictureInPicture();
|
||||
}
|
||||
|
||||
const absl::optional<SkRegion> ChromeBrowserDelegate::GetDraggableRegion()
|
||||
const std::optional<SkRegion> ChromeBrowserDelegate::GetDraggableRegion()
|
||||
const {
|
||||
DCHECK(SupportsDraggableRegion());
|
||||
return draggable_region_;
|
||||
@@ -408,19 +416,22 @@ void ChromeBrowserDelegate::WindowFullscreenStateChanged() {
|
||||
// Use a synchronous callback for notification on Windows/Linux. MacOS gets
|
||||
// notified asynchronously via CefNativeWidgetMac callbacks.
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
if (auto browser = ChromeBrowserHostImpl::GetBrowserForBrowser(browser_)) {
|
||||
if (auto chrome_browser_view = browser->chrome_browser_view()) {
|
||||
auto* cef_window = chrome_browser_view->cef_browser_view()->cef_window();
|
||||
if (auto* delegate = cef_window->delegate()) {
|
||||
// Give the CefWindowDelegate a chance to handle the event.
|
||||
delegate->OnWindowFullscreenTransition(cef_window,
|
||||
/*is_completed=*/true);
|
||||
}
|
||||
if (auto cef_window_impl = GetCefWindowImpl()) {
|
||||
if (auto* delegate = cef_window_impl->delegate()) {
|
||||
// Give the CefWindowDelegate a chance to handle the event.
|
||||
delegate->OnWindowFullscreenTransition(cef_window_impl,
|
||||
/*is_completed=*/true);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ChromeBrowserDelegate::HasViewsHostedOpener() const {
|
||||
DCHECK(browser_->is_type_picture_in_picture() ||
|
||||
browser_->is_type_devtools());
|
||||
return opener_host_ && opener_host_->is_views_hosted();
|
||||
}
|
||||
|
||||
void ChromeBrowserDelegate::WebContentsCreated(
|
||||
content::WebContents* source_contents,
|
||||
int opener_render_process_id,
|
||||
@@ -646,7 +657,7 @@ ChromeBrowserDelegate::CreateBrowserHostForPopup(
|
||||
}
|
||||
|
||||
CefBrowserContentsDelegate* ChromeBrowserDelegate::GetDelegateForWebContents(
|
||||
content::WebContents* web_contents) {
|
||||
content::WebContents* web_contents) const {
|
||||
auto browser_host =
|
||||
ChromeBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
if (browser_host) {
|
||||
@@ -655,6 +666,28 @@ CefBrowserContentsDelegate* ChromeBrowserDelegate::GetDelegateForWebContents(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool ChromeBrowserDelegate::IsViewsHosted() const {
|
||||
return create_params_.browser_view != nullptr ||
|
||||
create_params_.popup_with_views_hosted_opener;
|
||||
}
|
||||
|
||||
CefWindowImpl* ChromeBrowserDelegate::GetCefWindowImpl() const {
|
||||
if (IsViewsHosted()) {
|
||||
if (auto chrome_browser_view =
|
||||
static_cast<ChromeBrowserView*>(browser_->window())) {
|
||||
return chrome_browser_view->cef_browser_view()->cef_window_impl();
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CefWindowView* ChromeBrowserDelegate::GetCefWindowView() const {
|
||||
if (auto cef_window_impl = GetCefWindowImpl()) {
|
||||
return cef_window_impl->cef_window_view();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
namespace cef {
|
||||
|
||||
// static
|
||||
|
@@ -16,6 +16,8 @@
|
||||
|
||||
class CefBrowserContentsDelegate;
|
||||
class CefRequestContextImpl;
|
||||
class CefWindowImpl;
|
||||
class CefWindowView;
|
||||
class ChromeBrowserHostImpl;
|
||||
|
||||
// Implementation of the cef::BrowserDelegate interface. Lifespan is controlled
|
||||
@@ -69,15 +71,17 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
|
||||
bool IsPageActionIconVisible(PageActionIconType icon_type) override;
|
||||
bool IsToolbarButtonVisible(ToolbarButtonType button_type) override;
|
||||
void UpdateFindBarBoundingBox(gfx::Rect* bounds) override;
|
||||
void UpdateDialogTopInset(int* dialog_top_y) override;
|
||||
[[nodiscard]] content::MediaResponseCallback RequestMediaAccessPermissionEx(
|
||||
content::WebContents* web_contents,
|
||||
const content::MediaStreamRequest& request,
|
||||
content::MediaResponseCallback callback) override;
|
||||
absl::optional<bool> SupportsWindowFeature(int feature) const override;
|
||||
std::optional<bool> SupportsWindowFeature(int feature) const override;
|
||||
bool SupportsDraggableRegion() const override;
|
||||
const absl::optional<SkRegion> GetDraggableRegion() const override;
|
||||
const std::optional<SkRegion> GetDraggableRegion() const override;
|
||||
void UpdateDraggableRegion(const SkRegion& region) override;
|
||||
void WindowFullscreenStateChanged() override;
|
||||
bool HasViewsHostedOpener() const override;
|
||||
|
||||
// WebContentsDelegate methods:
|
||||
void WebContentsCreated(content::WebContents* source_contents,
|
||||
@@ -137,19 +141,25 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
|
||||
CefRefPtr<ChromeBrowserHostImpl> opener);
|
||||
|
||||
CefBrowserContentsDelegate* GetDelegateForWebContents(
|
||||
content::WebContents* web_contents);
|
||||
content::WebContents* web_contents) const;
|
||||
|
||||
bool SupportsFramelessPictureInPicture() const;
|
||||
|
||||
bool IsViewsHosted() const;
|
||||
|
||||
// Will return nullptr if the Browser is not Views-hosted.
|
||||
CefWindowImpl* GetCefWindowImpl() const;
|
||||
CefWindowView* GetCefWindowView() const;
|
||||
|
||||
Browser* const browser_;
|
||||
base::WeakPtr<ChromeBrowserHostImpl> opener_host_;
|
||||
|
||||
// Used when creating a new browser host.
|
||||
const CefBrowserCreateParams create_params_;
|
||||
|
||||
absl::optional<bool> show_status_bubble_;
|
||||
absl::optional<SkRegion> draggable_region_;
|
||||
mutable absl::optional<bool> frameless_pip_;
|
||||
std::optional<bool> show_status_bubble_;
|
||||
std::optional<SkRegion> draggable_region_;
|
||||
mutable std::optional<bool> frameless_pip_;
|
||||
|
||||
std::unique_ptr<CefShowDevToolsParams> pending_show_devtools_params_;
|
||||
};
|
||||
|
@@ -93,8 +93,15 @@ CefRefPtr<ChromeBrowserHostImpl> ChromeBrowserHostImpl::GetBrowserForGlobalId(
|
||||
CefRefPtr<ChromeBrowserHostImpl> ChromeBrowserHostImpl::GetBrowserForBrowser(
|
||||
const Browser* browser) {
|
||||
REQUIRE_CHROME_RUNTIME();
|
||||
return GetBrowserForContents(
|
||||
browser->tab_strip_model()->GetActiveWebContents());
|
||||
// Return the ChromeBrowserHostImpl that is currently active.
|
||||
// Views-hosted Browsers will contain a single ChromeBrowserHostImpl.
|
||||
// Otherwise, there will be a ChromeBrowserHostImpl per Tab/WebContents.
|
||||
// |contents| may be nullptr during Browser initialization or destruction.
|
||||
auto contents = browser->tab_strip_model()->GetActiveWebContents();
|
||||
if (!contents) {
|
||||
return nullptr;
|
||||
}
|
||||
return GetBrowserForContents(contents);
|
||||
}
|
||||
|
||||
ChromeBrowserHostImpl::~ChromeBrowserHostImpl() = default;
|
||||
@@ -235,7 +242,8 @@ void ChromeBrowserHostImpl::ShowDevToolsOnUIThread(
|
||||
DevToolsWindow::InspectElement(web_contents->GetPrimaryMainFrame(),
|
||||
inspect_element_at.x, inspect_element_at.y);
|
||||
} else {
|
||||
DevToolsWindow::OpenDevToolsWindow(web_contents, profile);
|
||||
DevToolsWindow::OpenDevToolsWindow(web_contents, profile,
|
||||
DevToolsOpenedByAction::kUnknown);
|
||||
}
|
||||
|
||||
// The DevTools browser host should now exist.
|
||||
@@ -361,11 +369,6 @@ bool ChromeBrowserHostImpl::IsAudioMuted() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void ChromeBrowserHostImpl::SetAccessibilityState(
|
||||
cef_state_t accessibility_state) {
|
||||
NOTIMPLEMENTED();
|
||||
}
|
||||
|
||||
void ChromeBrowserHostImpl::SetAutoResizeEnabled(bool enabled,
|
||||
const CefSize& min_size,
|
||||
const CefSize& max_size) {
|
||||
|
@@ -104,7 +104,6 @@ class ChromeBrowserHostImpl : public CefBrowserHostBase {
|
||||
void DragSourceEndedAt(int x, int y, DragOperationsMask op) override;
|
||||
void SetAudioMuted(bool mute) override;
|
||||
bool IsAudioMuted() override;
|
||||
void SetAccessibilityState(cef_state_t accessibility_state) override;
|
||||
void SetAutoResizeEnabled(bool enabled,
|
||||
const CefSize& min_size,
|
||||
const CefSize& max_size) override;
|
||||
|
@@ -335,7 +335,7 @@ bool ChromeContentBrowserClientCef::HandleExternalProtocol(
|
||||
return false;
|
||||
}
|
||||
|
||||
// The request was unhandled and we've recieved a callback from
|
||||
// The request was unhandled and we've received a callback from
|
||||
// HandleExternalProtocolHelper. Forward to the chrome layer for default
|
||||
// handling.
|
||||
return ChromeContentBrowserClient::HandleExternalProtocol(
|
||||
|
@@ -195,15 +195,6 @@ void CefBrowserPlatformDelegateChromeViews::PopupBrowserCreated(
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateChromeViews::UpdateFindBarBoundingBox(
|
||||
gfx::Rect* bounds) const {
|
||||
if (auto* window_impl = GetWindowImpl()) {
|
||||
if (window_impl->root_view()) {
|
||||
window_impl->root_view()->UpdateFindBarBoundingBox(bounds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CefBrowserPlatformDelegateChromeViews::IsViewsHosted() const {
|
||||
return true;
|
||||
}
|
||||
|
@@ -37,7 +37,6 @@ class CefBrowserPlatformDelegateChromeViews
|
||||
bool is_devtools) override;
|
||||
void PopupBrowserCreated(CefBrowserHostBase* new_browser,
|
||||
bool is_devtools) override;
|
||||
void UpdateFindBarBoundingBox(gfx::Rect* bounds) const override;
|
||||
bool IsViewsHosted() const override;
|
||||
|
||||
CefRefPtr<CefBrowserViewImpl> browser_view() const { return browser_view_; }
|
||||
|
@@ -10,6 +10,7 @@
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/hash/md5.h"
|
||||
#include "base/json/json_writer.h"
|
||||
#include "base/json/values_util.h"
|
||||
#include "base/lazy_instance.h"
|
||||
|
@@ -38,24 +38,24 @@ namespace {
|
||||
const char kNotImplementedError[] = "Not implemented";
|
||||
|
||||
void ZoomModeToZoomSettings(zoom::ZoomController::ZoomMode zoom_mode,
|
||||
api::tabs::ZoomSettings* zoom_settings) {
|
||||
tabs::ZoomSettings* zoom_settings) {
|
||||
DCHECK(zoom_settings);
|
||||
switch (zoom_mode) {
|
||||
case zoom::ZoomController::ZOOM_MODE_DEFAULT:
|
||||
zoom_settings->mode = api::tabs::ZOOM_SETTINGS_MODE_AUTOMATIC;
|
||||
zoom_settings->scope = api::tabs::ZOOM_SETTINGS_SCOPE_PER_ORIGIN;
|
||||
zoom_settings->mode = tabs::ZoomSettingsMode::kAutomatic;
|
||||
zoom_settings->scope = tabs::ZoomSettingsScope::kPerOrigin;
|
||||
break;
|
||||
case zoom::ZoomController::ZOOM_MODE_ISOLATED:
|
||||
zoom_settings->mode = api::tabs::ZOOM_SETTINGS_MODE_AUTOMATIC;
|
||||
zoom_settings->scope = api::tabs::ZOOM_SETTINGS_SCOPE_PER_TAB;
|
||||
zoom_settings->mode = tabs::ZoomSettingsMode::kAutomatic;
|
||||
zoom_settings->scope = tabs::ZoomSettingsScope::kPerTab;
|
||||
break;
|
||||
case zoom::ZoomController::ZOOM_MODE_MANUAL:
|
||||
zoom_settings->mode = api::tabs::ZOOM_SETTINGS_MODE_MANUAL;
|
||||
zoom_settings->scope = api::tabs::ZOOM_SETTINGS_SCOPE_PER_TAB;
|
||||
zoom_settings->mode = tabs::ZoomSettingsMode::kManual;
|
||||
zoom_settings->scope = tabs::ZoomSettingsScope::kPerTab;
|
||||
break;
|
||||
case zoom::ZoomController::ZOOM_MODE_DISABLED:
|
||||
zoom_settings->mode = api::tabs::ZOOM_SETTINGS_MODE_DISABLED;
|
||||
zoom_settings->scope = api::tabs::ZOOM_SETTINGS_SCOPE_PER_TAB;
|
||||
zoom_settings->mode = tabs::ZoomSettingsMode::kDisabled;
|
||||
zoom_settings->scope = tabs::ZoomSettingsScope::kPerTab;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -271,8 +271,8 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() {
|
||||
if (!details_value.is_dict()) {
|
||||
return set_init_result(VALIDATION_FAILURE);
|
||||
}
|
||||
std::unique_ptr<InjectDetails> details(new InjectDetails());
|
||||
if (!InjectDetails::Populate(details_value.GetDict(), *details)) {
|
||||
auto details = InjectDetails::FromValue(details_value.GetDict());
|
||||
if (!details) {
|
||||
return set_init_result(VALIDATION_FAILURE);
|
||||
}
|
||||
|
||||
@@ -463,7 +463,7 @@ ExtensionFunction::ResponseAction TabsGetZoomFunction::Run() {
|
||||
}
|
||||
|
||||
ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() {
|
||||
using api::tabs::ZoomSettings;
|
||||
using tabs::ZoomSettings;
|
||||
|
||||
absl::optional<tabs::SetZoomSettings::Params> params =
|
||||
tabs::SetZoomSettings::Params::Create(args());
|
||||
@@ -482,9 +482,9 @@ ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() {
|
||||
}
|
||||
|
||||
// "per-origin" scope is only available in "automatic" mode.
|
||||
if (params->zoom_settings.scope == tabs::ZOOM_SETTINGS_SCOPE_PER_ORIGIN &&
|
||||
params->zoom_settings.mode != tabs::ZOOM_SETTINGS_MODE_AUTOMATIC &&
|
||||
params->zoom_settings.mode != tabs::ZOOM_SETTINGS_MODE_NONE) {
|
||||
if (params->zoom_settings.scope == tabs::ZoomSettingsScope::kPerOrigin &&
|
||||
params->zoom_settings.mode != tabs::ZoomSettingsMode::kAutomatic &&
|
||||
params->zoom_settings.mode != tabs::ZoomSettingsMode::kNone) {
|
||||
return RespondNow(Error(tabs_constants::kPerOriginOnlyInAutomaticError));
|
||||
}
|
||||
|
||||
@@ -492,21 +492,21 @@ ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() {
|
||||
// user-specified |zoom_settings|.
|
||||
ZoomController::ZoomMode zoom_mode = ZoomController::ZOOM_MODE_DEFAULT;
|
||||
switch (params->zoom_settings.mode) {
|
||||
case tabs::ZOOM_SETTINGS_MODE_NONE:
|
||||
case tabs::ZOOM_SETTINGS_MODE_AUTOMATIC:
|
||||
case tabs::ZoomSettingsMode::kNone:
|
||||
case tabs::ZoomSettingsMode::kAutomatic:
|
||||
switch (params->zoom_settings.scope) {
|
||||
case tabs::ZOOM_SETTINGS_SCOPE_NONE:
|
||||
case tabs::ZOOM_SETTINGS_SCOPE_PER_ORIGIN:
|
||||
case tabs::ZoomSettingsScope::kNone:
|
||||
case tabs::ZoomSettingsScope::kPerOrigin:
|
||||
zoom_mode = ZoomController::ZOOM_MODE_DEFAULT;
|
||||
break;
|
||||
case tabs::ZOOM_SETTINGS_SCOPE_PER_TAB:
|
||||
case tabs::ZoomSettingsScope::kPerTab:
|
||||
zoom_mode = ZoomController::ZOOM_MODE_ISOLATED;
|
||||
}
|
||||
break;
|
||||
case tabs::ZOOM_SETTINGS_MODE_MANUAL:
|
||||
case tabs::ZoomSettingsMode::kManual:
|
||||
zoom_mode = ZoomController::ZOOM_MODE_MANUAL;
|
||||
break;
|
||||
case tabs::ZOOM_SETTINGS_MODE_DISABLED:
|
||||
case tabs::ZoomSettingsMode::kDisabled:
|
||||
zoom_mode = ZoomController::ZOOM_MODE_DISABLED;
|
||||
}
|
||||
|
||||
@@ -529,13 +529,13 @@ ExtensionFunction::ResponseAction TabsGetZoomSettingsFunction::Run() {
|
||||
ZoomController::FromWebContents(web_contents);
|
||||
|
||||
ZoomController::ZoomMode zoom_mode = zoom_controller->zoom_mode();
|
||||
api::tabs::ZoomSettings zoom_settings;
|
||||
tabs::ZoomSettings zoom_settings;
|
||||
ZoomModeToZoomSettings(zoom_mode, &zoom_settings);
|
||||
zoom_settings.default_zoom_factor =
|
||||
blink::PageZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel());
|
||||
|
||||
return RespondNow(
|
||||
ArgumentList(api::tabs::GetZoomSettings::Results::Create(zoom_settings)));
|
||||
ArgumentList(tabs::GetZoomSettings::Results::Create(zoom_settings)));
|
||||
}
|
||||
|
||||
} // namespace cef
|
||||
|
@@ -25,22 +25,15 @@
|
||||
|
||||
namespace extensions {
|
||||
|
||||
namespace {
|
||||
|
||||
bool InsertWebContents(std::vector<content::WebContents*>* vector,
|
||||
content::WebContents* web_contents) {
|
||||
vector->push_back(web_contents);
|
||||
return false; // Continue iterating.
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void GetAllGuestsForOwnerContents(content::WebContents* owner,
|
||||
std::vector<content::WebContents*>* guests) {
|
||||
content::BrowserPluginGuestManager* plugin_guest_manager =
|
||||
owner->GetBrowserContext()->GetGuestManager();
|
||||
plugin_guest_manager->ForEachGuest(
|
||||
owner, base::BindRepeating(InsertWebContents, guests));
|
||||
owner, [guests](content::WebContents* web_contents) {
|
||||
guests->push_back(web_contents);
|
||||
return false; // Continue iterating.
|
||||
});
|
||||
}
|
||||
|
||||
content::WebContents* GetOwnerForGuestContents(content::WebContents* guest) {
|
||||
|
@@ -421,13 +421,11 @@ api::tabs::Tab CefExtensionFunctionDetails::CreateTabObject(
|
||||
int index) const {
|
||||
content::WebContents* contents = new_browser->web_contents();
|
||||
|
||||
bool is_loading = contents->IsLoading();
|
||||
api::tabs::Tab tab_object;
|
||||
tab_object.id = new_browser->GetIdentifier();
|
||||
tab_object.index = index;
|
||||
tab_object.window_id = *tab_object.id;
|
||||
tab_object.status = is_loading ? api::tabs::TAB_STATUS_LOADING
|
||||
: api::tabs::TAB_STATUS_COMPLETE;
|
||||
tab_object.status = ExtensionTabUtil::GetLoadingStatus(contents);
|
||||
tab_object.active = active;
|
||||
tab_object.selected = true;
|
||||
tab_object.highlighted = true;
|
||||
|
@@ -51,7 +51,7 @@ void CefExtensionHostDelegate::ProcessMediaAccessRequest(
|
||||
|
||||
bool CefExtensionHostDelegate::CheckMediaAccessPermission(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& security_origin,
|
||||
const url::Origin& security_origin,
|
||||
blink::mojom::MediaStreamType type,
|
||||
const Extension* extension) {
|
||||
// Never routed here from AlloyBrowserHostImpl.
|
||||
|
@@ -34,7 +34,7 @@ class CefExtensionHostDelegate : public ExtensionHostDelegate {
|
||||
content::MediaResponseCallback callback,
|
||||
const Extension* extension) override;
|
||||
bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
|
||||
const GURL& security_origin,
|
||||
const url::Origin& security_origin,
|
||||
blink::mojom::MediaStreamType type,
|
||||
const Extension* extension) override;
|
||||
content::PictureInPictureResult EnterPictureInPicture(
|
||||
|
@@ -8,7 +8,9 @@
|
||||
#include <utility>
|
||||
|
||||
#include "libcef/browser/browser_host_base.h"
|
||||
#include "libcef/browser/extensions/browser_extensions_util.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
#include "libcef/common/extensions/extensions_util.h"
|
||||
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/functional/callback_helpers.h"
|
||||
@@ -62,8 +64,23 @@ class CefJSDialogCallbackImpl : public CefJSDialogCallback {
|
||||
|
||||
javascript_dialogs::TabModalDialogManager* GetTabModalDialogManager(
|
||||
content::WebContents* web_contents) {
|
||||
return javascript_dialogs::TabModalDialogManager::FromWebContents(
|
||||
web_contents);
|
||||
if (auto* manager =
|
||||
javascript_dialogs::TabModalDialogManager::FromWebContents(
|
||||
web_contents)) {
|
||||
return manager;
|
||||
}
|
||||
|
||||
// Try the owner WebContents if the dialog originates from a guest view such
|
||||
// as the PDF viewer or Print Preview.
|
||||
if (extensions::ExtensionsEnabled()) {
|
||||
if (auto* owner_contents =
|
||||
extensions::GetOwnerForGuestContents(web_contents)) {
|
||||
return javascript_dialogs::TabModalDialogManager::FromWebContents(
|
||||
owner_contents);
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -152,6 +169,12 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog(
|
||||
}
|
||||
|
||||
auto manager = GetTabModalDialogManager(web_contents);
|
||||
if (!manager) {
|
||||
// Dismiss the dialog.
|
||||
std::move(callback).Run(false, std::u16string());
|
||||
return;
|
||||
}
|
||||
|
||||
manager->RunJavaScriptDialog(web_contents, render_frame_host, message_type,
|
||||
message_text, default_prompt_text,
|
||||
std::move(callback), did_suppress_message);
|
||||
@@ -219,6 +242,12 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog(
|
||||
}
|
||||
|
||||
auto manager = GetTabModalDialogManager(web_contents);
|
||||
if (!manager) {
|
||||
// Accept the unload without showing the prompt.
|
||||
std::move(callback).Run(true, std::u16string());
|
||||
return;
|
||||
}
|
||||
|
||||
manager->RunBeforeUnloadDialog(web_contents, render_frame_host, is_reload,
|
||||
std::move(callback));
|
||||
}
|
||||
@@ -243,6 +272,10 @@ bool CefJavaScriptDialogManager::HandleJavaScriptDialog(
|
||||
}
|
||||
|
||||
auto manager = GetTabModalDialogManager(web_contents);
|
||||
if (!manager) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return manager->HandleJavaScriptDialog(web_contents, accept, prompt_override);
|
||||
}
|
||||
|
||||
@@ -272,6 +305,10 @@ void CefJavaScriptDialogManager::CancelDialogs(
|
||||
}
|
||||
|
||||
auto manager = GetTabModalDialogManager(web_contents);
|
||||
if (!manager) {
|
||||
return;
|
||||
}
|
||||
|
||||
manager->CancelDialogs(web_contents, reset_state);
|
||||
}
|
||||
|
||||
|
@@ -181,12 +181,20 @@ class CefUIThread : public base::PlatformThread::Delegate {
|
||||
|
||||
runner_->RunMessageLoop();
|
||||
|
||||
browser_runner_->Shutdown();
|
||||
browser_runner_.reset();
|
||||
// Stop may be called before InitializeBrowserRunner if
|
||||
// content::ContentMainRun was not successful (for example, due to process
|
||||
// singleton relaunch).
|
||||
if (browser_runner_) {
|
||||
browser_runner_->Shutdown();
|
||||
browser_runner_.reset();
|
||||
}
|
||||
|
||||
// This will be a no-op if there is no BrowserTaskExecutor.
|
||||
content::BrowserTaskExecutor::Shutdown();
|
||||
|
||||
std::move(shutdown_callback_).Run();
|
||||
if (!shutdown_callback_.is_null()) {
|
||||
std::move(shutdown_callback_).Run();
|
||||
}
|
||||
|
||||
// Run exit callbacks on the UI thread to avoid sequence check failures.
|
||||
base::AtExitManager::ProcessCallbacksNow();
|
||||
@@ -433,6 +441,11 @@ int CefMainRunner::ContentMainRun(bool* initialized,
|
||||
int* exit_code) {
|
||||
runner->main_delegate_->BeforeUIThreadInitialize();
|
||||
*exit_code = content::ContentMainRun(runner->main_runner_.get());
|
||||
|
||||
if (*exit_code != content::RESULT_CODE_NORMAL_EXIT) {
|
||||
runner->FinishShutdownOnUIThread();
|
||||
}
|
||||
|
||||
event->Signal();
|
||||
},
|
||||
base::Unretained(this), base::Unretained(&uithread_startup_event),
|
||||
@@ -444,6 +457,13 @@ int CefMainRunner::ContentMainRun(bool* initialized,
|
||||
|
||||
// We need to wait until content::ContentMainRun has finished.
|
||||
uithread_startup_event.Wait();
|
||||
|
||||
if (exit_code != content::RESULT_CODE_NORMAL_EXIT) {
|
||||
// content::ContentMainRun was not successful (for example, due to process
|
||||
// singleton relaunch). Stop the UI thread and block until done.
|
||||
ui_thread_->Stop();
|
||||
ui_thread_.reset();
|
||||
}
|
||||
} else {
|
||||
*initialized = true;
|
||||
main_delegate_->BeforeUIThreadInitialize();
|
||||
|
@@ -296,7 +296,7 @@ bool CheckCommandLinePermission() {
|
||||
|
||||
bool CheckMediaAccessPermission(CefBrowserHostBase* browser,
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& security_origin,
|
||||
const url::Origin& security_origin,
|
||||
blink::mojom::MediaStreamType type) {
|
||||
// Always allowed here. RequestMediaAccessPermission will be called.
|
||||
return true;
|
||||
|
@@ -12,15 +12,18 @@ namespace content {
|
||||
class RenderFrameHost;
|
||||
}
|
||||
|
||||
namespace url {
|
||||
class Origin;
|
||||
}
|
||||
|
||||
class CefBrowserHostBase;
|
||||
class GURL;
|
||||
|
||||
namespace media_access_query {
|
||||
|
||||
// Called from WebContentsDelegate::CheckMediaAccessPermission.
|
||||
bool CheckMediaAccessPermission(CefBrowserHostBase* browser,
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& security_origin,
|
||||
const url::Origin& security_origin,
|
||||
blink::mojom::MediaStreamType type);
|
||||
|
||||
// Called from WebContentsDelegate::RequestMediaAccessPermission.
|
||||
|
@@ -17,9 +17,9 @@
|
||||
#include "ui/events/platform/x11/x11_event_source.h"
|
||||
#include "ui/events/x/x11_event_translation.h"
|
||||
#include "ui/gfx/x/connection.h"
|
||||
#include "ui/gfx/x/x11_window_event_manager.h"
|
||||
#include "ui/gfx/x/visual_manager.h"
|
||||
#include "ui/gfx/x/window_event_manager.h"
|
||||
#include "ui/gfx/x/xinput.h"
|
||||
#include "ui/gfx/x/xproto_util.h"
|
||||
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"
|
||||
|
||||
namespace {
|
||||
@@ -34,8 +34,10 @@ const char kXdndProxy[] = "XdndProxy";
|
||||
|
||||
// Return true if |window| has any property with |property_name|.
|
||||
// Deleted from ui/base/x/x11_util.h in https://crrev.com/62fc260067.
|
||||
bool PropertyExists(x11::Window window, x11::Atom property) {
|
||||
auto response = x11::Connection::Get()
|
||||
bool PropertyExists(x11::Connection* connection,
|
||||
x11::Window window,
|
||||
x11::Atom property) {
|
||||
auto response = connection
|
||||
->GetProperty(x11::GetPropertyRequest{
|
||||
.window = window,
|
||||
.property = property,
|
||||
@@ -47,16 +49,16 @@ bool PropertyExists(x11::Window window, x11::Atom property) {
|
||||
|
||||
// Returns true if |window| is visible.
|
||||
// Deleted from ui/base/x/x11_util.h in https://crrev.com/62fc260067.
|
||||
bool IsWindowVisible(x11::Window window) {
|
||||
auto response = x11::Connection::Get()->GetWindowAttributes({window}).Sync();
|
||||
bool IsWindowVisible(x11::Connection* connection, x11::Window window) {
|
||||
auto response = connection->GetWindowAttributes({window}).Sync();
|
||||
if (!response || response->map_state != x11::MapState::Viewable) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Minimized windows are not visible.
|
||||
std::vector<x11::Atom> wm_states;
|
||||
if (x11::GetArrayProperty(window, x11::GetAtom("_NET_WM_STATE"),
|
||||
&wm_states)) {
|
||||
if (connection->GetArrayProperty(window, x11::GetAtom("_NET_WM_STATE"),
|
||||
&wm_states)) {
|
||||
x11::Atom hidden_atom = x11::GetAtom("_NET_WM_STATE_HIDDEN");
|
||||
if (base::Contains(wm_states, hidden_atom)) {
|
||||
return false;
|
||||
@@ -70,8 +72,8 @@ bool IsWindowVisible(x11::Window window) {
|
||||
return true;
|
||||
}
|
||||
|
||||
x11::Window FindChild(x11::Window window) {
|
||||
auto query_tree = x11::Connection::Get()->QueryTree({window}).Sync();
|
||||
x11::Window FindChild(x11::Connection* connection, x11::Window window) {
|
||||
auto query_tree = connection->QueryTree({window}).Sync();
|
||||
if (query_tree && query_tree->children.size() == 1U) {
|
||||
return query_tree->children[0];
|
||||
}
|
||||
@@ -79,17 +81,19 @@ x11::Window FindChild(x11::Window window) {
|
||||
return x11::Window::None;
|
||||
}
|
||||
|
||||
x11::Window FindToplevelParent(x11::Window window) {
|
||||
x11::Window FindToplevelParent(x11::Connection* connection,
|
||||
x11::Window window) {
|
||||
x11::Window top_level_window = window;
|
||||
|
||||
do {
|
||||
auto query_tree = x11::Connection::Get()->QueryTree({window}).Sync();
|
||||
auto query_tree = connection->QueryTree({window}).Sync();
|
||||
if (!query_tree) {
|
||||
break;
|
||||
}
|
||||
|
||||
top_level_window = window;
|
||||
if (!PropertyExists(query_tree->parent, x11::GetAtom(kNetWMPid)) ||
|
||||
if (!PropertyExists(connection, query_tree->parent,
|
||||
x11::GetAtom(kNetWMPid)) ||
|
||||
query_tree->parent == query_tree->root) {
|
||||
break;
|
||||
}
|
||||
@@ -125,7 +129,7 @@ CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostBase> browser,
|
||||
x11::VisualId visual;
|
||||
uint8_t depth;
|
||||
x11::ColorMap colormap;
|
||||
ui::XVisualManager::GetInstance()->ChooseVisualForWindow(
|
||||
connection_->GetOrCreateVisualManager().ChooseVisualForWindow(
|
||||
/*want_argb_visual=*/false, &visual, &depth, &colormap,
|
||||
/*visual_has_alpha=*/nullptr);
|
||||
|
||||
@@ -150,8 +154,7 @@ CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostBase> browser,
|
||||
auto event_mask = x11::EventMask::FocusChange |
|
||||
x11::EventMask::StructureNotify |
|
||||
x11::EventMask::PropertyChange;
|
||||
xwindow_events_ =
|
||||
std::make_unique<x11::XScopedEventSelector>(xwindow_, event_mask);
|
||||
xwindow_events_ = connection_->ScopedSelectEvent(xwindow_, event_mask);
|
||||
|
||||
connection_->Flush();
|
||||
|
||||
@@ -163,13 +166,13 @@ CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostBase> browser,
|
||||
x11::GetAtom(kWMDeleteWindow),
|
||||
x11::GetAtom(kNetWMPing),
|
||||
};
|
||||
x11::SetArrayProperty(xwindow_, x11::GetAtom(kWMProtocols), x11::Atom::ATOM,
|
||||
protocols);
|
||||
connection_->SetArrayProperty(xwindow_, x11::GetAtom(kWMProtocols),
|
||||
x11::Atom::ATOM, protocols);
|
||||
|
||||
// We need a WM_CLIENT_MACHINE value so we integrate with the desktop
|
||||
// environment.
|
||||
x11::SetStringProperty(xwindow_, x11::Atom::WM_CLIENT_MACHINE,
|
||||
x11::Atom::STRING, net::GetHostName());
|
||||
connection_->SetStringProperty(xwindow_, x11::Atom::WM_CLIENT_MACHINE,
|
||||
x11::Atom::STRING, net::GetHostName());
|
||||
|
||||
// Likewise, the X server needs to know this window's pid so it knows which
|
||||
// program to kill if the window hangs.
|
||||
@@ -177,14 +180,15 @@ CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostBase> browser,
|
||||
static_assert(sizeof(uint32_t) >= sizeof(pid_t),
|
||||
"pid_t should not be larger than uint32_t");
|
||||
uint32_t pid = getpid();
|
||||
x11::SetProperty(xwindow_, x11::GetAtom(kNetWMPid), x11::Atom::CARDINAL, pid);
|
||||
connection_->SetProperty(xwindow_, x11::GetAtom(kNetWMPid),
|
||||
x11::Atom::CARDINAL, pid);
|
||||
|
||||
// Set the initial window name, if provided.
|
||||
if (!title.empty()) {
|
||||
x11::SetStringProperty(xwindow_, x11::Atom::WM_NAME, x11::Atom::STRING,
|
||||
title);
|
||||
x11::SetStringProperty(xwindow_, x11::Atom::WM_ICON_NAME, x11::Atom::STRING,
|
||||
title);
|
||||
connection_->SetStringProperty(xwindow_, x11::Atom::WM_NAME,
|
||||
x11::Atom::STRING, title);
|
||||
connection_->SetStringProperty(xwindow_, x11::Atom::WM_ICON_NAME,
|
||||
x11::Atom::STRING, title);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,13 +224,13 @@ void CefWindowX11::Show() {
|
||||
if (!window_mapped_) {
|
||||
// Before we map the window, set size hints. Otherwise, some window managers
|
||||
// will ignore toplevel XMoveWindow commands.
|
||||
ui::SizeHints size_hints;
|
||||
x11::SizeHints size_hints;
|
||||
memset(&size_hints, 0, sizeof(size_hints));
|
||||
ui::GetWmNormalHints(xwindow_, &size_hints);
|
||||
size_hints.flags |= ui::SIZE_HINT_P_POSITION;
|
||||
connection_->GetWmNormalHints(xwindow_, &size_hints);
|
||||
size_hints.flags |= x11::SIZE_HINT_P_POSITION;
|
||||
size_hints.x = bounds_.x();
|
||||
size_hints.y = bounds_.y();
|
||||
ui::SetWmNormalHints(xwindow_, size_hints);
|
||||
connection_->SetWmNormalHints(xwindow_, size_hints);
|
||||
|
||||
connection_->MapWindow({xwindow_});
|
||||
|
||||
@@ -236,8 +240,8 @@ void CefWindowX11::Show() {
|
||||
|
||||
// Setup the drag and drop proxy on the top level window of the application
|
||||
// to be the child of this window.
|
||||
auto child = FindChild(xwindow_);
|
||||
auto toplevel_window = FindToplevelParent(xwindow_);
|
||||
auto child = FindChild(connection_, xwindow_);
|
||||
auto toplevel_window = FindToplevelParent(connection_, xwindow_);
|
||||
DCHECK_NE(toplevel_window, x11::Window::None);
|
||||
if (child != x11::Window::None && toplevel_window != x11::Window::None) {
|
||||
// Configure the drag&drop proxy property for the top-most window so
|
||||
@@ -246,14 +250,15 @@ void CefWindowX11::Show() {
|
||||
// DesktopDragDropClientAuraX11::FindWindowFor.
|
||||
x11::Window window = x11::Window::None;
|
||||
auto dndproxy_atom = x11::GetAtom(kXdndProxy);
|
||||
x11::GetProperty(toplevel_window, dndproxy_atom, &window);
|
||||
connection_->GetPropertyAs(toplevel_window, dndproxy_atom, &window);
|
||||
|
||||
if (window != child) {
|
||||
// Set the proxy target for the top-most window.
|
||||
x11::SetProperty(toplevel_window, dndproxy_atom, x11::Atom::WINDOW,
|
||||
child);
|
||||
connection_->SetProperty(toplevel_window, dndproxy_atom,
|
||||
x11::Atom::WINDOW, child);
|
||||
// Do the same for the proxy target per the spec.
|
||||
x11::SetProperty(child, dndproxy_atom, x11::Atom::WINDOW, child);
|
||||
connection_->SetProperty(child, dndproxy_atom, x11::Atom::WINDOW,
|
||||
child);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -265,7 +270,7 @@ void CefWindowX11::Hide() {
|
||||
}
|
||||
|
||||
if (window_mapped_) {
|
||||
ui::WithdrawWindow(xwindow_);
|
||||
connection_->WithdrawWindow(xwindow_);
|
||||
window_mapped_ = false;
|
||||
}
|
||||
}
|
||||
@@ -278,8 +283,8 @@ void CefWindowX11::Focus() {
|
||||
x11::Window focus_target = xwindow_;
|
||||
|
||||
if (browser_.get()) {
|
||||
auto child = FindChild(xwindow_);
|
||||
if (child != x11::Window::None && IsWindowVisible(child)) {
|
||||
auto child = FindChild(connection_, xwindow_);
|
||||
if (child != x11::Window::None && IsWindowVisible(connection_, child)) {
|
||||
// Give focus to the child DesktopWindowTreeHostLinux.
|
||||
focus_target = child;
|
||||
}
|
||||
@@ -331,7 +336,7 @@ gfx::Rect CefWindowX11::GetBoundsInScreen() {
|
||||
|
||||
views::DesktopWindowTreeHostLinux* CefWindowX11::GetHost() {
|
||||
if (browser_.get()) {
|
||||
auto child = FindChild(xwindow_);
|
||||
auto child = FindChild(connection_, xwindow_);
|
||||
if (child != x11::Window::None) {
|
||||
return static_cast<views::DesktopWindowTreeHostLinux*>(
|
||||
views::DesktopWindowTreeHostLinux::GetHostForWidget(
|
||||
@@ -373,14 +378,14 @@ void CefWindowX11::ContinueFocus() {
|
||||
}
|
||||
|
||||
bool CefWindowX11::TopLevelAlwaysOnTop() const {
|
||||
auto toplevel_window = FindToplevelParent(xwindow_);
|
||||
auto toplevel_window = FindToplevelParent(connection_, xwindow_);
|
||||
if (toplevel_window == x11::Window::None) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<x11::Atom> wm_states;
|
||||
if (x11::GetArrayProperty(toplevel_window, x11::GetAtom(kNetWMState),
|
||||
&wm_states)) {
|
||||
if (connection_->GetArrayProperty(toplevel_window, x11::GetAtom(kNetWMState),
|
||||
&wm_states)) {
|
||||
x11::Atom keep_above_atom = x11::GetAtom(kNetWMStateKeepAbove);
|
||||
if (base::Contains(wm_states, keep_above_atom)) {
|
||||
return true;
|
||||
@@ -399,7 +404,7 @@ void CefWindowX11::ProcessXEvent(const x11::Event& event) {
|
||||
configure->height);
|
||||
|
||||
if (browser_.get()) {
|
||||
auto child = FindChild(xwindow_);
|
||||
auto child = FindChild(connection_, xwindow_);
|
||||
if (child != x11::Window::None) {
|
||||
// Resize the child DesktopWindowTreeHostLinux to match this window.
|
||||
x11::ConfigureWindowRequest req{
|
||||
@@ -434,9 +439,9 @@ void CefWindowX11::ProcessXEvent(const x11::Event& event) {
|
||||
} else if (protocol == x11::GetAtom(kNetWMPing)) {
|
||||
x11::ClientMessageEvent reply_event = *client;
|
||||
reply_event.window = parent_xwindow_;
|
||||
x11::SendEvent(reply_event, reply_event.window,
|
||||
x11::EventMask::SubstructureNotify |
|
||||
x11::EventMask::SubstructureRedirect);
|
||||
connection_->SendEvent(reply_event, reply_event.window,
|
||||
x11::EventMask::SubstructureNotify |
|
||||
x11::EventMask::SubstructureRedirect);
|
||||
}
|
||||
}
|
||||
} else if (auto* focus = event.As<x11::FocusEvent>()) {
|
||||
@@ -466,15 +471,15 @@ void CefWindowX11::ProcessXEvent(const x11::Event& event) {
|
||||
if (property->atom == wm_state_atom) {
|
||||
// State change event like minimize/maximize.
|
||||
if (browser_.get()) {
|
||||
auto child = FindChild(xwindow_);
|
||||
auto child = FindChild(connection_, xwindow_);
|
||||
if (child != x11::Window::None) {
|
||||
// Forward the state change to the child DesktopWindowTreeHostLinux
|
||||
// window so that resource usage will be reduced while the window is
|
||||
// minimized. |atom_list| may be empty.
|
||||
std::vector<x11::Atom> atom_list;
|
||||
x11::GetArrayProperty(xwindow_, wm_state_atom, &atom_list);
|
||||
x11::SetArrayProperty(child, wm_state_atom, x11::Atom::ATOM,
|
||||
atom_list);
|
||||
connection_->GetArrayProperty(xwindow_, wm_state_atom, &atom_list);
|
||||
connection_->SetArrayProperty(child, wm_state_atom, x11::Atom::ATOM,
|
||||
atom_list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -7,19 +7,13 @@
|
||||
#define CEF_LIBCEF_BROWSER_NATIVE_WINDOW_X11_H_
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "include/internal/cef_ptr.h"
|
||||
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "ui/events/platform/platform_event_dispatcher.h"
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
#include "ui/gfx/x/atom_cache.h"
|
||||
#include "ui/gfx/x/connection.h"
|
||||
#include "ui/gfx/x/x11_atom_cache.h"
|
||||
|
||||
namespace x11 {
|
||||
class XScopedEventSelector;
|
||||
}
|
||||
|
||||
namespace views {
|
||||
class DesktopWindowTreeHostLinux;
|
||||
@@ -82,7 +76,7 @@ class CefWindowX11 : public ui::PlatformEventDispatcher,
|
||||
x11::Window xwindow_;
|
||||
|
||||
// Events selected on |xwindow_|.
|
||||
std::unique_ptr<x11::XScopedEventSelector> xwindow_events_;
|
||||
x11::ScopedEventSelector xwindow_events_;
|
||||
|
||||
// Is the window mapped to the screen?
|
||||
bool window_mapped_ = false;
|
||||
|
@@ -300,11 +300,10 @@ bool CefCookieManagerImpl::SetCookieInternal(
|
||||
|
||||
auto canonical_cookie = net::CanonicalCookie::CreateSanitizedCookie(
|
||||
url, name, value, domain, path,
|
||||
base::Time(), // Creation time.
|
||||
expiration_time,
|
||||
base::Time(), // Last access time.
|
||||
cookie.secure ? true : false, cookie.httponly ? true : false, same_site,
|
||||
priority, /*same_party=*/false, /*partition_key=*/absl::nullopt);
|
||||
/*creation_time=*/base::Time(), expiration_time,
|
||||
/*last_access_time=*/base::Time(), cookie.secure ? true : false,
|
||||
cookie.httponly ? true : false, same_site, priority,
|
||||
/*partition_key=*/absl::nullopt);
|
||||
|
||||
if (!canonical_cookie) {
|
||||
SetCookieCallbackImpl(
|
||||
|
@@ -895,6 +895,13 @@ const viz::LocalSurfaceId& CefRenderWidgetHostViewOSR::GetLocalSurfaceId()
|
||||
->GetOrCreateLocalSurfaceId();
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::UpdateFrameSinkIdRegistration() {
|
||||
RenderWidgetHostViewBase::UpdateFrameSinkIdRegistration();
|
||||
if (delegated_frame_host_) {
|
||||
delegated_frame_host_->SetIsFrameSinkIdOwner(is_frame_sink_id_owner());
|
||||
}
|
||||
}
|
||||
|
||||
const viz::FrameSinkId& CefRenderWidgetHostViewOSR::GetFrameSinkId() const {
|
||||
return delegated_frame_host_
|
||||
? delegated_frame_host_->frame_sink_id()
|
||||
|
@@ -196,6 +196,7 @@ class CefRenderWidgetHostViewOSR
|
||||
size_t offset,
|
||||
const gfx::Range& range) override;
|
||||
const viz::LocalSurfaceId& GetLocalSurfaceId() const override;
|
||||
void UpdateFrameSinkIdRegistration() override;
|
||||
const viz::FrameSinkId& GetFrameSinkId() const override;
|
||||
viz::FrameSinkId GetRootFrameSinkId() override;
|
||||
void NotifyHostAndDelegateOnWasShown(
|
||||
|
@@ -20,7 +20,6 @@
|
||||
#include "base/values.h"
|
||||
#include "chrome/browser/accessibility/accessibility_ui.h"
|
||||
#include "chrome/browser/download/download_prefs.h"
|
||||
#include "chrome/browser/first_party_sets/first_party_sets_pref_names.h"
|
||||
#include "chrome/browser/media/router/discovery/access_code/access_code_cast_feature.h"
|
||||
#include "chrome/browser/media/router/media_router_feature.h"
|
||||
#include "chrome/browser/media/webrtc/permission_bubble_media_access_handler.h"
|
||||
@@ -62,6 +61,7 @@
|
||||
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
|
||||
#include "components/safe_search_api/safe_search_util.h"
|
||||
#include "components/spellcheck/browser/pref_names.h"
|
||||
#include "components/supervised_user/core/common/buildflags.h"
|
||||
#include "components/sync_preferences/pref_service_syncable.h"
|
||||
#include "components/sync_preferences/pref_service_syncable_factory.h"
|
||||
#include "components/unified_consent/unified_consent_service.h"
|
||||
@@ -245,7 +245,6 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
|
||||
// Based on chrome/browser/ui/browser_ui_prefs.cc RegisterBrowserUserPrefs.
|
||||
registry->RegisterBooleanPref(prefs::kPrintPreviewUseSystemDefaultPrinter,
|
||||
false);
|
||||
registry->RegisterBooleanPref(prefs::kWebRTCAllowLegacyTLSProtocols, false);
|
||||
|
||||
// Profile preferences.
|
||||
// Based on chrome/browser/profiles/profiles_state.cc RegisterPrefs.
|
||||
@@ -346,11 +345,6 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
|
||||
}
|
||||
registry->RegisterListPref(prefs::kWebRtcLocalIpsAllowedUrls);
|
||||
|
||||
// First party sets preferences.
|
||||
// Based on FirstPartySetsPolicyServiceFactory::RegisterProfilePrefs.
|
||||
registry->RegisterDictionaryPref(
|
||||
first_party_sets::kRelatedWebsiteSetsOverrides);
|
||||
|
||||
// Always do this after all other profile prefs.
|
||||
RegisterProfilePrefs(registry.get());
|
||||
} else {
|
||||
|
@@ -118,7 +118,7 @@ void PrintToPDF(content::WebContents* web_contents,
|
||||
margin_top, margin_bottom, margin_left, margin_right,
|
||||
CefString(&settings.header_template),
|
||||
CefString(&settings.footer_template), !!settings.prefer_css_page_size,
|
||||
!!settings.generate_tagged_pdf);
|
||||
!!settings.generate_tagged_pdf, !!settings.generate_document_outline);
|
||||
|
||||
if (absl::holds_alternative<std::string>(print_pages_params)) {
|
||||
LOG(ERROR) << "PrintToPDF failed with error: "
|
||||
|
@@ -76,8 +76,8 @@ void CefSSLHostStateDelegate::SetHttpsEnforcementForHost(
|
||||
// Intentional no-op.
|
||||
}
|
||||
|
||||
bool CefSSLHostStateDelegate::IsHttpsEnforcedForHost(
|
||||
const std::string& host,
|
||||
bool CefSSLHostStateDelegate::IsHttpsEnforcedForUrl(
|
||||
const GURL& url,
|
||||
content::StoragePartition* storage_partition) {
|
||||
// Intentional no-op. Return value does not matter as HTTPS-First Mode is not
|
||||
// enabled.
|
||||
|
@@ -77,8 +77,8 @@ class CefSSLHostStateDelegate : public content::SSLHostStateDelegate {
|
||||
const std::string& host,
|
||||
bool enforce,
|
||||
content::StoragePartition* storage_partition) override;
|
||||
bool IsHttpsEnforcedForHost(
|
||||
const std::string& host,
|
||||
bool IsHttpsEnforcedForUrl(
|
||||
const GURL& url,
|
||||
content::StoragePartition* storage_partition) override;
|
||||
void RevokeUserAllowExceptions(const std::string& host) override;
|
||||
bool HasAllowException(const std::string& host,
|
||||
|
@@ -141,7 +141,7 @@ bool CefBrowserViewImpl::HandleKeyboardEvent(
|
||||
}
|
||||
|
||||
// Give the CefWindowDelegate a chance to handle the event.
|
||||
if (auto* window_impl = cef_window()) {
|
||||
if (auto* window_impl = cef_window_impl()) {
|
||||
CefKeyEvent cef_event;
|
||||
if (browser_util::GetCefKeyEvent(event, cef_event) &&
|
||||
window_impl->OnKeyEvent(cef_event)) {
|
||||
@@ -316,7 +316,11 @@ ChromeBrowserView* CefBrowserViewImpl::chrome_browser_view() const {
|
||||
return static_cast<ChromeBrowserView*>(root_view());
|
||||
}
|
||||
|
||||
CefWindowImpl* CefBrowserViewImpl::cef_window() const {
|
||||
CefWindowImpl* CefBrowserViewImpl::cef_window_impl() const {
|
||||
// Same implementation as GetWindow().
|
||||
if (!root_view()) {
|
||||
return nullptr;
|
||||
}
|
||||
CefRefPtr<CefWindow> window =
|
||||
view_util::GetWindowFor(root_view()->GetWidget());
|
||||
return static_cast<CefWindowImpl*>(window.get());
|
||||
|
@@ -85,7 +85,7 @@ class CefBrowserViewImpl
|
||||
ChromeBrowserView* chrome_browser_view() const;
|
||||
|
||||
// Return the CefWindowImpl hosting this object.
|
||||
CefWindowImpl* cef_window() const;
|
||||
CefWindowImpl* cef_window_impl() const;
|
||||
|
||||
private:
|
||||
// Create a new implementation object.
|
||||
|
@@ -80,8 +80,9 @@ CEF_LABEL_BUTTON_IMPL_T void CEF_LABEL_BUTTON_IMPL_D::SetImage(
|
||||
if (image) {
|
||||
image_skia = static_cast<CefImageImpl*>(image.get())->AsImageSkia();
|
||||
}
|
||||
ParentClass::root_view()->SetImage(
|
||||
static_cast<views::Button::ButtonState>(button_state), image_skia);
|
||||
ParentClass::root_view()->SetImageModel(
|
||||
static_cast<views::Button::ButtonState>(button_state),
|
||||
ui::ImageModel::FromImageSkia(image_skia));
|
||||
}
|
||||
|
||||
CEF_LABEL_BUTTON_IMPL_T CefRefPtr<CefImage> CEF_LABEL_BUTTON_IMPL_D::GetImage(
|
||||
|
@@ -167,7 +167,9 @@ CefOverlayViewHost::CefOverlayViewHost(CefWindowView* window_view,
|
||||
cef_docking_mode_t docking_mode)
|
||||
: window_view_(window_view), docking_mode_(docking_mode) {}
|
||||
|
||||
void CefOverlayViewHost::Init(views::View* host_view, CefRefPtr<CefView> view) {
|
||||
void CefOverlayViewHost::Init(views::View* host_view,
|
||||
CefRefPtr<CefView> view,
|
||||
bool can_activate) {
|
||||
DCHECK(view);
|
||||
|
||||
// Match the logic in CEF_PANEL_IMPL_D::AddChildView().
|
||||
@@ -186,7 +188,9 @@ void CefOverlayViewHost::Init(views::View* host_view, CefRefPtr<CefView> view) {
|
||||
params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
|
||||
params.parent = window_view_->GetWidget()->GetNativeView();
|
||||
params.opacity = views::Widget::InitParams::WindowOpacity::kTranslucent;
|
||||
params.activatable = views::Widget::InitParams::Activatable::kNo;
|
||||
params.activatable = can_activate
|
||||
? views::Widget::InitParams::Activatable::kYes
|
||||
: views::Widget::InitParams::Activatable::kNo;
|
||||
widget_->Init(std::move(params));
|
||||
|
||||
view_ = widget_->GetContentsView()->AddChildView(std::move(controls_view));
|
||||
@@ -274,6 +278,7 @@ void CefOverlayViewHost::SetOverlayBounds(const gfx::Rect& bounds) {
|
||||
view_->SetSize(bounds_.size());
|
||||
}
|
||||
widget_->SetBounds(bounds_);
|
||||
window_view_->OnOverlayBoundsChanged();
|
||||
|
||||
bounds_changing_ = false;
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ class CefOverlayViewHost : public views::WidgetDelegate,
|
||||
// paints into. On Aura platforms, |host_view| is the view whose position in
|
||||
// the |window_view_| view hierarchy determines the z-order of the widget
|
||||
// relative to views with layers and views with associated NativeViews.
|
||||
void Init(views::View* host_view, CefRefPtr<CefView> view);
|
||||
void Init(views::View* host_view, CefRefPtr<CefView> view, bool can_activate);
|
||||
|
||||
void Destroy();
|
||||
|
||||
|
@@ -137,7 +137,7 @@ void CefWindowImpl::ShowAsBrowserModalDialog(
|
||||
static_cast<CefBrowserViewImpl*>(browser_view.get());
|
||||
|
||||
// |browser_view| must belong to the host widget.
|
||||
auto* host_widget = static_cast<CefWindowView*>(root_view())->host_widget();
|
||||
auto* host_widget = cef_window_view()->host_widget();
|
||||
CHECK(host_widget &&
|
||||
browser_view_impl->root_view()->GetWidget() == host_widget);
|
||||
|
||||
@@ -349,10 +349,11 @@ CefRefPtr<CefImage> CefWindowImpl::GetWindowAppIcon() {
|
||||
|
||||
CefRefPtr<CefOverlayController> CefWindowImpl::AddOverlayView(
|
||||
CefRefPtr<CefView> view,
|
||||
cef_docking_mode_t docking_mode) {
|
||||
cef_docking_mode_t docking_mode,
|
||||
bool can_activate) {
|
||||
CEF_REQUIRE_VALID_RETURN(nullptr);
|
||||
if (root_view()) {
|
||||
return root_view()->AddOverlayView(view, docking_mode);
|
||||
return root_view()->AddOverlayView(view, docking_mode, can_activate);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@@ -738,6 +739,10 @@ void CefWindowImpl::RemoveAllAccelerators() {
|
||||
focus_manager->UnregisterAccelerators(this);
|
||||
}
|
||||
|
||||
CefWindowView* CefWindowImpl::cef_window_view() const {
|
||||
return static_cast<CefWindowView*>(root_view());
|
||||
}
|
||||
|
||||
CefWindowImpl::CefWindowImpl(CefRefPtr<CefWindowDelegate> delegate)
|
||||
: ParentClass(delegate) {}
|
||||
|
||||
@@ -746,7 +751,7 @@ CefWindowView* CefWindowImpl::CreateRootView() {
|
||||
}
|
||||
|
||||
void CefWindowImpl::InitializeRootView() {
|
||||
static_cast<CefWindowView*>(root_view())->Initialize();
|
||||
cef_window_view()->Initialize();
|
||||
}
|
||||
|
||||
void CefWindowImpl::CreateWidget(gfx::AcceleratedWidget parent_widget) {
|
||||
|
@@ -67,7 +67,8 @@ class CefWindowImpl
|
||||
CefRefPtr<CefImage> GetWindowAppIcon() override;
|
||||
CefRefPtr<CefOverlayController> AddOverlayView(
|
||||
CefRefPtr<CefView> view,
|
||||
cef_docking_mode_t docking_mode) override;
|
||||
cef_docking_mode_t docking_mode,
|
||||
bool can_activate) override;
|
||||
void ShowMenu(CefRefPtr<CefMenuModel> menu_model,
|
||||
const CefPoint& screen_point,
|
||||
cef_menu_anchor_position_t anchor_position) override;
|
||||
@@ -132,6 +133,8 @@ class CefWindowImpl
|
||||
cef_menu_anchor_position_t anchor_position);
|
||||
void MenuClosed();
|
||||
|
||||
CefWindowView* cef_window_view() const;
|
||||
|
||||
views::Widget* widget() const { return widget_; }
|
||||
bool initialized() const { return initialized_; }
|
||||
|
||||
|
@@ -25,8 +25,7 @@
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
#if BUILDFLAG(OZONE_PLATFORM_X11)
|
||||
#include "ui/gfx/x/x11_atom_cache.h"
|
||||
#include "ui/gfx/x/xproto_util.h"
|
||||
#include "ui/gfx/x/atom_cache.h"
|
||||
#include "ui/linux/linux_ui_delegate.h"
|
||||
#endif
|
||||
#endif
|
||||
@@ -93,7 +92,7 @@ class NativeFrameViewEx : public views::NativeFrameView {
|
||||
}
|
||||
|
||||
if (!view_->IsFrameless()) {
|
||||
if (auto titlebar_height = view_->GetTitlebarHeight()) {
|
||||
if (auto titlebar_height = view_->GetTitlebarHeight(/*required=*/true)) {
|
||||
window_bounds.Inset(gfx::Insets::TLBR(-(*titlebar_height), 0, 0, 0));
|
||||
}
|
||||
}
|
||||
@@ -449,6 +448,13 @@ void CefWindowView::CreateWidget(gfx::AcceleratedWidget parent_widget) {
|
||||
case CEF_SHOW_STATE_FULLSCREEN:
|
||||
params.show_state = ui::SHOW_STATE_FULLSCREEN;
|
||||
break;
|
||||
case CEF_SHOW_STATE_HIDDEN:
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
params.show_state = ui::SHOW_STATE_HIDDEN;
|
||||
#else
|
||||
params.show_state = ui::SHOW_STATE_MINIMIZED;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
bool is_menu = false;
|
||||
@@ -547,12 +553,14 @@ void CefWindowView::CreateWidget(gfx::AcceleratedWidget parent_widget) {
|
||||
view_util::GetWindowHandle(host_widget));
|
||||
CHECK(parent);
|
||||
|
||||
auto connection = x11::Connection::Get();
|
||||
|
||||
if (cef_delegate() && cef_delegate()->IsWindowModalDialog(GetCefWindow())) {
|
||||
// The presence of _NET_WM_STATE_MODAL in _NET_SUPPORTED indicates
|
||||
// possible window manager support. However, some window managers still
|
||||
// don't support this properly.
|
||||
x11::Atom modal_atom = x11::GetAtom("_NET_WM_STATE_MODAL");
|
||||
if (ui::WmSupportsHint(modal_atom)) {
|
||||
if (connection->WmSupportsHint(modal_atom)) {
|
||||
ui::SetWMSpecState(x11window, true, modal_atom, x11::Atom::None);
|
||||
} else {
|
||||
LOG(ERROR)
|
||||
@@ -561,11 +569,11 @@ void CefWindowView::CreateWidget(gfx::AcceleratedWidget parent_widget) {
|
||||
}
|
||||
|
||||
// From GtkUiPlatformX11::SetGtkWidgetTransientFor:
|
||||
x11::SetProperty(x11window, x11::Atom::WM_TRANSIENT_FOR, x11::Atom::WINDOW,
|
||||
parent);
|
||||
x11::SetProperty(x11window, x11::GetAtom("_NET_WM_WINDOW_TYPE"),
|
||||
x11::Atom::ATOM,
|
||||
x11::GetAtom("_NET_WM_WINDOW_TYPE_DIALOG"));
|
||||
connection->SetProperty(x11window, x11::Atom::WM_TRANSIENT_FOR,
|
||||
x11::Atom::WINDOW, parent);
|
||||
connection->SetProperty(x11window, x11::GetAtom("_NET_WM_WINDOW_TYPE"),
|
||||
x11::Atom::ATOM,
|
||||
x11::GetAtom("_NET_WM_WINDOW_TYPE_DIALOG"));
|
||||
|
||||
ui::LinuxUiDelegate::GetInstance()->SetTransientWindowForParent(
|
||||
parent, static_cast<gfx::AcceleratedWidget>(x11window));
|
||||
@@ -794,7 +802,8 @@ void CefWindowView::SetWindowAppIcon(CefRefPtr<CefImage> window_app_icon) {
|
||||
|
||||
CefRefPtr<CefOverlayController> CefWindowView::AddOverlayView(
|
||||
CefRefPtr<CefView> view,
|
||||
cef_docking_mode_t docking_mode) {
|
||||
cef_docking_mode_t docking_mode,
|
||||
bool can_activate) {
|
||||
DCHECK(view.get());
|
||||
DCHECK(view->IsValid());
|
||||
if (!view.get() || !view->IsValid()) {
|
||||
@@ -810,7 +819,7 @@ CefRefPtr<CefOverlayController> CefWindowView::AddOverlayView(
|
||||
std::make_unique<CefOverlayViewHost>(this, docking_mode));
|
||||
|
||||
auto& overlay_host = overlay_hosts_.back();
|
||||
overlay_host->Init(overlay_host_view, view);
|
||||
overlay_host->Init(overlay_host_view, view, can_activate);
|
||||
|
||||
return overlay_host->controller();
|
||||
}
|
||||
@@ -827,12 +836,23 @@ void CefWindowView::MoveOverlaysIfNecessary() {
|
||||
}
|
||||
}
|
||||
|
||||
void CefWindowView::InvalidateExclusionRegions() {
|
||||
if (last_dialog_top_inset_ != -1) {
|
||||
last_dialog_top_y_ = last_dialog_top_inset_ = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void CefWindowView::SetDraggableRegions(
|
||||
const std::vector<CefDraggableRegion>& regions) {
|
||||
if (regions.empty() && !draggable_region_) {
|
||||
// Still empty.
|
||||
return;
|
||||
}
|
||||
|
||||
InvalidateExclusionRegions();
|
||||
|
||||
if (regions.empty()) {
|
||||
if (draggable_region_) {
|
||||
draggable_region_.reset(nullptr);
|
||||
}
|
||||
draggable_region_.reset();
|
||||
draggable_rects_.clear();
|
||||
return;
|
||||
}
|
||||
@@ -852,6 +872,10 @@ void CefWindowView::SetDraggableRegions(
|
||||
}
|
||||
}
|
||||
|
||||
void CefWindowView::OnOverlayBoundsChanged() {
|
||||
InvalidateExclusionRegions();
|
||||
}
|
||||
|
||||
views::NonClientFrameView* CefWindowView::GetNonClientFrameView() const {
|
||||
const views::Widget* widget = GetWidget();
|
||||
if (!widget) {
|
||||
@@ -863,7 +887,8 @@ views::NonClientFrameView* CefWindowView::GetNonClientFrameView() const {
|
||||
return widget->non_client_view()->frame_view();
|
||||
}
|
||||
|
||||
void CefWindowView::UpdateFindBarBoundingBox(gfx::Rect* bounds) const {
|
||||
void CefWindowView::UpdateBoundingBox(gfx::Rect* bounds,
|
||||
bool add_titlebar_height) const {
|
||||
// Max distance from the edges of |bounds| to qualify for subtraction.
|
||||
const int kMaxDistance = 10;
|
||||
|
||||
@@ -876,16 +901,8 @@ void CefWindowView::UpdateFindBarBoundingBox(gfx::Rect* bounds) const {
|
||||
*bounds = SubtractOverlayFromBoundingBox(*bounds, rect, kMaxDistance);
|
||||
}
|
||||
|
||||
if (auto titlebar_height = GetTitlebarHeight()) {
|
||||
if (auto titlebar_height = GetTitlebarHeight(add_titlebar_height)) {
|
||||
gfx::Insets inset;
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
// For framed windows on macOS we must add the titlebar height.
|
||||
const bool add_titlebar_height = !is_frameless_;
|
||||
#else
|
||||
const bool add_titlebar_height = false;
|
||||
#endif
|
||||
|
||||
if (add_titlebar_height) {
|
||||
inset.set_top(*titlebar_height);
|
||||
} else if (bounds->y() < *titlebar_height) {
|
||||
@@ -898,6 +915,46 @@ void CefWindowView::UpdateFindBarBoundingBox(gfx::Rect* bounds) const {
|
||||
}
|
||||
}
|
||||
|
||||
void CefWindowView::UpdateFindBarBoundingBox(gfx::Rect* bounds) const {
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
// For framed windows on macOS we must add the titlebar height.
|
||||
const bool add_titlebar_height = !is_frameless_;
|
||||
#else
|
||||
const bool add_titlebar_height = false;
|
||||
#endif
|
||||
|
||||
UpdateBoundingBox(bounds, add_titlebar_height);
|
||||
}
|
||||
|
||||
void CefWindowView::UpdateDialogTopInset(int* dialog_top_y) const {
|
||||
if (*dialog_top_y == last_dialog_top_y_ && last_dialog_top_inset_ != -1) {
|
||||
// Return the cached value.
|
||||
*dialog_top_y = last_dialog_top_inset_;
|
||||
return;
|
||||
}
|
||||
|
||||
const views::Widget* widget = GetWidget();
|
||||
if (!widget) {
|
||||
return;
|
||||
}
|
||||
|
||||
gfx::Rect bounds(widget->GetSize());
|
||||
if (*dialog_top_y > 0) {
|
||||
// Start with the value computed in
|
||||
// BrowserViewLayout::LayoutBookmarkAndInfoBars.
|
||||
gfx::Insets inset;
|
||||
inset.set_top(*dialog_top_y);
|
||||
bounds.Inset(inset);
|
||||
}
|
||||
|
||||
UpdateBoundingBox(&bounds, /*add_titlebar_height=*/false);
|
||||
|
||||
last_dialog_top_y_ = *dialog_top_y;
|
||||
last_dialog_top_inset_ = bounds.y();
|
||||
|
||||
*dialog_top_y = bounds.y();
|
||||
}
|
||||
|
||||
views::Widget* CefWindowView::host_widget() const {
|
||||
if (host_widget_destruction_observer_) {
|
||||
return host_widget_destruction_observer_->widget();
|
||||
@@ -905,7 +962,7 @@ views::Widget* CefWindowView::host_widget() const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
absl::optional<float> CefWindowView::GetTitlebarHeight() const {
|
||||
std::optional<float> CefWindowView::GetTitlebarHeight(bool required) const {
|
||||
if (cef_delegate()) {
|
||||
float title_bar_height = 0;
|
||||
const bool has_title_bar_height =
|
||||
@@ -916,7 +973,7 @@ absl::optional<float> CefWindowView::GetTitlebarHeight() const {
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
if (!is_frameless_) {
|
||||
if (required) {
|
||||
// For framed windows on macOS we must include the titlebar height in the
|
||||
// UpdateFindBarBoundingBox() calculation.
|
||||
return view_util::GetNSWindowTitleBarHeight(
|
||||
@@ -924,5 +981,5 @@ absl::optional<float> CefWindowView::GetTitlebarHeight() const {
|
||||
}
|
||||
#endif
|
||||
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#define CEF_LIBCEF_BROWSER_VIEWS_WINDOW_VIEW_H_
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "include/views/cef_window.h"
|
||||
@@ -105,19 +106,26 @@ class CefWindowView
|
||||
|
||||
CefRefPtr<CefOverlayController> AddOverlayView(
|
||||
CefRefPtr<CefView> view,
|
||||
cef_docking_mode_t docking_mode);
|
||||
cef_docking_mode_t docking_mode,
|
||||
bool can_activate);
|
||||
|
||||
// Set/get the draggable regions.
|
||||
void SetDraggableRegions(const std::vector<CefDraggableRegion>& regions);
|
||||
SkRegion* draggable_region() const { return draggable_region_.get(); }
|
||||
|
||||
// Called from CefOverlayViewHost::SetOverlayBounds().
|
||||
void OnOverlayBoundsChanged();
|
||||
|
||||
// Returns the NonClientFrameView for this Window. May be nullptr.
|
||||
views::NonClientFrameView* GetNonClientFrameView() const;
|
||||
|
||||
// Optionally modify the bounding box for the Chrome Find bar.
|
||||
void UpdateFindBarBoundingBox(gfx::Rect* bounds) const;
|
||||
|
||||
absl::optional<float> GetTitlebarHeight() const;
|
||||
// Optionally modify the top inset for Chrome dialogs.
|
||||
void UpdateDialogTopInset(int* dialog_top_y) const;
|
||||
|
||||
std::optional<float> GetTitlebarHeight(bool required) const;
|
||||
bool IsFrameless() const { return is_frameless_; }
|
||||
|
||||
// The Widget that hosts us, if we're a modal dialog. May return nullptr
|
||||
@@ -129,6 +137,9 @@ class CefWindowView
|
||||
void DeleteDelegate();
|
||||
|
||||
void MoveOverlaysIfNecessary();
|
||||
void InvalidateExclusionRegions();
|
||||
|
||||
void UpdateBoundingBox(gfx::Rect* bounds, bool add_titlebar_height) const;
|
||||
|
||||
// Not owned by this object.
|
||||
Delegate* window_delegate_;
|
||||
@@ -143,6 +154,9 @@ class CefWindowView
|
||||
std::unique_ptr<SkRegion> draggable_region_;
|
||||
std::vector<gfx::Rect> draggable_rects_;
|
||||
|
||||
mutable int last_dialog_top_y_ = -1;
|
||||
mutable int last_dialog_top_inset_ = -1;
|
||||
|
||||
// Tracks the Widget that hosts us, if we're a modal dialog.
|
||||
std::unique_ptr<WidgetDestructionObserver> host_widget_destruction_observer_;
|
||||
|
||||
|
@@ -80,7 +80,8 @@ void XMLCALL xml_error_callback(void* arg,
|
||||
* Signature of the function to use when there is an error and
|
||||
* the module handles the new error reporting mechanism.
|
||||
*/
|
||||
void XMLCALL xml_structured_error_callback(void* userData, xmlErrorPtr error) {
|
||||
void XMLCALL xml_structured_error_callback(void* userData,
|
||||
const xmlError* error) {
|
||||
if (!error->message) {
|
||||
return;
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ const char* const kNonWildcardDomainNonPortSchemes[] = {
|
||||
const size_t kNonWildcardDomainNonPortSchemesSize =
|
||||
std::size(kNonWildcardDomainNonPortSchemes);
|
||||
|
||||
absl::optional<int> AcquireProcessSingleton(
|
||||
std::optional<int> AcquireProcessSingleton(
|
||||
const base::FilePath& user_data_dir) {
|
||||
// Take the Chrome process singleton lock. The process can become the
|
||||
// Browser process if it succeed to take the lock. Otherwise, the
|
||||
@@ -114,7 +114,7 @@ absl::optional<int> AcquireProcessSingleton(
|
||||
return chrome::RESULT_CODE_PROFILE_IN_USE;
|
||||
}
|
||||
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -130,17 +130,17 @@ AlloyMainDelegate::AlloyMainDelegate(CefMainRunnerHandler* runner,
|
||||
|
||||
AlloyMainDelegate::~AlloyMainDelegate() {}
|
||||
|
||||
absl::optional<int> AlloyMainDelegate::PreBrowserMain() {
|
||||
std::optional<int> AlloyMainDelegate::PreBrowserMain() {
|
||||
runner_->PreBrowserMain();
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
absl::optional<int> AlloyMainDelegate::PostEarlyInitialization(
|
||||
std::optional<int> AlloyMainDelegate::PostEarlyInitialization(
|
||||
InvokedIn invoked_in) {
|
||||
const auto* invoked_in_browser =
|
||||
absl::get_if<InvokedInBrowserProcess>(&invoked_in);
|
||||
if (!invoked_in_browser) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// Based on ChromeMainDelegate::PostEarlyInitialization.
|
||||
@@ -161,10 +161,10 @@ absl::optional<int> AlloyMainDelegate::PostEarlyInitialization(
|
||||
return process_singleton_result;
|
||||
}
|
||||
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
absl::optional<int> AlloyMainDelegate::BasicStartupComplete() {
|
||||
std::optional<int> AlloyMainDelegate::BasicStartupComplete() {
|
||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
std::string process_type =
|
||||
command_line->GetSwitchValueASCII(switches::kProcessType);
|
||||
@@ -510,7 +510,7 @@ absl::optional<int> AlloyMainDelegate::BasicStartupComplete() {
|
||||
util_mac::BasicStartupComplete();
|
||||
#endif
|
||||
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void AlloyMainDelegate::PreSandboxStartup() {
|
||||
|
@@ -46,9 +46,9 @@ class AlloyMainDelegate : public content::ContentMainDelegate,
|
||||
~AlloyMainDelegate() override;
|
||||
|
||||
// content::ContentMainDelegate overrides.
|
||||
absl::optional<int> PreBrowserMain() override;
|
||||
absl::optional<int> PostEarlyInitialization(InvokedIn invoked_in) override;
|
||||
absl::optional<int> BasicStartupComplete() override;
|
||||
std::optional<int> PreBrowserMain() override;
|
||||
std::optional<int> PostEarlyInitialization(InvokedIn invoked_in) override;
|
||||
std::optional<int> BasicStartupComplete() override;
|
||||
void PreSandboxStartup() override;
|
||||
absl::variant<int, content::MainFunctionParams> RunProcess(
|
||||
const std::string& process_type,
|
||||
|
@@ -56,7 +56,7 @@ ChromeMainDelegateCef::ChromeMainDelegateCef(CefMainRunnerHandler* runner,
|
||||
|
||||
ChromeMainDelegateCef::~ChromeMainDelegateCef() = default;
|
||||
|
||||
absl::optional<int> ChromeMainDelegateCef::BasicStartupComplete() {
|
||||
std::optional<int> ChromeMainDelegateCef::BasicStartupComplete() {
|
||||
// Returns no value if startup should proceed.
|
||||
auto result = ChromeMainDelegate::BasicStartupComplete();
|
||||
if (result.has_value()) {
|
||||
@@ -165,7 +165,7 @@ absl::optional<int> ChromeMainDelegateCef::BasicStartupComplete() {
|
||||
util_mac::BasicStartupComplete();
|
||||
#endif
|
||||
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void ChromeMainDelegateCef::PreSandboxStartup() {
|
||||
@@ -195,15 +195,15 @@ void ChromeMainDelegateCef::PreSandboxStartup() {
|
||||
crash_reporting::PreSandboxStartup(*command_line, process_type);
|
||||
}
|
||||
|
||||
absl::optional<int> ChromeMainDelegateCef::PreBrowserMain() {
|
||||
std::optional<int> ChromeMainDelegateCef::PreBrowserMain() {
|
||||
// The parent ChromeMainDelegate implementation creates the NSApplication
|
||||
// instance on macOS, and we intentionally don't want to do that here.
|
||||
// TODO(macos): Do we need l10n_util::OverrideLocaleWithCocoaLocale()?
|
||||
runner_->PreBrowserMain();
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
absl::optional<int> ChromeMainDelegateCef::PostEarlyInitialization(
|
||||
std::optional<int> ChromeMainDelegateCef::PostEarlyInitialization(
|
||||
InvokedIn invoked_in) {
|
||||
// Configure this before ChromeMainDelegate::PostEarlyInitialization triggers
|
||||
// ChromeBrowserPolicyConnector creation.
|
||||
|
@@ -36,10 +36,10 @@ class ChromeMainDelegateCef : public ChromeMainDelegate,
|
||||
~ChromeMainDelegateCef() override;
|
||||
|
||||
// ChromeMainDelegate overrides.
|
||||
absl::optional<int> BasicStartupComplete() override;
|
||||
std::optional<int> BasicStartupComplete() override;
|
||||
void PreSandboxStartup() override;
|
||||
absl::optional<int> PreBrowserMain() override;
|
||||
absl::optional<int> PostEarlyInitialization(InvokedIn invoked_in) override;
|
||||
std::optional<int> PreBrowserMain() override;
|
||||
std::optional<int> PostEarlyInitialization(InvokedIn invoked_in) override;
|
||||
absl::variant<int, content::MainFunctionParams> RunProcess(
|
||||
const std::string& process_type,
|
||||
content::MainFunctionParams main_function_params) override;
|
||||
|
@@ -58,6 +58,11 @@ void ChromeMainRunnerDelegate::BeforeMainThreadRun(
|
||||
|
||||
void ChromeMainRunnerDelegate::BeforeMainMessageLoopRun(
|
||||
base::RunLoop* run_loop) {
|
||||
// May be nullptr if content::ContentMainRun exits early.
|
||||
if (!g_browser_process) {
|
||||
return;
|
||||
}
|
||||
|
||||
// The ScopedKeepAlive instance triggers shutdown logic when released on the
|
||||
// UI thread before terminating the message loop (e.g. from CefQuitMessageLoop
|
||||
// or FinishShutdownOnUIThread when running with multi-threaded message loop).
|
||||
@@ -67,12 +72,17 @@ void ChromeMainRunnerDelegate::BeforeMainMessageLoopRun(
|
||||
// The QuitClosure will be executed from BrowserProcessImpl::Unpin() via
|
||||
// KeepAliveRegistry when the last ScopedKeepAlive is released.
|
||||
// ScopedKeepAlives are also held by Browser objects.
|
||||
DCHECK(g_browser_process);
|
||||
static_cast<BrowserProcessImpl*>(g_browser_process)
|
||||
->SetQuitClosure(run_loop->QuitClosure());
|
||||
}
|
||||
|
||||
bool ChromeMainRunnerDelegate::HandleMainMessageLoopQuit() {
|
||||
// May be nullptr if content::ContentMainRun exits early.
|
||||
if (!g_browser_process) {
|
||||
// Proceed with direct execution of the QuitClosure().
|
||||
return false;
|
||||
}
|
||||
|
||||
// May be called multiple times. See comments in RunMainMessageLoopBefore.
|
||||
keep_alive_.reset();
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "include/cef_version.h"
|
||||
|
||||
#include "base/strings/string_piece_forward.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "build/build_config.h"
|
||||
#include "components/crash/core/app/crash_reporter_client.h"
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "base/strings/string_piece_forward.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "build/build_config.h"
|
||||
|
||||
namespace base {
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "include/internal/cef_string_list.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/check_op.h"
|
||||
|
||||
namespace {
|
||||
using StringList = std::vector<CefString>;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "include/internal/cef_string_map.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/check_op.h"
|
||||
|
||||
namespace {
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "include/internal/cef_string_multimap.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/check_op.h"
|
||||
|
||||
namespace {
|
||||
|
||||
|
@@ -180,16 +180,10 @@ CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1,
|
||||
if (str1->length == 0 && str2->length == 0) {
|
||||
return 0;
|
||||
}
|
||||
#if defined(WCHAR_T_IS_UTF32)
|
||||
int r = std::char_traits<std::u16string::value_type>::compare(
|
||||
reinterpret_cast<std::u16string::value_type*>(str1->str),
|
||||
reinterpret_cast<std::u16string::value_type*>(str2->str),
|
||||
std::min(str1->length, str2->length));
|
||||
#else
|
||||
int r = wcsncmp(reinterpret_cast<wchar_t*>(str1->str),
|
||||
reinterpret_cast<wchar_t*>(str2->str),
|
||||
std::min(str1->length, str2->length));
|
||||
#endif
|
||||
if (r == 0) {
|
||||
if (str1->length > str2->length) {
|
||||
return 1;
|
||||
|
@@ -227,7 +227,8 @@ void AlloyContentRendererClient::RenderThreadStarted() {
|
||||
value.reset(base::SysUTF8ToCFStringRef("false"));
|
||||
}
|
||||
|
||||
CFPreferencesSetAppValue(key, value, kCFPreferencesCurrentApplication);
|
||||
CFPreferencesSetAppValue(key.get(), value.get(),
|
||||
kCFPreferencesCurrentApplication);
|
||||
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
|
||||
}
|
||||
#endif // BUILDFLAG(IS_MAC)
|
||||
@@ -282,7 +283,7 @@ void AlloyContentRendererClient::RenderFrameCreated(
|
||||
->AddInterface<extensions::mojom::MimeHandlerViewContainerManager>(
|
||||
base::BindRepeating(
|
||||
&extensions::MimeHandlerViewContainerManager::BindReceiver,
|
||||
render_frame->GetRoutingID()));
|
||||
base::Unretained(render_frame)));
|
||||
}
|
||||
|
||||
const base::CommandLine* command_line =
|
||||
@@ -335,7 +336,10 @@ bool AlloyContentRendererClient::IsPluginHandledExternally(
|
||||
// not supported. Here it suffices to return false but there should perhaps be
|
||||
// a more unified approach to avoid sending the IPC twice.
|
||||
chrome::mojom::PluginInfoPtr plugin_info = chrome::mojom::PluginInfo::New();
|
||||
ChromeContentRendererClient::GetPluginInfoHost()->GetPluginInfo(
|
||||
mojo::AssociatedRemote<chrome::mojom::PluginInfoHost> plugin_info_host;
|
||||
render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
|
||||
&plugin_info_host);
|
||||
plugin_info_host->GetPluginInfo(
|
||||
original_url, render_frame->GetWebFrame()->Top()->GetSecurityOrigin(),
|
||||
mime_type, &plugin_info);
|
||||
// TODO(ekaramad): Not continuing here due to a disallowed status should take
|
||||
@@ -379,7 +383,10 @@ bool AlloyContentRendererClient::OverrideCreatePlugin(
|
||||
|
||||
GURL url(params.url);
|
||||
chrome::mojom::PluginInfoPtr plugin_info = chrome::mojom::PluginInfo::New();
|
||||
ChromeContentRendererClient::GetPluginInfoHost()->GetPluginInfo(
|
||||
mojo::AssociatedRemote<chrome::mojom::PluginInfoHost> plugin_info_host;
|
||||
render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
|
||||
&plugin_info_host);
|
||||
plugin_info_host->GetPluginInfo(
|
||||
url, render_frame->GetWebFrame()->Top()->GetSecurityOrigin(),
|
||||
orig_mime_type, &plugin_info);
|
||||
*plugin = ChromeContentRendererClient::CreatePlugin(render_frame, params,
|
||||
|
@@ -50,8 +50,8 @@ void AlloyRenderThreadObserver::SetInitialConfiguration(
|
||||
chromeos_listener_receiver,
|
||||
mojo::PendingRemote<content_settings::mojom::ContentSettingsManager>
|
||||
content_settings_manager,
|
||||
mojo::PendingRemote<chrome::mojom::BoundSessionRequestThrottledListener>
|
||||
bound_session_request_throttled_listener) {
|
||||
mojo::PendingRemote<chrome::mojom::BoundSessionRequestThrottledHandler>
|
||||
bound_session_request_throttled_handler) {
|
||||
is_incognito_process_ = is_incognito_process;
|
||||
}
|
||||
|
||||
|
@@ -47,8 +47,8 @@ class AlloyRenderThreadObserver : public content::RenderThreadObserver,
|
||||
chromeos_listener_receiver,
|
||||
mojo::PendingRemote<content_settings::mojom::ContentSettingsManager>
|
||||
content_settings_manager,
|
||||
mojo::PendingRemote<chrome::mojom::BoundSessionRequestThrottledListener>
|
||||
bound_session_request_throttled_listener) override;
|
||||
mojo::PendingRemote<chrome::mojom::BoundSessionRequestThrottledHandler>
|
||||
bound_session_request_throttled_handler) override;
|
||||
void SetConfiguration(chrome::mojom::DynamicParamsPtr params) override;
|
||||
|
||||
void OnRendererConfigurationAssociatedRequest(
|
||||
|
@@ -46,7 +46,7 @@ CefURLLoaderThrottleProviderImpl::Clone() {
|
||||
|
||||
blink::WebVector<std::unique_ptr<blink::URLLoaderThrottle>>
|
||||
CefURLLoaderThrottleProviderImpl::CreateThrottles(
|
||||
int render_frame_id,
|
||||
base::optional_ref<const blink::LocalFrameToken> local_frame_token,
|
||||
const blink::WebURLRequest& request) {
|
||||
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
|
||||
|
@@ -30,7 +30,7 @@ class CefURLLoaderThrottleProviderImpl
|
||||
// blink::URLLoaderThrottleProvider implementation.
|
||||
std::unique_ptr<blink::URLLoaderThrottleProvider> Clone() override;
|
||||
blink::WebVector<std::unique_ptr<blink::URLLoaderThrottle>> CreateThrottles(
|
||||
int render_frame_id,
|
||||
base::optional_ref<const blink::LocalFrameToken> local_frame_token,
|
||||
const blink::WebURLRequest& request) override;
|
||||
void SetOnline(bool is_online) override;
|
||||
|
||||
|
@@ -71,7 +71,7 @@ void CefRenderFrameObserver::DidFinishLoad() {
|
||||
}
|
||||
}
|
||||
|
||||
void CefRenderFrameObserver::WillDetach() {
|
||||
void CefRenderFrameObserver::WillDetach(blink::DetachReason detach_reason) {
|
||||
if (frame_) {
|
||||
frame_->OnDetached();
|
||||
frame_ = nullptr;
|
||||
|
@@ -31,7 +31,7 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
|
||||
void DidCommitProvisionalLoad(ui::PageTransition transition) override;
|
||||
void DidFailProvisionalLoad() override;
|
||||
void DidFinishLoad() override;
|
||||
void WillDetach() override;
|
||||
void WillDetach(blink::DetachReason detach_reason) override;
|
||||
void FocusedElementChanged(const blink::WebElement& element) override;
|
||||
void DraggableRegionsChanged() override;
|
||||
void DidCreateScriptContext(v8::Handle<v8::Context> context,
|
||||
|
@@ -266,7 +266,7 @@ std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) {
|
||||
return out;
|
||||
}
|
||||
|
||||
#if defined(WCHAR_T_IS_UTF32)
|
||||
#if defined(WCHAR_T_IS_32_BIT)
|
||||
std::ostream& operator<<(std::ostream& out, const char16_t* wstr) {
|
||||
const auto length = wstr ? std::char_traits<char16_t>::length(wstr) : 0U;
|
||||
if (length > 0) {
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=9c7fea32f82cc202af9aac038b78000ed45aac2e$
|
||||
// $hash=a5f9a7de12728e82f8dee6d8dde3b9275a3e4ee4$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/views/window_cpptoc.h"
|
||||
@@ -467,7 +467,8 @@ window_get_window_app_icon(struct _cef_window_t* self) {
|
||||
cef_overlay_controller_t* CEF_CALLBACK
|
||||
window_add_overlay_view(struct _cef_window_t* self,
|
||||
cef_view_t* view,
|
||||
cef_docking_mode_t docking_mode) {
|
||||
cef_docking_mode_t docking_mode,
|
||||
int can_activate) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@@ -485,7 +486,8 @@ window_add_overlay_view(struct _cef_window_t* self,
|
||||
// Execute
|
||||
CefRefPtr<CefOverlayController> _retval =
|
||||
CefWindowCppToC::Get(self)->AddOverlayView(CefViewCppToC::Unwrap(view),
|
||||
docking_mode);
|
||||
docking_mode,
|
||||
can_activate ? true : false);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefOverlayControllerCppToC::Wrap(_retval);
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=a4d3216f156716d777fe549428568b38391fd06d$
|
||||
// $hash=a49624e0b20c4a50ff719c492d7101099646000f$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/views/window_ctocpp.h"
|
||||
@@ -461,7 +461,8 @@ CefRefPtr<CefImage> CefWindowCToCpp::GetWindowAppIcon() {
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefOverlayController> CefWindowCToCpp::AddOverlayView(
|
||||
CefRefPtr<CefView> view,
|
||||
cef_docking_mode_t docking_mode) {
|
||||
cef_docking_mode_t docking_mode,
|
||||
bool can_activate) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_window_t* _struct = GetStruct();
|
||||
@@ -479,7 +480,7 @@ CefRefPtr<CefOverlayController> CefWindowCToCpp::AddOverlayView(
|
||||
|
||||
// Execute
|
||||
cef_overlay_controller_t* _retval = _struct->add_overlay_view(
|
||||
_struct, CefViewCToCpp::Unwrap(view), docking_mode);
|
||||
_struct, CefViewCToCpp::Unwrap(view), docking_mode, can_activate);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefOverlayControllerCToCpp::Wrap(_retval);
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=35ef2ba61ce63ffcc269a326874d135090b0937a$
|
||||
// $hash=5b562d0924fd4a825f43ae7735c1fc98c474de6a$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_CTOCPP_H_
|
||||
@@ -64,7 +64,8 @@ class CefWindowCToCpp
|
||||
CefRefPtr<CefImage> GetWindowAppIcon() override;
|
||||
CefRefPtr<CefOverlayController> AddOverlayView(
|
||||
CefRefPtr<CefView> view,
|
||||
cef_docking_mode_t docking_mode) override;
|
||||
cef_docking_mode_t docking_mode,
|
||||
bool can_activate) override;
|
||||
void ShowMenu(CefRefPtr<CefMenuModel> menu_model,
|
||||
const CefPoint& screen_point,
|
||||
cef_menu_anchor_position_t anchor_position) override;
|
||||
|
@@ -121,6 +121,13 @@ patches = [
|
||||
# chrome: Allow override of Widget::Activate() to support activation of
|
||||
# DevTools windows with external parent.
|
||||
# https://github.com/chromiumembedded/cef/issues/3282
|
||||
#
|
||||
# mac: Add support for ui::SHOW_STATE_HIDDEN.
|
||||
# https://github.com/chromiumembedded/cef/issues/3630
|
||||
#
|
||||
# win: Delay enablement of native occlusion tracking until the initially-
|
||||
# minimized window is restored for the first time.
|
||||
# https://github.com/chromiumembedded/cef/issues/3638
|
||||
'name': 'views_widget',
|
||||
},
|
||||
{
|
||||
@@ -134,8 +141,6 @@ patches = [
|
||||
#
|
||||
# Add WebContentsObserver::RenderWidgetCreated.
|
||||
# https://github.com/chromiumembedded/cef/issues/3308
|
||||
#
|
||||
# Avoid crash in WebContentsImpl::GetWindowShowState with OSR.
|
||||
'name': 'web_contents_1257_1565',
|
||||
},
|
||||
{
|
||||
@@ -252,6 +257,11 @@ patches = [
|
||||
#
|
||||
# Fix NativeWebContentsModalDialogManagerViews::HostChanged to not reparent
|
||||
# between different root windows.
|
||||
#
|
||||
# Fix incorrect movement of parent window when showing modal dialog.
|
||||
# https://github.com/chromiumembedded/cef/issues/3629
|
||||
# Partially reverts
|
||||
# https://chromium-review.googlesource.com/c/chromium/src/+/5006355
|
||||
'name': 'chrome_browser_dialogs_widget',
|
||||
},
|
||||
{
|
||||
@@ -453,9 +463,8 @@ patches = [
|
||||
# "C:\temp\cache\Cache").
|
||||
# https://github.com/chromiumembedded/cef/issues/2622
|
||||
#
|
||||
# alloy: Avoid initialization of privacy sandbox, identity manager and
|
||||
# first party sets policy.
|
||||
# https://github.com/chromiumembedded/cef/issues/3434
|
||||
# alloy: Avoid initialization of privacy sandbox and identity manager.
|
||||
# https://github.com/chromiumembedded/cef/issues/3643
|
||||
'name': 'services_network_2622',
|
||||
},
|
||||
{
|
||||
@@ -677,8 +686,6 @@ patches = [
|
||||
{
|
||||
# Fix NOTREACHED() in RenderFrameHostImpl::CommitNavigation() with
|
||||
# CorsTest.IframeNoneServerToCustomUnregisteredScheme.
|
||||
# Fix bad optional access in VerifyInitiatorOrigin() with
|
||||
# RequestHandlerTest.NotificationsCrossOriginDelayedRenderer.
|
||||
# Partially reverts the below changes.
|
||||
# https://chromium-review.googlesource.com/c/chromium/src/+/4829483
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=1470837#c22
|
||||
@@ -700,14 +707,38 @@ patches = [
|
||||
# https://github.com/chromiumembedded/cef/issues/3616
|
||||
'name': 'linux_libxml_tls_3616'
|
||||
},
|
||||
{
|
||||
# linux: Fix crash after x11::Connection destruction with
|
||||
# multi-threaded-message-loop.
|
||||
# https://chromium-review.googlesource.com/c/chromium/src/+/5115482
|
||||
'name': 'linux_connection_5115482'
|
||||
},
|
||||
{
|
||||
# windows: Fix implicit conversion error when building cef_sandbox.
|
||||
# https://chromium-review.googlesource.com/c/chromium/src/+/5120035
|
||||
'name': 'base_allocator_5120035'
|
||||
},
|
||||
{
|
||||
# chrome: mac: Support locale configuration.
|
||||
# https://github.com/chromiumembedded/cef/issues/3623
|
||||
#
|
||||
# mac: Add fallback for unsupported --lang values.
|
||||
# https://github.com/chromiumembedded/cef/issues/3653
|
||||
'name': 'mac_chrome_locale_3623'
|
||||
},
|
||||
{
|
||||
# Fix mojom_ts_generator.py error with Python 3.11.
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=1422178
|
||||
'name': 'mojo_generator_1422178'
|
||||
}
|
||||
# alloy: Don't create GPUCache directory when cache_path is empty.
|
||||
# https://github.com/chromiumembedded/cef/issues/3617
|
||||
'name': 'content_renderer_host_3617'
|
||||
},
|
||||
{
|
||||
# chrome: win: Fix taskbar grouping of PiP and DevTools windows.
|
||||
# https://github.com/chromiumembedded/cef/issues/3641
|
||||
'name': 'win_taskbar_group_3641'
|
||||
},
|
||||
{
|
||||
# chrome: win: Disable taskbar decoration for PiP and DevTools windows.
|
||||
# https://github.com/chromiumembedded/cef/issues/3645
|
||||
'name': 'win_taskbar_decorator_3645'
|
||||
},
|
||||
]
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user