Compare commits

..

40 Commits
5672 ... 5735

Author SHA1 Message Date
Marshall Greenblatt
dc18c542a2 Update to Chromium version 114.0.5735.201 2023-07-21 02:00:59 +00:00
Marshall Greenblatt
6792e13230 Update to Chromium version 114.0.5735.200 2023-07-17 15:04:13 +00:00
Marshall Greenblatt
7c09f21d73 Update to Chromium version 114.0.5735.199 2023-06-28 07:31:32 +00:00
Marshall Greenblatt
87c88072bb Update to Chromium version 114.0.5735.134 2023-06-14 07:45:10 +00:00
Marshall Greenblatt
398e3c3a2a Update to Chromium version 114.0.5735.110 2023-06-07 08:20:02 +00:00
Chris Frank
1a97a28b0f linux: alloy: Fix window resize after context menu dismissal (fixes #3466) 2023-06-06 15:36:25 +03:00
Marshall Greenblatt
8746aab738 Update to Chromium version 114.0.5735.91 2023-06-04 10:50:53 +00:00
Marshall Greenblatt
778aa851a9 mac: cefclient: Fix compile error with Xcode 14.3.1 2023-06-02 17:27:20 +03:00
Marshall Greenblatt
c4d256c286 win: Ship d3dcompiler_47.dll on ARM64 (fixes #3515)
Use the same file from the Windows SDK as Chromium on all architectures
("$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll").
2023-06-01 13:37:31 +03:00
Marshall Greenblatt
4a5500fcb9 win: cmake: VS2022 is now required (fixes #3516) 2023-06-01 13:09:47 +03:00
Marshall Greenblatt
3d7ef76b75 win: Fix ambiguous max() usage (fixes #3524, see #3422) 2023-06-01 12:51:24 +03:00
Marshall Greenblatt
8251119be4 win: Update msvs_env.bat to prefer VS2022 (fixes #3509) 2023-06-01 12:51:18 +03:00
Marshall Greenblatt
11d21f100f win: Fix MSVC compile errors in registry.cc (fixes #3519) 2023-05-29 13:01:36 +03:00
Marshall Greenblatt
d70a0a832d Update to Chromium version 114.0.5735.45 2023-05-27 12:44:16 +03:00
Nik Pavlov
f3083218af alloy: views: mac: Add three-finger-swipe navigation gesture support
This adds support for the three-finger-swipe navigation gesture with
Alloy/Views. The default implementation matches the Chrome runtime
and navigates the browser back/forward. We also add an Alloy/Views-
specific client callback in CefBrowserViewDelegate for optional
custom handling of the gesture event.
2023-05-26 12:09:59 +03:00
Marshall Greenblatt
8ff65ec09f Add missing include for std::numeric_limits (see #3422) 2023-05-26 12:09:12 +03:00
Vladimir Kharitonov
8381105f52 Update CefRange type to match gfx::Range (fixes #3422) 2023-05-26 12:08:48 +03:00
Marshall Greenblatt
cbd0dfcdee tools: Fix incorrect SharedMemoryRegion translation (fixes #3498) 2023-05-09 12:39:57 +03:00
Marshall Greenblatt
ad726a0a40 Replace NOTREACHED() with DCHECK(false) in generated files (see #3500)
Restores the old behavior of assertion in Debug build only.
2023-05-08 18:36:45 +03:00
Marshall Greenblatt
0b98db28bb Replace NOTREACHED() with DCHECK(false) (fixes #3500)
Restores the old behavior of assertion in Debug build only.
2023-05-08 18:36:45 +03:00
Marshall Greenblatt
c05ff2847d Update to Chromium version 114.0.5735.9 2023-05-06 16:46:11 +03:00
Takashi Hashida
cf14b2a972 Add CefDownloadItem IsInterrupted and GetInterruptReason methods (fixes #3486) 2023-05-06 16:11:16 +03:00
Marshall Greenblatt
5a22a5c8a3 cmake: win: Fix incorrect /STACK value (fixes #3491) 2023-05-06 15:37:19 +03:00
Marshall Greenblatt
5e80ea3371 mac: Remove libtest_trace_processor.dylib as a runtime dependency 2023-05-05 22:53:16 +03:00
Marshall Greenblatt
d0b3042940 tests: Fix SchemeHandlerTest.HttpXSSDifferentOriginWithDomain failure
Cross-origin usage of document.domain is now restricted by default with the
Chrome runtime. Relax this policy for XSS tests by setting the
"Origin-Agent-Cluster: ?0" header.

Also remove usage of global variable in tests.
2023-05-05 22:53:16 +03:00
Marshall Greenblatt
de4f9e8908 tests: Change HTTP test URLs to HTTPS
This avoids unexpected HTTP to HTTPS redirects which cause test failures with
the Chrome runtime.
2023-05-05 22:53:16 +03:00
Marshall Greenblatt
ab94a13522 Update to Chromium version 114.0.5735.0 (#1135570)
- Mac: 13.3 SDK (Xcode 14.3) is now supported (see https://crbug.com/1431897).
- Mac: Removed UnderlayOpenGLHostingWindow which is no longer used.
2023-05-05 22:53:16 +03:00
Marshall Greenblatt
09c4142dad chrome: mac: Add Alerts helper app (fixes #3181)
Some Chromium code cleanup will follow in
https://chromium-review.googlesource.com/c/chromium/src/+/4456752
2023-04-21 14:39:19 -04:00
Marshall Greenblatt
e0063880ac chrome: mac: cefclient: Support Find window commands (fixes #3462) 2023-04-20 12:26:07 -04:00
Marshall Greenblatt
7ade772e0b chrome: mac: Support dispatch of window commands (see #3462) 2023-04-20 12:26:07 -04:00
Marshall Greenblatt
a39c2a0068 chrome: Improve positioning of the "Find" widget (fixes #3461)
The "Find" widget will be excluded from regions near the edges of the window
that contain overlays, draggable regions or titlebar.
2023-04-20 12:26:07 -04:00
Marshall Greenblatt
17cab6d955 views: mac: Fix overlay association with host CefWindow (fixes #3456) 2023-04-20 12:23:57 -04:00
Nik Pavlov
cad2498d87 mac: views: Add CefWindowDelegate::OnWindowFullscreenTransition 2023-04-20 14:59:15 +00:00
Marshall Greenblatt
6569ef09c5 Update API hash 2023-04-13 12:10:00 -04:00
Sergey Markelov
78ea5d8c61 Make string map append API match the manuals
Reduce cef_string_[multi]map_key() and cef_string_[multi]map_value() complexities
from O(N) to O(1).
2023-04-13 16:08:48 +00:00
Sergey Markelov
c3648f42b2 Use less error prone string list, map or multimap pointer types
Use pointers to incomplete struct types. If an argument of a not suitable
type is passed to a function of any string collection,
C compiler will warn:
  warning: passing argument 1 of <func> from incompatible pointer type
C++ compiler will raise an error, for example:
  error: cannot convert 'cef_string_list_t' ... to 'cef_string_multimap_t'

With the previously used `void*` pointer types, such errors in a code were not
diagnosed.
2023-04-13 16:06:02 +00:00
Sergey Markelov
f90d5bc49e Remove unused macro FALLTHROUGH
Chromium and CEF now use the attribute `[[fallthrough]]`.
2023-04-13 16:03:41 +00:00
Eric Astor
55e158fe81 Avoid generating an accidental UDL suffix
In the error case, we previously output a pragma with a string immediately
followed by __FILE__ - but with no space between the string terminator and
__FILE__, a compliant C++ compiler can interpret this as a user-defined literal
suffix and end up failing to embed the intended information. We should add
spaces here to ensure our generated code is standards-compliant.
2023-04-12 19:54:31 +00:00
Sergey Markelov
5d48f277f2 Fix typos in cef_origin_whitelist.h and capi/cef_origin_whitelist_capi.h 2023-04-12 18:21:39 +00:00
Marshall Greenblatt
2094a8e221 alloy: Fix incorrect rendering of PiP overlay on mouseover (fixes #3482)
Initialize the Chrome color mixer so that ColorProvider returns the expected
semi-transparent color for overlay background in video_overlay_window_views.cc
instead of the default opaque red color (kPlaceholderColor).
2023-04-11 14:08:36 -04:00
177 changed files with 3240 additions and 1890 deletions

View File

@@ -385,12 +385,13 @@ source_set("libcef_static_unittested") {
sources = [
"libcef/browser/devtools/devtools_util.cc",
"libcef/browser/devtools/devtools_util.h",
"libcef/browser/screen_util.h",
"libcef/browser/screen_util.cc",
"libcef/browser/geometry_util.h",
"libcef/browser/geometry_util.cc",
]
deps = [
"//base",
"//ui/gfx/geometry",
]
configs += [
@@ -406,7 +407,7 @@ test("libcef_static_unittests") {
sources = [
"libcef/browser/devtools/devtools_util_unittest.cc",
"libcef/browser/screen_util_unittest.cc",
"libcef/browser/geometry_util_unittest.cc",
]
deps = [
@@ -1351,6 +1352,8 @@ make_pack_header("resources") {
"$root_gen_dir/content/browser/webrtc/resources/grit/webrtc_internals_resources.h",
"$root_gen_dir/content/grit/content_resources.h",
"$root_gen_dir/content/grit/dev_ui_content_resources.h",
"$root_gen_dir/content/grit/gpu_resources.h",
"$root_gen_dir/content/grit/histograms_resources.h",
"$root_gen_dir/extensions/grit/extensions_browser_resources.h",
"$root_gen_dir/extensions/grit/extensions_renderer_resources.h",
"$root_gen_dir/extensions/grit/extensions_resources.h",
@@ -1374,6 +1377,8 @@ make_pack_header("resources") {
"//components/resources:components_resources",
"//components/resources:dev_ui_components_resources",
"//content/browser/devtools:devtools_resources",
"//content/browser/resources/gpu:resources",
"//content/browser/resources/histograms:resources",
"//content/browser/tracing:resources",
"//content/browser/webrtc/resources",
"//content:content_resources",
@@ -1503,6 +1508,8 @@ if (is_mac) {
public_deps += [ "//third_party/icu:icudata", ]
}
sources += [ "//ui/gl/resources/angle-metal/gpu_shader_cache.bin" ]
if (v8_use_external_startup_data) {
sources += [
"$root_out_dir/snapshot_blob.bin",
@@ -1770,7 +1777,20 @@ if (is_mac) {
}
}
foreach(helper_params, content_mac_helpers) {
# From //chrome/BUILD.gn:
# Helper app to display alert notifications. This is necessary as an app can
# only display either banner or alert style notifications and the main app
# will display banners.
alert_helper_params = [
"alerts",
".alerts",
" (Alerts)",
]
# Merge all helper apps needed by //content and //chrome.
chrome_mac_helpers = content_mac_helpers + [ alert_helper_params ]
foreach(helper_params, chrome_mac_helpers) {
_helper_target = helper_params[0]
_helper_bundle_id = helper_params[1]
_helper_suffix = helper_params[2]
@@ -1801,7 +1821,7 @@ if (is_mac) {
":cef_framework",
]
foreach(helper_params, content_mac_helpers) {
foreach(helper_params, chrome_mac_helpers) {
sources += [
"$root_out_dir/${app_helper_name}${helper_params[2]}.app",
]

View File

@@ -7,6 +7,6 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/113.0.5672.129',
'depot_tools_checkout': '2075f733e8'
'chromium_checkout': 'refs/tags/114.0.5735.201',
'depot_tools_checkout': '7ee8e6c7cb'
}

View File

@@ -359,6 +359,7 @@ if(OS_MAC)
# Format is "<name suffix>:<target suffix>:<plist suffix>".
set(CEF_HELPER_APP_SUFFIXES
"::"
" (Alerts):_alerts:.alerts"
" (GPU):_gpu:.gpu"
" (Plugin):_plugin:.plugin"
" (Renderer):_renderer:.renderer"
@@ -492,6 +493,7 @@ if(OS_WINDOWS)
# List of CEF binary files.
set(CEF_BINARY_FILES
chrome_elf.dll
d3dcompiler_47.dll
libcef.dll
libEGL.dll
libGLESv2.dll
@@ -502,12 +504,6 @@ if(OS_WINDOWS)
vulkan-1.dll
)
if(NOT PROJECT_ARCH STREQUAL "arm64")
list(APPEND CEF_BINARY_FILES
d3dcompiler_47.dll
)
endif()
# List of CEF resource files.
set(CEF_RESOURCE_FILES
chrome_100_percent.pak

View File

@@ -251,13 +251,6 @@
#define HAS_FEATURE(FEATURE) 0
#endif
// Macro for telling -Wimplicit-fallthrough that a fallthrough is intentional.
#if defined(__clang__)
#define FALLTHROUGH [[clang::fallthrough]]
#else
#define FALLTHROUGH
#endif
#if defined(COMPILER_GCC)
#define PRETTY_FUNCTION __PRETTY_FUNCTION__
#elif defined(COMPILER_MSVC)

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=332b9cb62b9c85573dc705aba4c9db3b34177e20$
// $hash=d9e9f4b914ae2d3b1ed83ae0d9e2e46e9e736af5$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
@@ -72,10 +72,21 @@ typedef struct _cef_download_item_t {
int(CEF_CALLBACK* is_complete)(struct _cef_download_item_t* self);
///
/// Returns true (1) if the download has been canceled or interrupted.
/// Returns true (1) if the download has been canceled.
///
int(CEF_CALLBACK* is_canceled)(struct _cef_download_item_t* self);
///
/// Returns true (1) if the download has been interrupted.
///
int(CEF_CALLBACK* is_interrupted)(struct _cef_download_item_t* self);
///
/// Returns the most recent interrupt reason.
///
cef_download_interrupt_reason_t(CEF_CALLBACK* get_interrupt_reason)(
struct _cef_download_item_t* self);
///
/// Returns a simple speed estimate in bytes/s.
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=b564dfe24017a0805e393854d12791a71c46c454$
// $hash=9330c709713a10c1e6b55278428e65c07f4c9dfb$
//
#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
@@ -70,7 +70,7 @@ extern "C" {
/// qualified |source_origin| URL (like http://www.example.com) will be allowed
/// access to all resources hosted on the specified |target_protocol| and
/// |target_domain|. If |target_domain| is non-NULL and
/// |allow_target_subdomains| if false (0) only exact domain matches will be
/// |allow_target_subdomains| is false (0) only exact domain matches will be
/// allowed. If |target_domain| contains a top- level domain component (like
/// "example.com") and |allow_target_subdomains| is true (1) sub-domain matches
/// will be allowed. If |target_domain| is NULL and |allow_target_subdomains| if

View File

@@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "509090f3945a0c74991845085f47240f11389523"
#define CEF_API_HASH_UNIVERSAL "eb6257d3e4894dd51617d20588b7f0c3c8717301"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "1c9ed9d86408e2d84cf88d4a8c865a2872eb40bd"
#define CEF_API_HASH_PLATFORM "3c99a150153b982d4d8b1a19e33b66a1d93fec21"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "8cc9baa9653847ce54b2da84431d573bc3669505"
#define CEF_API_HASH_PLATFORM "b63aacf68a1fda1164948c24bab4f74abe046137"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "741b042aa3d663f9e4ffad0b59d1bfb4faa03e70"
#define CEF_API_HASH_PLATFORM "b12c839a3ea0dcb9705e543fc17fd3c1d9fa1e7c"
#endif
#ifdef __cplusplus

View File

@@ -45,9 +45,6 @@
// Use the existing CrAppProtocol definition.
#import "base/message_loop/message_pump_mac.h"
// Use the existing UnderlayableSurface definition.
#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
// Use the existing empty protocol definitions.
#import "base/mac/cocoa_protocols.h"
@@ -70,13 +67,6 @@
- (void)setHandlingSendEvent:(BOOL)handlingSendEvent;
@end
// Copy of definition from ui/base/cocoa/underlay_opengl_hosting_window.h.
// Common base class for windows that host a OpenGL surface that renders under
// the window. Contains methods relating to hole punching so that the OpenGL
// surface is visible through the window.
@interface UnderlayOpenGLHostingWindow : NSWindow
@end
#endif // USING_CHROMIUM_INCLUDES
// All CEF client applications must subclass NSApplication and implement this

View File

@@ -66,11 +66,23 @@ class CefDownloadItem : public virtual CefBaseRefCounted {
virtual bool IsComplete() = 0;
///
/// Returns true if the download has been canceled or interrupted.
/// Returns true if the download has been canceled.
///
/*--cef()--*/
virtual bool IsCanceled() = 0;
///
/// Returns true if the download has been interrupted.
///
/*--cef()--*/
virtual bool IsInterrupted() = 0;
///
/// Returns the most recent interrupt reason.
///
/*--cef(default_retval=CEF_DOWNLOAD_INTERRUPT_REASON_NONE)--*/
virtual cef_download_interrupt_reason_t GetInterruptReason() = 0;
///
/// Returns a simple speed estimate in bytes/s.
///

View File

@@ -63,7 +63,7 @@
/// the same-origin policy. Scripts hosted underneath the fully qualified
/// |source_origin| URL (like http://www.example.com) will be allowed access to
/// all resources hosted on the specified |target_protocol| and |target_domain|.
/// If |target_domain| is non-empty and |allow_target_subdomains| if false only
/// If |target_domain| is non-empty and |allow_target_subdomains| is false only
/// exact domain matches will be allowed. If |target_domain| contains a top-
/// level domain component (like "example.com") and |allow_target_subdomains| is
/// true sub-domain matches will be allowed. If |target_domain| is empty and

View File

@@ -41,7 +41,7 @@ extern "C" {
///
/// CEF string maps are a set of key/value string pairs.
///
typedef void* cef_string_list_t;
typedef struct _cef_string_list_t* cef_string_list_t;
///
/// Allocate a new string map.

View File

@@ -41,7 +41,7 @@ extern "C" {
///
/// CEF string maps are a set of key/value string pairs.
///
typedef void* cef_string_map_t;
typedef struct _cef_string_map_t* cef_string_map_t;
///
/// Allocate a new string map.
@@ -75,7 +75,8 @@ CEF_EXPORT int cef_string_map_value(cef_string_map_t map,
cef_string_t* value);
///
/// Append a new key/value pair at the end of the string map.
/// Append a new key/value pair at the end of the string map. If the key exists,
/// overwrite the existing value with a new value w/o changing the pair order.
///
CEF_EXPORT int cef_string_map_append(cef_string_map_t map,
const cef_string_t* key,

View File

@@ -42,7 +42,7 @@ extern "C" {
/// CEF string multimaps are a set of key/value string pairs.
/// More than one value can be assigned to a single key.
///
typedef void* cef_string_multimap_t;
typedef struct _cef_string_multimap_t* cef_string_multimap_t;
///
/// Allocate a new string multimap.

View File

@@ -3488,6 +3488,123 @@ typedef enum {
CEF_PREFERENCES_TYPE_REQUEST_CONTEXT,
} cef_preferences_type_t;
///
/// Download interrupt reasons. Should be kept in sync with
/// Chromium's download::DownloadInterruptReason type.
///
typedef enum {
CEF_DOWNLOAD_INTERRUPT_REASON_NONE = 0,
/// Generic file operation failure.
CEF_DOWNLOAD_INTERRUPT_REASON_FILE_FAILED = 1,
/// The file cannot be accessed due to security restrictions.
CEF_DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED = 2,
/// There is not enough room on the drive.
CEF_DOWNLOAD_INTERRUPT_REASON_FILE_NO_SPACE = 3,
/// The directory or file name is too long.
CEF_DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG = 5,
/// The file is too large for the file system to handle.
CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE = 6,
/// The file contains a virus.
CEF_DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED = 7,
/// The file was in use. Too many files are opened at once. We have run out of
/// memory.
CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR = 10,
/// The file was blocked due to local policy.
CEF_DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED = 11,
/// An attempt to check the safety of the download failed due to unexpected
/// reasons. See http://crbug.com/153212.
CEF_DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED = 12,
/// An attempt was made to seek past the end of a file in opening
/// a file (as part of resuming a previously interrupted download).
CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT = 13,
/// The partial file didn't match the expected hash.
CEF_DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH = 14,
/// The source and the target of the download were the same.
CEF_DOWNLOAD_INTERRUPT_REASON_FILE_SAME_AS_SOURCE = 15,
// Network errors.
/// Generic network failure.
CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED = 20,
/// The network operation timed out.
CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT = 21,
/// The network connection has been lost.
CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED = 22,
/// The server has gone down.
CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN = 23,
/// The network request was invalid. This may be due to the original URL or a
/// redirected URL:
/// - Having an unsupported scheme.
/// - Being an invalid URL.
/// - Being disallowed by policy.
CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST = 24,
// Server responses.
/// The server indicates that the operation has failed (generic).
CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED = 30,
/// The server does not support range requests.
/// Internal use only: must restart from the beginning.
CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE = 31,
/// The server does not have the requested data.
CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT = 33,
/// Server didn't authorize access to resource.
CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED = 34,
/// Server certificate problem.
CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CERT_PROBLEM = 35,
/// Server access forbidden.
CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_FORBIDDEN = 36,
/// Unexpected server response. This might indicate that the responding server
/// may not be the intended server.
CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_UNREACHABLE = 37,
/// The server sent fewer bytes than the content-length header. It may
/// indicate that the connection was closed prematurely, or the Content-Length
/// header was invalid. The download is only interrupted if strong validators
/// are present. Otherwise, it is treated as finished.
CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CONTENT_LENGTH_MISMATCH = 38,
/// An unexpected cross-origin redirect happened.
CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CROSS_ORIGIN_REDIRECT = 39,
// User input.
/// The user canceled the download.
CEF_DOWNLOAD_INTERRUPT_REASON_USER_CANCELED = 40,
/// The user shut down the browser.
/// Internal use only: resume pending downloads if possible.
CEF_DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN = 41,
// Crash.
/// The browser crashed.
/// Internal use only: resume pending downloads if possible.
CEF_DOWNLOAD_INTERRUPT_REASON_CRASH = 50,
} cef_download_interrupt_reason_t;
///
/// Specifies the gesture commands.
///

View File

@@ -450,6 +450,12 @@ AlloyBrowserContext::GetUserCloudPolicyManager() {
return nullptr;
}
policy::ProfileCloudPolicyManager*
AlloyBrowserContext::GetProfileCloudPolicyManager() {
DCHECK(false);
return nullptr;
}
policy::ProfilePolicyConnector*
AlloyBrowserContext::GetProfilePolicyConnector() {
DCHECK(false);

View File

@@ -94,6 +94,7 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
ProfileKey* GetProfileKey() const override;
policy::SchemaRegistryService* GetPolicySchemaRegistryService() override;
policy::UserCloudPolicyManager* GetUserCloudPolicyManager() override;
policy::ProfileCloudPolicyManager* GetProfileCloudPolicyManager() override;
policy::ProfilePolicyConnector* GetProfilePolicyConnector() override;
const policy::ProfilePolicyConnector* GetProfilePolicyConnector()
const override;

View File

@@ -120,7 +120,6 @@
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/guest_view/extensions_guest_view.h"
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
#include "extensions/browser/info_map.h"
#include "extensions/browser/process_map.h"
#include "extensions/browser/renderer_startup_helper.h"
#include "extensions/browser/url_loader_factory_manager.h"
@@ -923,14 +922,21 @@ AlloyContentBrowserClient::CreateURLLoaderThrottles(
Profile* profile = Profile::FromBrowserContext(browser_context);
chrome::mojom::DynamicParams dynamic_params = {
profile->GetPrefs()->GetBoolean(
policy::policy_prefs::kForceGoogleSafeSearch),
profile->GetPrefs()->GetInteger(
policy::policy_prefs::kForceYouTubeRestrict),
profile->GetPrefs()->GetString(prefs::kAllowedDomainsForApps)};
result.push_back(
std::make_unique<GoogleURLLoaderThrottle>(std::move(dynamic_params)));
chrome::mojom::DynamicParamsPtr dynamic_params =
chrome::mojom::DynamicParams::New(
#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
/*bound_session_params=*/nullptr,
#endif
profile->GetPrefs()->GetBoolean(
policy::policy_prefs::kForceGoogleSafeSearch),
profile->GetPrefs()->GetInteger(
policy::policy_prefs::kForceYouTubeRestrict),
profile->GetPrefs()->GetString(prefs::kAllowedDomainsForApps));
result.push_back(std::make_unique<GoogleURLLoaderThrottle>(
#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
/*bound_session_request_throttled_listener=*/nullptr,
#endif
std::move(dynamic_params)));
return result;
}

View File

@@ -241,6 +241,9 @@ std::unique_ptr<CefMenuRunner> CefBrowserPlatformDelegate::CreateMenuRunner() {
return nullptr;
}
void CefBrowserPlatformDelegate::UpdateFindBarBoundingBox(
gfx::Rect* bounds) const {}
bool CefBrowserPlatformDelegate::IsWindowless() const {
return false;
}

View File

@@ -286,6 +286,9 @@ 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;

View File

@@ -92,6 +92,9 @@ class BrowserDelegate : public content::WebContentsDelegate {
return true;
}
// Optionally modify the bounding box for the Find bar.
virtual void UpdateFindBarBoundingBox(gfx::Rect* bounds) {}
// Same as RequestMediaAccessPermission but returning |callback| if the
// request is unhandled.
[[nodiscard]] virtual content::MediaResponseCallback

View File

@@ -176,6 +176,12 @@ bool ChromeBrowserDelegate::IsToolbarButtonVisible(
return true;
}
void ChromeBrowserDelegate::UpdateFindBarBoundingBox(gfx::Rect* bounds) {
if (auto browser = ChromeBrowserHostImpl::GetBrowserForBrowser(browser_)) {
browser->platform_delegate()->UpdateFindBarBoundingBox(bounds);
}
}
content::MediaResponseCallback
ChromeBrowserDelegate::RequestMediaAccessPermissionEx(
content::WebContents* web_contents,

View File

@@ -60,6 +60,7 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
bool IsAppMenuItemEnabled(int command_id) override;
bool IsPageActionIconVisible(PageActionIconType icon_type) override;
bool IsToolbarButtonVisible(ToolbarButtonType button_type) override;
void UpdateFindBarBoundingBox(gfx::Rect* bounds) override;
[[nodiscard]] content::MediaResponseCallback RequestMediaAccessPermissionEx(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,

View File

@@ -5,6 +5,7 @@
#include "libcef/browser/chrome/views/browser_platform_delegate_chrome_views.h"
#include "include/views/cef_window.h"
#include "libcef/browser/views/window_impl.h"
#include "chrome/browser/ui/browser.h"
#include "ui/views/widget/widget.h"
@@ -170,6 +171,23 @@ 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;
}
CefWindowImpl* CefBrowserPlatformDelegateChromeViews::GetWindowImpl() const {
if (auto* widget = GetWindowWidget()) {
CefRefPtr<CefWindow> window = view_util::GetWindowFor(widget);
return static_cast<CefWindowImpl*>(window.get());
}
return nullptr;
}

View File

@@ -8,6 +8,8 @@
#include "libcef/browser/chrome/browser_platform_delegate_chrome.h"
#include "libcef/browser/views/browser_view_impl.h"
class CefWindowImpl;
// Implementation of Chrome-based browser functionality.
class CefBrowserPlatformDelegateChromeViews
: public CefBrowserPlatformDelegateChrome {
@@ -35,6 +37,7 @@ 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_; }
@@ -42,6 +45,8 @@ class CefBrowserPlatformDelegateChromeViews
private:
void SetBrowserView(CefRefPtr<CefBrowserViewImpl> browser_view);
CefWindowImpl* GetWindowImpl() const;
CefRefPtr<CefBrowserViewImpl> browser_view_;
};

View File

@@ -8,6 +8,12 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#if BUILDFLAG(IS_MAC)
#include "libcef/browser/views/native_widget_mac.h"
#include "libcef/browser/views/view_util.h"
#include "ui/views/widget/native_widget_private.h"
#endif
void ChromeBrowserFrame::Init(BrowserView* browser_view,
std::unique_ptr<Browser> browser) {
DCHECK(browser_view);
@@ -21,6 +27,19 @@ void ChromeBrowserFrame::Init(BrowserView* browser_view,
// Initialize BrowserView state.
browser_view->InitBrowser(std::move(browser));
#if BUILDFLAG(IS_MAC)
// Initialize native window state.
if (auto native_window = view_util::GetNativeWindow(this)) {
if (auto* native_widget_private = views::internal::NativeWidgetPrivate::
GetNativeWidgetForNativeWindow(native_window)) {
auto* native_widget_mac =
static_cast<CefNativeWidgetMac*>(native_widget_private);
native_widget_mac->SetBrowserView(browser_view);
native_widget_mac->OnWindowInitialized();
}
}
#endif // BUILDFLAG(IS_MAC)
}
views::internal::RootView* ChromeBrowserFrame::CreateRootView() {

View File

@@ -39,6 +39,17 @@ bool CefDownloadItemImpl::IsCanceled() {
return const_value().GetState() == download::DownloadItem::CANCELLED;
}
bool CefDownloadItemImpl::IsInterrupted() {
CEF_VALUE_VERIFY_RETURN(false, false);
return const_value().GetState() == download::DownloadItem::INTERRUPTED;
}
cef_download_interrupt_reason_t CefDownloadItemImpl::GetInterruptReason() {
CEF_VALUE_VERIFY_RETURN(false, CEF_DOWNLOAD_INTERRUPT_REASON_NONE);
return static_cast<cef_download_interrupt_reason_t>(
const_value().GetLastReason());
}
int64 CefDownloadItemImpl::GetCurrentSpeed() {
CEF_VALUE_VERIFY_RETURN(false, 0);
return const_value().CurrentSpeed();

View File

@@ -27,6 +27,8 @@ class CefDownloadItemImpl
bool IsInProgress() override;
bool IsComplete() override;
bool IsCanceled() override;
bool IsInterrupted() override;
cef_download_interrupt_reason_t GetInterruptReason() override;
int64 GetCurrentSpeed() override;
int GetPercentComplete() override;
int64 GetTotalBytes() override;

View File

@@ -90,8 +90,9 @@ ExtensionFunction::ResponseAction TabsCreateFunction::Run() {
}
// Return data about the newly created tab.
return RespondNow(has_callback() ? OneArgument(base::Value(result->ToValue()))
: NoArguments());
return RespondNow(has_callback()
? WithArguments(base::Value(result->ToValue()))
: NoArguments());
}
BaseAPIFunction::BaseAPIFunction() : cef_details_(this) {}

View File

@@ -36,7 +36,6 @@
#include "extensions/browser/api/app_runtime/app_runtime_api.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/info_map.h"
#include "extensions/browser/notification_types.h"
#include "extensions/browser/null_app_sorting.h"
#include "extensions/browser/quota_service.h"
@@ -437,13 +436,6 @@ CefExtensionSystem::store_factory() {
return store_factory_;
}
InfoMap* CefExtensionSystem::info_map() {
if (!info_map_.get()) {
info_map_ = new InfoMap;
}
return info_map_.get();
}
QuotaService* CefExtensionSystem::quota_service() {
return quota_service_.get();
}
@@ -452,31 +444,6 @@ AppSorting* CefExtensionSystem::app_sorting() {
return app_sorting_.get();
}
// Implementation based on
// ExtensionSystemImpl::RegisterExtensionWithRequestContexts.
void CefExtensionSystem::RegisterExtensionWithRequestContexts(
const Extension* extension,
base::OnceClosure callback) {
// TODO(extensions): The |incognito_enabled| value should be set based on
// manifest settings.
content::GetIOThreadTaskRunner({})->PostTaskAndReply(
FROM_HERE,
base::BindOnce(&InfoMap::AddExtension, info_map(),
base::RetainedRef(extension), base::Time::Now(),
true, // incognito_enabled
false), // notifications_disabled
std::move(callback));
}
// Implementation based on
// ExtensionSystemImpl::UnregisterExtensionWithRequestContexts.
void CefExtensionSystem::UnregisterExtensionWithRequestContexts(
const std::string& extension_id) {
content::GetIOThreadTaskRunner({})->PostTask(
FROM_HERE,
base::BindOnce(&InfoMap::RemoveExtension, info_map(), extension_id));
}
const base::OneShotEvent& CefExtensionSystem::ready() const {
return ready_;
}
@@ -615,18 +582,11 @@ void CefExtensionSystem::UnloadExtension(const std::string& extension_id,
// This method can be called via PostTask, so the extension may have been
// unloaded by the time this runs.
if (!extension.get()) {
// In case the extension may have crashed/uninstalled. Allow the profile to
// clean up its RequestContexts.
UnregisterExtensionWithRequestContexts(extension_id);
return;
}
if (registry_->disabled_extensions().Contains(extension->id())) {
registry_->RemoveDisabled(extension->id());
// Make sure the profile cleans up its RequestContexts when an already
// disabled extension is unloaded (since they are also tracking the disabled
// extensions).
UnregisterExtensionWithRequestContexts(extension_id);
// Don't send the unloaded notification. It was sent when the extension
// was disabled.
} else {
@@ -638,18 +598,6 @@ void CefExtensionSystem::UnloadExtension(const std::string& extension_id,
// Implementation based on ExtensionService::NotifyExtensionLoaded.
void CefExtensionSystem::NotifyExtensionLoaded(const Extension* extension) {
// The URLRequestContexts need to be first to know that the extension
// was loaded, otherwise a race can arise where a renderer that is created
// for the extension may try to load an extension URL with an extension id
// that the request context doesn't yet know about. The profile is responsible
// for ensuring its URLRequestContexts appropriately discover the loaded
// extension.
RegisterExtensionWithRequestContexts(
extension,
base::BindOnce(
&CefExtensionSystem::OnExtensionRegisteredWithRequestContexts,
weak_ptr_factory_.GetWeakPtr(), base::WrapRefCounted(extension)));
// Tell renderers about the loaded extension.
renderer_helper_->OnExtensionLoaded(*extension);
@@ -690,14 +638,6 @@ void CefExtensionSystem::NotifyExtensionLoaded(const Extension* extension) {
}
}
void CefExtensionSystem::OnExtensionRegisteredWithRequestContexts(
scoped_refptr<const extensions::Extension> extension) {
registry_->AddReady(extension);
if (registry_->enabled_extensions().Contains(extension->id())) {
registry_->TriggerOnReady(extension.get());
}
}
// Implementation based on ExtensionService::NotifyExtensionUnloaded.
void CefExtensionSystem::NotifyExtensionUnloaded(
const Extension* extension,
@@ -718,8 +658,6 @@ void CefExtensionSystem::NotifyExtensionUnloaded(
// Tell renderers about the unloaded extension.
renderer_helper_->OnExtensionUnloaded(*extension);
UnregisterExtensionWithRequestContexts(extension->id());
}
} // namespace extensions

View File

@@ -94,14 +94,8 @@ class CefExtensionSystem : public ExtensionSystem {
StateStore* rules_store() override;
StateStore* dynamic_user_scripts_store() override;
scoped_refptr<value_store::ValueStoreFactory> store_factory() override;
InfoMap* info_map() override;
QuotaService* quota_service() override;
AppSorting* app_sorting() override;
void RegisterExtensionWithRequestContexts(
const Extension* extension,
base::OnceClosure callback) override;
void UnregisterExtensionWithRequestContexts(
const std::string& extension_id) override;
const base::OneShotEvent& ready() const override;
bool is_ready() const override;
ContentVerifier* content_verifier() override;
@@ -159,18 +153,10 @@ class CefExtensionSystem : public ExtensionSystem {
void NotifyExtensionUnloaded(const Extension* extension,
UnloadedExtensionReason reason);
// Completes extension loading after URLRequestContexts have been updated
// on the IO thread.
void OnExtensionRegisteredWithRequestContexts(
scoped_refptr<const extensions::Extension> extension);
content::BrowserContext* browser_context_; // Not owned.
bool initialized_;
// Data to be accessed on the IO thread. Must outlive process_manager_.
scoped_refptr<InfoMap> info_map_;
std::unique_ptr<ServiceWorkerManager> service_worker_manager_;
std::unique_ptr<QuotaService> quota_service_;
std::unique_ptr<AppSorting> app_sorting_;

View File

@@ -0,0 +1,102 @@
// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "libcef/browser/geometry_util.h"
#include <algorithm>
#include "ui/gfx/geometry/rect.h"
namespace {
constexpr int kMinWidth = 0;
constexpr int kMinHeight = 0;
// Makes sure that line segment lies entirely between min and max.
int clamp_segment_start(int start, int len, int min, int max) {
start = std::clamp(start, min, max);
const int end = start + len;
const int excess = end - max;
if (excess > 0) {
start = start - excess;
}
return start;
}
} // namespace
gfx::Rect MakeVisibleOnScreenRect(const gfx::Rect& rect,
const gfx::Rect& screen) {
const int width = std::clamp(rect.width(), kMinWidth, screen.width());
const int height = std::clamp(rect.height(), kMinHeight, screen.height());
const int right_border = screen.x() + screen.width();
const int x = clamp_segment_start(rect.x(), width, screen.x(), right_border);
const int bottom_border = screen.y() + screen.height();
const int y =
clamp_segment_start(rect.y(), height, screen.y(), bottom_border);
return gfx::Rect(x, y, width, height);
}
gfx::Rect SubtractOverlayFromBoundingBox(const gfx::Rect& bounds,
const gfx::Rect& overlay,
int max_distance) {
if (overlay.Contains(bounds)) {
// Early exit; |bounds| is completely inside |overlay|.
return bounds;
}
// Portion of |overlay| that is inside |bounds|.
auto overlap = overlay;
overlap.Intersect(bounds);
if (overlap.IsEmpty()) {
// Early exit; |bounds| and |overlay| don't intersect.
return bounds;
}
gfx::Insets insets;
if (overlap.width() >= overlap.height()) {
// Wide overlay; maybe inset |bounds| in the Y direction.
const int delta_top = overlap.y() - bounds.y();
const int delta_bottom =
bounds.y() + bounds.height() - overlap.y() - overlap.height();
// Inset from the closest side that meets |max_distance| requirements.
if (delta_top <= delta_bottom && delta_top <= max_distance) {
// Inset from the top.
insets.set_top(delta_top + overlap.height());
} else if (delta_bottom <= max_distance) {
// Inset from the bottom.
insets.set_bottom(delta_bottom + overlap.height());
}
} else {
// Tall overlay; maybe inset |bounds| in the X direction.
const int delta_left = overlap.x() - bounds.x();
const int delta_right =
bounds.x() + bounds.width() - overlap.x() - overlap.width();
// Inset from the closest side that meets |max_distance| requirements.
if (delta_left <= delta_right && delta_left <= max_distance) {
// Inset from the left.
insets.set_left(delta_left + overlap.width());
} else if (delta_right <= max_distance) {
// Inset from the right.
insets.set_right(delta_right + overlap.width());
}
}
if (insets.IsEmpty()) {
// |overlay| is too far inside |bounds| to trigger insets.
return bounds;
}
auto result = bounds;
result.Inset(insets);
return result;
}

View File

@@ -0,0 +1,29 @@
// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_GEOMETRY_UTIL_H_
#define CEF_LIBCEF_BROWSER_GEOMETRY_UTIL_H_
#pragma once
namespace gfx {
class Rect;
}
// Create a new rectangle from the input |rect| rectangle that is fully visible
// on provided |screen_rect| screen. The width and height of the resulting
// rectangle are clamped to the screen width and height respectively if they
// would overflow.
gfx::Rect MakeVisibleOnScreenRect(const gfx::Rect& rect,
const gfx::Rect& screen);
// Possibly subtract |overlay| from |bounds|. We only want to subtract overlays
// that are inside |bounds| and close to the edges, so |max_distance| is the
// maximum allowed distance between |overlay| and |bounds| extents in order to
// trigger the subtraction. Subtraction will occur from the closest edge. If
// distances are otherwise equal then top will be preferred followed by left.
gfx::Rect SubtractOverlayFromBoundingBox(const gfx::Rect& bounds,
const gfx::Rect& overlay,
int max_distance);
#endif // CEF_LIBCEF_BROWSER_GEOMETRY_UTIL_H_

View File

@@ -0,0 +1,352 @@
// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "cef/libcef/browser/geometry_util.h"
#include "tests/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/rect.h"
namespace {
constexpr int kScreenWidth = 1024;
constexpr int kScreenHeight = 768;
const gfx::Rect kMainScreen(0, 0, kScreenWidth, kScreenHeight);
const gfx::Rect kLeftScreen(-1024, 0, kScreenWidth, kScreenHeight);
#define EXPECT_RECT_EQ(rect1, rect2) \
EXPECT_EQ(rect1.x(), rect2.x()); \
EXPECT_EQ(rect1.y(), rect2.y()); \
EXPECT_EQ(rect1.width(), rect2.width()); \
EXPECT_EQ(rect1.height(), rect2.height())
} // namespace
TEST(GeometryUtil, MakeVisibleOnScreenRect_RectSizeIsBiggerThanScreen) {
const gfx::Rect rect{400, 500, 1500, 800};
auto result = MakeVisibleOnScreenRect(rect, kMainScreen);
EXPECT_EQ(result.x(), 0);
EXPECT_EQ(result.width(), kMainScreen.width());
EXPECT_EQ(result.y(), 0);
EXPECT_EQ(result.height(), kMainScreen.height());
}
TEST(GeometryUtil, MakeVisibleOnScreenRect_RightBorderIsOutsideTheScreen) {
const gfx::Rect rect{600, 400, 500, 300};
auto result = MakeVisibleOnScreenRect(rect, kMainScreen);
EXPECT_EQ(result.x(), 524);
EXPECT_EQ(result.width(), rect.width());
EXPECT_EQ(result.y(), rect.y());
EXPECT_EQ(result.height(), rect.height());
}
TEST(GeometryUtil, MakeVisibleOnScreenRect_LeftBorderIsOutsideTheScreen) {
const gfx::Rect rect{-400, 400, 500, 300};
auto result = MakeVisibleOnScreenRect(rect, kMainScreen);
EXPECT_EQ(result.x(), 0);
EXPECT_EQ(result.width(), rect.width());
EXPECT_EQ(result.y(), rect.y());
EXPECT_EQ(result.height(), rect.height());
}
TEST(GeometryUtil, MakeVisibleOnScreenRect_BottomBorderIsOutsideTheScreen) {
const gfx::Rect rect{600, 500, 300, 300};
auto result = MakeVisibleOnScreenRect(rect, kMainScreen);
EXPECT_EQ(result.x(), 600);
EXPECT_EQ(result.width(), rect.width());
EXPECT_EQ(result.y(), 468);
EXPECT_EQ(result.height(), rect.height());
}
TEST(GeometryUtil, MakeVisibleOnScreenRect_RectIsVisibleOnTheLeftScreen) {
const gfx::Rect rect{-500, 300, 300, 300};
auto result = MakeVisibleOnScreenRect(rect, kLeftScreen);
EXPECT_RECT_EQ(result, rect);
}
TEST(GeometryUtil, MakeVisibleOnScreenRect_RectSizeIsBiggerThanLeftScreen) {
const gfx::Rect rect{-500, 300, 3000, 3000};
auto result = MakeVisibleOnScreenRect(rect, kLeftScreen);
EXPECT_RECT_EQ(result, kLeftScreen);
}
TEST(GeometryUtil, SubtractOverlayFromBoundingBox_Square_NoIntersect_NoInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{0, 0, 10, 10};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 10);
EXPECT_RECT_EQ(bounds, result);
}
TEST(GeometryUtil, SubtractOverlayFromBoundingBox_Square_Contains_NoInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{5, 5, 85, 85};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 10);
EXPECT_RECT_EQ(bounds, result);
}
TEST(GeometryUtil, SubtractOverlayFromBoundingBox_Square_AllClose_TopInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{12, 12, 76, 76};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
// When all sides are close, inset from the top.
const gfx::Rect expected_bounds{10, 88, 80, 2};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_Square_TopAndLeftClose_TopInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{12, 12, 30, 30};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
// When top and left sides are close, inset from the top.
const gfx::Rect expected_bounds{10, 42, 80, 48};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_Square_TopAndRightClose_TopInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{58, 12, 30, 30};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
// When top and right sides are close, inset from the top.
const gfx::Rect expected_bounds{10, 42, 80, 48};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_Square_BottomAndLeftClose_BottomInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{12, 58, 30, 30};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
// When bottom and left sides are close, inset from the botom.
const gfx::Rect expected_bounds{10, 10, 80, 48};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_Square_BottomAndRightClose_BottomInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{58, 58, 30, 30};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
// When bottom and right sides are close, inset from the botom.
const gfx::Rect expected_bounds{10, 10, 80, 48};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_WideRect_TopAndLeftExact_TopInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{10, 10, 10, 5};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 0);
const gfx::Rect expected_bounds{10, 15, 80, 75};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_WideRect_TopIntersectLeftExact_TopInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{10, 7, 10, 5};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
const gfx::Rect expected_bounds{10, 12, 80, 78};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_WideRect_TopInsideLeftExact_TopInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{10, 12, 10, 5};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
const gfx::Rect expected_bounds{10, 17, 80, 73};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_WideRect_TopTooFarInsideLeftExact_NoInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{10, 16, 10, 5};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
EXPECT_RECT_EQ(bounds, result);
}
TEST(GeometryUtil, SubtractOverlayFromBoundingBox_WideRect_Oversized_TopInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{5, 5, 85, 10};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 10);
const gfx::Rect expected_bounds{10, 15, 80, 75};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_WideRect_BottomAndLeftExact_BottomInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{10, 85, 10, 5};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 0);
const gfx::Rect expected_bounds{10, 10, 80, 75};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(
GeometryUtil,
SubtractOverlayFromBoundingBox_WideRect_BottomInsideLeftExact_BottomInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{10, 83, 10, 5};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
const gfx::Rect expected_bounds{10, 10, 80, 73};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(
GeometryUtil,
SubtractOverlayFromBoundingBox_WideRect_BottomIntersectLeftExact_BottomInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{10, 87, 10, 5};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
const gfx::Rect expected_bounds{10, 10, 80, 77};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(
GeometryUtil,
SubtractOverlayFromBoundingBox_WideRect_BottomTooFarInsideLeftExact_NoInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{10, 77, 10, 5};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
EXPECT_RECT_EQ(bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_WideRect_Oversized_BottomInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{5, 85, 85, 10};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 10);
const gfx::Rect expected_bounds{10, 10, 80, 75};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_TallRect_TopAndLeftExact_LeftInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{10, 10, 5, 10};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 0);
const gfx::Rect expected_bounds{15, 10, 75, 80};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_TallRect_TopExactLeftIntersect_LeftInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{7, 10, 5, 10};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
const gfx::Rect expected_bounds{12, 10, 78, 80};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_TallRect_TopExactLeftInside_LeftInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{12, 10, 5, 10};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
const gfx::Rect expected_bounds{17, 10, 73, 80};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_TallRect_TopExactLeftTooFarInside_NoInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{16, 10, 5, 10};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
EXPECT_RECT_EQ(bounds, result);
}
TEST(GeometryUtil, SubtractOverlayFromBoundingBox_TallRect_Oversize_LeftInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{5, 5, 10, 85};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 10);
const gfx::Rect expected_bounds{15, 10, 75, 80};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_TallRect_TopAndRightExact_RightInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{85, 10, 5, 10};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 0);
const gfx::Rect expected_bounds{10, 10, 75, 80};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_TallRect_TopExactRightInside_RightInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{83, 10, 5, 10};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
const gfx::Rect expected_bounds{10, 10, 73, 80};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(
GeometryUtil,
SubtractOverlayFromBoundingBox_TallRect_TopExactRightIntersect_RightInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{87, 10, 5, 10};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
const gfx::Rect expected_bounds{10, 10, 77, 80};
EXPECT_RECT_EQ(expected_bounds, result);
}
TEST(
GeometryUtil,
SubtractOverlayFromBoundingBox_TallRect_TopExactRightTooFarInside_NoInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{77, 10, 5, 10};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 5);
EXPECT_RECT_EQ(bounds, result);
}
TEST(GeometryUtil,
SubtractOverlayFromBoundingBox_TallRect_Oversize_RightInset) {
const gfx::Rect bounds{10, 10, 80, 80};
const gfx::Rect overlay{85, 5, 10, 85};
auto result = SubtractOverlayFromBoundingBox(bounds, overlay, 10);
const gfx::Rect expected_bounds{10, 10, 75, 80};
EXPECT_RECT_EQ(expected_bounds, result);
}

View File

@@ -23,7 +23,6 @@
#include "third_party/blink/public/common/input/web_input_event.h"
#include "third_party/blink/public/common/input/web_mouse_event.h"
#include "third_party/blink/public/common/input/web_mouse_wheel_event.h"
#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
#include "ui/display/screen.h"
#include "ui/events/base_event_utils.h"
#include "ui/events/keycodes/keyboard_codes_posix.h"
@@ -280,11 +279,10 @@ bool CefBrowserPlatformDelegateNativeMac::CreateHostWindow() {
kDefaultStyleMask, frame_rect, content_rect);
// Create a new window.
new_window = [[UnderlayOpenGLHostingWindow alloc]
initWithContentRect:content_rect
styleMask:kDefaultStyleMask
backing:NSBackingStoreBuffered
defer:NO];
new_window = [[NSWindow alloc] initWithContentRect:content_rect
styleMask:kDefaultStyleMask
backing:NSBackingStoreBuffered
defer:NO];
// Create the delegate for control and browser window events.
[[CefWindowDelegate alloc] initWithWindow:new_window andBrowser:browser_];

View File

@@ -10,8 +10,8 @@
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/context.h"
#include "libcef/browser/geometry_util.h"
#include "libcef/browser/native/window_delegate_view.h"
#include "libcef/browser/screen_util.h"
#include "libcef/browser/thread_util.h"
#include "base/base_paths_win.h"

View File

@@ -10,7 +10,9 @@
#include "content/public/browser/render_widget_host_view.h"
#include "ui/base/cursor/cursor_factory.h"
#include "ui/base/cursor/mojom/cursor_type.mojom.h"
#include "ui/display/display.h"
#include "ui/display/display_util.h"
#include "ui/display/screen.h"
#include "ui/wm/core/cursor_loader.h"
#if BUILDFLAG(IS_LINUX)
@@ -30,28 +32,6 @@ namespace cursor_util {
namespace {
display::ScreenInfo GetScreenInfo(CefRefPtr<CefBrowser> browser) {
display::ScreenInfo screen_info;
bool screen_info_set = false;
if (auto web_contents =
static_cast<CefBrowserHostBase*>(browser.get())->GetWebContents()) {
if (auto view = web_contents->GetRenderWidgetHostView()) {
const auto screen_infos = view->GetScreenInfos();
if (!screen_infos.screen_infos.empty()) {
screen_info = screen_infos.current();
screen_info_set = true;
}
}
}
if (!screen_info_set) {
display::DisplayUtil::GetDefaultScreenInfo(&screen_info);
}
return screen_info;
}
display::Display::Rotation OrientationAngleToRotation(
uint16_t orientation_angle) {
// The Display rotation and the ScreenInfo orientation are not the same
@@ -74,6 +54,31 @@ display::Display::Rotation OrientationAngleToRotation(
return display::Display::ROTATE_0;
}
// It would be better if CursorLoader took a ScreenInfo argument.
// See https://crbug.com/1149906#c33.
display::Display GetDisplay(CefRefPtr<CefBrowser> browser) {
if (auto web_contents =
static_cast<CefBrowserHostBase*>(browser.get())->GetWebContents()) {
if (auto view = web_contents->GetRenderWidgetHostView()) {
// Windowless browsers always return nullptr from GetNativeView().
if (auto native_view = view->GetNativeView()) {
return display::Screen::GetScreen()->GetDisplayNearestView(native_view);
}
// Make a minimal-effort fake Display object to satisfy the actual usage
// by CursorLoader::SetDisplay.
display::Display fake_display;
auto screen_info = view->GetScreenInfo();
fake_display.set_device_scale_factor(screen_info.device_scale_factor);
fake_display.set_rotation(
OrientationAngleToRotation(screen_info.orientation_angle));
return fake_display;
}
}
return display::Display::GetDefaultDisplay();
}
scoped_refptr<ui::PlatformCursor> ToPlatformCursor(
CefRefPtr<CefBrowser> browser,
const ui::Cursor& ui_cursor) {
@@ -87,10 +92,7 @@ scoped_refptr<ui::PlatformCursor> ToPlatformCursor(
ui::mojom::CursorType::kCustom, ui_cursor.custom_bitmap(),
ui_cursor.custom_hotspot());
} else {
const auto& screen_info = GetScreenInfo(browser);
cursor_loader.SetDisplayData(
OrientationAngleToRotation(screen_info.orientation_angle),
screen_info.device_scale_factor);
cursor_loader.SetDisplay(GetDisplay(browser));
// Attempts to load the cursor via the platform or from pak resources.
cursor_loader.SetPlatformCursor(&loaded_cursor);

View File

@@ -127,6 +127,7 @@ CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostBase> browser,
/*visual_has_alpha=*/nullptr);
xwindow_ = connection_->GenerateId<x11::Window>();
connection_->CreateWindow({
.depth = depth,
.wid = xwindow_,
@@ -140,12 +141,15 @@ CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostBase> browser,
.background_pixel = 0,
.border_pixel = 0,
.override_redirect = x11::Bool32(false),
.event_mask = x11::EventMask::FocusChange |
x11::EventMask::StructureNotify |
x11::EventMask::PropertyChange,
.colormap = colormap,
});
auto event_mask = x11::EventMask::FocusChange |
x11::EventMask::StructureNotify |
x11::EventMask::PropertyChange;
xwindow_events_ =
std::make_unique<x11::XScopedEventSelector>(xwindow_, event_mask);
connection_->Flush();
DCHECK(ui::X11EventSource::HasInstance());
@@ -384,7 +388,7 @@ bool CefWindowX11::TopLevelAlwaysOnTop() const {
void CefWindowX11::ProcessXEvent(const x11::Event& event) {
if (auto* configure = event.As<x11::ConfigureNotifyEvent>()) {
DCHECK_EQ(xwindow_, configure->event);
DCHECK_EQ(xwindow_, configure->window);
// It's possible that the X window may be resized by some other means
// than from within Aura (e.g. the X window manager can change the
// size). Make sure the root window size is maintained properly.

View File

@@ -10,13 +10,13 @@
#include "base/files/file_util.h"
#include "base/logging.h"
#include "content/public/browser/network_service_instance.h"
#include "services/network/network_service.h"
#include "services/cert_verifier/public/mojom/cert_verifier_service_factory.mojom.h"
namespace {
void UpdateCRLSet(const std::string& crl_set_bytes) {
CEF_REQUIRE_UIT();
content::GetNetworkService()->UpdateCRLSet(
content::GetCertVerifierServiceFactory()->UpdateCRLSet(
base::as_bytes(base::make_span(crl_set_bytes)), base::DoNothing());
}

View File

@@ -1106,7 +1106,8 @@ void InterceptedRequest::OnURLLoaderClientError() {
void InterceptedRequest::OnURLLoaderError(uint32_t custom_reason,
const std::string& description) {
if (custom_reason == network::mojom::URLLoader::kClientDisconnectReason) {
if (custom_reason == network::mojom::URLLoader::kClientDisconnectReason &&
description == safe_browsing::kCustomCancelReasonForURLLoader) {
SendErrorCallback(safe_browsing::kNetErrorCodeForSafeBrowsing, true);
}

View File

@@ -515,7 +515,6 @@ void CefRenderWidgetHostViewOSR::TakeFallbackContentFrom(
delegated_frame_host_->TakeFallbackContentFrom(
view_cef->delegated_frame_host_.get());
}
host()->GetContentRenderingTimeoutFrom(view_cef->host());
}
void CefRenderWidgetHostViewOSR::OnPresentCompositorFrame() {}

View File

@@ -47,6 +47,7 @@
#include "components/language/core/browser/language_prefs.h"
#include "components/language/core/browser/pref_names.h"
#include "components/permissions/permission_actions_history.h"
#include "components/permissions/permission_hats_trigger_helper.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/json_pref_store.h"
@@ -61,6 +62,7 @@
#include "components/spellcheck/browser/pref_names.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"
#include "components/update_client/update_client.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/extension_prefs.h"
@@ -75,8 +77,8 @@
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
#include "chrome/browser/profiles/profile_key.h"
#include "chrome/browser/supervised_user/supervised_user_pref_store.h"
#include "chrome/browser/supervised_user/supervised_user_settings_service_factory.h"
#include "components/supervised_user/core/browser/supervised_user_pref_store.h"
#include "components/supervised_user/core/browser/supervised_user_settings_service.h"
#endif
@@ -270,10 +272,13 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
MediaDeviceIDSalt::RegisterProfilePrefs(registry.get());
PermissionBubbleMediaAccessHandler::RegisterProfilePrefs(registry.get());
permissions::PermissionActionsHistory::RegisterProfilePrefs(registry.get());
permissions::PermissionHatsTriggerHelper::RegisterProfilePrefs(
registry.get());
prefetch::RegisterPredictionOptionsProfilePrefs(registry.get());
privacy_sandbox::RegisterProfilePrefs(registry.get());
ProfileNetworkContextService::RegisterProfilePrefs(registry.get());
safe_browsing::RegisterProfilePrefs(registry.get());
unified_consent::UnifiedConsentService::RegisterPrefs(registry.get());
const std::string& locale =
command_line->GetSwitchValueASCII(switches::kLang);

View File

@@ -1,44 +0,0 @@
// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "libcef/browser/screen_util.h"
#include <algorithm>
#include "ui/gfx/geometry/rect.h"
namespace {
constexpr int kMinWidth = 0;
constexpr int kMinHeight = 0;
// Makes sure that line segment lies entirely between min and max.
int clamp_segment_start(int start, int len, int min, int max) {
start = std::clamp(start, min, max);
const int end = start + len;
const int excess = end - max;
if (excess > 0) {
start = start - excess;
}
return start;
}
} // namespace
gfx::Rect MakeVisibleOnScreenRect(const gfx::Rect& rect,
const gfx::Rect& screen) {
const int width = std::clamp(rect.width(), kMinWidth, screen.width());
const int height = std::clamp(rect.height(), kMinHeight, screen.height());
const int right_border = screen.x() + screen.width();
const int x = clamp_segment_start(rect.x(), width, screen.x(), right_border);
const int bottom_border = screen.y() + screen.height();
const int y =
clamp_segment_start(rect.y(), height, screen.y(), bottom_border);
return gfx::Rect(x, y, width, height);
}

View File

@@ -1,20 +0,0 @@
// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_SCREEN_UTIL_H_
#define CEF_LIBCEF_BROWSER_SCREEN_UTIL_H_
#pragma once
namespace gfx {
class Rect;
}
// Create a new rectangle from the input |rect| rectangle that is fully visible
// on provided |screen_rect| screen. The width and height of the resulting
// rectangle are clamped to the screen width and height respectively if they
// would overflow.
gfx::Rect MakeVisibleOnScreenRect(const gfx::Rect& rect,
const gfx::Rect& screen);
#endif // CEF_LIBCEF_BROWSER_SCREEN_UTIL_H_

View File

@@ -1,83 +0,0 @@
// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "cef/libcef/browser/screen_util.h"
#include "tests/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/rect.h"
namespace {
constexpr int kScreenWidth = 1024;
constexpr int kScreenHeight = 768;
const gfx::Rect kMainScreen(0, 0, kScreenWidth, kScreenHeight);
const gfx::Rect kLeftScreen(-1024, 0, kScreenWidth, kScreenHeight);
} // namespace
TEST(MakeVisibleOnScreenRect, RectSizeIsBiggerThanScreen) {
const gfx::Rect rect{400, 500, 1500, 800};
auto result = MakeVisibleOnScreenRect(rect, kMainScreen);
EXPECT_EQ(result.x(), 0);
EXPECT_EQ(result.width(), kMainScreen.width());
EXPECT_EQ(result.y(), 0);
EXPECT_EQ(result.height(), kMainScreen.height());
}
TEST(MakeVisibleOnScreenRect, RightBorderIsOutsideTheScreen) {
const gfx::Rect rect{600, 400, 500, 300};
auto result = MakeVisibleOnScreenRect(rect, kMainScreen);
EXPECT_EQ(result.x(), 524);
EXPECT_EQ(result.width(), rect.width());
EXPECT_EQ(result.y(), rect.y());
EXPECT_EQ(result.height(), rect.height());
}
TEST(MakeVisibleOnScreenRect, LeftBorderIsOutsideTheScreen) {
const gfx::Rect rect{-400, 400, 500, 300};
auto result = MakeVisibleOnScreenRect(rect, kMainScreen);
EXPECT_EQ(result.x(), 0);
EXPECT_EQ(result.width(), rect.width());
EXPECT_EQ(result.y(), rect.y());
EXPECT_EQ(result.height(), rect.height());
}
TEST(MakeVisibleOnScreenRect, BottomBorderIsOutsideTheScreen) {
const gfx::Rect rect{600, 500, 300, 300};
auto result = MakeVisibleOnScreenRect(rect, kMainScreen);
EXPECT_EQ(result.x(), 600);
EXPECT_EQ(result.width(), rect.width());
EXPECT_EQ(result.y(), 468);
EXPECT_EQ(result.height(), rect.height());
}
TEST(MakeVisibleOnScreenRect, RectIsVisibleOnTheLeftScreen) {
const gfx::Rect rect{-500, 300, 300, 300};
auto result = MakeVisibleOnScreenRect(rect, kLeftScreen);
EXPECT_EQ(result.x(), rect.x());
EXPECT_EQ(result.width(), rect.width());
EXPECT_EQ(result.y(), rect.y());
EXPECT_EQ(result.height(), rect.height());
}
TEST(MakeVisibleOnScreenRect, RectSizeIsBiggerThanLeftScreen) {
const gfx::Rect rect{-500, 300, 3000, 3000};
auto result = MakeVisibleOnScreenRect(rect, kLeftScreen);
EXPECT_EQ(result.x(), kLeftScreen.x());
EXPECT_EQ(result.width(), kLeftScreen.width());
EXPECT_EQ(result.y(), kLeftScreen.y());
EXPECT_EQ(result.height(), kLeftScreen.height());
}

View File

@@ -69,6 +69,21 @@ bool CefSSLHostStateDelegate::IsHttpAllowedForHost(
return false;
}
void CefSSLHostStateDelegate::SetHttpsEnforcementForHost(
const std::string& host,
bool enforce,
content::StoragePartition* storage_partition) {
// Intentional no-op.
}
bool CefSSLHostStateDelegate::IsHttpsEnforcedForHost(
const std::string& host,
content::StoragePartition* storage_partition) {
// Intentional no-op. Return value does not matter as HTTPS-First Mode is not
// enabled.
return false;
}
void CefSSLHostStateDelegate::AllowCert(
const std::string& host,
const net::X509Certificate& cert,

View File

@@ -73,6 +73,13 @@ class CefSSLHostStateDelegate : public content::SSLHostStateDelegate {
bool IsHttpAllowedForHost(
const std::string& host,
content::StoragePartition* storage_partition) override;
void SetHttpsEnforcementForHost(
const std::string& host,
bool enforce,
content::StoragePartition* storage_partition) override;
bool IsHttpsEnforcedForHost(
const std::string& host,
content::StoragePartition* storage_partition) override;
void RevokeUserAllowExceptions(const std::string& host) override;
bool HasAllowException(const std::string& host,
content::StoragePartition* storage_partition) override;

View File

@@ -10,6 +10,7 @@
#include "ui/views/widget/native_widget_mac.h"
class BrowserView;
class CefWindow;
class CefWindowDelegate;
@@ -23,19 +24,31 @@ class CefNativeWidgetMac : public views::NativeWidgetMac {
CefNativeWidgetMac(const CefNativeWidgetMac&) = delete;
CefNativeWidgetMac& operator=(const CefNativeWidgetMac&) = delete;
protected:
void SetBrowserView(BrowserView* browser_view);
// NativeWidgetMac:
void ValidateUserInterfaceItem(
int32_t command,
remote_cocoa::mojom::ValidateUserInterfaceItemResult* result) override;
bool WillExecuteCommand(int32_t command,
WindowOpenDisposition window_open_disposition,
bool is_before_first_responder) override;
bool ExecuteCommand(int32_t command,
WindowOpenDisposition window_open_disposition,
bool is_before_first_responder) override;
NativeWidgetMacNSWindow* CreateNSWindow(
const remote_cocoa::mojom::CreateWindowParams* params) override;
void GetWindowFrameTitlebarHeight(bool* override_titlebar_height,
float* titlebar_height) override;
void OnWindowFullscreenTransitionStart() override;
void OnWindowFullscreenTransitionComplete() override;
void OnWindowInitialized() override;
private:
const CefRefPtr<CefWindow> window_;
CefWindowDelegate* const window_delegate_;
BrowserView* browser_view_ = nullptr;
};
#endif // CEF_LIBCEF_BROWSER_VIEWS_NATIVE_WIDGET_MAC_H_

View File

@@ -8,6 +8,27 @@
#include "include/views/cef_window_delegate.h"
#include "libcef/browser/views/ns_window.h"
#include "chrome/browser/apps/app_shim/app_shim_host_mac.h"
#include "chrome/browser/apps/app_shim/app_shim_manager_mac.h"
#import "chrome/browser/ui/cocoa/browser_window_command_handler.h"
#import "chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h"
#include "chrome/browser/ui/views/frame/browser_frame_mac.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#import "components/remote_cocoa/app_shim/native_widget_ns_window_bridge.h"
#import "ui/views/cocoa/native_widget_mac_ns_window_host.h"
namespace {
AppShimHost* GetHostForBrowser(Browser* browser) {
auto* const shim_manager = apps::AppShimManager::Get();
if (!shim_manager) {
return nullptr;
}
return shim_manager->GetHostForRemoteCocoaBrowser(browser);
}
} // namespace
CefNativeWidgetMac::CefNativeWidgetMac(
views::internal::NativeWidgetDelegate* delegate,
CefRefPtr<CefWindow> window,
@@ -16,6 +37,48 @@ CefNativeWidgetMac::CefNativeWidgetMac(
window_(window),
window_delegate_(window_delegate) {}
void CefNativeWidgetMac::SetBrowserView(BrowserView* browser_view) {
browser_view_ = browser_view;
}
void CefNativeWidgetMac::ValidateUserInterfaceItem(
int32_t tag,
remote_cocoa::mojom::ValidateUserInterfaceItemResult* result) {
if (!browser_view_) {
result->enable = false;
return;
}
return BrowserFrameMac::ValidateUserInterfaceItem(browser_view_->browser(),
tag, result);
}
bool CefNativeWidgetMac::WillExecuteCommand(
int32_t command,
WindowOpenDisposition window_open_disposition,
bool is_before_first_responder) {
if (!browser_view_) {
return false;
}
return BrowserFrameMac::WillExecuteCommand(browser_view_->browser(), command,
window_open_disposition,
is_before_first_responder);
}
bool CefNativeWidgetMac::ExecuteCommand(
int32_t command,
WindowOpenDisposition window_open_disposition,
bool is_before_first_responder) {
if (!browser_view_) {
return false;
}
return BrowserFrameMac::ExecuteCommand(browser_view_->browser(), command,
window_open_disposition,
is_before_first_responder);
}
NativeWidgetMacNSWindow* CefNativeWidgetMac::CreateNSWindow(
const remote_cocoa::mojom::CreateWindowParams* params) {
NSUInteger style_mask =
@@ -62,3 +125,21 @@ void CefNativeWidgetMac::OnWindowFullscreenTransitionComplete() {
views::NativeWidgetMac::OnWindowFullscreenTransitionComplete();
window_delegate_->OnWindowFullscreenTransition(window_, true);
}
void CefNativeWidgetMac::OnWindowInitialized() {
if (!browser_view_) {
return;
}
// From BrowserFrameMac::OnWindowInitialized.
if (auto* bridge = GetInProcessNSWindowBridge()) {
bridge->SetCommandDispatcher(
[[[ChromeCommandDispatcherDelegate alloc] init] autorelease],
[[[BrowserWindowCommandHandler alloc] init] autorelease]);
} else {
if (auto* host = GetHostForBrowser(browser_view_->browser())) {
host->GetAppShim()->CreateCommandDispatcherForWidget(
GetNSWindowHost()->bridged_native_widget_id());
}
}
}

View File

@@ -14,11 +14,6 @@
#include "ui/compositor/compositor.h"
#include "ui/compositor/layer.h"
#if defined(USE_AURA)
#include "ui/aura/window.h"
#include "ui/views/view_constants_aura.h"
#endif
namespace {
class CefOverlayControllerImpl : public CefOverlayController {
@@ -172,8 +167,7 @@ CefOverlayViewHost::CefOverlayViewHost(CefWindowView* window_view,
cef_docking_mode_t docking_mode)
: window_view_(window_view), docking_mode_(docking_mode) {}
void CefOverlayViewHost::Init(views::View* widget_view,
CefRefPtr<CefView> view) {
void CefOverlayViewHost::Init(views::View* host_view, CefRefPtr<CefView> view) {
DCHECK(view);
// Match the logic in CEF_PANEL_IMPL_D::AddChildView().
@@ -202,10 +196,7 @@ void CefOverlayViewHost::Init(views::View* widget_view,
widget_->GetCompositor()->SetBackgroundColor(SK_ColorTRANSPARENT);
}
#if defined(USE_AURA)
// See matching logic in view_util::GetWindowFor.
widget_->GetNativeView()->SetProperty(views::kHostViewKey, widget_view);
#endif
view_util::SetHostView(widget_.get(), host_view);
if (cef::IsChromeRuntimeEnabled()) {
// Some attributes associated with a Chrome toolbar are located via the

View File

@@ -29,9 +29,9 @@ class CefOverlayViewHost : public views::WidgetDelegate,
CefOverlayViewHost& operator=(const CefOverlayViewHost&) = delete;
// Initializes the CefOverlayViewHost. This creates the Widget that |view|
// paints into. |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.
// 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 Destroy();

View File

@@ -20,11 +20,6 @@
#include "ui/display/win/screen_win.h"
#endif
#if defined(USE_AURA)
#include "ui/aura/window.h"
#include "ui/views/view_constants_aura.h"
#endif
namespace view_util {
namespace {
@@ -169,17 +164,12 @@ void ResumeOwnership(CefRefPtr<CefView> view) {
CefRefPtr<CefWindow> GetWindowFor(views::Widget* widget) {
CefRefPtr<CefWindow> window;
#if defined(USE_AURA)
// Retrieve the parent Widget for an overlay.
// If |widget| is an overlay, retrieve the host Widget.
if (widget) {
// See matching logic in CefOverlayViewHost::Init.
auto widget_view =
widget->GetNativeView()->GetProperty(views::kHostViewKey);
if (widget_view) {
if (auto widget_view = GetHostView(widget)) {
widget = widget_view->GetWidget();
}
}
#endif // defined(USE_AURA)
if (widget) {
// The views::WidgetDelegate should be a CefWindowView and |content_view|

View File

@@ -22,6 +22,7 @@ class Point;
namespace views {
class NativeWidget;
class View;
class Widget;
namespace internal {
class NativeWidgetDelegate;
@@ -152,6 +153,18 @@ views::NativeWidget* CreateNativeWidget(
CefRefPtr<CefWindow> window,
CefWindowDelegate* window_delegate);
// Called from CefOverlayViewHost::Init to associate |host_view| with |widget|.
// This is necessary for GetWindowFor() to correctly return the CefWindow
// associated with the host Widget. On Aura platforms, |host_view| is the view
// whose position in the view hierarchy determines the z-order of the widget
// relative to views with layers and views with associated NativeViews.
void SetHostView(views::Widget* widget, views::View* host_view);
views::View* GetHostView(views::Widget* widget);
#if BUILDFLAG(IS_MAC)
float GetNSWindowTitleBarHeight(views::Widget* widget);
#endif
} // namespace view_util
#endif // CEF_LIBCEF_BROWSER_VIEWS_VIEW_UTIL_H_

View File

@@ -6,6 +6,7 @@
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
#include "ui/views/view_constants_aura.h"
#include "ui/views/widget/native_widget.h"
#include "ui/views/widget/native_widget_delegate.h"
#include "ui/views/widget/widget.h"
@@ -49,4 +50,12 @@ views::NativeWidget* CreateNativeWidget(
return nullptr;
}
void SetHostView(views::Widget* widget, views::View* host_view) {
widget->GetNativeView()->SetProperty(views::kHostViewKey, host_view);
}
views::View* GetHostView(views::Widget* widget) {
return widget->GetNativeView()->GetProperty(views::kHostViewKey);
}
} // namespace view_util

View File

@@ -13,6 +13,15 @@
namespace view_util {
namespace {
constexpr char kNativeHostViewKey[] = "CefNativeHostViewKey";
// For Venura 13.3.1.
constexpr float kDefaultTitleBarHeight = 30;
} // namespace
gfx::NativeWindow GetNativeWindow(views::Widget* widget) {
if (widget) {
return widget->GetNativeWindow();
@@ -51,4 +60,23 @@ views::NativeWidget* CreateNativeWidget(
CefWindowDelegate* window_delegate) {
return new CefNativeWidgetMac(delegate, window, window_delegate);
}
void SetHostView(views::Widget* widget, views::View* host_view) {
widget->SetNativeWindowProperty(kNativeHostViewKey, host_view);
}
views::View* GetHostView(views::Widget* widget) {
return static_cast<views::View*>(
widget->GetNativeWindowProperty(kNativeHostViewKey));
}
float GetNSWindowTitleBarHeight(views::Widget* widget) {
if (auto window = GetNativeWindow(widget)) {
NSWindow* nswindow = window.GetNativeNSWindow();
return nswindow.frame.size.height -
[nswindow contentRectForFrameRect:nswindow.frame].size.height;
}
return kDefaultTitleBarHeight;
}
} // namespace view_util

View File

@@ -5,6 +5,7 @@
#include "libcef/browser/views/window_view.h"
#include "libcef/browser/chrome/views/chrome_browser_frame.h"
#include "libcef/browser/geometry_util.h"
#include "libcef/browser/image_impl.h"
#include "libcef/browser/views/window_impl.h"
#include "libcef/features/runtime.h"
@@ -638,6 +639,7 @@ void CefWindowView::SetDraggableRegions(
if (draggable_region_) {
draggable_region_.reset(nullptr);
}
draggable_rects_.clear();
return;
}
@@ -648,6 +650,11 @@ void CefWindowView::SetDraggableRegions(
region.bounds.x + region.bounds.width,
region.bounds.y + region.bounds.height},
region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
if (region.draggable) {
draggable_rects_.push_back({region.bounds.x, region.bounds.y,
region.bounds.width, region.bounds.height});
}
}
}
@@ -661,3 +668,60 @@ views::NonClientFrameView* CefWindowView::GetNonClientFrameView() const {
}
return widget->non_client_view()->frame_view();
}
void CefWindowView::UpdateFindBarBoundingBox(gfx::Rect* bounds) const {
// Max distance from the edges of |bounds| to qualify for subtraction.
const int kMaxDistance = 10;
for (auto& overlay_host : overlay_hosts_) {
*bounds = SubtractOverlayFromBoundingBox(*bounds, overlay_host->bounds(),
kMaxDistance);
}
for (auto& rect : draggable_rects_) {
*bounds = SubtractOverlayFromBoundingBox(*bounds, rect, kMaxDistance);
}
if (auto titlebar_height = GetTitlebarHeight()) {
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) {
inset.set_top(*titlebar_height - bounds->y());
}
if (!inset.IsEmpty()) {
bounds->Inset(inset);
}
}
}
absl::optional<float> CefWindowView::GetTitlebarHeight() const {
if (cef_delegate()) {
float title_bar_height = 0;
const bool has_title_bar_height =
cef_delegate()->GetTitlebarHeight(GetCefWindow(), &title_bar_height);
if (has_title_bar_height) {
return title_bar_height;
}
}
#if BUILDFLAG(IS_MAC)
if (!is_frameless_) {
// For framed windows on macOS we must include the titlebar height in the
// UpdateFindBarBoundingBox() calculation.
return view_util::GetNSWindowTitleBarHeight(
const_cast<views::Widget*>(GetWidget()));
}
#endif
return absl::nullopt;
}

View File

@@ -113,12 +113,17 @@ class CefWindowView
// 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;
private:
// Called when removed from the Widget and before |this| is deleted.
void DeleteDelegate();
void MoveOverlaysIfNecessary();
absl::optional<float> GetTitlebarHeight() const;
// Not owned by this object.
Delegate* window_delegate_;
@@ -130,6 +135,7 @@ class CefWindowView
CefRefPtr<CefImage> window_app_icon_;
std::unique_ptr<SkRegion> draggable_region_;
std::vector<gfx::Rect> draggable_rects_;
// Hosts for overlay widgets.
std::vector<std::unique_ptr<CefOverlayViewHost>> overlay_hosts_;

View File

@@ -13,7 +13,7 @@ using StringList = std::vector<CefString>;
} // namespace
CEF_EXPORT cef_string_list_t cef_string_list_alloc() {
return new StringList;
return reinterpret_cast<cef_string_list_t>(new StringList);
}
CEF_EXPORT size_t cef_string_list_size(cef_string_list_t list) {
@@ -58,5 +58,5 @@ CEF_EXPORT void cef_string_list_free(cef_string_list_t list) {
CEF_EXPORT cef_string_list_t cef_string_list_copy(cef_string_list_t list) {
DCHECK(list);
StringList* impl = reinterpret_cast<StringList*>(list);
return new StringList(*impl);
return reinterpret_cast<cef_string_list_t>(new StringList(*impl));
}

View File

@@ -3,17 +3,48 @@
// can be found in the LICENSE file.
#include <map>
#include <vector>
#include "include/internal/cef_string_map.h"
#include "base/logging.h"
namespace {
using StringMap = std::map<CefString, CefString>;
class StringMap {
using Map = std::map<CefString, CefString>;
using value_type = Map::value_type;
public:
using const_iterator = Map::const_iterator;
size_t size() const { return map_ref_.size(); }
size_t count(const CefString& key) const { return map_.count(key); }
const_iterator find(const CefString& value) const { return map_.find(value); }
const_iterator cend() const { return map_.cend(); }
const value_type& operator[](size_t pos) const { return *map_ref_[pos]; }
void insert(value_type&& value) {
// does not invalidate iterators
const auto [it, inserted] = map_.insert(std::move(value));
if (inserted) {
map_ref_.push_back(std::move(it));
}
}
void clear() {
map_ref_.clear();
map_.clear();
}
private:
Map map_;
std::vector<Map::const_iterator> map_ref_;
};
} // namespace
CEF_EXPORT cef_string_map_t cef_string_map_alloc() {
return new StringMap;
return reinterpret_cast<cef_string_map_t>(new StringMap);
}
CEF_EXPORT size_t cef_string_map_size(cef_string_map_t map) {
@@ -29,7 +60,7 @@ CEF_EXPORT int cef_string_map_find(cef_string_map_t map,
DCHECK(value);
StringMap* impl = reinterpret_cast<StringMap*>(map);
StringMap::const_iterator it = impl->find(CefString(key));
if (it == impl->end()) {
if (it == impl->cend()) {
return 0;
}
@@ -48,13 +79,8 @@ CEF_EXPORT int cef_string_map_key(cef_string_map_t map,
return 0;
}
StringMap::const_iterator it = impl->begin();
for (size_t ct = 0; it != impl->end(); ++it, ct++) {
if (ct == index) {
return cef_string_set(it->first.c_str(), it->first.length(), key, true);
}
}
return 0;
const auto& [k, _] = (*impl)[index];
return cef_string_set(k.c_str(), k.length(), key, true);
}
CEF_EXPORT int cef_string_map_value(cef_string_map_t map,
@@ -68,14 +94,8 @@ CEF_EXPORT int cef_string_map_value(cef_string_map_t map,
return 0;
}
StringMap::const_iterator it = impl->begin();
for (size_t ct = 0; it != impl->end(); ++it, ct++) {
if (ct == index) {
return cef_string_set(it->second.c_str(), it->second.length(), value,
true);
}
}
return 0;
const auto& [_, v] = (*impl)[index];
return cef_string_set(v.c_str(), v.length(), value, true);
}
CEF_EXPORT int cef_string_map_append(cef_string_map_t map,

View File

@@ -3,17 +3,47 @@
// can be found in the LICENSE file.
#include <map>
#include <vector>
#include "include/internal/cef_string_multimap.h"
#include "base/logging.h"
namespace {
using StringMultimap = std::multimap<CefString, CefString>;
class StringMultimap {
using Map = std::multimap<CefString, CefString>;
using value_type = Map::value_type;
public:
using const_iterator = Map::const_iterator;
size_t size() const { return map_ref_.size(); }
size_t count(const CefString& key) const { return map_.count(key); }
const value_type operator[](size_t pos) const { return *map_ref_[pos]; }
std::pair<const_iterator, const_iterator> equal_range(
const CefString& key) const {
return map_.equal_range(key);
}
void insert(value_type&& value) {
auto it = map_.insert(std::move(value)); // does not invalidate iterators
map_ref_.push_back(std::move(it));
}
void clear() {
map_ref_.clear();
map_.clear();
}
private:
Map map_;
std::vector<Map::const_iterator> map_ref_;
};
} // namespace
CEF_EXPORT cef_string_multimap_t cef_string_multimap_alloc() {
return new StringMultimap;
return reinterpret_cast<cef_string_multimap_t>(new StringMultimap);
}
CEF_EXPORT size_t cef_string_multimap_size(cef_string_multimap_t map) {
@@ -46,8 +76,8 @@ CEF_EXPORT int cef_string_multimap_enumerate(cef_string_multimap_t map,
return 0;
}
std::pair<StringMultimap::iterator, StringMultimap::iterator> range_it =
impl->equal_range(key_str);
std::pair<StringMultimap::const_iterator, StringMultimap::const_iterator>
range_it = impl->equal_range(key_str);
size_t count = value_index;
while (count-- && range_it.first != range_it.second) {
@@ -73,13 +103,8 @@ CEF_EXPORT int cef_string_multimap_key(cef_string_multimap_t map,
return 0;
}
StringMultimap::const_iterator it = impl->begin();
for (size_t ct = 0; it != impl->end(); ++it, ct++) {
if (ct == index) {
return cef_string_set(it->first.c_str(), it->first.length(), key, true);
}
}
return 0;
const auto& [k, _] = (*impl)[index];
return cef_string_set(k.c_str(), k.length(), key, true);
}
CEF_EXPORT int cef_string_multimap_value(cef_string_multimap_t map,
@@ -93,14 +118,8 @@ CEF_EXPORT int cef_string_multimap_value(cef_string_multimap_t map,
return 0;
}
StringMultimap::const_iterator it = impl->begin();
for (size_t ct = 0; it != impl->end(); ++it, ct++) {
if (ct == index) {
return cef_string_set(it->second.c_str(), it->second.length(), value,
true);
}
}
return 0;
const auto& [_, v] = (*impl)[index];
return cef_string_set(v.c_str(), v.length(), value, true);
}
CEF_EXPORT int cef_string_multimap_append(cef_string_multimap_t map,

View File

@@ -46,11 +46,6 @@ std::string GetMainBundleID();
// running in an app bundle.
base::FilePath GetMainResourcesDirectory();
// Returns the path to the child process executable (e.g. "myapp.app/
// Contents/Frameworks/myapp Helper.app/Contents/MacOS/myapp Helper"). May
// return an empty value if not running in an app bundle.
base::FilePath GetChildProcessPath();
// Called from MainDelegate::PreSandboxStartup for the main process.
void PreSandboxStartup();

View File

@@ -52,14 +52,27 @@ void OverrideBaseBundleID() {
base::mac::SetBaseBundleID(bundle_id.c_str());
}
base::FilePath GetNormalChildProcessPath() {
base::FilePath frameworks_path = GetFrameworksPath();
if (frameworks_path.empty()) {
return base::FilePath();
}
std::string exe_name = GetMainProcessPath().BaseName().value();
return frameworks_path.Append(FILE_PATH_LITERAL(exe_name + " Helper.app"))
.Append(FILE_PATH_LITERAL("Contents"))
.Append(FILE_PATH_LITERAL("MacOS"))
.Append(FILE_PATH_LITERAL(exe_name + " Helper"));
}
void OverrideChildProcessPath() {
base::FilePath child_process_path =
base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
switches::kBrowserSubprocessPath);
if (child_process_path.empty()) {
child_process_path = util_mac::GetChildProcessPath();
DCHECK(!child_process_path.empty());
child_process_path = GetNormalChildProcessPath();
CHECK(!child_process_path.empty());
}
// Used by ChildProcessHost::GetChildPath and PlatformCrashpadInitialization.
@@ -135,19 +148,6 @@ base::FilePath GetMainResourcesDirectory() {
.Append(FILE_PATH_LITERAL("Resources"));
}
base::FilePath GetChildProcessPath() {
base::FilePath frameworks_path = GetFrameworksPath();
if (frameworks_path.empty()) {
return base::FilePath();
}
std::string exe_name = GetMainProcessPath().BaseName().value();
return frameworks_path.Append(FILE_PATH_LITERAL(exe_name + " Helper.app"))
.Append(FILE_PATH_LITERAL("Contents"))
.Append(FILE_PATH_LITERAL("MacOS"))
.Append(FILE_PATH_LITERAL(exe_name + " Helper"));
}
void PreSandboxStartup() {
OverrideChildProcessPath();
}

View File

@@ -112,8 +112,8 @@ AlloyContentRendererClient::AlloyContentRendererClient()
if (extensions::ExtensionsEnabled()) {
extensions_client_.reset(new extensions::CefExtensionsClient);
extensions::ExtensionsClient::Set(extensions_client_.get());
extensions_renderer_client_.reset(
new extensions::CefExtensionsRendererClient);
extensions_renderer_client_ =
std::make_unique<extensions::CefExtensionsRendererClient>(this);
extensions::ExtensionsRendererClient::Set(
extensions_renderer_client_.get());
}
@@ -474,7 +474,8 @@ void AlloyContentRendererClient::DevToolsAgentDetached() {
std::unique_ptr<blink::URLLoaderThrottleProvider>
AlloyContentRendererClient::CreateURLLoaderThrottleProvider(
blink::URLLoaderThrottleProviderType provider_type) {
return std::make_unique<CefURLLoaderThrottleProviderImpl>(provider_type);
return std::make_unique<CefURLLoaderThrottleProviderImpl>(provider_type,
this);
}
void AlloyContentRendererClient::AppendContentSecurityPolicy(

View File

@@ -120,6 +120,10 @@ class AlloyContentRendererClient
// MessageLoopCurrent::DestructionObserver implementation.
void WillDestroyCurrentMessageLoop() override;
AlloyRenderThreadObserver* GetAlloyObserver() const {
return observer_.get();
}
private:
void OnBrowserCreated(blink::WebView* web_view,
absl::optional<bool> is_windowless);

View File

@@ -8,31 +8,26 @@
#include "libcef/common/net/net_resource_provider.h"
#include "base/no_destructor.h"
#include "chrome/common/renderer_configuration.mojom.h"
#include "net/base/net_module.h"
#include "services/service_manager/public/cpp/connector.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
namespace {
chrome::mojom::DynamicParams* GetDynamicConfigParams() {
static base::NoDestructor<chrome::mojom::DynamicParams> dynamic_params;
return dynamic_params.get();
}
} // namespace
bool AlloyRenderThreadObserver::is_incognito_process_ = false;
AlloyRenderThreadObserver::AlloyRenderThreadObserver() {
net::NetModule::SetResourceProvider(NetResourceProvider);
}
AlloyRenderThreadObserver::~AlloyRenderThreadObserver() {}
// static
const chrome::mojom::DynamicParams&
AlloyRenderThreadObserver::GetDynamicParams() {
return *GetDynamicConfigParams();
chrome::mojom::DynamicParamsPtr AlloyRenderThreadObserver::GetDynamicParams()
const {
{
base::AutoLock lock(dynamic_params_lock_);
if (dynamic_params_) {
return dynamic_params_.Clone();
}
}
return chrome::mojom::DynamicParams::New();
}
void AlloyRenderThreadObserver::RegisterMojoInterfaces(
@@ -51,15 +46,19 @@ void AlloyRenderThreadObserver::UnregisterMojoInterfaces(
void AlloyRenderThreadObserver::SetInitialConfiguration(
bool is_incognito_process,
mojo::PendingReceiver<chrome::mojom::ChromeOSListener> chromeos_listener,
mojo::PendingReceiver<chrome::mojom::ChromeOSListener>
chromeos_listener_receiver,
mojo::PendingRemote<content_settings::mojom::ContentSettingsManager>
content_settings_manager) {
content_settings_manager,
mojo::PendingRemote<chrome::mojom::BoundSessionRequestThrottledListener>
bound_session_request_throttled_listener) {
is_incognito_process_ = is_incognito_process;
}
void AlloyRenderThreadObserver::SetConfiguration(
chrome::mojom::DynamicParamsPtr params) {
*GetDynamicConfigParams() = std::move(*params);
base::AutoLock lock(dynamic_params_lock_);
dynamic_params_ = std::move(params);
}
void AlloyRenderThreadObserver::OnRendererConfigurationAssociatedRequest(

View File

@@ -8,6 +8,8 @@
#include <memory>
#include "base/synchronization/lock.h"
#include "base/thread_annotations.h"
#include "chrome/common/renderer_configuration.mojom.h"
#include "components/content_settings/core/common/content_settings.h"
#include "content/public/renderer/render_thread_observer.h"
@@ -25,11 +27,11 @@ class AlloyRenderThreadObserver : public content::RenderThreadObserver,
~AlloyRenderThreadObserver() override;
static bool is_incognito_process() { return is_incognito_process_; }
bool IsIncognitoProcess() const { return is_incognito_process_; }
// Return the dynamic parameters - those that may change while the
// Return a copy of the dynamic parameters - those that may change while the
// render process is running.
static const chrome::mojom::DynamicParams& GetDynamicParams();
chrome::mojom::DynamicParamsPtr GetDynamicParams() const;
private:
// content::RenderThreadObserver:
@@ -41,19 +43,26 @@ class AlloyRenderThreadObserver : public content::RenderThreadObserver,
// chrome::mojom::RendererConfiguration:
void SetInitialConfiguration(
bool is_incognito_process,
mojo::PendingReceiver<chrome::mojom::ChromeOSListener> chromeos_listener,
mojo::PendingReceiver<chrome::mojom::ChromeOSListener>
chromeos_listener_receiver,
mojo::PendingRemote<content_settings::mojom::ContentSettingsManager>
content_settings_manager) override;
content_settings_manager,
mojo::PendingRemote<chrome::mojom::BoundSessionRequestThrottledListener>
bound_session_request_throttled_listener) override;
void SetConfiguration(chrome::mojom::DynamicParamsPtr params) override;
void OnRendererConfigurationAssociatedRequest(
mojo::PendingAssociatedReceiver<chrome::mojom::RendererConfiguration>
receiver);
static bool is_incognito_process_;
bool is_incognito_process_ = false;
mojo::AssociatedReceiverSet<chrome::mojom::RendererConfiguration>
renderer_configuration_receivers_;
chrome::mojom::DynamicParamsPtr dynamic_params_
GUARDED_BY(dynamic_params_lock_);
mutable base::Lock dynamic_params_lock_;
};
#endif // CEF_LIBCEF_RENDERER_ALLOY_ALLOY_RENDER_THREAD_OBSERVER_H_

View File

@@ -5,12 +5,14 @@
#include "libcef/renderer/alloy/url_loader_throttle_provider_impl.h"
#include "libcef/common/extensions/extensions_util.h"
#include "libcef/renderer/alloy/alloy_content_renderer_client.h"
#include "libcef/renderer/alloy/alloy_render_thread_observer.h"
#include <utility>
#include "base/feature_list.h"
#include "chrome/common/google_url_loader_throttle.h"
#include "components/signin/public/base/signin_buildflags.h"
#include "content/public/common/content_features.h"
#include "content/public/renderer/render_frame.h"
#include "services/network/public/cpp/features.h"
@@ -18,8 +20,10 @@
#include "third_party/blink/public/platform/web_url.h"
CefURLLoaderThrottleProviderImpl::CefURLLoaderThrottleProviderImpl(
blink::URLLoaderThrottleProviderType type)
: type_(type) {
blink::URLLoaderThrottleProviderType type,
AlloyContentRendererClient* alloy_content_renderer_client)
: type_(type),
alloy_content_renderer_client_(alloy_content_renderer_client) {
DETACH_FROM_THREAD(thread_checker_);
}
@@ -29,7 +33,8 @@ CefURLLoaderThrottleProviderImpl::~CefURLLoaderThrottleProviderImpl() {
CefURLLoaderThrottleProviderImpl::CefURLLoaderThrottleProviderImpl(
const CefURLLoaderThrottleProviderImpl& other)
: type_(other.type_) {
: type_(other.type_),
alloy_content_renderer_client_(other.alloy_content_renderer_client_) {
DETACH_FROM_THREAD(thread_checker_);
}
@@ -59,7 +64,10 @@ CefURLLoaderThrottleProviderImpl::CreateThrottles(
type_ == blink::URLLoaderThrottleProviderType::kFrame);
throttles.emplace_back(std::make_unique<GoogleURLLoaderThrottle>(
AlloyRenderThreadObserver::GetDynamicParams()));
#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
/*bound_session_request_throttled_listener=*/nullptr,
#endif
alloy_content_renderer_client_->GetAlloyObserver()->GetDynamicParams()));
return throttles;
}

View File

@@ -11,13 +11,16 @@
#include "base/threading/thread_checker.h"
#include "third_party/blink/public/platform/url_loader_throttle_provider.h"
class AlloyContentRendererClient;
// Instances must be constructed on the render thread, and then used and
// destructed on a single thread, which can be different from the render thread.
class CefURLLoaderThrottleProviderImpl
: public blink::URLLoaderThrottleProvider {
public:
explicit CefURLLoaderThrottleProviderImpl(
blink::URLLoaderThrottleProviderType type);
CefURLLoaderThrottleProviderImpl(
blink::URLLoaderThrottleProviderType type,
AlloyContentRendererClient* alloy_content_renderer_client);
CefURLLoaderThrottleProviderImpl& operator=(
const CefURLLoaderThrottleProviderImpl&) = delete;
@@ -38,6 +41,7 @@ class CefURLLoaderThrottleProviderImpl
const CefURLLoaderThrottleProviderImpl& other);
blink::URLLoaderThrottleProviderType type_;
AlloyContentRendererClient* const alloy_content_renderer_client_;
THREAD_CHECKER(thread_checker_);
};

View File

@@ -4,6 +4,7 @@
#include "libcef/renderer/extensions/extensions_renderer_client.h"
#include "libcef/renderer/alloy/alloy_content_renderer_client.h"
#include "libcef/renderer/alloy/alloy_render_thread_observer.h"
#include "libcef/renderer/extensions/extensions_dispatcher_delegate.h"
@@ -39,12 +40,15 @@ void IsGuestViewApiAvailableToScriptContext(
} // namespace
CefExtensionsRendererClient::CefExtensionsRendererClient() {}
CefExtensionsRendererClient::CefExtensionsRendererClient(
AlloyContentRendererClient* alloy_content_renderer_client)
: alloy_content_renderer_client_(alloy_content_renderer_client) {}
CefExtensionsRendererClient::~CefExtensionsRendererClient() {}
bool CefExtensionsRendererClient::IsIncognitoProcess() const {
return AlloyRenderThreadObserver::is_incognito_process();
return alloy_content_renderer_client_->GetAlloyObserver()
->IsIncognitoProcess();
}
int CefExtensionsRendererClient::GetLowestIsolatedWorldId() const {

View File

@@ -12,6 +12,7 @@
#include "services/service_manager/public/cpp/binder_registry.h"
#include "ui/base/page_transition_types.h"
class AlloyContentRendererClient;
class GURL;
namespace blink {
@@ -43,7 +44,8 @@ class ResourceRequestPolicy;
class CefExtensionsRendererClient : public ExtensionsRendererClient {
public:
CefExtensionsRendererClient();
explicit CefExtensionsRendererClient(
AlloyContentRendererClient* alloy_content_renderer_client);
CefExtensionsRendererClient(const CefExtensionsRendererClient&) = delete;
CefExtensionsRendererClient& operator=(const CefExtensionsRendererClient&) =
@@ -79,6 +81,8 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient {
void RunScriptsAtDocumentIdle(content::RenderFrame* render_frame);
private:
AlloyContentRendererClient* const alloy_content_renderer_client_;
std::unique_ptr<extensions::Dispatcher> extension_dispatcher_;
std::unique_ptr<extensions::ResourceRequestPolicy> resource_request_policy_;
};

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=dadbfc8511bfe89942a8e4403deebd2d1b1d3206$
// $hash=0396657d42ed5b75838d1882434adefbcd562be6$
//
#include "libcef_dll/cpptoc/download_item_cpptoc.h"
@@ -88,6 +88,43 @@ int CEF_CALLBACK download_item_is_canceled(struct _cef_download_item_t* self) {
return _retval;
}
int CEF_CALLBACK
download_item_is_interrupted(struct _cef_download_item_t* self) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self) {
return 0;
}
// Execute
bool _retval = CefDownloadItemCppToC::Get(self)->IsInterrupted();
// Return type: bool
return _retval;
}
cef_download_interrupt_reason_t CEF_CALLBACK
download_item_get_interrupt_reason(struct _cef_download_item_t* self) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self) {
return CEF_DOWNLOAD_INTERRUPT_REASON_NONE;
}
// Execute
cef_download_interrupt_reason_t _retval =
CefDownloadItemCppToC::Get(self)->GetInterruptReason();
// Return type: simple
return _retval;
}
int64 CEF_CALLBACK
download_item_get_current_speed(struct _cef_download_item_t* self) {
shutdown_checker::AssertNotShutdown();
@@ -330,6 +367,8 @@ CefDownloadItemCppToC::CefDownloadItemCppToC() {
GetStruct()->is_in_progress = download_item_is_in_progress;
GetStruct()->is_complete = download_item_is_complete;
GetStruct()->is_canceled = download_item_is_canceled;
GetStruct()->is_interrupted = download_item_is_interrupted;
GetStruct()->get_interrupt_reason = download_item_get_interrupt_reason;
GetStruct()->get_current_speed = download_item_get_current_speed;
GetStruct()->get_percent_complete = download_item_get_percent_complete;
GetStruct()->get_total_bytes = download_item_get_total_bytes;

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=f1f158b5b3feddceeccbd963174a2a3e51577149$
// $hash=d4e111b0649264459c7acfdc4b5df8ba5d6a3f13$
//
#include "libcef_dll/ctocpp/download_item_ctocpp.h"
@@ -85,6 +85,42 @@ NO_SANITIZE("cfi-icall") bool CefDownloadItemCToCpp::IsCanceled() {
return _retval ? true : false;
}
NO_SANITIZE("cfi-icall") bool CefDownloadItemCToCpp::IsInterrupted() {
shutdown_checker::AssertNotShutdown();
cef_download_item_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, is_interrupted)) {
return false;
}
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->is_interrupted(_struct);
// Return type: bool
return _retval ? true : false;
}
NO_SANITIZE("cfi-icall")
cef_download_interrupt_reason_t CefDownloadItemCToCpp::GetInterruptReason() {
shutdown_checker::AssertNotShutdown();
cef_download_item_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_interrupt_reason)) {
return CEF_DOWNLOAD_INTERRUPT_REASON_NONE;
}
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_download_interrupt_reason_t _retval =
_struct->get_interrupt_reason(_struct);
// Return type: simple
return _retval;
}
NO_SANITIZE("cfi-icall") int64 CefDownloadItemCToCpp::GetCurrentSpeed() {
shutdown_checker::AssertNotShutdown();

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=d0295aa7dbc39993e62486a20a1ef8123d0648b2$
// $hash=8db814c52f72368cb7dd612ed3d2efaccddb865c$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CTOCPP_H_
@@ -38,6 +38,8 @@ class CefDownloadItemCToCpp : public CefCToCppRefCounted<CefDownloadItemCToCpp,
bool IsInProgress() override;
bool IsComplete() override;
bool IsCanceled() override;
bool IsInterrupted() override;
cef_download_interrupt_reason_t GetInterruptReason() override;
int64 GetCurrentSpeed() override;
int GetPercentComplete() override;
int64 GetTotalBytes() override;

View File

@@ -75,11 +75,6 @@ patches = [
# RuntimeEnabledFeatures methods.
'name': 'webkit_runtime_enabled_features',
},
{
# Fix export of UnderlayOpenGLHostingWindow for 64-bit MacOS builds.
# https://github.com/chromiumembedded/cef/issues/1051
'name': 'underlay_1051',
},
{
# Allow specification of a parent window handle for Widget creation.
# https://github.com/chromiumembedded/cef/issues/180
@@ -258,6 +253,11 @@ patches = [
# https://github.com/chromiumembedded/cef/issues/2969
'name': 'chrome_browser_extensions',
},
{
# chrome: Expose static access to BrowserFrameMac methods.
# https://github.com/chromiumembedded/cef/issues/3462
'name': 'chrome_browser_frame_mac',
},
{
# alloy: Disable ProxyErrorClient callbacks when extensions are disabled.
# https://github.com/chromiumembedded/cef/issues/2830
@@ -521,6 +521,12 @@ patches = [
# Avoid usage of PartitionAlloc assertions (PA_BASE_CHECK) in raw_ptr.h.
'name': 'base_sandbox_2743',
},
{
# Windows: Fix MSVC compile errors using base::MakeFixedFlatMapSorted
# in registry.cc when building cef_sandbox.
# https://github.com/chromiumembedded/cef/issues/3519
'name': 'base_sandbox_3519',
},
{
# Add RenderWidgetHostImpl::SetCompositorForFlingScheduler to fix fling
# scrolling in OSR mode.
@@ -605,14 +611,14 @@ patches = [
# https://chromium-review.googlesource.com/c/chromium/src/+/4200240
'name': 'blink_web_element_4200240'
},
{
# Fix GN gen unresolved dependencies error with cef_sandbox build.
# https://chromium-review.googlesource.com/c/chromium/src/+/4401670
'name': 'gpu_test_trace_4401670'
},
{
# Fix ThreadChecker crash on startup with Chrome runtime + multi-threaded
# message loop.
'name': 'metrics_system_profile'
},
{
# macOS: Remove run-time dependency on libtest_trace_processor.dylib
# Reverts the changes from https://crrev.com/8b18bd125d
'name': 'base_test_4396276'
}
]

View File

@@ -1,5 +1,5 @@
diff --git base/BUILD.gn base/BUILD.gn
index 4d8087f0d747e..7b80d8012399b 100644
index 8417fcda40d49..b4aae014eded9 100644
--- base/BUILD.gn
+++ base/BUILD.gn
@@ -40,6 +40,7 @@ import("//build/config/ui.gni")
@@ -10,7 +10,7 @@ index 4d8087f0d747e..7b80d8012399b 100644
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
@@ -1537,7 +1538,11 @@ component("base") {
@@ -1528,7 +1529,11 @@ component("base") {
"hash/md5_constexpr_internal.h",
"hash/sha1.h",
]
@@ -23,7 +23,7 @@ index 4d8087f0d747e..7b80d8012399b 100644
sources += [
"hash/md5_nacl.cc",
"hash/md5_nacl.h",
@@ -1937,6 +1942,12 @@ component("base") {
@@ -1928,6 +1933,12 @@ component("base") {
defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ]
}
@@ -37,18 +37,18 @@ index 4d8087f0d747e..7b80d8012399b 100644
"cfgmgr32.lib",
"ntdll.lib",
diff --git base/allocator/dispatcher/dispatcher.cc base/allocator/dispatcher/dispatcher.cc
index 0f044388cefee..49fc4cd20be64 100644
index 2d4f17ea2a301..ff2ccafd53056 100644
--- base/allocator/dispatcher/dispatcher.cc
+++ base/allocator/dispatcher/dispatcher.cc
@@ -13,6 +13,7 @@
@@ -12,6 +12,7 @@
#include "base/check.h"
#include "base/dcheck_is_on.h"
#include "base/no_destructor.h"
#include "base/sampling_heap_profiler/poisson_allocation_sampler.h"
+#include "cef/libcef/features/features.h"
#if DCHECK_IS_ON()
#include <atomic>
@@ -259,7 +260,7 @@ struct Dispatcher::Impl {
@@ -31,7 +32,7 @@ struct Dispatcher::Impl {
}
void Reset() {
@@ -88,7 +88,7 @@ index 29626e5853c6e..2fb1c61504c5d 100644
#else
#include "base/hash/sha1_boringssl.h"
diff --git base/rand_util.h base/rand_util.h
index 04024537ee698..59864cb084559 100644
index 38be94387237d..889550e16a6ce 100644
--- base/rand_util.h
+++ base/rand_util.h
@@ -15,8 +15,9 @@
@@ -102,7 +102,7 @@ index 04024537ee698..59864cb084559 100644
#include "third_party/boringssl/src/include/openssl/rand.h"
#endif
@@ -93,7 +94,7 @@ class RandomBitGenerator {
@@ -97,7 +98,7 @@ class RandomBitGenerator {
~RandomBitGenerator() = default;
};

View File

@@ -0,0 +1,62 @@
diff --git base/ranges/ranges.h base/ranges/ranges.h
index 641bbaf2c7576..afdd641e38452 100644
--- base/ranges/ranges.h
+++ base/ranges/ranges.h
@@ -30,12 +30,14 @@ constexpr T* begin(std::array<T, N>& array, priority_tag<2> tag) {
return const_cast<T*>(begin(const_cast<const std::array<T, N>&>(array), tag));
}
+#if !defined(CEF_EXCLUDE_PROBLEMATIC_CONST_ARRAY_OVERLOADS)
// Overload for const std::array. Required since std::array::begin is not
// constexpr prior to C++17.
template <typename T, size_t N>
constexpr const T* begin(const std::array<T, N>& array, priority_tag<2>) {
return N != 0 ? &array[0] : nullptr;
}
+#endif
// Generic container overload.
template <typename Range>
@@ -65,12 +67,14 @@ constexpr T* end(std::array<T, N>& array, priority_tag<2> tag) {
return const_cast<T*>(end(const_cast<const std::array<T, N>&>(array), tag));
}
+#if !defined(CEF_EXCLUDE_PROBLEMATIC_CONST_ARRAY_OVERLOADS)
// Overload for const std::array. Required since std::array::end is not
// constexpr prior to C++17.
template <typename T, size_t N>
constexpr const T* end(const std::array<T, N>& array, priority_tag<2>) {
return N != 0 ? (&array[0]) + N : nullptr;
}
+#endif
// Generic container overload.
template <typename Range>
diff --git base/win/registry.cc base/win/registry.cc
index 473f5fdc861ce..eb85a31611560 100644
--- base/win/registry.cc
+++ base/win/registry.cc
@@ -13,6 +13,14 @@
#include <utility>
#include <vector>
+#include "cef/libcef/features/features.h"
+
+#if BUILDFLAG(IS_CEF_SANDBOX_BUILD)
+// Avoid overloads for const std::array in base/ranges/ranges.h that don't
+// compile with MSVC. See issue #3519.
+#define CEF_EXCLUDE_PROBLEMATIC_CONST_ARRAY_OVERLOADS 1
+#endif
+
#include "base/check_op.h"
#include "base/containers/fixed_flat_map.h"
#include "base/functional/callback.h"
@@ -314,7 +322,7 @@ class ExportDerived {
{"RegSetValueExW", reinterpret_cast<void**>(&reg_set_value_ex_)},
});
- auto* entry = kMap.find(name);
+ auto entry = kMap.find(name);
if (entry == kMap.end()) {
return true;
}

View File

@@ -0,0 +1,103 @@
diff --git base/test/BUILD.gn base/test/BUILD.gn
index cc75b7235f438..f5bbc354f7918 100644
--- base/test/BUILD.gn
+++ base/test/BUILD.gn
@@ -175,7 +175,6 @@ static_library("test_support") {
if (!is_chromeos) {
# TODO(rasikan): Add to ios and chromeos when unblocked by the chromiumos
# change to add the shared lib to the chrome-binary-tests directory.
- public_deps += [ ":test_trace_processor" ]
if (is_ios) {
deps += [
":test_trace_processor+bundle",
@@ -490,7 +489,7 @@ if (enable_base_tracing) {
# processor depends on dev_sqlite. The two share the same symbols but have
# different implementations, so we need to hide dev_sqlite in this shared
# library even in non-component builds to prevent duplicate symbols.
- _target_type = "shared_library"
+ _target_type = "component"
if (is_ios) {
_target_type = "ios_framework_bundle"
}
@@ -516,32 +515,5 @@ if (enable_base_tracing) {
output_name = "TestTraceProcessor"
bundle_deps_filter = [ "//third_party/icu:icudata" ]
}
-
- # Set rpath on dependent tests so that they can find the shared library
- # in a non-component build.
- if (!is_component_build) {
- all_dependent_configs = []
- if (is_linux || is_chromeos) {
- all_dependent_configs +=
- [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
- }
- if (is_mac) {
- # We need the lib to be in $root_out_dir/Libraries so the library is where
- # the linker expects it, since we set the install_name flag. We need to
- # set this flag so that the library can be found when it is bundled in the
- # Content Shell Framework (see test_trace_processor_bundle_data).
- output_dir = "$root_out_dir/Libraries"
- ldflags = [ "-Wl,-install_name,@loader_path/Libraries/libtest_trace_processor.dylib" ]
- }
- }
- }
-
- if (!is_component_build && is_mac) {
- bundle_data("test_trace_processor_bundle_data") {
- testonly = true
- sources = [ "$root_out_dir/Libraries/libtest_trace_processor.dylib" ]
- outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
- public_deps = [ ":test_trace_processor" ]
- }
}
}
diff --git base/test/test_trace_processor_export.h base/test/test_trace_processor_export.h
index f5191b804bc07..aadb7d66ba4c3 100644
--- base/test/test_trace_processor_export.h
+++ base/test/test_trace_processor_export.h
@@ -5,6 +5,7 @@
#ifndef BASE_TEST_TEST_TRACE_PROCESSOR_EXPORT_H_
#define BASE_TEST_TEST_TRACE_PROCESSOR_EXPORT_H_
+#if defined(COMPONENT_BUILD)
#if defined(WIN32)
#if defined(TEST_TRACE_PROCESSOR_IMPL)
@@ -23,4 +24,8 @@
#endif // defined(WIN32)
+#else // defined(COMPONENT_BUILD)
+#define TEST_TRACE_PROCESSOR_EXPORT
+#endif
+
#endif // BASE_TEST_TEST_TRACE_PROCESSOR_EXPORT_H_
diff --git content/shell/BUILD.gn content/shell/BUILD.gn
index e0921c6326700..1d3fbfaa532a1 100644
--- content/shell/BUILD.gn
+++ content/shell/BUILD.gn
@@ -809,7 +809,6 @@ if (is_mac) {
# Specify a sensible install_name for static builds. The library is
# dlopen()ed so this is not used to resolve the module.
ldflags = [ "-Wl,-install_name,@executable_path/../Frameworks/$output_name.framework/$output_name" ]
- deps += [ "//base/test:test_trace_processor_bundle_data" ]
} else {
# Both the main :content_shell and :content_shell_helper_app executables
# need to link the framework. Because they are at different directory
diff --git gpu/BUILD.gn gpu/BUILD.gn
index 7bbd7cb6be9c2..df9e0f2a93ad9 100644
--- gpu/BUILD.gn
+++ gpu/BUILD.gn
@@ -730,10 +730,7 @@ test("gpu_unittests") {
"//url",
]
- # Cronet disables tracing (crbug.com/1400235).
- # TODO(rasikan): Remove when unblocked by chromiumos change to add shared lib
- # to add the shared lib to the chrome-binary-tests directory.
- if (enable_base_tracing && !is_cronet_build && is_chromeos) {
+ if (enable_base_tracing) {
deps += [ "//base/test:test_trace_processor" ]
}

View File

@@ -1,8 +1,8 @@
diff --git content/browser/scheduler/browser_task_executor.cc content/browser/scheduler/browser_task_executor.cc
index 33ec36151d7fb..947772e015ad9 100644
index 818e5f14ee60f..d68d6a16cda67 100644
--- content/browser/scheduler/browser_task_executor.cc
+++ content/browser/scheduler/browser_task_executor.cc
@@ -269,7 +269,7 @@ BrowserTaskExecutor::OnUserInputStart() {
@@ -221,7 +221,7 @@ BrowserTaskExecutor::OnUserInputStart() {
// static
void BrowserTaskExecutor::Shutdown() {

View File

@@ -1,8 +1,8 @@
diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc
index 2cc2e8e2a16da..b9484a5832f74 100644
index 66008c3abbc49..64d2773724750 100644
--- content/browser/child_process_security_policy_impl.cc
+++ content/browser/child_process_security_policy_impl.cc
@@ -1800,6 +1800,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForMaybeOpaqueOrigin(
@@ -1804,6 +1804,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForMaybeOpaqueOrigin(
// DeclarativeApiTest.PersistRules.
if (actual_process_lock.matches_scheme(url::kDataScheme))
return true;
@@ -20,10 +20,10 @@ index 2cc2e8e2a16da..b9484a5832f74 100644
// Make an exception to allow most visited tiles to commit in
diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc
index bfead21ad8426..d3d3ff5e4effd 100644
index a2530d474b606..20f6aded15935 100644
--- content/browser/renderer_host/navigation_request.cc
+++ content/browser/renderer_host/navigation_request.cc
@@ -7152,10 +7152,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
@@ -7323,10 +7323,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
bool use_opaque_origin =
(sandbox_flags & network::mojom::WebSandboxFlags::kOrigin) ==
network::mojom::WebSandboxFlags::kOrigin;
@@ -47,7 +47,7 @@ index bfead21ad8426..d3d3ff5e4effd 100644
}
return origin_and_debug_info;
@@ -7185,6 +7197,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
@@ -7356,6 +7368,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
SandboxFlagsToCommit());

View File

@@ -1,8 +1,8 @@
diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn
index d3adf9735ca95..30aa892822318 100644
index 28c2255ba8090..b77b14ffbe7f1 100644
--- build/config/compiler/BUILD.gn
+++ build/config/compiler/BUILD.gn
@@ -1916,8 +1916,6 @@ config("thin_archive") {
@@ -1925,8 +1925,6 @@ config("thin_archive") {
# confuses lldb.
if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) {
arflags = [ "-T" ]

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
index 93d76a4dcead4..29999a775a482 100644
index acf48b7ffd061..9b441db457bee 100644
--- chrome/browser/BUILD.gn
+++ chrome/browser/BUILD.gn
@@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni")
@@ -10,7 +10,7 @@ index 93d76a4dcead4..29999a775a482 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/browser/downgrade/buildflags.gni")
import("//chrome/common/features.gni")
@@ -1939,6 +1940,7 @@ static_library("browser") {
@@ -1935,6 +1936,7 @@ static_library("browser") {
"//build/config/chromebox_for_meetings:buildflags",
"//build/config/compiler:compiler_buildflags",
"//cc",
@@ -29,7 +29,7 @@ index 93d76a4dcead4..29999a775a482 100644
if (is_android) {
sources += [
"after_startup_task_utils_android.cc",
@@ -6073,8 +6079,6 @@ static_library("browser") {
@@ -6118,8 +6124,6 @@ static_library("browser") {
sources += [
"enterprise/chrome_browser_main_extra_parts_enterprise.cc",
"enterprise/chrome_browser_main_extra_parts_enterprise.h",

View File

@@ -14,10 +14,10 @@ index 4279a763e28e2..2ec8e4cbfac7d 100644
std::unique_ptr<BackgroundModeManager> manager) = 0;
#endif
diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc
index 00043e84a13e0..6c64dd46b47b9 100644
index 787a23b85d06c..80a8667e58a86 100644
--- chrome/browser/browser_process_impl.cc
+++ chrome/browser/browser_process_impl.cc
@@ -1069,18 +1069,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() {
@@ -1042,18 +1042,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() {
return download_request_limiter_.get();
}

View File

@@ -13,7 +13,7 @@ index 370d6ab102471..fe1e4111780ed 100644
return false;
}
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
index 60994f80e8e51..262869e33aa30 100644
index da6c3853d1540..273915b67a396 100644
--- chrome/browser/ui/BUILD.gn
+++ chrome/browser/ui/BUILD.gn
@@ -9,6 +9,7 @@ import("//build/config/compiler/compiler.gni")
@@ -24,7 +24,7 @@ index 60994f80e8e51..262869e33aa30 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/common/features.gni")
import("//chromeos/ash/components/assistant/assistant.gni")
@@ -364,6 +365,10 @@ static_library("ui") {
@@ -368,6 +369,10 @@ static_library("ui") {
"//build/config/compiler:wexit_time_destructors",
]
@@ -35,7 +35,7 @@ index 60994f80e8e51..262869e33aa30 100644
# Since browser and browser_ui actually depend on each other,
# we must omit the dependency from browser_ui to browser.
# However, this means browser_ui and browser should more or less
@@ -388,6 +393,7 @@ static_library("ui") {
@@ -392,6 +397,7 @@ static_library("ui") {
"//build:chromeos_buildflags",
"//build/config/chromebox_for_meetings:buildflags",
"//cc/paint",
@@ -43,7 +43,7 @@ index 60994f80e8e51..262869e33aa30 100644
"//chrome:extra_resources",
"//chrome:resources",
"//chrome:strings",
@@ -2574,6 +2580,8 @@ static_library("ui") {
@@ -2600,6 +2606,8 @@ static_library("ui") {
"views/apps/app_dialog/app_block_dialog_view.h",
"views/apps/app_dialog/app_pause_dialog_view.cc",
"views/apps/app_dialog/app_pause_dialog_view.h",
@@ -52,7 +52,7 @@ index 60994f80e8e51..262869e33aa30 100644
"views/apps/app_info_dialog/arc_app_info_links_panel.cc",
"views/apps/app_info_dialog/arc_app_info_links_panel.h",
"views/apps/chrome_app_window_client_views_chromeos.cc",
@@ -4369,8 +4377,6 @@ static_library("ui") {
@@ -4429,8 +4437,6 @@ static_library("ui") {
"views/accessibility/theme_tracking_non_accessible_image_view.h",
"views/apps/app_dialog/app_dialog_view.cc",
"views/apps/app_dialog/app_dialog_view.h",
@@ -61,7 +61,7 @@ index 60994f80e8e51..262869e33aa30 100644
"views/apps/app_info_dialog/app_info_dialog_container.cc",
"views/apps/app_info_dialog/app_info_dialog_container.h",
"views/apps/app_info_dialog/app_info_dialog_views.cc",
@@ -5915,6 +5921,7 @@ static_library("ui") {
@@ -5990,6 +5996,7 @@ static_library("ui") {
if (enable_printing) {
deps += [
"//components/printing/browser",
@@ -70,10 +70,10 @@ index 60994f80e8e51..262869e33aa30 100644
]
}
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
index f1e679d2db0f0..9ad5aaf3a4dfd 100644
index 0fcb0295dec5d..134b0b2ccc61c 100644
--- chrome/browser/ui/browser.cc
+++ chrome/browser/ui/browser.cc
@@ -263,6 +263,25 @@
@@ -264,6 +264,25 @@
#include "components/captive_portal/content/captive_portal_tab_helper.h"
#endif
@@ -99,7 +99,7 @@ index f1e679d2db0f0..9ad5aaf3a4dfd 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_browser_window_helper.h"
#endif
@@ -510,6 +529,13 @@ Browser::Browser(const CreateParams& params)
@@ -511,6 +530,13 @@ Browser::Browser(const CreateParams& params)
tab_strip_model_->AddObserver(this);
@@ -113,7 +113,7 @@ index f1e679d2db0f0..9ad5aaf3a4dfd 100644
location_bar_model_ = std::make_unique<LocationBarModelImpl>(
location_bar_model_delegate_.get(), content::kMaxURLDisplayChars);
@@ -649,6 +675,12 @@ Browser::~Browser() {
@@ -650,6 +676,12 @@ Browser::~Browser() {
// away so they don't try and call back to us.
if (select_file_dialog_.get())
select_file_dialog_->ListenerDestroyed();
@@ -126,7 +126,7 @@ index f1e679d2db0f0..9ad5aaf3a4dfd 100644
}
///////////////////////////////////////////////////////////////////////////////
@@ -1358,6 +1390,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
@@ -1380,6 +1412,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
if (exclusive_access_manager_->HandleUserKeyEvent(event))
return content::KeyboardEventProcessingResult::HANDLED;
@@ -141,7 +141,7 @@ index f1e679d2db0f0..9ad5aaf3a4dfd 100644
return window()->PreHandleKeyboardEvent(event);
}
@@ -1365,8 +1405,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
@@ -1387,8 +1427,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
const NativeWebKeyboardEvent& event) {
DevToolsWindow* devtools_window =
DevToolsWindow::GetInstanceForInspectedWebContents(source);
@@ -162,7 +162,7 @@ index f1e679d2db0f0..9ad5aaf3a4dfd 100644
}
bool Browser::TabsNeedBeforeUnloadFired() {
@@ -1569,6 +1619,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source,
@@ -1591,6 +1641,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source,
return window->OpenURLFromTab(source, params);
}
@@ -177,7 +177,7 @@ index f1e679d2db0f0..9ad5aaf3a4dfd 100644
NavigateParams nav_params(this, params.url, params.transition);
nav_params.FillNavigateParamsFromOpenURLParams(params);
nav_params.source_contents = source;
@@ -1726,6 +1784,8 @@ void Browser::LoadingStateChanged(WebContents* source,
@@ -1748,6 +1806,8 @@ void Browser::LoadingStateChanged(WebContents* source,
bool should_show_loading_ui) {
ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD);
UpdateWindowForLoadingStateChanged(source, should_show_loading_ui);
@@ -186,7 +186,7 @@ index f1e679d2db0f0..9ad5aaf3a4dfd 100644
}
void Browser::CloseContents(WebContents* source) {
@@ -1754,6 +1814,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
@@ -1776,6 +1836,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
}
void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
@@ -195,7 +195,7 @@ index f1e679d2db0f0..9ad5aaf3a4dfd 100644
if (!GetStatusBubble())
return;
@@ -1761,6 +1823,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
@@ -1783,6 +1845,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
GetStatusBubble()->SetURL(url);
}
@@ -213,7 +213,7 @@ index f1e679d2db0f0..9ad5aaf3a4dfd 100644
void Browser::ContentsMouseEvent(WebContents* source,
bool motion,
bool exited) {
@@ -1785,6 +1858,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
@@ -1807,6 +1880,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
return false;
}
@@ -233,7 +233,7 @@ index f1e679d2db0f0..9ad5aaf3a4dfd 100644
void Browser::BeforeUnloadFired(WebContents* web_contents,
bool proceed,
bool* proceed_to_fire_unload) {
@@ -1877,6 +1963,10 @@ void Browser::WebContentsCreated(WebContents* source_contents,
@@ -1899,6 +1985,10 @@ void Browser::WebContentsCreated(WebContents* source_contents,
// Make the tab show up in the task manager.
task_manager::WebContentsTags::CreateForTabContents(new_contents);
@@ -244,7 +244,7 @@ index f1e679d2db0f0..9ad5aaf3a4dfd 100644
}
void Browser::PortalWebContentsCreated(WebContents* portal_web_contents) {
@@ -1988,11 +2078,15 @@ void Browser::EnterFullscreenModeForTab(
@@ -2010,11 +2100,15 @@ void Browser::EnterFullscreenModeForTab(
const blink::mojom::FullscreenOptions& options) {
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
requesting_frame, options.display_id);
@@ -260,7 +260,7 @@ index f1e679d2db0f0..9ad5aaf3a4dfd 100644
}
bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) {
@@ -2194,6 +2288,15 @@ void Browser::RequestMediaAccessPermission(
@@ -2204,6 +2298,15 @@ void Browser::RequestMediaAccessPermission(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
content::MediaResponseCallback callback) {
@@ -276,7 +276,7 @@ index f1e679d2db0f0..9ad5aaf3a4dfd 100644
const extensions::Extension* extension =
GetExtensionForOrigin(profile_, request.security_origin);
MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
@@ -2734,13 +2837,20 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
@@ -2744,13 +2847,20 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
// Browser, Getters for UI (private):
StatusBubble* Browser::GetStatusBubble() {
@@ -298,7 +298,7 @@ index f1e679d2db0f0..9ad5aaf3a4dfd 100644
return window_ ? window_->GetStatusBubble() : nullptr;
}
@@ -2874,6 +2984,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
@@ -2884,6 +2994,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this);
web_contents_collection_.StopObserving(web_contents);
}
@@ -308,7 +308,7 @@ index f1e679d2db0f0..9ad5aaf3a4dfd 100644
void Browser::TabDetachedAtImpl(content::WebContents* contents,
diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h
index 83b8260beb59d..480bf6df8f2e5 100644
index 23a838ba30c68..52601ebdcc9bd 100644
--- chrome/browser/ui/browser.h
+++ chrome/browser/ui/browser.h
@@ -22,6 +22,7 @@
@@ -389,7 +389,7 @@ index 83b8260beb59d..480bf6df8f2e5 100644
void BeforeUnloadFired(content::WebContents* source,
bool proceed,
bool* proceed_to_fire_unload) override;
@@ -1256,6 +1287,8 @@ class Browser : public TabStripModelObserver,
@@ -1264,6 +1295,8 @@ class Browser : public TabStripModelObserver,
const std::string initial_workspace_;
bool initial_visible_on_all_workspaces_state_;
@@ -398,7 +398,7 @@ index 83b8260beb59d..480bf6df8f2e5 100644
CreationSource creation_source_ = CreationSource::kUnknown;
UnloadController unload_controller_;
@@ -1320,6 +1353,10 @@ class Browser : public TabStripModelObserver,
@@ -1328,6 +1361,10 @@ class Browser : public TabStripModelObserver,
extension_browser_window_helper_;
#endif
@@ -410,10 +410,10 @@ index 83b8260beb59d..480bf6df8f2e5 100644
// The opener browser of the document picture-in-picture browser. Null if the
diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc
index c4a4bb8af94b0..37d64039e7eed 100644
index 9ee8a99f70bed..a2e198d987498 100644
--- chrome/browser/ui/browser_navigator.cc
+++ chrome/browser/ui/browser_navigator.cc
@@ -553,6 +553,13 @@ std::unique_ptr<content::WebContents> CreateTargetContents(
@@ -554,6 +554,13 @@ std::unique_ptr<content::WebContents> CreateTargetContents(
std::unique_ptr<WebContents> target_contents =
WebContents::Create(create_params);

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/content_settings/host_content_settings_map_factory.cc chrome/browser/content_settings/host_content_settings_map_factory.cc
index 9a405503f15bd..7edad568f1bb4 100644
index 5e4d0b203491b..dc5c8fb36d592 100644
--- chrome/browser/content_settings/host_content_settings_map_factory.cc
+++ chrome/browser/content_settings/host_content_settings_map_factory.cc
@@ -9,6 +9,7 @@
@@ -7,8 +7,8 @@ index 9a405503f15bd..7edad568f1bb4 100644
#include "build/build_config.h"
#include "build/buildflag.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/content_settings/one_time_geolocation_permission_provider.h"
#include "chrome/browser/permissions/last_tab_standing_tracker_factory.h"
#include "chrome/browser/content_settings/one_time_permission_provider.h"
#include "chrome/browser/permissions/one_time_permissions_tracker_factory.h"
#include "chrome/browser/profiles/off_the_record_profile_impl.h"
@@ -23,6 +24,10 @@
#include "extensions/buildflags/buildflags.h"
@@ -21,8 +21,8 @@ index 9a405503f15bd..7edad568f1bb4 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "base/trace_event/trace_event.h"
#include "extensions/browser/api/content_settings/content_settings_custom_extension_provider.h"
@@ -62,7 +67,13 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory()
DependsOn(TemplateURLServiceFactory::GetInstance());
@@ -63,7 +68,13 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory()
DependsOn(OneTimePermissionsTrackerFactory::GetInstance());
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_CEF)
@@ -35,8 +35,8 @@ index 9a405503f15bd..7edad568f1bb4 100644
#endif
// Used by way of ShouldRestoreOldSessionCookies().
#if BUILDFLAG(ENABLE_SESSION_SERVICE)
@@ -136,6 +147,9 @@ scoped_refptr<RefcountedKeyedService>
}
@@ -127,6 +138,9 @@ scoped_refptr<RefcountedKeyedService>
std::move(allowlist_provider));
#if BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_CEF)
@@ -45,7 +45,7 @@ index 9a405503f15bd..7edad568f1bb4 100644
// These must be registered before before the HostSettings are passed over to
// the IOThread. Simplest to do this on construction.
settings_map->RegisterProvider(
@@ -148,6 +162,9 @@ scoped_refptr<RefcountedKeyedService>
@@ -139,6 +153,9 @@ scoped_refptr<RefcountedKeyedService>
// the case where profile->IsOffTheRecord() is true? And what is the
// interaction with profile->IsGuestSession()?
false));

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/renderer_context_menu/render_view_context_menu.cc chrome/browser/renderer_context_menu/render_view_context_menu.cc
index 56f143c94da9c..8e6b18a9b92eb 100644
index 688c112eb8470..9b5aa9052efb2 100644
--- chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -316,6 +316,13 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() {
@@ -319,6 +319,13 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() {
return callback.get();
}
@@ -16,7 +16,7 @@ index 56f143c94da9c..8e6b18a9b92eb 100644
enum class UmaEnumIdLookupType {
GeneralEnumId,
ContextSpecificEnumId,
@@ -562,6 +569,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) {
@@ -565,6 +572,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) {
if (ContextMenuMatcher::IsExtensionsCustomCommandId(id))
return 1;
@@ -27,7 +27,7 @@ index 56f143c94da9c..8e6b18a9b92eb 100644
id = CollapseCommandsForUMA(id);
const auto& map = GetIdcToUmaMap(type);
auto it = map.find(id);
@@ -775,6 +786,14 @@ RenderViewContextMenu::RenderViewContextMenu(
@@ -786,6 +797,14 @@ RenderViewContextMenu::RenderViewContextMenu(
#if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
pdf_ocr_submenu_model_ = std::make_unique<ui::SimpleMenuModel>(this);
#endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
@@ -42,7 +42,7 @@ index 56f143c94da9c..8e6b18a9b92eb 100644
}
RenderViewContextMenu::~RenderViewContextMenu() = default;
@@ -1190,6 +1209,12 @@ void RenderViewContextMenu::InitMenu() {
@@ -1203,6 +1222,12 @@ void RenderViewContextMenu::InitMenu() {
// menu, meaning that each menu item added/removed in this function will cause
// it to visibly jump on the screen (see b/173569669).
AppendQuickAnswersItems();
@@ -55,7 +55,7 @@ index 56f143c94da9c..8e6b18a9b92eb 100644
}
Profile* RenderViewContextMenu::GetProfile() const {
@@ -3148,6 +3173,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting(
@@ -3165,6 +3190,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting(
execute_plugin_action_callback_ = std::move(cb);
}
@@ -69,7 +69,7 @@ index 56f143c94da9c..8e6b18a9b92eb 100644
RenderViewContextMenu::GetHandlersForLinkUrl() {
custom_handlers::ProtocolHandlerRegistry::ProtocolHandlerList handlers =
diff --git chrome/browser/renderer_context_menu/render_view_context_menu.h chrome/browser/renderer_context_menu/render_view_context_menu.h
index 4b6e2d55455c3..e25577396d5c1 100644
index b0505bb7375ee..85b9a58b4655f 100644
--- chrome/browser/renderer_context_menu/render_view_context_menu.h
+++ chrome/browser/renderer_context_menu/render_view_context_menu.h
@@ -142,6 +142,12 @@ class RenderViewContextMenu
@@ -85,7 +85,7 @@ index 4b6e2d55455c3..e25577396d5c1 100644
protected:
Profile* GetProfile() const;
@@ -389,6 +395,9 @@ class RenderViewContextMenu
@@ -394,6 +400,9 @@ class RenderViewContextMenu
// built.
bool is_protocol_submenu_valid_ = false;

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/file_select_helper.cc chrome/browser/file_select_helper.cc
index 0ff5db3d439bc..586a20ddc8a89 100644
index 1ee6c28cd47bc..62fd628dffd07 100644
--- chrome/browser/file_select_helper.cc
+++ chrome/browser/file_select_helper.cc
@@ -20,6 +20,7 @@
@@ -10,7 +10,7 @@ index 0ff5db3d439bc..586a20ddc8a89 100644
#include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/connectors/common.h"
#include "chrome/browser/platform_util.h"
@@ -254,6 +255,13 @@ void FileSelectHelper::OnListFile(
@@ -250,6 +251,13 @@ void FileSelectHelper::OnListFile(
void FileSelectHelper::LaunchConfirmationDialog(
const base::FilePath& path,
std::vector<ui::SelectedFileInfo> selected_files) {
@@ -24,7 +24,7 @@ index 0ff5db3d439bc..586a20ddc8a89 100644
ShowFolderUploadConfirmationDialog(
path,
base::BindOnce(&FileSelectHelper::ConvertToFileChooserFileInfoList, this),
@@ -338,6 +346,12 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded(
@@ -334,6 +342,12 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded(
if (AbortIfWebContentsDestroyed())
return;
@@ -37,7 +37,7 @@ index 0ff5db3d439bc..586a20ddc8a89 100644
#if BUILDFLAG(FULL_SAFE_BROWSING)
enterprise_connectors::ContentAnalysisDelegate::Data data;
if (enterprise_connectors::ContentAnalysisDelegate::IsEnabled(
@@ -526,7 +540,8 @@ bool FileSelectHelper::IsDirectoryEnumerationStartedForTesting() {
@@ -522,7 +536,8 @@ bool FileSelectHelper::IsDirectoryEnumerationStartedForTesting() {
std::unique_ptr<ui::SelectFileDialog::FileTypeInfo>
FileSelectHelper::GetFileTypesFromAcceptType(
@@ -47,7 +47,7 @@ index 0ff5db3d439bc..586a20ddc8a89 100644
auto base_file_type = std::make_unique<ui::SelectFileDialog::FileTypeInfo>();
if (accept_types.empty())
return base_file_type;
@@ -539,17 +554,24 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -535,17 +550,24 @@ FileSelectHelper::GetFileTypesFromAcceptType(
std::vector<base::FilePath::StringType>* extensions =
&file_type->extensions.back();
@@ -73,7 +73,7 @@ index 0ff5db3d439bc..586a20ddc8a89 100644
} else {
if (!base::IsStringASCII(accept_type))
continue;
@@ -560,10 +582,18 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -556,10 +578,18 @@ FileSelectHelper::GetFileTypesFromAcceptType(
description_id = IDS_AUDIO_FILES;
else if (ascii_type == "video/*")
description_id = IDS_VIDEO_FILES;
@@ -94,7 +94,7 @@ index 0ff5db3d439bc..586a20ddc8a89 100644
if (extensions->size() > old_extension_size)
valid_type_count++;
}
@@ -588,6 +618,15 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -584,6 +614,15 @@ FileSelectHelper::GetFileTypesFromAcceptType(
l10n_util::GetStringUTF16(description_id));
}
@@ -110,7 +110,7 @@ index 0ff5db3d439bc..586a20ddc8a89 100644
return file_type;
}
@@ -595,7 +634,8 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -591,7 +630,8 @@ FileSelectHelper::GetFileTypesFromAcceptType(
void FileSelectHelper::RunFileChooser(
content::RenderFrameHost* render_frame_host,
scoped_refptr<content::FileSelectListener> listener,
@@ -120,7 +120,7 @@ index 0ff5db3d439bc..586a20ddc8a89 100644
Profile* profile = Profile::FromBrowserContext(
render_frame_host->GetProcess()->GetBrowserContext());
@@ -614,6 +654,7 @@ void FileSelectHelper::RunFileChooser(
@@ -610,6 +650,7 @@ void FileSelectHelper::RunFileChooser(
// message.
scoped_refptr<FileSelectHelper> file_select_helper(
new FileSelectHelper(profile));
@@ -128,7 +128,7 @@ index 0ff5db3d439bc..586a20ddc8a89 100644
file_select_helper->RunFileChooser(render_frame_host, std::move(listener),
params.Clone());
}
@@ -667,7 +708,8 @@ void FileSelectHelper::RunFileChooser(
@@ -661,7 +702,8 @@ void FileSelectHelper::RunFileChooser(
}
void FileSelectHelper::GetFileTypesInThreadPool(FileChooserParamsPtr params) {
@@ -139,10 +139,10 @@ index 0ff5db3d439bc..586a20ddc8a89 100644
params->need_local_path ? ui::SelectFileDialog::FileTypeInfo::NATIVE_PATH
: ui::SelectFileDialog::FileTypeInfo::ANY_PATH;
diff --git chrome/browser/file_select_helper.h chrome/browser/file_select_helper.h
index d4b49202f61ce..4813ec70d9b1b 100644
index a900e41ccf973..4354a90469fd9 100644
--- chrome/browser/file_select_helper.h
+++ chrome/browser/file_select_helper.h
@@ -65,7 +65,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
@@ -61,7 +61,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
static void RunFileChooser(
content::RenderFrameHost* render_frame_host,
scoped_refptr<content::FileSelectListener> listener,
@@ -152,7 +152,7 @@ index d4b49202f61ce..4813ec70d9b1b 100644
// Enumerates all the files in directory.
static void EnumerateDirectory(
@@ -296,7 +297,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
@@ -288,7 +289,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
// |accept_types| contains only valid lowercased MIME types or file extensions
// beginning with a period (.).
static std::unique_ptr<ui::SelectFileDialog::FileTypeInfo>
@@ -162,7 +162,7 @@ index d4b49202f61ce..4813ec70d9b1b 100644
// Check the accept type is valid. It is expected to be all lower case with
// no whitespace.
@@ -361,6 +363,9 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
@@ -349,6 +351,9 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
// Set to false in unit tests since there is no WebContents.
bool abort_on_missing_web_contents_in_tests_ = true;

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/ui/views/chrome_javascript_app_modal_view_factory_views.cc chrome/browser/ui/views/chrome_javascript_app_modal_view_factory_views.cc
index d62e9fa67d534..e7bdaeb7b5e19 100644
index b169371e4d42f..509e4bda85b47 100644
--- chrome/browser/ui/views/chrome_javascript_app_modal_view_factory_views.cc
+++ chrome/browser/ui/views/chrome_javascript_app_modal_view_factory_views.cc
@@ -97,7 +97,7 @@ javascript_dialogs::AppModalDialogView* CreateViewsJavaScriptDialog(
@@ -100,7 +100,7 @@ javascript_dialogs::AppModalDialogView* CreateViewsJavaScriptDialog(
gfx::NativeWindow parent_window =
controller->web_contents()->GetTopLevelNativeWindow();
#if defined(USE_AURA)

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/extensions/api/chrome_extensions_api_client.cc chrome/browser/extensions/api/chrome_extensions_api_client.cc
index cc2cce154cbbf..4298bd8ab3f1c 100644
index 76cfedc631be6..7b04f6ef7353b 100644
--- chrome/browser/extensions/api/chrome_extensions_api_client.cc
+++ chrome/browser/extensions/api/chrome_extensions_api_client.cc
@@ -13,6 +13,7 @@
@@ -21,7 +21,7 @@ index cc2cce154cbbf..4298bd8ab3f1c 100644
#if BUILDFLAG(ENABLE_PDF)
#include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h"
#include "components/pdf/browser/pdf_web_contents_helper.h"
@@ -306,6 +311,11 @@ ChromeExtensionsAPIClient::CreateGuestViewManagerDelegate(
@@ -307,6 +312,11 @@ ChromeExtensionsAPIClient::CreateGuestViewManagerDelegate(
std::unique_ptr<MimeHandlerViewGuestDelegate>
ChromeExtensionsAPIClient::CreateMimeHandlerViewGuestDelegate(
MimeHandlerViewGuest* guest) const {

View File

@@ -0,0 +1,97 @@
diff --git chrome/browser/ui/views/frame/browser_frame_mac.h chrome/browser/ui/views/frame/browser_frame_mac.h
index ab1d8fd9bfa84..77f65b44e591a 100644
--- chrome/browser/ui/views/frame/browser_frame_mac.h
+++ chrome/browser/ui/views/frame/browser_frame_mac.h
@@ -12,6 +12,7 @@
#include "chrome/browser/command_observer.h"
#include "ui/views/widget/native_widget_mac.h"
+class Browser;
class BrowserFrame;
class BrowserView;
@class BrowserWindowTouchBarController;
@@ -55,6 +56,21 @@ class BrowserFrameMac : public views::NativeWidgetMac,
bool ShouldUseInitialVisibleOnAllWorkspaces() const override;
void AnnounceTextInInProcessWindow(const std::u16string& text) override;
+ static void ValidateUserInterfaceItem(
+ Browser* browser,
+ int32_t command,
+ remote_cocoa::mojom::ValidateUserInterfaceItemResult* result);
+ static bool WillExecuteCommand(
+ Browser* browser,
+ int32_t command,
+ WindowOpenDisposition window_open_disposition,
+ bool is_before_first_responder);
+ static bool ExecuteCommand(
+ Browser* browser,
+ int32_t command,
+ WindowOpenDisposition window_open_disposition,
+ bool is_before_first_responder);
+
protected:
~BrowserFrameMac() override;
diff --git chrome/browser/ui/views/frame/browser_frame_mac.mm chrome/browser/ui/views/frame/browser_frame_mac.mm
index 2290270c3e159..a4a0f4b3c5a33 100644
--- chrome/browser/ui/views/frame/browser_frame_mac.mm
+++ chrome/browser/ui/views/frame/browser_frame_mac.mm
@@ -181,7 +181,14 @@ void BrowserFrameMac::OnWindowFullscreenTransitionComplete() {
void BrowserFrameMac::ValidateUserInterfaceItem(
int32_t tag,
remote_cocoa::mojom::ValidateUserInterfaceItemResult* result) {
- Browser* browser = browser_view_->browser();
+ return ValidateUserInterfaceItem(browser_view_->browser(), tag, result);
+}
+
+// static
+void BrowserFrameMac::ValidateUserInterfaceItem(
+ Browser* browser,
+ int32_t tag,
+ remote_cocoa::mojom::ValidateUserInterfaceItemResult* result) {
if (!chrome::SupportsCommand(browser, tag)) {
result->enable = false;
return;
@@ -309,8 +316,16 @@ bool BrowserFrameMac::WillExecuteCommand(
int32_t command,
WindowOpenDisposition window_open_disposition,
bool is_before_first_responder) {
- Browser* browser = browser_view_->browser();
+ return WillExecuteCommand(browser_view_->browser(), command,
+ window_open_disposition, is_before_first_responder);
+}
+// static
+bool BrowserFrameMac::WillExecuteCommand(
+ Browser* browser,
+ int32_t command,
+ WindowOpenDisposition window_open_disposition,
+ bool is_before_first_responder) {
if (is_before_first_responder) {
// The specification for this private extensions API is incredibly vague.
// For now, we avoid triggering chrome commands prior to giving the
@@ -341,11 +356,20 @@ bool BrowserFrameMac::ExecuteCommand(
int32_t command,
WindowOpenDisposition window_open_disposition,
bool is_before_first_responder) {
- if (!WillExecuteCommand(command, window_open_disposition,
- is_before_first_responder))
- return false;
+ return ExecuteCommand(browser_view_->browser(), command,
+ window_open_disposition, is_before_first_responder);
+}
- Browser* browser = browser_view_->browser();
+// static
+bool BrowserFrameMac::ExecuteCommand(
+ Browser* browser,
+ int32_t command,
+ WindowOpenDisposition window_open_disposition,
+ bool is_before_first_responder) {
+ if (!WillExecuteCommand(browser, command, window_open_disposition,
+ is_before_first_responder)) {
+ return false;
+ }
chrome::ExecuteCommandWithDisposition(browser, command,
window_open_disposition);

View File

@@ -44,7 +44,7 @@ index 16107572d4d0d..409e9ea870482 100644
base::FeatureList::IsEnabled(
features::kPeriodicSyncPermissionForDefaultSearchEngine) &&
diff --git chrome/browser/permissions/chrome_permissions_client.cc chrome/browser/permissions/chrome_permissions_client.cc
index 1a2fe8936295a..033ecd276cf45 100644
index dfc443d307d52..4eb3b286b9838 100644
--- chrome/browser/permissions/chrome_permissions_client.cc
+++ chrome/browser/permissions/chrome_permissions_client.cc
@@ -14,6 +14,7 @@
@@ -55,7 +55,7 @@ index 1a2fe8936295a..033ecd276cf45 100644
#include "chrome/browser/bluetooth/bluetooth_chooser_context_factory.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
@@ -174,6 +175,9 @@ ChromePermissionsClient::GetPermissionDecisionAutoBlocker(
@@ -175,6 +176,9 @@ ChromePermissionsClient::GetPermissionDecisionAutoBlocker(
double ChromePermissionsClient::GetSiteEngagementScore(
content::BrowserContext* browser_context,
const GURL& origin) {
@@ -65,7 +65,7 @@ index 1a2fe8936295a..033ecd276cf45 100644
return site_engagement::SiteEngagementService::Get(
Profile::FromBrowserContext(browser_context))
->GetScore(origin);
@@ -321,8 +325,10 @@ ChromePermissionsClient::CreatePermissionUiSelectors(
@@ -331,8 +335,10 @@ ChromePermissionsClient::CreatePermissionUiSelectors(
std::make_unique<ContextualNotificationPermissionUiSelector>());
selectors.emplace_back(std::make_unique<PrefNotificationPermissionUiSelector>(
Profile::FromBrowserContext(browser_context)));

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/profiles/off_the_record_profile_impl.cc chrome/browser/profiles/off_the_record_profile_impl.cc
index 43431d7a42fe5..a440d7732f7dd 100644
index ec0e1b7be7209..ea85965f1f2c9 100644
--- chrome/browser/profiles/off_the_record_profile_impl.cc
+++ chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -659,7 +659,9 @@ std::unique_ptr<Profile> Profile::CreateOffTheRecordProfile(
@@ -664,7 +664,9 @@ std::unique_ptr<Profile> Profile::CreateOffTheRecordProfile(
#endif
if (!profile)
profile = std::make_unique<OffTheRecordProfileImpl>(parent, otr_profile_id);
@@ -14,7 +14,7 @@ index 43431d7a42fe5..a440d7732f7dd 100644
}
diff --git chrome/browser/profiles/profile.cc chrome/browser/profiles/profile.cc
index d035eb9f2bea7..0ff6726604022 100644
index 6cffe941b26f9..3e6223ab0d423 100644
--- chrome/browser/profiles/profile.cc
+++ chrome/browser/profiles/profile.cc
@@ -84,6 +84,7 @@ base::LazyInstance<std::set<content::BrowserContext*>>::Leaky
@@ -35,7 +35,7 @@ index d035eb9f2bea7..0ff6726604022 100644
base::CompareCase::SENSITIVE) ||
base::StartsWith(profile_id_, kMediaRouterOTRProfileIDPrefix,
@@ -141,6 +144,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique(
base::GUID::GenerateRandomV4().AsLowercaseString().c_str()));
base::Uuid::GenerateRandomV4().AsLowercaseString().c_str()));
}
+// static
@@ -52,10 +52,10 @@ index d035eb9f2bea7..0ff6726604022 100644
Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() {
return CreateUnique(kDevToolsOTRProfileIDPrefix);
diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h
index 1e6a22d95a53f..6ec4182bfc5e7 100644
index 5d6a5b65698c0..964541b2343de 100644
--- chrome/browser/profiles/profile.h
+++ chrome/browser/profiles/profile.h
@@ -99,6 +99,10 @@ class Profile : public content::BrowserContext {
@@ -100,6 +100,10 @@ class Profile : public content::BrowserContext {
// be applicable to run. Please see crbug.com/1098697#c3 for more details.
static OTRProfileID CreateUnique(const std::string& profile_id_prefix);
@@ -66,7 +66,7 @@ index 1e6a22d95a53f..6ec4182bfc5e7 100644
// Creates a unique OTR profile id to be used for DevTools browser contexts.
static OTRProfileID CreateUniqueForDevTools();
@@ -494,6 +498,8 @@ class Profile : public content::BrowserContext {
@@ -507,6 +511,8 @@ class Profile : public content::BrowserContext {
base::WeakPtr<Profile> GetWeakPtr();
@@ -75,7 +75,7 @@ index 1e6a22d95a53f..6ec4182bfc5e7 100644
protected:
// Creates an OffTheRecordProfile which points to this Profile.
static std::unique_ptr<Profile> CreateOffTheRecordProfile(
@@ -505,7 +511,6 @@ class Profile : public content::BrowserContext {
@@ -518,7 +524,6 @@ class Profile : public content::BrowserContext {
static PrefStore* CreateExtensionPrefStore(Profile*,
bool incognito_pref_store);
@@ -84,10 +84,10 @@ index 1e6a22d95a53f..6ec4182bfc5e7 100644
// Returns whether the user has signed in this profile to an account.
diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc
index 3ee6b902b6bc2..6416146fba8af 100644
index 57d728da590da..fc57b690011d6 100644
--- chrome/browser/profiles/profile_impl.cc
+++ chrome/browser/profiles/profile_impl.cc
@@ -1015,7 +1015,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id,
@@ -1036,7 +1036,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id,
otr_profiles_[otr_profile_id] = std::move(otr_profile);
@@ -99,10 +99,10 @@ index 3ee6b902b6bc2..6416146fba8af 100644
return raw_otr_profile;
}
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
index eab4bc302ef7d..9ed7d61345263 100644
index 2b0e6098334bf..9d7fdfc8401aa 100644
--- chrome/browser/profiles/profile_manager.cc
+++ chrome/browser/profiles/profile_manager.cc
@@ -392,7 +392,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
@@ -395,7 +395,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
base::Unretained(this)));
#endif
@@ -112,7 +112,7 @@ index eab4bc302ef7d..9ed7d61345263 100644
zombie_metrics_timer_.Start(FROM_HERE, base::Minutes(30), this,
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
index c3626f110e6fb..c7d70d32d8f37 100644
index 60c9fd19fe15b..2a3e317d9c240 100644
--- chrome/browser/profiles/profile_manager.h
+++ chrome/browser/profiles/profile_manager.h
@@ -130,7 +130,7 @@ class ProfileManager : public Profile::Delegate {
@@ -124,7 +124,7 @@ index c3626f110e6fb..c7d70d32d8f37 100644
// Returns regular or off-the-record profile given its profile key.
static Profile* GetProfileFromProfileKey(ProfileKey* profile_key);
@@ -171,7 +171,7 @@ class ProfileManager : public Profile::Delegate {
@@ -174,7 +174,7 @@ class ProfileManager : public Profile::Delegate {
// Returns true if the profile pointer is known to point to an existing
// profile.
@@ -134,21 +134,21 @@ index c3626f110e6fb..c7d70d32d8f37 100644
// Returns the directory where the first created profile is stored,
// relative to the user data directory currently in use.
diff --git chrome/browser/profiles/renderer_updater.cc chrome/browser/profiles/renderer_updater.cc
index b3cf2ad8d367b..431b44e39de40 100644
index 884e79cd54e0d..ed47d9a7d1bb4 100644
--- chrome/browser/profiles/renderer_updater.cc
+++ chrome/browser/profiles/renderer_updater.cc
@@ -8,6 +8,7 @@
@@ -9,6 +9,7 @@
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/content_settings/content_settings_manager_delegate.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -36,8 +37,10 @@ RendererUpdater::RendererUpdater(Profile* profile)
: profile_(profile),
is_off_the_record_(profile_->IsOffTheRecord()),
original_profile_(profile->GetOriginalProfile()) {
@@ -49,8 +50,10 @@ RendererUpdater::RendererUpdater(Profile* profile)
BoundSessionCookieRefreshServiceFactory::GetForProfile(profile))
#endif
{
+ if (!cef::IsAlloyRuntimeEnabled()) {
identity_manager_observation_.Observe(
IdentityManagerFactory::GetForProfile(original_profile_));

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn
index 5e6f67286ba3d..65411bd132294 100644
index aaa2a770e4c9f..8d524c456d9dc 100644
--- chrome/browser/safe_browsing/BUILD.gn
+++ chrome/browser/safe_browsing/BUILD.gn
@@ -32,6 +32,7 @@ static_library("safe_browsing") {

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/themes/theme_service.cc chrome/browser/themes/theme_service.cc
index c9a644a755c12..bf4ea541fb359 100644
index 67dc4a2e0695e..16f819e133886 100644
--- chrome/browser/themes/theme_service.cc
+++ chrome/browser/themes/theme_service.cc
@@ -30,6 +30,7 @@
@@ -10,7 +10,7 @@ index c9a644a755c12..bf4ea541fb359 100644
#include "chrome/browser/browser_features.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/theme_installed_infobar_delegate.h"
@@ -66,6 +67,10 @@
@@ -68,6 +69,10 @@
#include "ui/color/color_provider.h"
#include "ui/native_theme/native_theme.h"
@@ -21,7 +21,7 @@ index c9a644a755c12..bf4ea541fb359 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "base/scoped_observation.h"
#include "extensions/browser/extension_registry_observer.h"
@@ -268,11 +273,19 @@ void ThemeService::Init() {
@@ -270,11 +275,19 @@ void ThemeService::Init() {
// OnExtensionServiceReady. Otherwise, the ThemeObserver won't be
// constructed in time to observe the corresponding events.
#if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -42,7 +42,7 @@ index c9a644a755c12..bf4ea541fb359 100644
theme_syncable_service_ =
std::make_unique<ThemeSyncableService>(profile_, this);
diff --git chrome/browser/themes/theme_service_factory.cc chrome/browser/themes/theme_service_factory.cc
index e3a7101326eee..c6592c0d5a1ba 100644
index 622dcc82663c5..7fbe022c1f78b 100644
--- chrome/browser/themes/theme_service_factory.cc
+++ chrome/browser/themes/theme_service_factory.cc
@@ -7,6 +7,7 @@

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc
index cb9253cf1ab6a..b46c6b92a30ce 100644
index 95cd290b601a3..89e8ab892e5ea 100644
--- chrome/browser/plugins/plugin_info_host_impl.cc
+++ chrome/browser/plugins/plugin_info_host_impl.cc
@@ -140,6 +140,10 @@ bool IsPluginLoadingAccessibleResourceInWebView(
@@ -42,10 +42,10 @@ index 8b3f569882aeb..afc8007a6228b 100644
const extensions::Extension* extension =
registry->enabled_extensions().GetByID(extension_id);
diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc
index 846a2ee1b05d0..b77a01012bbbb 100644
index c5c1deb4a388c..6606f5bd417ca 100644
--- chrome/renderer/chrome_content_renderer_client.cc
+++ chrome/renderer/chrome_content_renderer_client.cc
@@ -1009,6 +1009,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -985,6 +985,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
if ((status == chrome::mojom::PluginStatus::kUnauthorized ||
status == chrome::mojom::PluginStatus::kBlocked) &&
@@ -53,7 +53,7 @@ index 846a2ee1b05d0..b77a01012bbbb 100644
content_settings_agent_delegate->IsPluginTemporarilyAllowed(
identifier)) {
status = chrome::mojom::PluginStatus::kAllowed;
@@ -1176,7 +1177,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1152,7 +1153,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
plugin_auth_host.BindNewEndpointAndPassReceiver());
plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier);
@@ -63,7 +63,7 @@ index 846a2ee1b05d0..b77a01012bbbb 100644
break;
}
case chrome::mojom::PluginStatus::kBlocked: {
@@ -1185,7 +1187,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1161,7 +1163,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
placeholder->AllowLoading();
RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked"));
@@ -73,7 +73,7 @@ index 846a2ee1b05d0..b77a01012bbbb 100644
break;
}
case chrome::mojom::PluginStatus::kBlockedByPolicy: {
@@ -1195,7 +1198,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1171,7 +1174,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
group_name));
RenderThread::Get()->RecordAction(
UserMetricsAction("Plugin_BlockedByPolicy"));

View File

@@ -1,5 +1,5 @@
diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn
index 0a535c03b96b0..3787cbc8dc8d0 100644
index a78e96688e039..7b56e77529899 100644
--- chrome/renderer/BUILD.gn
+++ chrome/renderer/BUILD.gn
@@ -5,6 +5,7 @@
@@ -10,7 +10,7 @@ index 0a535c03b96b0..3787cbc8dc8d0 100644
import("//chrome/common/features.gni")
import("//components/nacl/features.gni")
import("//components/offline_pages/buildflags/features.gni")
@@ -122,6 +123,7 @@ static_library("renderer") {
@@ -125,6 +126,7 @@ static_library("renderer") {
deps = [
"//base/allocator:buildflags",
"//build:chromeos_buildflags",
@@ -18,7 +18,7 @@ index 0a535c03b96b0..3787cbc8dc8d0 100644
"//chrome:resources",
"//chrome:strings",
"//chrome/common",
@@ -220,6 +222,10 @@ static_library("renderer") {
@@ -223,6 +225,10 @@ static_library("renderer") {
configs += [ "//build/config/compiler:wexit_time_destructors" ]

View File

@@ -1,5 +1,5 @@
diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc
index d4b31d11a51c4..534973146e405 100644
index fb5093709a104..2a69318c3e5e2 100644
--- chrome/app/chrome_main_delegate.cc
+++ chrome/app/chrome_main_delegate.cc
@@ -39,6 +39,7 @@
@@ -7,10 +7,10 @@ index d4b31d11a51c4..534973146e405 100644
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/buildflags.h"
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/chrome_resource_bundle_helper.h"
#include "chrome/browser/defaults.h"
@@ -498,6 +499,8 @@ struct MainFunction {
@@ -502,6 +503,8 @@ struct MainFunction {
// Initializes the user data dir. Must be called before InitializeLocalState().
void InitializeUserDataDir(base::CommandLine* command_line) {
@@ -19,7 +19,7 @@ index d4b31d11a51c4..534973146e405 100644
#if BUILDFLAG(IS_WIN)
// Reach out to chrome_elf for the truth on the user data directory.
// Note that in tests, this links to chrome_elf_test_stubs.
@@ -647,6 +650,10 @@ ChromeMainDelegate::~ChromeMainDelegate() {
@@ -651,6 +654,10 @@ ChromeMainDelegate::~ChromeMainDelegate() {
ChromeMainDelegate::~ChromeMainDelegate() = default;
#endif // !BUILDFLAG(IS_ANDROID)
@@ -30,7 +30,7 @@ index d4b31d11a51c4..534973146e405 100644
absl::optional<int> ChromeMainDelegate::PostEarlyInitialization(
InvokedIn invoked_in) {
DCHECK(base::ThreadPoolInstance::Get());
@@ -855,7 +862,8 @@ absl::optional<int> ChromeMainDelegate::PostEarlyInitialization(
@@ -867,7 +874,8 @@ absl::optional<int> ChromeMainDelegate::PostEarlyInitialization(
if (base::FeatureList::IsEnabled(
features::kWriteBasicSystemProfileToPersistentHistogramsFile)) {
@@ -40,7 +40,7 @@ index d4b31d11a51c4..534973146e405 100644
#if BUILDFLAG(IS_ANDROID)
record =
base::FeatureList::IsEnabled(chrome::android::kUmaBackgroundSessions);
@@ -1280,6 +1288,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1294,6 +1302,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
@@ -48,7 +48,7 @@ index d4b31d11a51c4..534973146e405 100644
crash_reporter::InitializeCrashKeys();
#if BUILDFLAG(IS_POSIX)
@@ -1290,6 +1299,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1304,6 +1313,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
InitMacCrashReporter(command_line, process_type);
SetUpInstallerPreferences(command_line);
#endif
@@ -56,7 +56,7 @@ index d4b31d11a51c4..534973146e405 100644
#if BUILDFLAG(IS_WIN)
child_process_logging::Init();
@@ -1484,6 +1494,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1498,6 +1508,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
}
@@ -64,7 +64,7 @@ index d4b31d11a51c4..534973146e405 100644
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
// Zygote needs to call InitCrashReporter() in RunZygote().
if (process_type != switches::kZygoteProcess) {
@@ -1527,6 +1538,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1541,6 +1552,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
// After all the platform Breakpads have been initialized, store the command
// line for crash reporting.
crash_keys::SetCrashKeysFromCommandLine(command_line);
@@ -72,7 +72,7 @@ index d4b31d11a51c4..534973146e405 100644
#if BUILDFLAG(ENABLE_PDF)
MaybePatchGdiGetFontData();
@@ -1650,6 +1662,7 @@ void ChromeMainDelegate::ZygoteForked() {
@@ -1664,6 +1676,7 @@ void ChromeMainDelegate::ZygoteForked() {
SetUpProfilingShutdownHandler();
}
@@ -80,7 +80,7 @@ index d4b31d11a51c4..534973146e405 100644
// Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets
// this up for the browser process in a different manner.
const base::CommandLine* command_line =
@@ -1672,6 +1685,7 @@ void ChromeMainDelegate::ZygoteForked() {
@@ -1686,6 +1699,7 @@ void ChromeMainDelegate::ZygoteForked() {
// Reset the command line for the newly spawned process.
crash_keys::SetCrashKeysFromCommandLine(*command_line);
@@ -88,7 +88,7 @@ index d4b31d11a51c4..534973146e405 100644
}
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
@@ -1763,11 +1777,12 @@ void ChromeMainDelegate::InitializeMemorySystem() {
@@ -1783,6 +1797,7 @@ void ChromeMainDelegate::InitializeMemorySystem() {
channel == version_info::Channel::DEV);
const bool gwp_asan_boost_sampling = is_canary_dev || is_browser_process;
@@ -96,9 +96,10 @@ index d4b31d11a51c4..534973146e405 100644
memory_system::Initializer()
.SetGwpAsanParameters(gwp_asan_boost_sampling, process_type)
.SetProfilingClientParameters(channel,
GetProfileParamsProcess(*command_line))
.SetDispatcherParameters(memory_system::DispatcherParameters::
PoissonAllocationSamplerInclusion::kEnforce)
@@ -1791,5 +1806,5 @@ void ChromeMainDelegate::InitializeMemorySystem() {
PoissonAllocationSamplerInclusion::kEnforce,
memory_system::DispatcherParameters::
AllocationTraceRecorderInclusion::kDynamic)
- .Initialize(memory_system_);
+ .Initialize(*memory_system_);
}
@@ -125,7 +126,7 @@ index dad9f981d2e01..29baaf84465a0 100644
#if BUILDFLAG(IS_CHROMEOS_LACROS)
std::unique_ptr<chromeos::LacrosService> lacros_service_;
diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc
index b74b87e496946..89cdeef75fea0 100644
index b759be27d35ab..75d3c03b748a2 100644
--- chrome/browser/chrome_browser_main.cc
+++ chrome/browser/chrome_browser_main.cc
@@ -51,6 +51,7 @@
@@ -136,7 +137,7 @@ index b74b87e496946..89cdeef75fea0 100644
#include "chrome/browser/about_flags.h"
#include "chrome/browser/active_use_util.h"
#include "chrome/browser/after_startup_task_utils.h"
@@ -1478,7 +1479,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1499,7 +1500,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
}
#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
@@ -145,7 +146,7 @@ index b74b87e496946..89cdeef75fea0 100644
// Handle special early return paths (which couldn't be processed even earlier
// as they require the process singleton to be held) first.
@@ -1525,7 +1526,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1546,7 +1547,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
return content::RESULT_CODE_NORMAL_EXIT;
#endif // BUILDFLAG(IS_WIN)
}
@@ -154,7 +155,7 @@ index b74b87e496946..89cdeef75fea0 100644
#if BUILDFLAG(IS_WIN)
// Check if there is any machine level Chrome installed on the current
@@ -1580,12 +1581,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1601,12 +1602,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
browser_process_->local_state());
}
@@ -169,7 +170,7 @@ index b74b87e496946..89cdeef75fea0 100644
#if BUILDFLAG(IS_ANDROID)
page_info::SetPageInfoClient(new ChromePageInfoClient());
@@ -1734,6 +1737,10 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1755,6 +1758,10 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
@@ -180,7 +181,7 @@ index b74b87e496946..89cdeef75fea0 100644
// This step is costly and is already measured in
// Startup.StartupBrowserCreator_Start.
// See the comment above for an explanation of |process_command_line|.
@@ -1772,11 +1779,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1793,11 +1800,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
// Create the RunLoop for MainMessageLoopRun() to use and transfer
// ownership of the browser's lifetime to the BrowserProcess.
@@ -234,10 +235,10 @@ index d495e1a903fd8..31cf6632e831c 100644
+#endif
}
diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc
index cfbed0fd8183a..63529099116e4 100644
index bb3d32d4f4909..7c05c6064dd6e 100644
--- chrome/browser/chrome_content_browser_client.cc
+++ chrome/browser/chrome_content_browser_client.cc
@@ -37,6 +37,7 @@
@@ -40,6 +40,7 @@
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
@@ -245,17 +246,17 @@ index cfbed0fd8183a..63529099116e4 100644
#include "chrome/browser/accessibility/accessibility_labels_service.h"
#include "chrome/browser/accessibility/accessibility_labels_service_factory.h"
#include "chrome/browser/after_startup_task_utils.h"
@@ -1523,6 +1524,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() {
@@ -1558,6 +1559,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() {
}
ChromeContentBrowserClient::ChromeContentBrowserClient() {
+ keepalive_timer_.reset(new base::OneShotTimer());
+
#if BUILDFLAG(ENABLE_PLUGINS)
extra_parts_.push_back(new ChromeContentBrowserClientPluginsPart);
#endif
@@ -1548,6 +1551,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() {
extra_parts_.clear();
extra_parts_.push_back(
std::make_unique<ChromeContentBrowserClientPluginsPart>());
@@ -1590,6 +1593,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() {
}
}
+void ChromeContentBrowserClient::CleanupOnUIThread() {
@@ -266,7 +267,7 @@ index cfbed0fd8183a..63529099116e4 100644
// static
void ChromeContentBrowserClient::RegisterLocalStatePrefs(
PrefRegistrySimple* registry) {
@@ -4342,9 +4350,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
@@ -4412,9 +4420,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
&search::HandleNewTabURLReverseRewrite);
#endif // BUILDFLAG(IS_ANDROID)
@@ -278,7 +279,7 @@ index cfbed0fd8183a..63529099116e4 100644
}
base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() {
@@ -6240,7 +6250,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated(
@@ -6333,7 +6343,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated(
#endif
}
@@ -287,7 +288,7 @@ index cfbed0fd8183a..63529099116e4 100644
content::BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -6258,6 +6268,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams(
@@ -6351,6 +6361,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams(
network_context_params->user_agent = GetUserAgentBasedOnPolicy(context);
network_context_params->accept_language = GetApplicationLocale();
}
@@ -296,7 +297,7 @@ index cfbed0fd8183a..63529099116e4 100644
}
std::vector<base::FilePath>
@@ -7194,10 +7206,10 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted(
@@ -7340,10 +7352,10 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted(
const auto now = base::TimeTicks::Now();
const auto timeout = GetKeepaliveTimerTimeout(context);
keepalive_deadline_ = std::max(keepalive_deadline_, now + timeout);
@@ -309,7 +310,7 @@ index cfbed0fd8183a..63529099116e4 100644
FROM_HERE, keepalive_deadline_ - now,
base::BindOnce(
&ChromeContentBrowserClient::OnKeepaliveTimerFired,
@@ -7216,7 +7228,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() {
@@ -7362,7 +7374,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() {
--num_keepalive_requests_;
if (num_keepalive_requests_ == 0) {
DVLOG(1) << "Stopping the keepalive timer";
@@ -319,7 +320,7 @@ index cfbed0fd8183a..63529099116e4 100644
// This deletes the keep alive handle attached to the timer function and
// unblock the shutdown sequence.
}
@@ -7352,7 +7365,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired(
@@ -7498,7 +7511,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired(
const auto now = base::TimeTicks::Now();
const auto then = keepalive_deadline_;
if (now < then) {
@@ -329,10 +330,10 @@ index cfbed0fd8183a..63529099116e4 100644
base::BindOnce(&ChromeContentBrowserClient::OnKeepaliveTimerFired,
weak_factory_.GetWeakPtr(),
diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h
index d2337ac7d7fbf..af49a2589cabf 100644
index 30ee8cf906f70..09e4fa568c05a 100644
--- chrome/browser/chrome_content_browser_client.h
+++ chrome/browser/chrome_content_browser_client.h
@@ -133,6 +133,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
@@ -134,6 +134,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
~ChromeContentBrowserClient() override;
@@ -341,7 +342,7 @@ index d2337ac7d7fbf..af49a2589cabf 100644
// TODO(https://crbug.com/787567): This file is about calls from content/ out
// to chrome/ to get values or notify about events, but both of these
// functions are from chrome/ to chrome/ and don't involve content/ at all.
@@ -616,7 +618,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
@@ -618,7 +620,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
override;
void OnNetworkServiceCreated(
network::mojom::NetworkService* network_service) override;
@@ -350,7 +351,7 @@ index d2337ac7d7fbf..af49a2589cabf 100644
content::BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -989,7 +991,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
@@ -998,7 +1000,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
#if !BUILDFLAG(IS_ANDROID)
uint64_t num_keepalive_requests_ = 0;
@@ -360,10 +361,10 @@ index d2337ac7d7fbf..af49a2589cabf 100644
#endif
diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc
index bc342655b8367..bc7cbc93dac17 100644
index d11c0f1334924..47f8edcf62b3a 100644
--- chrome/browser/prefs/browser_prefs.cc
+++ chrome/browser/prefs/browser_prefs.cc
@@ -12,6 +12,7 @@
@@ -13,6 +13,7 @@
#include "build/build_config.h"
#include "build/chromecast_buildflags.h"
#include "build/chromeos_buildflags.h"
@@ -382,7 +383,7 @@ index bc342655b8367..bc7cbc93dac17 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/accessibility/animation_policy_prefs.h"
#include "chrome/browser/apps/platform_apps/shortcut_manager.h"
@@ -1365,6 +1370,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
@@ -1369,6 +1374,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
// This is intentionally last.
RegisterLocalStatePrefsForMigration(registry);
@@ -394,7 +395,7 @@ index bc342655b8367..bc7cbc93dac17 100644
}
// Register prefs applicable to all profiles.
@@ -1759,6 +1769,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
@@ -1766,6 +1776,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
const std::string& locale) {
RegisterProfilePrefs(registry, locale);

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc
index dc085f13cb279..bad8857a44807 100644
index 2a14f1b7c2f51..e679d7a24783b 100644
--- chrome/browser/ui/browser_command_controller.cc
+++ chrome/browser/ui/browser_command_controller.cc
@@ -389,6 +389,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
@@ -394,6 +394,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
// choose to not implement CommandUpdaterDelegate inside this class and
// therefore command_updater_ doesn't have the delegate set).
if (!SupportsCommand(id) || !IsCommandEnabled(id)) {
@@ -10,7 +10,7 @@ index dc085f13cb279..bad8857a44807 100644
return false;
}
@@ -405,6 +406,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
@@ -410,6 +411,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
DCHECK(command_updater_.IsCommandEnabled(id))
<< "Invalid/disabled command " << id;
@@ -24,7 +24,7 @@ index dc085f13cb279..bad8857a44807 100644
// The order of commands in this switch statement must match the function
// declaration order in browser.h!
switch (id) {
@@ -1050,11 +1058,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
@@ -1089,11 +1097,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
// BrowserCommandController, private:
bool BrowserCommandController::IsShowingMainUI() {
@@ -41,11 +41,11 @@ index dc085f13cb279..bad8857a44807 100644
bool BrowserCommandController::IsWebAppOrCustomTab() const {
diff --git chrome/browser/ui/toolbar/app_menu_model.cc chrome/browser/ui/toolbar/app_menu_model.cc
index f505dbc9aa7b9..de2fa3e6732f5 100644
index e881f0cffc04f..f58fe5aab7685 100644
--- chrome/browser/ui/toolbar/app_menu_model.cc
+++ chrome/browser/ui/toolbar/app_menu_model.cc
@@ -157,6 +157,57 @@ absl::optional<std::u16string> GetInstallPWAAppMenuItemName(Browser* browser) {
ui::EscapeMenuLabelAmpersands(app_name));
@@ -176,6 +176,57 @@ bool IsPasswordManagerPage(const GURL& url) {
url.DomainIs(password_manager::kChromeUIPasswordManagerHost);
}
+#if BUILDFLAG(ENABLE_CEF)
@@ -102,7 +102,7 @@ index f505dbc9aa7b9..de2fa3e6732f5 100644
} // namespace
////////////////////////////////////////////////////////////////////////////////
@@ -811,7 +862,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const {
@@ -908,7 +959,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const {
return false;
}
@@ -111,7 +111,7 @@ index f505dbc9aa7b9..de2fa3e6732f5 100644
GlobalError* error =
GlobalErrorServiceFactory::GetForProfile(browser_->profile())
->GetGlobalErrorByMenuItemCommandID(command_id);
@@ -826,7 +877,7 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const {
@@ -923,7 +974,7 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const {
}
}
@@ -120,7 +120,7 @@ index f505dbc9aa7b9..de2fa3e6732f5 100644
switch (command_id) {
case IDC_PIN_TO_START_SCREEN:
return false;
@@ -849,6 +900,34 @@ bool AppMenuModel::IsCommandIdVisible(int command_id) const {
@@ -946,6 +997,34 @@ bool AppMenuModel::IsCommandIdVisible(int command_id) const {
}
}
@@ -155,44 +155,47 @@ index f505dbc9aa7b9..de2fa3e6732f5 100644
bool AppMenuModel::IsCommandIdAlerted(int command_id) const {
if ((command_id == IDC_RECENT_TABS_MENU) ||
(command_id == AppMenuModel::kMinRecentTabsCommandId)) {
@@ -965,9 +1044,13 @@ void AppMenuModel::Build() {
kExtensionsMenuItem);
@@ -1097,11 +1176,15 @@ void AppMenuModel::Build() {
}
}
- AddSeparator(ui::LOWER_SEPARATOR);
- AddSeparator(features::IsChromeRefresh2023() ? ui::NORMAL_SEPARATOR
- : ui::LOWER_SEPARATOR);
- CreateZoomMenu();
- AddSeparator(ui::UPPER_SEPARATOR);
- AddSeparator(features::IsChromeRefresh2023() ? ui::NORMAL_SEPARATOR
- : ui::UPPER_SEPARATOR);
+ if (IsCommandIdVisible(IDC_ZOOM_MENU)) {
+ AddSeparator(ui::LOWER_SEPARATOR);
+ AddSeparator(features::IsChromeRefresh2023() ? ui::NORMAL_SEPARATOR
+ : ui::LOWER_SEPARATOR);
+ CreateZoomMenu();
+ AddSeparator(ui::UPPER_SEPARATOR);
+ AddSeparator(features::IsChromeRefresh2023() ? ui::NORMAL_SEPARATOR
+ : ui::UPPER_SEPARATOR);
+ } else {
+ AddSeparator(ui::NORMAL_SEPARATOR);
+ }
AddItemWithStringId(IDC_PRINT, IDS_PRINT);
@@ -1031,9 +1114,14 @@ void AppMenuModel::Build() {
sub_menus_.back().get());
SetElementIdentifierAt(GetIndexOfCommandId(IDC_MORE_TOOLS_MENU).value(),
@@ -1190,9 +1273,13 @@ void AppMenuModel::Build() {
kMoreToolsMenuItem);
- AddSeparator(ui::LOWER_SEPARATOR);
- CreateCutCopyPasteMenu();
- AddSeparator(ui::UPPER_SEPARATOR);
+
+ if (IsCommandIdVisible(IDC_EDIT_MENU)) {
+ AddSeparator(ui::LOWER_SEPARATOR);
+ CreateCutCopyPasteMenu();
+ AddSeparator(ui::UPPER_SEPARATOR);
+ } else {
+ AddSeparator(ui::NORMAL_SEPARATOR);
+ }
AddItemWithStringId(IDC_OPTIONS, IDS_SETTINGS);
// The help submenu is only displayed on official Chrome builds. As the
@@ -1070,6 +1158,11 @@ void AppMenuModel::Build() {
if (!features::IsChromeRefresh2023()) {
- AddSeparator(ui::LOWER_SEPARATOR);
- CreateCutCopyPasteMenu();
- AddSeparator(ui::UPPER_SEPARATOR);
+ if (IsCommandIdVisible(IDC_EDIT_MENU)) {
+ AddSeparator(ui::LOWER_SEPARATOR);
+ CreateCutCopyPasteMenu();
+ AddSeparator(ui::UPPER_SEPARATOR);
+ } else {
+ AddSeparator(ui::NORMAL_SEPARATOR);
+ }
}
if (!features::IsChromeRefresh2023()) {
@@ -1278,6 +1365,11 @@ void AppMenuModel::Build() {
set_icon(IDC_EXIT, kExitMenuIcon);
}
#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(ENABLE_CEF)
+ FilterMenuModel(this, base::BindRepeating(&AppMenuModel::IsCommandIdVisible,
@@ -203,10 +206,10 @@ index f505dbc9aa7b9..de2fa3e6732f5 100644
}
diff --git chrome/browser/ui/toolbar/app_menu_model.h chrome/browser/ui/toolbar/app_menu_model.h
index 26545b0cee2c1..118cf0df456d6 100644
index 55fb00dbc746a..396eac70f92fd 100644
--- chrome/browser/ui/toolbar/app_menu_model.h
+++ chrome/browser/ui/toolbar/app_menu_model.h
@@ -230,6 +230,9 @@ class AppMenuModel : public ui::SimpleMenuModel,
@@ -254,6 +254,9 @@ class AppMenuModel : public ui::SimpleMenuModel,
// Appends a zoom menu (without separators).
void CreateZoomMenu();
@@ -214,10 +217,27 @@ index 26545b0cee2c1..118cf0df456d6 100644
+ bool IsCommandIdVisibleInternal(int command_id) const;
+
private:
friend class ::MockAppMenuModel;
// Adds actionable global error menu items to the menu.
// Examples: Extension permissions and sign in errors.
diff --git chrome/browser/ui/views/find_bar_host.cc chrome/browser/ui/views/find_bar_host.cc
index 59024587ef6b7..0c30aa71768cf 100644
--- chrome/browser/ui/views/find_bar_host.cc
+++ chrome/browser/ui/views/find_bar_host.cc
@@ -412,6 +412,12 @@ void FindBarHost::GetWidgetBounds(gfx::Rect* bounds) {
// The BrowserView does Layout for the components that we care about
// positioning relative to, so we ask it to tell us where we should go.
*bounds = browser_view()->GetFindBarBoundingBox();
+
+#if BUILDFLAG(ENABLE_CEF)
+ if (browser_view()->browser() && browser_view()->browser()->cef_delegate()) {
+ browser_view()->browser()->cef_delegate()->UpdateFindBarBoundingBox(bounds);
+ }
+#endif
}
void FindBarHost::RegisterAccelerators() {
diff --git chrome/browser/ui/views/frame/browser_frame.cc chrome/browser/ui/views/frame/browser_frame.cc
index 8da09b8c01c3f..d4f2a855bb8e8 100644
index 618e1b254389e..0b5a25ffe96c3 100644
--- chrome/browser/ui/views/frame/browser_frame.cc
+++ chrome/browser/ui/views/frame/browser_frame.cc
@@ -71,15 +71,23 @@ bool IsUsingLinuxSystemTheme(Profile* profile) {
@@ -246,7 +266,7 @@ index 8da09b8c01c3f..d4f2a855bb8e8 100644
}
BrowserFrame::~BrowserFrame() {}
@@ -170,6 +178,12 @@ void BrowserFrame::LayoutWebAppWindowTitle(
@@ -174,6 +182,12 @@ void BrowserFrame::LayoutWebAppWindowTitle(
}
int BrowserFrame::GetTopInset() const {
@@ -259,7 +279,7 @@ index 8da09b8c01c3f..d4f2a855bb8e8 100644
return browser_frame_view_->GetTopInset(false);
}
@@ -186,6 +200,8 @@ BrowserNonClientFrameView* BrowserFrame::GetFrameView() const {
@@ -190,6 +204,8 @@ BrowserNonClientFrameView* BrowserFrame::GetFrameView() const {
}
bool BrowserFrame::UseCustomFrame() const {
@@ -268,7 +288,7 @@ index 8da09b8c01c3f..d4f2a855bb8e8 100644
return native_browser_frame_->UseCustomFrame();
}
@@ -199,20 +215,30 @@ bool BrowserFrame::ShouldDrawFrameHeader() const {
@@ -203,20 +219,30 @@ bool BrowserFrame::ShouldDrawFrameHeader() const {
void BrowserFrame::GetWindowPlacement(gfx::Rect* bounds,
ui::WindowShowState* show_state) const {
@@ -299,7 +319,7 @@ index 8da09b8c01c3f..d4f2a855bb8e8 100644
browser_frame_view_->OnBrowserViewInitViewsComplete();
}
@@ -274,7 +300,7 @@ const ui::ThemeProvider* BrowserFrame::GetThemeProvider() const {
@@ -278,7 +304,7 @@ const ui::ThemeProvider* BrowserFrame::GetThemeProvider() const {
ui::ColorProviderManager::ThemeInitializerSupplier*
BrowserFrame::GetCustomTheme() const {
// Do not return any custom theme if the browser has to use the dark theme.
@@ -308,7 +328,7 @@ index 8da09b8c01c3f..d4f2a855bb8e8 100644
return nullptr;
Browser* browser = browser_view_->browser();
@@ -291,6 +317,8 @@ BrowserFrame::GetCustomTheme() const {
@@ -295,6 +321,8 @@ BrowserFrame::GetCustomTheme() const {
}
void BrowserFrame::OnNativeWidgetWorkspaceChanged() {
@@ -317,7 +337,7 @@ index 8da09b8c01c3f..d4f2a855bb8e8 100644
chrome::SaveWindowWorkspace(browser_view_->browser(), GetWorkspace());
chrome::SaveWindowVisibleOnAllWorkspaces(browser_view_->browser(),
IsVisibleOnAllWorkspaces());
@@ -388,6 +416,8 @@ void BrowserFrame::SetTabDragKind(TabDragKind tab_drag_kind) {
@@ -402,6 +430,8 @@ void BrowserFrame::SetTabDragKind(TabDragKind tab_drag_kind) {
ui::ColorProviderManager::Key BrowserFrame::GetColorProviderKey() const {
auto key = Widget::GetColorProviderKey();
@@ -326,7 +346,7 @@ index 8da09b8c01c3f..d4f2a855bb8e8 100644
key.frame_type = UseCustomFrame()
? ui::ColorProviderManager::FrameType::kChromium
: ui::ColorProviderManager::FrameType::kNative;
@@ -397,6 +427,9 @@ ui::ColorProviderManager::Key BrowserFrame::GetColorProviderKey() const {
@@ -411,6 +441,9 @@ ui::ColorProviderManager::Key BrowserFrame::GetColorProviderKey() const {
}
absl::optional<SkColor> BrowserFrame::GetUserColor() const {
@@ -336,7 +356,7 @@ index 8da09b8c01c3f..d4f2a855bb8e8 100644
#if BUILDFLAG(IS_CHROMEOS_ASH)
// ChromeOS SystemWebApps use the OS theme all the time.
if (ash::IsSystemWebApp(browser_view_->browser())) {
@@ -489,5 +522,7 @@ bool BrowserFrame::RegenerateFrameOnThemeChange(
@@ -503,5 +536,7 @@ bool BrowserFrame::RegenerateFrameOnThemeChange(
}
bool BrowserFrame::ShouldUseDarkTheme() const {
@@ -345,7 +365,7 @@ index 8da09b8c01c3f..d4f2a855bb8e8 100644
return browser_view_->browser()->profile()->IsIncognitoProfile();
}
diff --git chrome/browser/ui/views/frame/browser_frame.h chrome/browser/ui/views/frame/browser_frame.h
index d9fb9af4db3eb..4a809ee9962fd 100644
index ea9371d731de0..9398b262c8d83 100644
--- chrome/browser/ui/views/frame/browser_frame.h
+++ chrome/browser/ui/views/frame/browser_frame.h
@@ -61,7 +61,9 @@ enum class TabDragKind {
@@ -359,7 +379,7 @@ index d9fb9af4db3eb..4a809ee9962fd 100644
BrowserFrame(const BrowserFrame&) = delete;
BrowserFrame& operator=(const BrowserFrame&) = delete;
diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc
index 2325af914bd63..9498778a7256e 100644
index 6f9c8b1d38430..7250c21e5e781 100644
--- chrome/browser/ui/views/frame/browser_view.cc
+++ chrome/browser/ui/views/frame/browser_view.cc
@@ -308,11 +308,10 @@ using content::NativeWebKeyboardEvent;
@@ -427,7 +447,7 @@ index 2325af914bd63..9498778a7256e 100644
contents_separator_ =
top_container_->AddChildView(std::make_unique<ContentsSeparator>());
@@ -1802,6 +1818,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const {
@@ -1805,6 +1821,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const {
if (immersive_mode_controller_->IsEnabled())
return false;
@@ -436,7 +456,7 @@ index 2325af914bd63..9498778a7256e 100644
return frame_->GetFrameView()->ShouldHideTopUIForFullscreen();
}
@@ -2694,7 +2712,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() {
@@ -2703,7 +2721,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() {
}
DownloadBubbleUIController* BrowserView::GetDownloadBubbleUIController() {
@@ -446,7 +466,7 @@ index 2325af914bd63..9498778a7256e 100644
if (auto* download_button = toolbar_button_provider_->GetDownloadButton())
return download_button->bubble_controller();
return nullptr;
@@ -3194,7 +3213,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
@@ -3203,7 +3222,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
if (top_container()->parent() == this)
return;
@@ -456,7 +476,7 @@ index 2325af914bd63..9498778a7256e 100644
top_container()->DestroyLayer();
AddChildViewAt(top_container(), 0);
EnsureFocusOrder();
@@ -3747,8 +3767,10 @@ void BrowserView::Layout() {
@@ -3756,8 +3776,10 @@ void BrowserView::Layout() {
// TODO(jamescook): Why was this in the middle of layout code?
toolbar_->location_bar()->omnibox_view()->SetFocusBehavior(
@@ -469,7 +489,7 @@ index 2325af914bd63..9498778a7256e 100644
// Some of the situations when the BrowserView is laid out are:
// - Enter/exit immersive fullscreen mode.
@@ -3814,6 +3836,11 @@ void BrowserView::AddedToWidget() {
@@ -3823,6 +3845,11 @@ void BrowserView::AddedToWidget() {
SetThemeProfileForWindow(GetNativeWindow(), browser_->profile());
#endif
@@ -481,7 +501,7 @@ index 2325af914bd63..9498778a7256e 100644
toolbar_->Init();
// TODO(pbos): Investigate whether the side panels should be creatable when
@@ -3860,13 +3887,9 @@ void BrowserView::AddedToWidget() {
@@ -3869,13 +3896,9 @@ void BrowserView::AddedToWidget() {
EnsureFocusOrder();
@@ -497,7 +517,7 @@ index 2325af914bd63..9498778a7256e 100644
using_native_frame_ = frame_->ShouldUseNativeFrame();
MaybeInitializeWebUITabStrip();
@@ -4272,7 +4295,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
@@ -4281,7 +4304,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
// Undo our anti-jankiness hacks and force a re-layout.
in_process_fullscreen_ = false;
ToolbarSizeChanged(false);
@@ -507,7 +527,7 @@ index 2325af914bd63..9498778a7256e 100644
}
bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const {
@@ -4628,6 +4652,8 @@ Profile* BrowserView::GetProfile() {
@@ -4637,6 +4661,8 @@ Profile* BrowserView::GetProfile() {
}
void BrowserView::UpdateUIForTabFullscreen() {
@@ -516,7 +536,7 @@ index 2325af914bd63..9498778a7256e 100644
frame()->GetFrameView()->UpdateFullscreenTopUI();
}
@@ -4650,6 +4676,8 @@ void BrowserView::HideDownloadShelf() {
@@ -4659,6 +4685,8 @@ void BrowserView::HideDownloadShelf() {
}
bool BrowserView::CanUserExitFullscreen() const {
@@ -526,7 +546,7 @@ index 2325af914bd63..9498778a7256e 100644
}
diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h
index a2693a336f830..74d7864151d62 100644
index 3eb7c4bd065e1..05ef8266d8650 100644
--- chrome/browser/ui/views/frame/browser_view.h
+++ chrome/browser/ui/views/frame/browser_view.h
@@ -124,11 +124,16 @@ class BrowserView : public BrowserWindow,
@@ -546,7 +566,7 @@ index a2693a336f830..74d7864151d62 100644
void set_frame(BrowserFrame* frame) {
frame_ = frame;
paint_as_active_subscription_ =
@@ -773,6 +778,12 @@ class BrowserView : public BrowserWindow,
@@ -784,6 +789,12 @@ class BrowserView : public BrowserWindow,
return web_app_frame_toolbar();
}
@@ -622,10 +642,10 @@ index 0dcdb241b98f7..1117776bbc85c 100644
case PageActionIconType::kPaymentsOfferNotification:
add_page_action_icon(
diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index f4a5c3ad8cc9c..4f9c1a111e7ce 100644
index 73eff726270d3..be211a4a285be 100644
--- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -565,33 +565,47 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
@@ -569,33 +569,47 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
}
bool BrowserTabStripController::IsFrameCondensed() const {
@@ -674,10 +694,10 @@ index f4a5c3ad8cc9c..4f9c1a111e7ce 100644
}
diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc
index f2b0bd4099b4f..89b7520e359c3 100644
index f650013dafc56..239f6551658d0 100644
--- chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -169,12 +169,13 @@ constexpr int kToolbarDividerCornerRadius = 1;
@@ -173,12 +173,13 @@ constexpr int kToolbarDividerSpacing = 9;
////////////////////////////////////////////////////////////////////////////////
// ToolbarView, public:
@@ -693,19 +713,10 @@ index f2b0bd4099b4f..89b7520e359c3 100644
SetID(VIEW_ID_TOOLBAR);
if (display_mode_ == DisplayMode::NORMAL) {
@@ -205,7 +206,7 @@ void ToolbarView::Init() {
#endif
auto location_bar = std::make_unique<LocationBarView>(
browser_, browser_->profile(), browser_->command_controller(), this,
- display_mode_ != DisplayMode::NORMAL);
+ display_mode_ != DisplayMode::NORMAL && !browser_->toolbar_overridden());
// Make sure the toolbar shows by default.
size_animation_.Reset(1);
@@ -229,6 +230,19 @@ void ToolbarView::Init() {
browser, command, ui::DispositionFromEventFlags(event.flags()));
};
@@ -200,6 +201,19 @@ ToolbarView::~ToolbarView() {
}
void ToolbarView::Init() {
+#if BUILDFLAG(ENABLE_CEF)
+ using ToolbarButtonType = cef::BrowserDelegate::ToolbarButtonType;
+ auto button_visible = [this](ToolbarButtonType type) {
@@ -719,10 +730,26 @@ index f2b0bd4099b4f..89b7520e359c3 100644
+ #define BUTTON_VISIBLE(type) true
+#endif
+
std::unique_ptr<ToolbarButton> back = std::make_unique<BackForwardButton>(
BackForwardButton::Direction::kBack,
base::BindRepeating(callback, browser_, IDC_BACK), browser_);
@@ -258,8 +272,10 @@ void ToolbarView::Init() {
#if defined(USE_AURA)
// Avoid generating too many occlusion tracking calculation events before this
// function returns. The occlusion status will be computed only once once this
@@ -209,12 +223,13 @@ void ToolbarView::Init() {
#endif
auto location_bar = std::make_unique<LocationBarView>(
browser_, browser_->profile(), browser_->command_controller(), this,
- display_mode_ != DisplayMode::NORMAL);
+ display_mode_ != DisplayMode::NORMAL && !browser_->toolbar_overridden());
// Make sure the toolbar shows by default.
size_animation_.Reset(1);
std::unique_ptr<DownloadToolbarButtonView> download_button;
- if (download::IsDownloadBubbleEnabled(browser_->profile())) {
+ if (download::IsDownloadBubbleEnabled(browser_->profile()) &&
+ BUTTON_VISIBLE(kDownload)) {
download_button =
std::make_unique<DownloadToolbarButtonView>(browser_view_);
}
@@ -295,8 +310,10 @@ void ToolbarView::Init() {
}
}
std::unique_ptr<media_router::CastToolbarButton> cast;
@@ -734,16 +761,7 @@ index f2b0bd4099b4f..89b7520e359c3 100644
std::unique_ptr<MediaToolbarButtonView> media_button;
if (base::FeatureList::IsEnabled(media::kGlobalMediaControls)) {
@@ -268,14 +284,16 @@ void ToolbarView::Init() {
}
std::unique_ptr<DownloadToolbarButtonView> download_button;
- if (download::IsDownloadBubbleEnabled(browser_->profile())) {
+ if (download::IsDownloadBubbleEnabled(browser_->profile()) &&
+ BUTTON_VISIBLE(kDownload)) {
download_button =
std::make_unique<DownloadToolbarButtonView>(browser_view_);
}
@@ -306,7 +323,8 @@ void ToolbarView::Init() {
std::unique_ptr<send_tab_to_self::SendTabToSelfToolbarIconView>
send_tab_to_self_button;
@@ -753,15 +771,15 @@ index f2b0bd4099b4f..89b7520e359c3 100644
send_tab_to_self_button =
std::make_unique<send_tab_to_self::SendTabToSelfToolbarIconView>(
browser_view_);
@@ -283,7 +301,7 @@ void ToolbarView::Init() {
@@ -314,7 +332,7 @@ void ToolbarView::Init() {
std::unique_ptr<SidePanelToolbarButton> side_panel_button;
std::unique_ptr<SidePanelToolbarContainer> side_panel_toolbar_container;
- if (browser_view_->unified_side_panel()) {
+ if (browser_view_->unified_side_panel() && BUTTON_VISIBLE(kSidePanel)) {
if (base::FeatureList::IsEnabled(features::kSidePanelCompanion)) {
if (base::FeatureList::IsEnabled(
companion::features::kSidePanelCompanion)) {
side_panel_toolbar_container =
std::make_unique<SidePanelToolbarContainer>(browser_view_);
diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h
index b3c20d4eaf0b3..62aef2fbc752d 100644
--- chrome/browser/ui/views/toolbar/toolbar_view.h

View File

@@ -1,8 +1,8 @@
diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h
index 8ac089ad10e93..7205803b7156c 100644
index 108bab494ea98..97ec37795ce8b 100644
--- content/browser/devtools/devtools_instrumentation.h
+++ content/browser/devtools/devtools_instrumentation.h
@@ -102,7 +102,7 @@ bool ApplyUserAgentMetadataOverrides(
@@ -100,7 +100,7 @@ bool ApplyUserAgentMetadataOverrides(
FrameTreeNode* frame_tree_node,
absl::optional<blink::UserAgentMetadata>* override_out);
@@ -68,7 +68,7 @@ index 97c7dc7c25000..63c42610bfd9c 100644
blink::mojom::V8CacheOptions GetV8CacheOptions();
diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn
index 64214a7885df2..0cbc7cfc6fe43 100644
index 53cc163cde365..bf2aa2df19ded 100644
--- third_party/blink/renderer/controller/BUILD.gn
+++ third_party/blink/renderer/controller/BUILD.gn
@@ -35,6 +35,7 @@ component("controller") {

View File

@@ -1,5 +1,5 @@
diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc
index 3083bd8c2a8d6..1966cb5bee7e9 100644
index f4f583be8fba9..a2ed253f3724d 100644
--- content/browser/devtools/devtools_http_handler.cc
+++ content/browser/devtools/devtools_http_handler.cc
@@ -588,7 +588,7 @@ void DevToolsHttpHandler::OnJsonRequest(
@@ -12,10 +12,10 @@ index 3083bd8c2a8d6..1966cb5bee7e9 100644
version.Set("V8-Version", V8_VERSION_STRING);
std::string host = info.GetHeaderValue("host");
diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc
index fc00cee495e56..1979a0767edf1 100644
index dcc79329a078f..fa5e1e45d1698 100644
--- content/browser/loader/navigation_url_loader_impl.cc
+++ content/browser/loader/navigation_url_loader_impl.cc
@@ -741,6 +741,17 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest() {
@@ -738,6 +738,17 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest() {
resource_request_->has_user_gesture, initiating_origin,
initiator_document_.AsRenderFrameHostIfValid(), &loader_factory);
@@ -34,10 +34,10 @@ index fc00cee495e56..1979a0767edf1 100644
factory = base::MakeRefCounted<network::WrapperSharedURLLoaderFactory>(
std::move(loader_factory));
diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc
index cd77eefb577e6..6cff0a16f2eab 100644
index f9c88663946a9..f9a78d6468364 100644
--- content/public/browser/content_browser_client.cc
+++ content/public/browser/content_browser_client.cc
@@ -968,7 +968,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload(
@@ -986,7 +986,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload(
void ContentBrowserClient::OnNetworkServiceCreated(
network::mojom::NetworkService* network_service) {}
@@ -46,7 +46,7 @@ index cd77eefb577e6..6cff0a16f2eab 100644
BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -977,6 +977,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams(
@@ -995,6 +995,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams(
cert_verifier_creation_params) {
network_context_params->user_agent = GetUserAgentBasedOnPolicy(context);
network_context_params->accept_language = "en-us,en";
@@ -55,10 +55,10 @@ index cd77eefb577e6..6cff0a16f2eab 100644
std::vector<base::FilePath>
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
index 5500a0cec01ec..ea2fa77649607 100644
index a60c4455d1d7d..1f0f0db3d8cad 100644
--- content/public/browser/content_browser_client.h
+++ content/public/browser/content_browser_client.h
@@ -35,6 +35,7 @@
@@ -37,6 +37,7 @@
#include "content/public/browser/login_delegate.h"
#include "content/public/browser/mojo_binder_policy_map.h"
#include "content/public/browser/storage_partition_config.h"
@@ -66,7 +66,7 @@ index 5500a0cec01ec..ea2fa77649607 100644
#include "content/public/common/alternative_error_page_override_info.mojom-forward.h"
#include "content/public/common/page_visibility_state.h"
#include "content/public/common/window_container_type.mojom-forward.h"
@@ -1781,7 +1782,7 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1812,7 +1813,7 @@ class CONTENT_EXPORT ContentBrowserClient {
//
// If |relative_partition_path| is the empty string, it means this needs to
// create the default NetworkContext for the BrowserContext.
@@ -75,7 +75,7 @@ index 5500a0cec01ec..ea2fa77649607 100644
BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -1984,6 +1985,19 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -2020,6 +2021,19 @@ class CONTENT_EXPORT ContentBrowserClient {
RenderFrameHost* initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory);
@@ -95,7 +95,7 @@ index 5500a0cec01ec..ea2fa77649607 100644
// Creates an OverlayWindow to be used for video or Picture-in-Picture.
// This window will house the content shown when in Picture-in-Picture mode.
// This will return a new OverlayWindow.
@@ -2040,6 +2054,10 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -2076,6 +2090,10 @@ class CONTENT_EXPORT ContentBrowserClient {
// Used as part of the user agent string.
virtual std::string GetProduct();
@@ -132,7 +132,7 @@ index 77f2c4fbf8c88..ddbacedde912a 100644
// started.
virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {}
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
index 3d3645fa25131..2b72ced4c62c4 100644
index a614d8eb1ecd3..51986244b8960 100644
--- content/renderer/render_thread_impl.cc
+++ content/renderer/render_thread_impl.cc
@@ -624,6 +624,8 @@ void RenderThreadImpl::Init() {
@@ -145,10 +145,10 @@ index 3d3645fa25131..2b72ced4c62c4 100644
base::BindRepeating(&RenderThreadImpl::OnRendererInterfaceReceiver,
base::Unretained(this)));
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
index decef7b3d86c0..4efa8338dc3b5 100644
index 93de85d842315..11c124e4bd06f 100644
--- content/renderer/renderer_blink_platform_impl.cc
+++ content/renderer/renderer_blink_platform_impl.cc
@@ -969,6 +969,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() {
@@ -975,6 +975,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() {
//------------------------------------------------------------------------------
@@ -165,12 +165,12 @@ index decef7b3d86c0..4efa8338dc3b5 100644
RendererBlinkPlatformImpl::CreateWebV8ValueConverter() {
return std::make_unique<V8ValueConverterImpl>();
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
index a15ca0214e694..cdc2331096cc5 100644
index 0067dcb8b5c6b..524af9093e620 100644
--- content/renderer/renderer_blink_platform_impl.h
+++ content/renderer/renderer_blink_platform_impl.h
@@ -232,6 +232,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
base::TimeDelta MinimumIntervalOfUserLevelMemoryPressureSignal() override;
#endif
@@ -229,6 +229,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
InertAndMinimumIntervalOfUserLevelMemoryPressureSignal() override;
#endif // BUILDFLAG(IS_ANDROID)
+ void DevToolsAgentAttached() override;
+ void DevToolsAgentDetached() override;

View File

@@ -94,7 +94,7 @@ index 3062f57603321..d8532c9c2eabb 100644
}
diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc
index a6458f11a69e3..16ee357a2ad8e 100644
index 38c5f465d8e45..762c4b7562d55 100644
--- content/app/content_main_runner_impl.cc
+++ content/app/content_main_runner_impl.cc
@@ -46,6 +46,7 @@
@@ -105,7 +105,7 @@ index a6458f11a69e3..16ee357a2ad8e 100644
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
@@ -1284,6 +1285,12 @@ void ContentMainRunnerImpl::Shutdown() {
@@ -1316,6 +1317,12 @@ void ContentMainRunnerImpl::Shutdown() {
is_shutdown_ = true;
}
@@ -154,10 +154,10 @@ index 283161145d792..9f3f635abdd1c 100644
if (main_argv)
setproctitle_init(main_argv);
diff --git content/public/app/content_main.h content/public/app/content_main.h
index 16e8c657ad61f..62d58b8dcccf5 100644
index a1eeb534c0743..aac5194a44efb 100644
--- content/public/app/content_main.h
+++ content/public/app/content_main.h
@@ -93,6 +93,13 @@ struct CONTENT_EXPORT ContentMainParams {
@@ -100,6 +100,13 @@ struct CONTENT_EXPORT ContentMainParams {
}
};

View File

@@ -202,12 +202,12 @@ index 284dd099122df..c09c614c11283 100644
-
} // namespace crash_reporter
diff --git components/crash/core/app/crash_reporter_client.h components/crash/core/app/crash_reporter_client.h
index 9f8f20dfa6506..5d42f6fc1b003 100644
index a604df7a5ea6a..618fbde10a65c 100644
--- components/crash/core/app/crash_reporter_client.h
+++ components/crash/core/app/crash_reporter_client.h
@@ -5,7 +5,9 @@
#ifndef COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_
#define COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_
@@ -7,7 +7,9 @@
#include <stdint.h>
+#include <map>
#include <string>
@@ -215,7 +215,7 @@ index 9f8f20dfa6506..5d42f6fc1b003 100644
#include "build/build_config.h"
@@ -94,7 +96,7 @@ class CrashReporterClient {
@@ -96,7 +98,7 @@ class CrashReporterClient {
virtual bool GetShouldDumpLargerDumps();
#endif
@@ -224,7 +224,7 @@ index 9f8f20dfa6506..5d42f6fc1b003 100644
// Returns a textual description of the product type and version to include
// in the crash report. Neither out parameter should be set to NULL.
// TODO(jperaza): Remove the 2-parameter overload of this method once all
@@ -105,6 +107,7 @@ class CrashReporterClient {
@@ -107,6 +109,7 @@ class CrashReporterClient {
std::string* version,
std::string* channel);
@@ -232,7 +232,7 @@ index 9f8f20dfa6506..5d42f6fc1b003 100644
virtual base::FilePath GetReporterLogFilename();
// Custom crash minidump handler after the minidump is generated.
@@ -114,6 +117,7 @@ class CrashReporterClient {
@@ -116,6 +119,7 @@ class CrashReporterClient {
// libc nor allocate memory normally.
virtual bool HandleCrashDump(const char* crashdump_filename,
uint64_t crash_pid);
@@ -240,7 +240,7 @@ index 9f8f20dfa6506..5d42f6fc1b003 100644
#endif
// The location where minidump files should be written. Returns true if
@@ -211,6 +215,20 @@ class CrashReporterClient {
@@ -213,6 +217,20 @@ class CrashReporterClient {
// Returns true if breakpad should run in the given process type.
virtual bool EnableBreakpadForProcess(const std::string& process_type);

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