Compare commits

...

12 Commits
master ... 7103

Author SHA1 Message Date
Marshall Greenblatt
15882fefc4 Pin depot_tools version for out-of-support branch 2025-05-29 13:47:45 -04:00
Marshall Greenblatt
1ac1b149e5 Update to Chromium version 136.0.7103.114 2025-05-15 13:05:35 +00:00
Marshall Greenblatt
723b52b57d win: Fix crash loading chrome://sandbox when sandbox is disabled 2025-05-13 18:01:36 -04:00
Marshall Greenblatt
89c0a8c39a Update to Chromium version 136.0.7103.93 2025-05-07 14:29:49 +00:00
Marshall Greenblatt
6b7eacfcc7 Update to Chromium version 136.0.7103.59 2025-05-06 21:13:13 +00:00
Marshall Greenblatt
4ff4593bfc Update to Chromium version 136.0.7103.49 2025-05-05 12:10:53 -04:00
Marshall Greenblatt
4dec9aa6f2 Update to Chromium version 136.0.7103.33 2025-04-22 13:01:20 -04:00
Marshall Greenblatt
1390ca425c Tag 13601 API version 2025-04-22 10:37:36 -04:00
Marshall Greenblatt
928a900850 Fix enum value typos 2025-04-22 10:37:35 -04:00
Marshall Greenblatt
8f7877b8b0 Add callback to allow Document PiP moveTo/By() (fixes #3714)
Allow Document picture-in-picture moveTo/By() and resizeTo/By()
(without user gesture) if the new
CefBrowserViewDelegate::AllowMoveForPictureInPicture callback
returns true.
2025-04-22 10:37:35 -04:00
Marshall Greenblatt
2cad7c4842 Update to Chromium version 136.0.7103.17 2025-04-09 16:24:41 +00:00
Marshall Greenblatt
ecce29f1ee Update to Chromium version 136.0.7103.17 2025-04-07 17:54:10 -04:00
51 changed files with 438 additions and 278 deletions

View File

@@ -839,6 +839,7 @@ source_set("libcef_static") {
"libcef/common/values_impl.h", "libcef/common/values_impl.h",
"libcef/common/waitable_event_impl.cc", "libcef/common/waitable_event_impl.cc",
"libcef/common/waitable_event_impl.h", "libcef/common/waitable_event_impl.h",
"libcef/renderer/browser_config.h",
"libcef/renderer/browser_impl.cc", "libcef/renderer/browser_impl.cc",
"libcef/renderer/browser_impl.h", "libcef/renderer/browser_impl.h",
"libcef/renderer/chrome/chrome_content_renderer_client_cef.cc", "libcef/renderer/chrome/chrome_content_renderer_client_cef.cc",

View File

@@ -7,5 +7,6 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{ {
'chromium_checkout': 'refs/tags/136.0.7103.0' 'chromium_checkout': 'refs/tags/136.0.7103.114',
'depot_tools_checkout': 'c9fe205c66'
} }

View File

@@ -53,8 +53,14 @@
"linux": "eb353ba7b8b9bcbef890217971cd8ec41efeaa75", "linux": "eb353ba7b8b9bcbef890217971cd8ec41efeaa75",
"mac": "22c77d1f2305de8a6147f14e52f074b4a4e5222c", "mac": "22c77d1f2305de8a6147f14e52f074b4a4e5222c",
"windows": "a8832519b4eb058567d68b65be1e1c9e80aae566" "windows": "a8832519b4eb058567d68b65be1e1c9e80aae566"
},
"13601": {
"comment": "Added April 22, 2025.",
"linux": "40b224f295a20694241c5db49721bc90a3796f30",
"mac": "ff885fe921f9eae1a5ce6a71b30b0c37b306bf56",
"windows": "116a4153047ee1ee67f17fc938f084ee72b24e54"
} }
}, },
"last": "13600", "last": "13601",
"min": "13300" "min": "13300"
} }

View File

@@ -1271,7 +1271,11 @@ typedef enum {
PDE_TYPE_BYTES, PDE_TYPE_BYTES,
PDE_TYPE_FILE, PDE_TYPE_FILE,
#if CEF_API_ADDED(13601)
PDE_TYPE_NUM_VALUES,
#else
PDF_TYPE_NUM_VALUES, PDF_TYPE_NUM_VALUES,
#endif
} cef_postdataelement_type_t; } cef_postdataelement_type_t;
/// ///

View File

@@ -387,7 +387,11 @@ typedef enum {
/// ALLOW (default): no effect (e.g. third-party cookies allowed, if not /// ALLOW (default): no effect (e.g. third-party cookies allowed, if not
/// blocked otherwise). /// blocked otherwise).
/// BLOCK: third-party cookies blocked, but 3PCD mitigations enabled. /// BLOCK: third-party cookies blocked, but 3PCD mitigations enabled.
#if CEF_API_ADDED(13601)
CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_TPCD_ORIGIN_TRIAL,
#else
CEF_CONTENT_SETTING_TOP_LEVEL_TPCD_ORIGIN_TRIAL, CEF_CONTENT_SETTING_TOP_LEVEL_TPCD_ORIGIN_TRIAL,
#endif
/// Content setting used to indicate whether entering picture-in-picture /// Content setting used to indicate whether entering picture-in-picture
/// automatically should be enabled. /// automatically should be enabled.

View File

@@ -38,6 +38,7 @@
#define CEF_INCLUDE_VIEWS_CEF_BROWSER_VIEW_DELEGATE_H_ #define CEF_INCLUDE_VIEWS_CEF_BROWSER_VIEW_DELEGATE_H_
#pragma once #pragma once
#include "include/cef_api_hash.h"
#include "include/cef_client.h" #include "include/cef_client.h"
#include "include/views/cef_view_delegate.h" #include "include/views/cef_view_delegate.h"
@@ -129,6 +130,18 @@ class CefBrowserViewDelegate : public CefViewDelegate {
return false; return false;
} }
#if CEF_API_ADDED(13601)
///
/// Return true to allow the use of JavaScript moveTo/By() and resizeTo/By()
/// (without user activation) with Document picture-in-picture popups.
///
/*--cef(added=13601)--*/
virtual bool AllowMoveForPictureInPicture(
CefRefPtr<CefBrowserView> browser_view) {
return false;
}
#endif
/// ///
/// Called when |browser_view| receives a gesture command. Return true to /// Called when |browser_view| receives a gesture command. Return true to
/// handle (or disable) a |gesture_command| or false to propagate the gesture /// handle (or disable) a |gesture_command| or false to propagate the gesture

View File

@@ -117,8 +117,7 @@ CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::Create(
scoped_refptr<CefBrowserInfo> info = scoped_refptr<CefBrowserInfo> info =
CefBrowserInfoManager::GetInstance()->CreateBrowserInfo( CefBrowserInfoManager::GetInstance()->CreateBrowserInfo(
/*is_devtools_popup=*/false, platform_delegate->IsWindowless(), /*is_devtools_popup=*/false, platform_delegate->GetBrowserConfig(),
platform_delegate->IsPrintPreviewSupported(),
create_params.extra_info); create_params.extra_info);
bool own_web_contents = false; bool own_web_contents = false;
@@ -132,8 +131,7 @@ CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::Create(
CefRefPtr<AlloyBrowserHostImpl> browser = CefRefPtr<AlloyBrowserHostImpl> browser =
CreateInternal(create_params.settings, create_params.client, web_contents, CreateInternal(create_params.settings, create_params.client, web_contents,
own_web_contents, info, own_web_contents, info, /*opener=*/nullptr,
/*opener=*/nullptr, /*is_devtools_popup=*/false,
request_context_impl, std::move(platform_delegate)); request_context_impl, std::move(platform_delegate));
if (!browser) { if (!browser) {
return nullptr; return nullptr;
@@ -160,7 +158,6 @@ CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::CreateInternal(
bool own_web_contents, bool own_web_contents,
scoped_refptr<CefBrowserInfo> browser_info, scoped_refptr<CefBrowserInfo> browser_info,
CefRefPtr<AlloyBrowserHostImpl> opener, CefRefPtr<AlloyBrowserHostImpl> opener,
bool is_devtools_popup,
CefRefPtr<CefRequestContextImpl> request_context, CefRefPtr<CefRequestContextImpl> request_context,
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate) { std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate) {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
@@ -185,7 +182,7 @@ CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::CreateInternal(
// new browser's platform delegate. // new browser's platform delegate.
opener->platform_delegate_->PopupWebContentsCreated( opener->platform_delegate_->PopupWebContentsCreated(
settings, client, web_contents, platform_delegate.get(), settings, client, web_contents, platform_delegate.get(),
is_devtools_popup); /*is_devtools=*/false);
} }
// Take ownership of |web_contents| if |own_web_contents| is true. // Take ownership of |web_contents| if |own_web_contents| is true.
@@ -208,7 +205,7 @@ CefRefPtr<AlloyBrowserHostImpl> AlloyBrowserHostImpl::CreateInternal(
// result in a call to CefBrowserViewDelegate::OnPopupBrowserViewCreated(). // result in a call to CefBrowserViewDelegate::OnPopupBrowserViewCreated().
// Do this first for consistency with Chrome style. // Do this first for consistency with Chrome style.
opener->platform_delegate_->PopupBrowserCreated( opener->platform_delegate_->PopupBrowserCreated(
browser->platform_delegate(), browser.get(), is_devtools_popup); browser->platform_delegate(), browser.get(), /*is_devtools=*/false);
} }
// 2. Notify the browser's LifeSpanHandler. This must always be the first // 2. Notify the browser's LifeSpanHandler. This must always be the first
@@ -1121,8 +1118,7 @@ void AlloyBrowserHostImpl::WebContentsCreated(
scoped_refptr<CefBrowserInfo> info = scoped_refptr<CefBrowserInfo> info =
CefBrowserInfoManager::GetInstance()->CreatePopupBrowserInfo( CefBrowserInfoManager::GetInstance()->CreatePopupBrowserInfo(
new_contents, platform_delegate->IsWindowless(), new_contents, platform_delegate->GetBrowserConfig(), extra_info);
platform_delegate->IsPrintPreviewSupported(), extra_info);
CHECK(info.get()); CHECK(info.get());
CHECK(info->is_popup()); CHECK(info->is_popup());
@@ -1140,8 +1136,7 @@ void AlloyBrowserHostImpl::WebContentsCreated(
// However, we need to install observers/delegates here. // However, we need to install observers/delegates here.
CefRefPtr<AlloyBrowserHostImpl> browser = CreateInternal( CefRefPtr<AlloyBrowserHostImpl> browser = CreateInternal(
settings, client, new_contents, /*own_web_contents=*/false, info, opener, settings, client, new_contents, /*own_web_contents=*/false, info, opener,
/*is_devtools_popup=*/false, request_context, request_context, std::move(platform_delegate));
std::move(platform_delegate));
} }
void AlloyBrowserHostImpl::RendererUnresponsive( void AlloyBrowserHostImpl::RendererUnresponsive(

View File

@@ -298,7 +298,6 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
bool own_web_contents, bool own_web_contents,
scoped_refptr<CefBrowserInfo> browser_info, scoped_refptr<CefBrowserInfo> browser_info,
CefRefPtr<AlloyBrowserHostImpl> opener, CefRefPtr<AlloyBrowserHostImpl> opener,
bool is_devtools_popup,
CefRefPtr<CefRequestContextImpl> request_context, CefRefPtr<CefRequestContextImpl> request_context,
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate); std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate);

View File

@@ -28,13 +28,11 @@ CefBrowserInfo::FrameInfo::~FrameInfo() {
CefBrowserInfo::CefBrowserInfo(int browser_id, CefBrowserInfo::CefBrowserInfo(int browser_id,
bool is_popup, bool is_popup,
bool is_windowless, const cef::BrowserConfig& config,
bool print_preview_enabled,
CefRefPtr<CefDictionaryValue> extra_info) CefRefPtr<CefDictionaryValue> extra_info)
: browser_id_(browser_id), : browser_id_(browser_id),
is_popup_(is_popup), is_popup_(is_popup),
is_windowless_(is_windowless), config_(config),
print_preview_enabled_(print_preview_enabled),
extra_info_(extra_info) { extra_info_(extra_info) {
DCHECK_GT(browser_id, 0); DCHECK_GT(browser_id, 0);

View File

@@ -19,6 +19,7 @@
#include "base/values.h" #include "base/values.h"
#include "cef/include/internal/cef_ptr.h" #include "cef/include/internal/cef_ptr.h"
#include "cef/libcef/common/values_impl.h" #include "cef/libcef/common/values_impl.h"
#include "cef/libcef/renderer/browser_config.h"
#include "content/public/browser/global_routing_id.h" #include "content/public/browser/global_routing_id.h"
#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_frame_host.h"
@@ -36,8 +37,7 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
public: public:
CefBrowserInfo(int browser_id, CefBrowserInfo(int browser_id,
bool is_popup, bool is_popup,
bool is_windowless, const cef::BrowserConfig& config,
bool print_preview_enabled,
CefRefPtr<CefDictionaryValue> extra_info); CefRefPtr<CefDictionaryValue> extra_info);
CefBrowserInfo(const CefBrowserInfo&) = delete; CefBrowserInfo(const CefBrowserInfo&) = delete;
@@ -45,8 +45,7 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
int browser_id() const { return browser_id_; } int browser_id() const { return browser_id_; }
bool is_popup() const { return is_popup_; } bool is_popup() const { return is_popup_; }
bool is_windowless() const { return is_windowless_; } const cef::BrowserConfig& config() const { return config_; }
bool print_preview_enabled() const { return print_preview_enabled_; }
CefRefPtr<CefDictionaryValue> extra_info() const { return extra_info_; } CefRefPtr<CefDictionaryValue> extra_info() const { return extra_info_; }
// May return nullptr if the browser has not yet been created (before // May return nullptr if the browser has not yet been created (before
@@ -202,8 +201,7 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
const int browser_id_; const int browser_id_;
const bool is_popup_; const bool is_popup_;
const bool is_windowless_; const cef::BrowserConfig config_;
const bool print_preview_enabled_;
CefRefPtr<CefDictionaryValue> extra_info_; CefRefPtr<CefDictionaryValue> extra_info_;
// Navigation will be blocked while |navigation_lock_| exists. // Navigation will be blocked while |navigation_lock_| exists.

View File

@@ -69,15 +69,13 @@ CefBrowserInfoManager* CefBrowserInfoManager::GetInstance() {
} }
scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::CreateBrowserInfo( scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::CreateBrowserInfo(
bool is_popup, bool is_devtools_popup,
bool is_windowless, const cef::BrowserConfig& config,
bool print_preview_enabled,
CefRefPtr<CefDictionaryValue> extra_info) { CefRefPtr<CefDictionaryValue> extra_info) {
base::AutoLock lock_scope(browser_info_lock_); base::AutoLock lock_scope(browser_info_lock_);
scoped_refptr<CefBrowserInfo> browser_info = scoped_refptr<CefBrowserInfo> browser_info = new CefBrowserInfo(
new CefBrowserInfo(++next_browser_id_, is_popup, is_windowless, ++next_browser_id_, is_devtools_popup, config, extra_info);
print_preview_enabled, extra_info);
browser_info_list_.push_back(browser_info); browser_info_list_.push_back(browser_info);
return browser_info; return browser_info;
@@ -85,8 +83,7 @@ scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::CreateBrowserInfo(
scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::CreatePopupBrowserInfo( scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::CreatePopupBrowserInfo(
content::WebContents* new_contents, content::WebContents* new_contents,
bool is_windowless, const cef::BrowserConfig& config,
bool print_preview_enabled,
CefRefPtr<CefDictionaryValue> extra_info) { CefRefPtr<CefDictionaryValue> extra_info) {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
@@ -95,8 +92,8 @@ scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::CreatePopupBrowserInfo(
scoped_refptr<CefBrowserInfo> browser_info; scoped_refptr<CefBrowserInfo> browser_info;
{ {
base::AutoLock lock_scope(browser_info_lock_); base::AutoLock lock_scope(browser_info_lock_);
browser_info = new CefBrowserInfo(++next_browser_id_, true, is_windowless, browser_info =
print_preview_enabled, extra_info); new CefBrowserInfo(++next_browser_id_, true, config, extra_info);
browser_info_list_.push_back(browser_info); browser_info_list_.push_back(browser_info);
} }
@@ -777,9 +774,14 @@ void CefBrowserInfoManager::SendNewBrowserInfoResponse(
if (browser_info) { if (browser_info) {
params->browser_id = browser_info->browser_id(); params->browser_id = browser_info->browser_id();
params->is_windowless = browser_info->is_windowless();
params->is_popup = browser_info->is_popup(); auto config = cef::mojom::NewBrowserConfig::New();
params->print_preview_enabled = browser_info->print_preview_enabled(); config->is_popup = browser_info->is_popup();
config->is_windowless = browser_info->config().is_windowless;
config->print_preview_enabled =
browser_info->config().print_preview_enabled;
config->move_pip_enabled = browser_info->config().move_pip_enabled;
params->config = std::move(config);
auto extra_info = browser_info->extra_info(); auto extra_info = browser_info->extra_info();
if (extra_info) { if (extra_info) {

View File

@@ -53,11 +53,10 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
static CefBrowserInfoManager* GetInstance(); static CefBrowserInfoManager* GetInstance();
// Called immediately before a new CefBrowserHost implementation is created // Called immediately before a new CefBrowserHost implementation is created
// directly. In this case |is_popup| will be true only for DevTools browsers. // directly.
scoped_refptr<CefBrowserInfo> CreateBrowserInfo( scoped_refptr<CefBrowserInfo> CreateBrowserInfo(
bool is_popup, bool is_devtools_popup,
bool is_windowless, const cef::BrowserConfig& config,
bool print_preview_enabled,
CefRefPtr<CefDictionaryValue> extra_info); CefRefPtr<CefDictionaryValue> extra_info);
// Called from WebContentsDelegate::WebContentsCreated when a new browser is // Called from WebContentsDelegate::WebContentsCreated when a new browser is
@@ -66,8 +65,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
// response will be sent when this method is called. // response will be sent when this method is called.
scoped_refptr<CefBrowserInfo> CreatePopupBrowserInfo( scoped_refptr<CefBrowserInfo> CreatePopupBrowserInfo(
content::WebContents* new_contents, content::WebContents* new_contents,
bool is_windowless, const cef::BrowserConfig& config,
bool print_preview_enabled,
CefRefPtr<CefDictionaryValue> extra_info); CefRefPtr<CefDictionaryValue> extra_info);
// Called from ContentBrowserClient::CanCreateWindow. See comments on // Called from ContentBrowserClient::CanCreateWindow. See comments on

View File

@@ -567,6 +567,15 @@ bool CefBrowserPlatformDelegate::IsPrintPreviewSupported() const {
return true; return true;
} }
bool CefBrowserPlatformDelegate::IsMovePictureInPictureEnabled() const {
return false;
}
cef::BrowserConfig CefBrowserPlatformDelegate::GetBrowserConfig() const {
return {IsWindowless(), IsPrintPreviewSupported(),
IsMovePictureInPictureEnabled()};
}
void CefBrowserPlatformDelegate::Find(const CefString& searchText, void CefBrowserPlatformDelegate::Find(const CefString& searchText,
bool forward, bool forward,
bool matchCase, bool matchCase,

View File

@@ -15,6 +15,7 @@
#include "cef/include/cef_drag_data.h" #include "cef/include/cef_drag_data.h"
#include "cef/include/internal/cef_types.h" #include "cef/include/internal/cef_types.h"
#include "cef/include/views/cef_browser_view.h" #include "cef/include/views/cef_browser_view.h"
#include "cef/libcef/renderer/browser_config.h"
#include "third_party/blink/public/common/page/drag_operation.h" #include "third_party/blink/public/common/page/drag_operation.h"
#include "third_party/blink/public/mojom/drag/drag.mojom-forward.h" #include "third_party/blink/public/mojom/drag/drag.mojom-forward.h"
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
@@ -370,6 +371,12 @@ class CefBrowserPlatformDelegate {
bool findNext); bool findNext);
virtual void StopFinding(bool clearSelection); virtual void StopFinding(bool clearSelection);
virtual bool IsMovePictureInPictureEnabled() const;
// CefBrowser configuration determined prior to CefBrowserHost creation and
// passed to the renderer process via the GetNewBrowserInfo Mojo request.
cef::BrowserConfig GetBrowserConfig() const;
protected: protected:
// Allow deletion via std::unique_ptr only. // Allow deletion via std::unique_ptr only.
friend std::default_delete<CefBrowserPlatformDelegate>; friend std::default_delete<CefBrowserPlatformDelegate>;

View File

@@ -260,8 +260,8 @@ void ChromeBrowserDelegate::SetAsDelegate(content::WebContents* web_contents,
CHECK(platform_delegate->IsChromeStyle()); CHECK(platform_delegate->IsChromeStyle());
auto browser_info = CefBrowserInfoManager::GetInstance()->CreateBrowserInfo( auto browser_info = CefBrowserInfoManager::GetInstance()->CreateBrowserInfo(
is_devtools_popup, /*is_windowless=*/false, is_devtools_popup, platform_delegate->GetBrowserConfig(),
platform_delegate->IsPrintPreviewSupported(), create_params_.extra_info); create_params_.extra_info);
auto request_context_impl = auto request_context_impl =
CefRequestContextImpl::GetOrCreateForRequestContext( CefRequestContextImpl::GetOrCreateForRequestContext(
@@ -759,8 +759,7 @@ ChromeBrowserDelegate::CreateBrowserHostForPopup(
auto browser_info = auto browser_info =
CefBrowserInfoManager::GetInstance()->CreatePopupBrowserInfo( CefBrowserInfoManager::GetInstance()->CreatePopupBrowserInfo(
web_contents, /*is_windowless=*/false, web_contents, platform_delegate->GetBrowserConfig(), extra_info);
platform_delegate->IsPrintPreviewSupported(), extra_info);
CHECK(browser_info->is_popup()); CHECK(browser_info->is_popup());
// Popups must share the same RequestContext as the parent. // Popups must share the same RequestContext as the parent.

View File

@@ -500,8 +500,7 @@ void ChromeBrowserHostImpl::Attach(content::WebContents* web_contents,
is_devtools_popup); is_devtools_popup);
} }
platform_delegate_->WebContentsCreated(web_contents, platform_delegate_->WebContentsCreated(web_contents, /*owned=*/false);
/*own_web_contents=*/false);
contents_delegate_.ObserveWebContents(web_contents); contents_delegate_.ObserveWebContents(web_contents);
// Associate the platform delegate with this browser. // Associate the platform delegate with this browser.

View File

@@ -130,6 +130,16 @@ bool CefBrowserPlatformDelegateChromeViews::IsViewsHosted() const {
return true; return true;
} }
bool CefBrowserPlatformDelegateChromeViews::IsMovePictureInPictureEnabled()
const {
if (browser_view_) {
if (auto* delegate = browser_view_->delegate()) {
return delegate->AllowMoveForPictureInPicture(browser_view_.get());
}
}
return false;
}
CefWindowImpl* CefBrowserPlatformDelegateChromeViews::GetWindowImpl() const { CefWindowImpl* CefBrowserPlatformDelegateChromeViews::GetWindowImpl() const {
if (auto* widget = GetWindowWidget()) { if (auto* widget = GetWindowWidget()) {
CefRefPtr<CefWindow> window = view_util::GetWindowFor(widget); CefRefPtr<CefWindow> window = view_util::GetWindowFor(widget);

View File

@@ -34,6 +34,7 @@ class CefBrowserPlatformDelegateChromeViews
void SetBrowserView(CefRefPtr<CefBrowserView> browser_view) override; void SetBrowserView(CefRefPtr<CefBrowserView> browser_view) override;
void SetFocus(bool setFocus) override; void SetFocus(bool setFocus) override;
bool IsViewsHosted() const override; bool IsViewsHosted() const override;
bool IsMovePictureInPictureEnabled() const override;
CefBrowserViewImpl* browser_view() const { return browser_view_.get(); } CefBrowserViewImpl* browser_view() const { return browser_view_.get(); }

View File

@@ -208,7 +208,7 @@ CEF_EXPORT int cef_get_min_log_level() {
} }
CEF_EXPORT int cef_get_vlog_level(const char* file_start, size_t N) { CEF_EXPORT int cef_get_vlog_level(const char* file_start, size_t N) {
return logging::GetVlogLevelHelper(std::string_view(file_start, N)); return logging::GetVlogLevelHelper(file_start, N);
} }
CEF_EXPORT void cef_log(const char* file, CEF_EXPORT void cef_log(const char* file,

View File

@@ -111,12 +111,19 @@ struct NewRenderThreadInfo {
array<CrossOriginWhiteListEntry>? cross_origin_whitelist_entries; array<CrossOriginWhiteListEntry>? cross_origin_whitelist_entries;
}; };
struct NewBrowserConfig {
bool is_popup;
// Values from cef::BrowserConfig.
bool is_windowless;
bool print_preview_enabled;
bool move_pip_enabled;
};
struct NewBrowserInfo { struct NewBrowserInfo {
int32 browser_id; int32 browser_id;
bool? is_popup;
bool? is_windowless;
bool? print_preview_enabled;
bool is_excluded; bool is_excluded;
NewBrowserConfig? config;
mojo_base.mojom.DictionaryValue? extra_info; mojo_base.mojom.DictionaryValue? extra_info;
}; };

View File

@@ -0,0 +1,22 @@
// Copyright 2025 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_RENDERER_BROWSER_CONFIG_H_
#define CEF_LIBCEF_RENDERER_BROWSER_CONFIG_H_
#pragma once
namespace cef {
// CefBrowser configuration determined prior to CefBrowserHost creation (in
// CefBrowserPlatformDelegate::GetBrowserConfig) and passed to the renderer
// process via the GetNewBrowserInfo Mojo request.
struct BrowserConfig {
bool is_windowless;
bool print_preview_enabled;
bool move_pip_enabled;
};
} // namespace cef
#endif // CEF_LIBCEF_RENDERER_BROWSER_CONFIG_H_

View File

@@ -276,13 +276,11 @@ void CefBrowserImpl::GetFrameNames(std::vector<CefString>& names) {
CefBrowserImpl::CefBrowserImpl(blink::WebView* web_view, CefBrowserImpl::CefBrowserImpl(blink::WebView* web_view,
int browser_id, int browser_id,
bool is_popup, bool is_popup,
bool is_windowless, const cef::BrowserConfig& config)
bool print_preview_enabled)
: blink::WebViewObserver(web_view), : blink::WebViewObserver(web_view),
browser_id_(browser_id), browser_id_(browser_id),
is_popup_(is_popup), is_popup_(is_popup),
is_windowless_(is_windowless), config_(config) {}
print_preview_enabled_(print_preview_enabled) {}
CefBrowserImpl::~CefBrowserImpl() = default; CefBrowserImpl::~CefBrowserImpl() = default;

View File

@@ -16,6 +16,7 @@
#include "cef/include/cef_browser.h" #include "cef/include/cef_browser.h"
#include "cef/include/cef_client.h" #include "cef/include/cef_client.h"
#include "cef/libcef/renderer/browser_config.h"
#include "cef/libcef/renderer/frame_impl.h" #include "cef/libcef/renderer/frame_impl.h"
#include "third_party/blink/public/common/tokens/tokens.h" #include "third_party/blink/public/common/tokens/tokens.h"
#include "third_party/blink/public/web/web_view_observer.h" #include "third_party/blink/public/web/web_view_observer.h"
@@ -66,8 +67,7 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver {
CefBrowserImpl(blink::WebView* web_view, CefBrowserImpl(blink::WebView* web_view,
int browser_id, int browser_id,
bool is_popup, bool is_popup,
bool is_windowless, const cef::BrowserConfig& config);
bool print_preview_enabled);
CefBrowserImpl(const CefBrowserImpl&) = delete; CefBrowserImpl(const CefBrowserImpl&) = delete;
CefBrowserImpl& operator=(const CefBrowserImpl&) = delete; CefBrowserImpl& operator=(const CefBrowserImpl&) = delete;
@@ -80,8 +80,7 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver {
int browser_id() const { return browser_id_; } int browser_id() const { return browser_id_; }
bool is_popup() const { return is_popup_; } bool is_popup() const { return is_popup_; }
bool is_windowless() const { return is_windowless_; } const cef::BrowserConfig& config() const { return config_; }
bool print_preview_enabled() const { return print_preview_enabled_; }
// blink::WebViewObserver methods. // blink::WebViewObserver methods.
void OnDestruct() override; void OnDestruct() override;
@@ -96,8 +95,7 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver {
// same browser ID. // same browser ID.
const int browser_id_; const int browser_id_;
const bool is_popup_; const bool is_popup_;
const bool is_windowless_; const cef::BrowserConfig config_;
const bool print_preview_enabled_;
// Map of unique frame tokens to CefFrameImpl references. // Map of unique frame tokens to CefFrameImpl references.
using FrameMap = std::map<blink::LocalFrameToken, CefRefPtr<CefFrameImpl>>; using FrameMap = std::map<blink::LocalFrameToken, CefRefPtr<CefFrameImpl>>;

View File

@@ -46,20 +46,19 @@ void ChromeContentRendererClientCef::RenderFrameCreated(
new CefRenderFrameObserver(render_frame); new CefRenderFrameObserver(render_frame);
bool browser_created; bool browser_created;
std::optional<bool> is_windowless; std::optional<cef::BrowserConfig> config;
std::optional<bool> print_preview_enabled;
render_manager_->RenderFrameCreated(render_frame, render_frame_observer, render_manager_->RenderFrameCreated(render_frame, render_frame_observer,
browser_created, is_windowless, browser_created, config);
print_preview_enabled);
if (browser_created) { if (browser_created) {
OnBrowserCreated(render_frame->GetWebView(), is_windowless); CHECK(config.has_value());
OnBrowserCreated(render_frame->GetWebView(), *config);
} }
if (print_preview_enabled.has_value()) { if (config.has_value()) {
// This value will be used when the when ChromeContentRendererClient // This value will be used when the ChromeContentRendererClient
// creates the new ChromePrintRenderFrameHelperDelegate below. // creates the new ChromePrintRenderFrameHelperDelegate below.
ChromePrintRenderFrameHelperDelegate::SetNextPrintPreviewEnabled( ChromePrintRenderFrameHelperDelegate::SetNextPrintPreviewEnabled(
*print_preview_enabled); (*config).print_preview_enabled);
} }
ChromeContentRendererClient::RenderFrameCreated(render_frame); ChromeContentRendererClient::RenderFrameCreated(render_frame);
@@ -73,12 +72,11 @@ void ChromeContentRendererClientCef::WebViewCreated(
outermost_origin); outermost_origin);
bool browser_created; bool browser_created;
std::optional<bool> is_windowless; std::optional<cef::BrowserConfig> config;
std::optional<bool> print_preview_enabled; render_manager_->WebViewCreated(web_view, browser_created, config);
render_manager_->WebViewCreated(web_view, browser_created, is_windowless,
print_preview_enabled);
if (browser_created) { if (browser_created) {
OnBrowserCreated(web_view, is_windowless); CHECK(config.has_value());
OnBrowserCreated(web_view, *config);
} }
} }
@@ -117,14 +115,9 @@ void ChromeContentRendererClientCef::ExposeInterfacesToBrowser(
void ChromeContentRendererClientCef::OnBrowserCreated( void ChromeContentRendererClientCef::OnBrowserCreated(
blink::WebView* web_view, blink::WebView* web_view,
std::optional<bool> is_windowless) { const cef::BrowserConfig& config) {
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
const bool windowless = is_windowless.has_value() && *is_windowless; web_view->SetUseExternalPopupMenusThisInstance(!config.is_windowless);
// FIXME: It would be better if this API would be a callback from the
// WebKit layer, or if it would be exposed as an WebView instance method; the
// current implementation uses a static variable, and WebKit needs to be
// patched in order to make it work for each WebView instance
web_view->SetUseExternalPopupMenusThisInstance(!windowless);
#endif #endif
web_view->SetMovePictureInPictureEnabled(config.move_pip_enabled);
} }

View File

@@ -12,6 +12,10 @@
#include "base/task/single_thread_task_runner.h" #include "base/task/single_thread_task_runner.h"
#include "chrome/renderer/chrome_content_renderer_client.h" #include "chrome/renderer/chrome_content_renderer_client.h"
namespace cef {
struct BrowserConfig;
}
class CefRenderManager; class CefRenderManager;
// CEF override of ChromeContentRendererClient. // CEF override of ChromeContentRendererClient.
@@ -48,7 +52,7 @@ class ChromeContentRendererClientCef : public ChromeContentRendererClient {
private: private:
void OnBrowserCreated(blink::WebView* web_view, void OnBrowserCreated(blink::WebView* web_view,
std::optional<bool> is_windowless); const cef::BrowserConfig& config);
std::unique_ptr<CefRenderManager> render_manager_; std::unique_ptr<CefRenderManager> render_manager_;

View File

@@ -56,25 +56,17 @@ class CefExcludedView : public blink::WebViewObserver {
public: public:
CefExcludedView(CefRenderManager* manager, CefExcludedView(CefRenderManager* manager,
blink::WebView* web_view, blink::WebView* web_view,
std::optional<bool> is_windowless, const std::optional<cef::BrowserConfig>& config)
std::optional<bool> print_preview_enabled) : blink::WebViewObserver(web_view), manager_(manager), config_(config) {}
: blink::WebViewObserver(web_view),
manager_(manager),
is_windowless_(is_windowless),
print_preview_enabled_(print_preview_enabled) {}
std::optional<bool> is_windowless() const { return is_windowless_; } const std::optional<cef::BrowserConfig>& config() const { return config_; }
std::optional<bool> print_preview_enabled() const {
return print_preview_enabled_;
}
private: private:
// RenderViewObserver methods. // RenderViewObserver methods.
void OnDestruct() override { manager_->OnExcludedViewDestroyed(this); } void OnDestruct() override { manager_->OnExcludedViewDestroyed(this); }
CefRenderManager* const manager_; CefRenderManager* const manager_;
const std::optional<bool> is_windowless_; const std::optional<cef::BrowserConfig> config_;
const std::optional<bool> print_preview_enabled_;
}; };
CefRenderManager::CefRenderManager() { CefRenderManager::CefRenderManager() {
@@ -110,11 +102,9 @@ void CefRenderManager::RenderFrameCreated(
content::RenderFrame* render_frame, content::RenderFrame* render_frame,
CefRenderFrameObserver* render_frame_observer, CefRenderFrameObserver* render_frame_observer,
bool& browser_created, bool& browser_created,
std::optional<bool>& is_windowless, std::optional<cef::BrowserConfig>& config) {
std::optional<bool>& print_preview_enabled) {
auto browser = MaybeCreateBrowser(render_frame->GetWebView(), render_frame, auto browser = MaybeCreateBrowser(render_frame->GetWebView(), render_frame,
&browser_created, &is_windowless, browser_created, config);
&print_preview_enabled);
if (browser) { if (browser) {
// Attach the frame to the observer for message routing purposes. // Attach the frame to the observer for message routing purposes.
render_frame_observer->AttachFrame( render_frame_observer->AttachFrame(
@@ -130,16 +120,14 @@ void CefRenderManager::RenderFrameCreated(
void CefRenderManager::WebViewCreated( void CefRenderManager::WebViewCreated(
blink::WebView* web_view, blink::WebView* web_view,
bool& browser_created, bool& browser_created,
std::optional<bool>& is_windowless, std::optional<cef::BrowserConfig>& config) {
std::optional<bool>& print_preview_enabled) {
content::RenderFrame* render_frame = nullptr; content::RenderFrame* render_frame = nullptr;
if (web_view->MainFrame()->IsWebLocalFrame()) { if (web_view->MainFrame()->IsWebLocalFrame()) {
render_frame = content::RenderFrame::FromWebFrame( render_frame = content::RenderFrame::FromWebFrame(
web_view->MainFrame()->ToWebLocalFrame()); web_view->MainFrame()->ToWebLocalFrame());
} }
MaybeCreateBrowser(web_view, render_frame, &browser_created, &is_windowless, MaybeCreateBrowser(web_view, render_frame, browser_created, config);
&print_preview_enabled);
} }
void CefRenderManager::DevToolsAgentAttached() { void CefRenderManager::DevToolsAgentAttached() {
@@ -294,12 +282,9 @@ void CefRenderManager::WebKitInitialized() {
CefRefPtr<CefBrowserImpl> CefRenderManager::MaybeCreateBrowser( CefRefPtr<CefBrowserImpl> CefRenderManager::MaybeCreateBrowser(
blink::WebView* web_view, blink::WebView* web_view,
content::RenderFrame* render_frame, content::RenderFrame* render_frame,
bool* browser_created, bool& browser_created,
std::optional<bool>* is_windowless, std::optional<cef::BrowserConfig>& config) {
std::optional<bool>* print_preview_enabled) { browser_created = false;
if (browser_created) {
*browser_created = false;
}
if (!web_view || !render_frame) { if (!web_view || !render_frame) {
return nullptr; return nullptr;
@@ -307,25 +292,13 @@ CefRefPtr<CefBrowserImpl> CefRenderManager::MaybeCreateBrowser(
// Don't create another browser or excluded view object if one already exists // Don't create another browser or excluded view object if one already exists
// for the view. // for the view.
auto browser = GetBrowserForView(web_view); if (auto browser = GetBrowserForView(web_view)) {
if (browser) { config = browser->config();
if (is_windowless) {
*is_windowless = browser->is_windowless();
}
if (print_preview_enabled) {
*print_preview_enabled = browser->print_preview_enabled();
}
return browser; return browser;
} }
auto excluded_view = GetExcludedViewForView(web_view); if (auto excluded_view = GetExcludedViewForView(web_view)) {
if (excluded_view) { config = excluded_view->config();
if (is_windowless) {
*is_windowless = excluded_view->is_windowless();
}
if (print_preview_enabled) {
*print_preview_enabled = excluded_view->print_preview_enabled();
}
return nullptr; return nullptr;
} }
@@ -338,11 +311,10 @@ CefRefPtr<CefBrowserImpl> CefRenderManager::MaybeCreateBrowser(
return nullptr; return nullptr;
} }
if (is_windowless) { if (params->config) {
*is_windowless = params->is_windowless; config = cef::BrowserConfig{params->config->is_windowless,
} params->config->print_preview_enabled,
if (print_preview_enabled) { params->config->move_pip_enabled};
*print_preview_enabled = params->print_preview_enabled;
} }
if (params->is_excluded || params->browser_id < 0) { if (params->is_excluded || params->browser_id < 0) {
@@ -350,15 +322,13 @@ CefRefPtr<CefBrowserImpl> CefRenderManager::MaybeCreateBrowser(
// extension or print preview dialog), or if the new browser info response // extension or print preview dialog), or if the new browser info response
// has timed out. // has timed out.
excluded_views_.insert(std::make_pair( excluded_views_.insert(std::make_pair(
web_view, web_view, std::make_unique<CefExcludedView>(this, web_view, config)));
std::make_unique<CefExcludedView>(this, web_view, params->is_windowless,
params->print_preview_enabled)));
return nullptr; return nullptr;
} }
browser = new CefBrowserImpl(web_view, params->browser_id, *params->is_popup, CHECK(params->config);
*params->is_windowless, CefRefPtr<CefBrowserImpl> browser = new CefBrowserImpl(
*params->print_preview_enabled); web_view, params->browser_id, params->config->is_popup, *config);
browsers_.insert(std::make_pair(web_view, browser)); browsers_.insert(std::make_pair(web_view, browser));
// Notify the render process handler. // Notify the render process handler.
@@ -377,9 +347,7 @@ CefRefPtr<CefBrowserImpl> CefRenderManager::MaybeCreateBrowser(
} }
} }
if (browser_created) { browser_created = true;
*browser_created = true;
}
return browser; return browser;
} }

View File

@@ -12,6 +12,7 @@
#include "cef/include/internal/cef_ptr.h" #include "cef/include/internal/cef_ptr.h"
#include "cef/libcef/common/mojom/cef.mojom.h" #include "cef/libcef/common/mojom/cef.mojom.h"
#include "cef/libcef/renderer/browser_config.h"
#include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote.h"
@@ -52,12 +53,10 @@ class CefRenderManager : public cef::mojom::RenderManager {
void RenderFrameCreated(content::RenderFrame* render_frame, void RenderFrameCreated(content::RenderFrame* render_frame,
CefRenderFrameObserver* render_frame_observer, CefRenderFrameObserver* render_frame_observer,
bool& browser_created, bool& browser_created,
std::optional<bool>& is_windowless, std::optional<cef::BrowserConfig>& config);
std::optional<bool>& print_preview_enabled);
void WebViewCreated(blink::WebView* web_view, void WebViewCreated(blink::WebView* web_view,
bool& browser_created, bool& browser_created,
std::optional<bool>& is_windowless, std::optional<cef::BrowserConfig>& config);
std::optional<bool>& print_preview_enabled);
void DevToolsAgentAttached(); void DevToolsAgentAttached();
void DevToolsAgentDetached(); void DevToolsAgentDetached();
void ExposeInterfacesToBrowser(mojo::BinderMap* binders); void ExposeInterfacesToBrowser(mojo::BinderMap* binders);
@@ -94,9 +93,8 @@ class CefRenderManager : public cef::mojom::RenderManager {
CefRefPtr<CefBrowserImpl> MaybeCreateBrowser( CefRefPtr<CefBrowserImpl> MaybeCreateBrowser(
blink::WebView* web_view, blink::WebView* web_view,
content::RenderFrame* render_frame, content::RenderFrame* render_frame,
bool* browser_created, bool& browser_created,
std::optional<bool>* is_windowless, std::optional<cef::BrowserConfig>& config);
std::optional<bool>* print_preview_enabled);
// Called from CefBrowserImpl::OnDestruct(). // Called from CefBrowserImpl::OnDestruct().
void OnBrowserDestroyed(CefBrowserImpl* browser); void OnBrowserDestroyed(CefBrowserImpl* browser);

View File

@@ -68,6 +68,9 @@ patches = [
}, },
{ {
# Enable popups in offscreen rendering on MacOS. # Enable popups in offscreen rendering on MacOS.
#
# Enable moveTo()/moveBy() for Document picture-in-picture popups.
# https://github.com/chromiumembedded/cef/issues/3714
'name': 'webkit_popups', 'name': 'webkit_popups',
}, },
{ {
@@ -221,10 +224,6 @@ patches = [
# See related documentation in # See related documentation in
# libcef/browser/chrome/views/chrome_browser_frame.h. # libcef/browser/chrome/views/chrome_browser_frame.h.
# https://github.com/chromiumembedded/cef/issues/2969 # https://github.com/chromiumembedded/cef/issues/2969
#
# Properly disable 3-dot > "Open glic" menu item to avoid crash in
# GlicKeyedService::ToggleUI.
# https://issues.chromium.org/issues/408163318
'name': 'chrome_runtime_views', 'name': 'chrome_runtime_views',
}, },
{ {
@@ -782,10 +781,5 @@ patches = [
# builds. # builds.
# https://github.com/chromiumembedded/cef/issues/3892 # https://github.com/chromiumembedded/cef/issues/3892
'name': 'config_3892' 'name': 'config_3892'
},
{
# Fix DCHECK_EQ in SchemefulSite with custom standard schemes.
# https://issues.chromium.org/issues/408329644
'name': 'net_schemeful_site_408329644'
} }
] ]

View File

@@ -1,5 +1,5 @@
diff --git base/BUILD.gn base/BUILD.gn diff --git base/BUILD.gn base/BUILD.gn
index 50893c5653a42..75dd03c3df9a8 100644 index 57a6af0061615..d18a8a8a4559d 100644
--- base/BUILD.gn --- base/BUILD.gn
+++ base/BUILD.gn +++ base/BUILD.gn
@@ -41,6 +41,7 @@ import("//build/rust/rust_static_library.gni") @@ -41,6 +41,7 @@ import("//build/rust/rust_static_library.gni")
@@ -10,7 +10,7 @@ index 50893c5653a42..75dd03c3df9a8 100644
import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni") import("//testing/test.gni")
@@ -1518,7 +1519,13 @@ component("base") { @@ -1519,7 +1520,13 @@ component("base") {
"hash/md5_constexpr_internal.h", "hash/md5_constexpr_internal.h",
"hash/sha1.h", "hash/sha1.h",
] ]
@@ -25,7 +25,7 @@ index 50893c5653a42..75dd03c3df9a8 100644
sources += [ sources += [
"hash/md5_nacl.cc", "hash/md5_nacl.cc",
"hash/md5_nacl.h", "hash/md5_nacl.h",
@@ -1968,6 +1975,12 @@ component("base") { @@ -1969,6 +1976,12 @@ component("base") {
defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ] defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ]
} }
@@ -141,7 +141,7 @@ index 48a9b893d3f9d..a5a2223b2a0fa 100644
#else #else
return base::FeatureList::IsEnabled(base::features::kUseRustJsonParser); return base::FeatureList::IsEnabled(base::features::kUseRustJsonParser);
diff --git base/logging.cc base/logging.cc diff --git base/logging.cc base/logging.cc
index 22aa478001fb5..e799d8da52589 100644 index 26ba1a286e451..99b2ce6feb274 100644
--- base/logging.cc --- base/logging.cc
+++ base/logging.cc +++ base/logging.cc
@@ -51,6 +51,7 @@ @@ -51,6 +51,7 @@
@@ -152,7 +152,7 @@ index 22aa478001fb5..e799d8da52589 100644
#include "third_party/abseil-cpp/absl/base/internal/raw_logging.h" #include "third_party/abseil-cpp/absl/base/internal/raw_logging.h"
#include "third_party/abseil-cpp/absl/cleanup/cleanup.h" #include "third_party/abseil-cpp/absl/cleanup/cleanup.h"
@@ -538,7 +539,7 @@ bool BaseInitLoggingImpl(const LoggingSettings& settings) { @@ -530,7 +531,7 @@ bool BaseInitLoggingImpl(const LoggingSettings& settings) {
} }
#endif #endif

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
index 5186cdf0bcf3b..deb65db4ed097 100644 index b5783087429ee..32b59c28e40bd 100644
--- chrome/browser/BUILD.gn --- chrome/browser/BUILD.gn
+++ chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn
@@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni") @@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni")
@@ -10,7 +10,7 @@ index 5186cdf0bcf3b..deb65db4ed097 100644
import("//chrome/browser/buildflags.gni") import("//chrome/browser/buildflags.gni")
import("//chrome/browser/downgrade/buildflags.gni") import("//chrome/browser/downgrade/buildflags.gni")
import("//chrome/browser/request_header_integrity/buildflags.gni") import("//chrome/browser/request_header_integrity/buildflags.gni")
@@ -1876,6 +1877,7 @@ static_library("browser") { @@ -1884,6 +1885,7 @@ static_library("browser") {
"//build/config/compiler:compiler_buildflags", "//build/config/compiler:compiler_buildflags",
"//build/config/linux/dbus:buildflags", "//build/config/linux/dbus:buildflags",
"//cc", "//cc",
@@ -18,7 +18,7 @@ index 5186cdf0bcf3b..deb65db4ed097 100644
"//chrome:extra_resources", "//chrome:extra_resources",
"//chrome:resources", "//chrome:resources",
"//chrome:strings", "//chrome:strings",
@@ -2575,6 +2577,10 @@ static_library("browser") { @@ -2583,6 +2585,10 @@ static_library("browser") {
sources += [ "net/net_error_diagnostics_dialog_stub.cc" ] sources += [ "net/net_error_diagnostics_dialog_stub.cc" ]
} }

View File

@@ -83,7 +83,7 @@ index 8e0717f34f37f..df852d4b2e69f 100644
OverrideAndSyncDevToolsRendererPrefs(); OverrideAndSyncDevToolsRendererPrefs();
} }
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
index 51c55cb054ae7..df9aa9bc45a67 100644 index ba0cba1897577..82bb0ac855dc2 100644
--- chrome/browser/ui/BUILD.gn --- chrome/browser/ui/BUILD.gn
+++ chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn
@@ -7,6 +7,7 @@ import("//build/config/compiler/compiler.gni") @@ -7,6 +7,7 @@ import("//build/config/compiler/compiler.gni")
@@ -113,7 +113,7 @@ index 51c55cb054ae7..df9aa9bc45a67 100644
"//chrome:resources", "//chrome:resources",
"//chrome:strings", "//chrome:strings",
"//chrome/app:chrome_dll_resources", "//chrome/app:chrome_dll_resources",
@@ -701,6 +707,13 @@ static_library("ui") { @@ -704,6 +710,13 @@ static_library("ui") {
deps += [ "//components/plus_addresses/resources:vector_icons" ] deps += [ "//components/plus_addresses/resources:vector_icons" ]
} }
@@ -127,7 +127,7 @@ index 51c55cb054ae7..df9aa9bc45a67 100644
# TODO(crbug.com/41437292): Remove this circular dependency. # TODO(crbug.com/41437292): Remove this circular dependency.
# Any circular includes must depend on the target "//chrome/browser:browser_public_dependencies". # Any circular includes must depend on the target "//chrome/browser:browser_public_dependencies".
# These are all-platform circular includes. # These are all-platform circular includes.
@@ -5501,6 +5514,7 @@ static_library("ui") { @@ -5504,6 +5517,7 @@ static_library("ui") {
if (enable_printing) { if (enable_printing) {
deps += [ deps += [
"//components/printing/browser", "//components/printing/browser",

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn
index 50c6735fe6074..749fb1ff46146 100644 index 093e7502bd54d..fe30827b95425 100644
--- chrome/browser/safe_browsing/BUILD.gn --- chrome/browser/safe_browsing/BUILD.gn
+++ chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn
@@ -37,6 +37,7 @@ static_library("safe_browsing") { @@ -37,6 +37,7 @@ static_library("safe_browsing") {

View File

@@ -433,7 +433,7 @@ index e26e3625c99c8..c0d4a95607e37 100644
+#endif +#endif
} }
diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc
index 5b8b1bf1bc86e..8d2274c606ef4 100644 index a7d66215ad0b7..3282ea58c5872 100644
--- chrome/browser/chrome_content_browser_client.cc --- chrome/browser/chrome_content_browser_client.cc
+++ chrome/browser/chrome_content_browser_client.cc +++ chrome/browser/chrome_content_browser_client.cc
@@ -48,6 +48,7 @@ @@ -48,6 +48,7 @@
@@ -444,7 +444,7 @@ index 5b8b1bf1bc86e..8d2274c606ef4 100644
#include "chrome/browser/after_startup_task_utils.h" #include "chrome/browser/after_startup_task_utils.h"
#include "chrome/browser/ai/ai_manager.h" #include "chrome/browser/ai/ai_manager.h"
#include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/app_mode/app_mode_utils.h"
@@ -1494,6 +1495,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() { @@ -1495,6 +1496,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() {
} }
ChromeContentBrowserClient::ChromeContentBrowserClient() { ChromeContentBrowserClient::ChromeContentBrowserClient() {
@@ -453,7 +453,7 @@ index 5b8b1bf1bc86e..8d2274c606ef4 100644
#if BUILDFLAG(ENABLE_PLUGINS) #if BUILDFLAG(ENABLE_PLUGINS)
extra_parts_.push_back( extra_parts_.push_back(
std::make_unique<ChromeContentBrowserClientPluginsPart>()); std::make_unique<ChromeContentBrowserClientPluginsPart>());
@@ -1531,6 +1534,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() { @@ -1532,6 +1535,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() {
} }
} }
@@ -465,7 +465,7 @@ index 5b8b1bf1bc86e..8d2274c606ef4 100644
// static // static
void ChromeContentBrowserClient::RegisterLocalStatePrefs( void ChromeContentBrowserClient::RegisterLocalStatePrefs(
PrefRegistrySimple* registry) { PrefRegistrySimple* registry) {
@@ -4792,9 +4800,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( @@ -4793,9 +4801,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
&search::HandleNewTabURLReverseRewrite); &search::HandleNewTabURLReverseRewrite);
#endif // BUILDFLAG(IS_ANDROID) #endif // BUILDFLAG(IS_ANDROID)
@@ -477,7 +477,7 @@ index 5b8b1bf1bc86e..8d2274c606ef4 100644
} }
base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() {
@@ -6876,7 +6886,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated( @@ -6877,7 +6887,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated(
} }
} }
@@ -486,7 +486,7 @@ index 5b8b1bf1bc86e..8d2274c606ef4 100644
content::BrowserContext* context, content::BrowserContext* context,
bool in_memory, bool in_memory,
const base::FilePath& relative_partition_path, const base::FilePath& relative_partition_path,
@@ -6894,6 +6904,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams( @@ -6895,6 +6905,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams(
network_context_params->user_agent = GetUserAgentBasedOnPolicy(context); network_context_params->user_agent = GetUserAgentBasedOnPolicy(context);
network_context_params->accept_language = GetApplicationLocale(); network_context_params->accept_language = GetApplicationLocale();
} }
@@ -495,7 +495,7 @@ index 5b8b1bf1bc86e..8d2274c606ef4 100644
} }
std::vector<base::FilePath> std::vector<base::FilePath>
@@ -8032,11 +8044,11 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted( @@ -8033,11 +8045,11 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted(
const auto now = base::TimeTicks::Now(); const auto now = base::TimeTicks::Now();
const auto timeout = GetKeepaliveTimerTimeout(context); const auto timeout = GetKeepaliveTimerTimeout(context);
keepalive_deadline_ = std::max(keepalive_deadline_, now + timeout); keepalive_deadline_ = std::max(keepalive_deadline_, now + timeout);
@@ -509,7 +509,7 @@ index 5b8b1bf1bc86e..8d2274c606ef4 100644
FROM_HERE, keepalive_deadline_ - now, FROM_HERE, keepalive_deadline_ - now,
base::BindOnce( base::BindOnce(
&ChromeContentBrowserClient::OnKeepaliveTimerFired, &ChromeContentBrowserClient::OnKeepaliveTimerFired,
@@ -8058,7 +8070,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() { @@ -8059,7 +8071,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() {
--num_keepalive_requests_; --num_keepalive_requests_;
if (num_keepalive_requests_ == 0) { if (num_keepalive_requests_ == 0) {
DVLOG(1) << "Stopping the keepalive timer"; DVLOG(1) << "Stopping the keepalive timer";
@@ -519,7 +519,7 @@ index 5b8b1bf1bc86e..8d2274c606ef4 100644
// This deletes the keep alive handle attached to the timer function and // This deletes the keep alive handle attached to the timer function and
// unblock the shutdown sequence. // unblock the shutdown sequence.
} }
@@ -8236,7 +8249,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired( @@ -8237,7 +8250,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired(
const auto now = base::TimeTicks::Now(); const auto now = base::TimeTicks::Now();
const auto then = keepalive_deadline_; const auto then = keepalive_deadline_;
if (now < then) { if (now < then) {
@@ -529,7 +529,7 @@ index 5b8b1bf1bc86e..8d2274c606ef4 100644
base::BindOnce(&ChromeContentBrowserClient::OnKeepaliveTimerFired, base::BindOnce(&ChromeContentBrowserClient::OnKeepaliveTimerFired,
weak_factory_.GetWeakPtr(), weak_factory_.GetWeakPtr(),
diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h
index 3542dd8ea5593..dfd89fec1e4a6 100644 index 0751efb504919..7a45c45e92c44 100644
--- chrome/browser/chrome_content_browser_client.h --- chrome/browser/chrome_content_browser_client.h
+++ chrome/browser/chrome_content_browser_client.h +++ chrome/browser/chrome_content_browser_client.h
@@ -159,6 +159,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { @@ -159,6 +159,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
@@ -550,7 +550,7 @@ index 3542dd8ea5593..dfd89fec1e4a6 100644
content::BrowserContext* context, content::BrowserContext* context,
bool in_memory, bool in_memory,
const base::FilePath& relative_partition_path, const base::FilePath& relative_partition_path,
@@ -1358,7 +1360,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { @@ -1366,7 +1368,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
#if !BUILDFLAG(IS_ANDROID) #if !BUILDFLAG(IS_ANDROID)
uint64_t num_keepalive_requests_ = 0; uint64_t num_keepalive_requests_ = 0;
@@ -560,7 +560,7 @@ index 3542dd8ea5593..dfd89fec1e4a6 100644
#endif #endif
diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc
index 7393b3400afe4..e19f464f67640 100644 index 77be6bf7413f9..95e8b3e788f4a 100644
--- chrome/browser/prefs/browser_prefs.cc --- chrome/browser/prefs/browser_prefs.cc
+++ chrome/browser/prefs/browser_prefs.cc +++ chrome/browser/prefs/browser_prefs.cc
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
@@ -582,7 +582,7 @@ index 7393b3400afe4..e19f464f67640 100644
#if BUILDFLAG(ENABLE_EXTENSIONS) #if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/accessibility/animation_policy_prefs.h" #include "chrome/browser/accessibility/animation_policy_prefs.h"
#include "chrome/browser/apps/platform_apps/shortcut_manager.h" #include "chrome/browser/apps/platform_apps/shortcut_manager.h"
@@ -1830,6 +1835,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) { @@ -1841,6 +1846,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
// This is intentionally last. // This is intentionally last.
RegisterLocalStatePrefsForMigration(registry); RegisterLocalStatePrefsForMigration(registry);
@@ -594,7 +594,7 @@ index 7393b3400afe4..e19f464f67640 100644
} }
// Register prefs applicable to all profiles. // Register prefs applicable to all profiles.
@@ -2271,6 +2281,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry, @@ -2282,6 +2292,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
const std::string& locale) { const std::string& locale) {
RegisterProfilePrefs(registry, locale); RegisterProfilePrefs(registry, locale);

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc
index 99056d7aff8c7..2741155416953 100644 index 3fcd374a0223f..37a4d0a0b2fe4 100644
--- chrome/browser/ui/browser_command_controller.cc --- chrome/browser/ui/browser_command_controller.cc
+++ chrome/browser/ui/browser_command_controller.cc +++ chrome/browser/ui/browser_command_controller.cc
@@ -441,6 +441,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( @@ -441,6 +441,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
@@ -40,24 +40,8 @@ index 99056d7aff8c7..2741155416953 100644
} }
void BrowserCommandController::InitCommandState() { void BrowserCommandController::InitCommandState() {
@@ -1523,11 +1533,12 @@ void BrowserCommandController::InitCommandState() {
#if BUILDFLAG(ENABLE_GLIC)
// Glic commands.
command_updater_.UpdateCommandEnabled(
- IDC_GLIC_TOGGLE_PIN, glic::GlicEnabling::IsProfileEligible(profile()));
+ IDC_GLIC_TOGGLE_PIN, glic::GlicEnabling::IsEnabledForProfile(profile()));
command_updater_.UpdateCommandEnabled(
- IDC_OPEN_GLIC, glic::GlicEnabling::IsProfileEligible(profile()));
+ IDC_OPEN_GLIC, glic::GlicEnabling::IsEnabledForProfile(profile()));
command_updater_.UpdateCommandEnabled(
- IDC_GLIC_TOGGLE_FOCUS, glic::GlicEnabling::IsProfileEligible(profile()));
+ IDC_GLIC_TOGGLE_FOCUS,
+ glic::GlicEnabling::IsEnabledForProfile(profile()));
#endif
// Initialize other commands whose state changes based on various conditions.
diff --git chrome/browser/ui/toolbar/app_menu_model.cc chrome/browser/ui/toolbar/app_menu_model.cc diff --git chrome/browser/ui/toolbar/app_menu_model.cc chrome/browser/ui/toolbar/app_menu_model.cc
index 3dc212eb62ae8..4191ffa5f52a8 100644 index 4afe64b8b2f33..d1997e0ff5485 100644
--- chrome/browser/ui/toolbar/app_menu_model.cc --- chrome/browser/ui/toolbar/app_menu_model.cc
+++ chrome/browser/ui/toolbar/app_menu_model.cc +++ chrome/browser/ui/toolbar/app_menu_model.cc
@@ -736,10 +736,12 @@ FindAndEditSubMenuModel::FindAndEditSubMenuModel( @@ -736,10 +736,12 @@ FindAndEditSubMenuModel::FindAndEditSubMenuModel(
@@ -131,7 +115,7 @@ index 3dc212eb62ae8..4191ffa5f52a8 100644
} // namespace } // namespace
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@@ -1748,7 +1801,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const { @@ -1747,7 +1800,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const {
return false; return false;
} }
@@ -140,7 +124,7 @@ index 3dc212eb62ae8..4191ffa5f52a8 100644
GlobalError* error = GlobalError* error =
GlobalErrorServiceFactory::GetForProfile(browser_->profile()) GlobalErrorServiceFactory::GetForProfile(browser_->profile())
->GetGlobalErrorByMenuItemCommandID(command_id); ->GetGlobalErrorByMenuItemCommandID(command_id);
@@ -1764,6 +1817,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const { @@ -1763,6 +1816,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const {
} }
} }
@@ -171,7 +155,7 @@ index 3dc212eb62ae8..4191ffa5f52a8 100644
bool AppMenuModel::IsCommandIdAlerted(int command_id) const { bool AppMenuModel::IsCommandIdAlerted(int command_id) const {
if (command_id == IDC_VIEW_PASSWORDS || if (command_id == IDC_VIEW_PASSWORDS ||
command_id == IDC_SHOW_PASSWORD_MANAGER) { command_id == IDC_SHOW_PASSWORD_MANAGER) {
@@ -1919,8 +1996,10 @@ void AppMenuModel::Build() { @@ -1918,8 +1995,10 @@ void AppMenuModel::Build() {
IDS_CLEAR_BROWSING_DATA, IDS_CLEAR_BROWSING_DATA,
kTrashCanRefreshIcon); kTrashCanRefreshIcon);
@@ -182,7 +166,7 @@ index 3dc212eb62ae8..4191ffa5f52a8 100644
AddSeparator(ui::NORMAL_SEPARATOR); AddSeparator(ui::NORMAL_SEPARATOR);
AddItemWithStringIdAndVectorIcon(this, IDC_PRINT, IDS_PRINT, kPrintMenuIcon); AddItemWithStringIdAndVectorIcon(this, IDC_PRINT, IDS_PRINT, kPrintMenuIcon);
@@ -2028,6 +2107,11 @@ void AppMenuModel::Build() { @@ -2027,6 +2106,11 @@ void AppMenuModel::Build() {
} }
#endif // !BUILDFLAG(IS_CHROMEOS) #endif // !BUILDFLAG(IS_CHROMEOS)
@@ -776,7 +760,7 @@ index 7a2f7b5d43762..ef55ed7e6cd43 100644
// Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate // Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate
// interface to keep these two classes decoupled and testable. // interface to keep these two classes decoupled and testable.
diff --git chrome/browser/ui/views/frame/browser_view_layout.cc chrome/browser/ui/views/frame/browser_view_layout.cc diff --git chrome/browser/ui/views/frame/browser_view_layout.cc chrome/browser/ui/views/frame/browser_view_layout.cc
index 7cfadb577326f..5d97370b499c7 100644 index 88b786fa68fa5..3d1136f57be04 100644
--- chrome/browser/ui/views/frame/browser_view_layout.cc --- chrome/browser/ui/views/frame/browser_view_layout.cc
+++ chrome/browser/ui/views/frame/browser_view_layout.cc +++ chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -53,6 +53,10 @@ @@ -53,6 +53,10 @@
@@ -1036,7 +1020,7 @@ index c0d519f033713..6df5e004f43d2 100644
case PageActionIconType::kPaymentsOfferNotification: case PageActionIconType::kPaymentsOfferNotification:
add_page_action_icon( 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 diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index 9454a78b72cc3..e3aab475b2465 100644 index ff62541aa946d..3c3258e36ad3f 100644
--- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc --- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -698,29 +698,41 @@ gfx::Range BrowserTabStripController::ListTabsInGroup( @@ -698,29 +698,41 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
@@ -1082,7 +1066,7 @@ index 9454a78b72cc3..e3aab475b2465 100644
} }
diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc
index af3d65c89950b..f04c923a37be9 100644 index 62da5fee718a1..8a4a5a62d640f 100644
--- chrome/browser/ui/views/toolbar/toolbar_view.cc --- chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ chrome/browser/ui/views/toolbar/toolbar_view.cc +++ chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -185,7 +185,7 @@ class TabstripLikeBackground : public views::Background { @@ -185,7 +185,7 @@ class TabstripLikeBackground : public views::Background {
@@ -1144,7 +1128,7 @@ index af3d65c89950b..f04c923a37be9 100644
// Make sure the toolbar shows by default. // Make sure the toolbar shows by default.
size_animation_.Reset(1); size_animation_.Reset(1);
@@ -350,7 +366,8 @@ void ToolbarView::Init() { @@ -354,7 +370,8 @@ void ToolbarView::Init() {
} }
std::unique_ptr<media_router::CastToolbarButton> cast; std::unique_ptr<media_router::CastToolbarButton> cast;
if (!base::FeatureList::IsEnabled(features::kPinnedCastButton)) { if (!base::FeatureList::IsEnabled(features::kPinnedCastButton)) {
@@ -1154,7 +1138,7 @@ index af3d65c89950b..f04c923a37be9 100644
cast = media_router::CastToolbarButton::Create(browser_); cast = media_router::CastToolbarButton::Create(browser_);
} }
} }
@@ -814,7 +831,8 @@ void ToolbarView::Layout(PassKey) { @@ -818,7 +835,8 @@ void ToolbarView::Layout(PassKey) {
if (display_mode_ == DisplayMode::NORMAL) { if (display_mode_ == DisplayMode::NORMAL) {
LayoutCommon(); LayoutCommon();

View File

@@ -47,7 +47,7 @@ index 085e9a60031ea..15e8ba49573e9 100644
return std::make_pair( return std::make_pair(
/*is_cacheable=*/false, /*is_cacheable=*/false,
diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc
index 47750f538148c..3260524e74306 100644 index e2382e9769cb7..f5738329609c9 100644
--- content/public/browser/content_browser_client.cc --- content/public/browser/content_browser_client.cc
+++ content/public/browser/content_browser_client.cc +++ content/public/browser/content_browser_client.cc
@@ -1181,7 +1181,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload( @@ -1181,7 +1181,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload(
@@ -68,10 +68,10 @@ index 47750f538148c..3260524e74306 100644
std::vector<base::FilePath> std::vector<base::FilePath>
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
index b7864a93b53a3..5b6174340e2cc 100644 index 9b75a6c3c222a..30cf0e43f3f09 100644
--- content/public/browser/content_browser_client.h --- content/public/browser/content_browser_client.h
+++ content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h
@@ -1379,6 +1379,12 @@ class CONTENT_EXPORT ContentBrowserClient { @@ -1380,6 +1380,12 @@ class CONTENT_EXPORT ContentBrowserClient {
bool opener_suppressed, bool opener_suppressed,
bool* no_javascript_access); bool* no_javascript_access);
@@ -84,7 +84,7 @@ index b7864a93b53a3..5b6174340e2cc 100644
// Allows the embedder to return a delegate for the SpeechRecognitionManager. // Allows the embedder to return a delegate for the SpeechRecognitionManager.
// The delegate will be owned by the manager. It's valid to return nullptr. // The delegate will be owned by the manager. It's valid to return nullptr.
virtual SpeechRecognitionManagerDelegate* virtual SpeechRecognitionManagerDelegate*
@@ -2230,7 +2236,7 @@ class CONTENT_EXPORT ContentBrowserClient { @@ -2231,7 +2237,7 @@ class CONTENT_EXPORT ContentBrowserClient {
// //
// If |relative_partition_path| is the empty string, it means this needs to // If |relative_partition_path| is the empty string, it means this needs to
// create the default NetworkContext for the BrowserContext. // create the default NetworkContext for the BrowserContext.
@@ -93,7 +93,7 @@ index b7864a93b53a3..5b6174340e2cc 100644
BrowserContext* context, BrowserContext* context,
bool in_memory, bool in_memory,
const base::FilePath& relative_partition_path, const base::FilePath& relative_partition_path,
@@ -2472,6 +2478,22 @@ class CONTENT_EXPORT ContentBrowserClient { @@ -2473,6 +2479,22 @@ class CONTENT_EXPORT ContentBrowserClient {
const net::IsolationInfo& isolation_info, const net::IsolationInfo& isolation_info,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory); mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory);
@@ -116,7 +116,7 @@ index b7864a93b53a3..5b6174340e2cc 100644
// Creates an OverlayWindow to be used for video or Picture-in-Picture. // 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 window will house the content shown when in Picture-in-Picture mode.
// This will return a new OverlayWindow. // This will return a new OverlayWindow.
@@ -2537,6 +2559,10 @@ class CONTENT_EXPORT ContentBrowserClient { @@ -2538,6 +2560,10 @@ class CONTENT_EXPORT ContentBrowserClient {
// Used as part of the user agent string. // Used as part of the user agent string.
virtual std::string GetProduct(); virtual std::string GetProduct();

View File

@@ -1,5 +1,5 @@
diff --git ui/gtk/gtk_ui.cc ui/gtk/gtk_ui.cc diff --git ui/gtk/gtk_ui.cc ui/gtk/gtk_ui.cc
index aba9091667b74..6921c64b60cad 100644 index c761f9de266f6..ca4c0b705f2ad 100644
--- ui/gtk/gtk_ui.cc --- ui/gtk/gtk_ui.cc
+++ ui/gtk/gtk_ui.cc +++ ui/gtk/gtk_ui.cc
@@ -31,6 +31,7 @@ @@ -31,6 +31,7 @@

View File

@@ -1,5 +1,5 @@
diff --git content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm diff --git content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index 22ee05153569d..e957efa72066d 100644 index b0a49de7b4ed6..0abea22fc9a2c 100644
--- content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm --- content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm +++ content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -172,6 +172,13 @@ void ExtractUnderlines(NSAttributedString* string, @@ -172,6 +172,13 @@ void ExtractUnderlines(NSAttributedString* string,
@@ -16,7 +16,7 @@ index 22ee05153569d..e957efa72066d 100644
// Private methods: // Private methods:
@interface RenderWidgetHostViewCocoa () @interface RenderWidgetHostViewCocoa ()
@@ -774,6 +781,15 @@ void ExtractUnderlines(NSAttributedString* string, @@ -783,6 +790,15 @@ void ExtractUnderlines(NSAttributedString* string,
} }
- (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {

View File

@@ -1,18 +0,0 @@
diff --git net/base/schemeful_site.cc net/base/schemeful_site.cc
index 4b9760d916213..87556e7e0dc99 100644
--- net/base/schemeful_site.cc
+++ net/base/schemeful_site.cc
@@ -43,6 +43,13 @@ bool IsSameSiteInternal(const url::Origin& a,
return true;
}
+ // If host equality is false, then the only way the origins can be same site
+ // is if we have a standard scheme with a network host, which is the only case
+ // when SchemefulSite looks at the registerable domain.
+ if (!IsStandardSchemeWithNetworkHost(a.scheme())) {
+ return false;
+ }
+
std::string_view b_site = GetDomainAndRegistryAsStringPiece(
b, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);

View File

@@ -72,10 +72,10 @@ index 573269ba54150..a51715e7dc6cc 100644
uint16_t angle, uint16_t angle,
display::mojom::ScreenOrientation type) { display::mojom::ScreenOrientation type) {
diff --git content/browser/renderer_host/render_widget_host_impl.h content/browser/renderer_host/render_widget_host_impl.h diff --git content/browser/renderer_host/render_widget_host_impl.h content/browser/renderer_host/render_widget_host_impl.h
index c201cff9e5c3b..900af39ae4b09 100644 index 3b3eec99c80a8..b07e1d00d4a1e 100644
--- content/browser/renderer_host/render_widget_host_impl.h --- content/browser/renderer_host/render_widget_host_impl.h
+++ content/browser/renderer_host/render_widget_host_impl.h +++ content/browser/renderer_host/render_widget_host_impl.h
@@ -843,6 +843,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl @@ -847,6 +847,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl
void ProgressFlingIfNeeded(base::TimeTicks current_time); void ProgressFlingIfNeeded(base::TimeTicks current_time);
void StopFling(); void StopFling();

View File

@@ -1,8 +1,8 @@
diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc
index 7d8baae182adb..a9b5cb4c8b43d 100644 index 775a132ea523c..6fb096739a3dc 100644
--- content/browser/renderer_host/render_frame_host_impl.cc --- content/browser/renderer_host/render_frame_host_impl.cc
+++ content/browser/renderer_host/render_frame_host_impl.cc +++ content/browser/renderer_host/render_frame_host_impl.cc
@@ -9654,6 +9654,16 @@ void RenderFrameHostImpl::CreateNewWindow( @@ -9662,6 +9662,16 @@ void RenderFrameHostImpl::CreateNewWindow(
return; return;
} }
@@ -19,7 +19,7 @@ index 7d8baae182adb..a9b5cb4c8b43d 100644
// Otherwise, consume user activation before we proceed. In particular, it is // Otherwise, consume user activation before we proceed. In particular, it is
// important to do this before we return from the |opener_suppressed| case // important to do this before we return from the |opener_suppressed| case
// below. // below.
@@ -12061,6 +12071,7 @@ void RenderFrameHostImpl::CommitNavigation( @@ -12069,6 +12079,7 @@ void RenderFrameHostImpl::CommitNavigation(
auto browser_calc_origin_to_commit = auto browser_calc_origin_to_commit =
navigation_request->GetOriginToCommitWithDebugInfo(); navigation_request->GetOriginToCommitWithDebugInfo();
if (!process_lock.is_error_page() && !is_mhtml_subframe && if (!process_lock.is_error_page() && !is_mhtml_subframe &&

View File

@@ -26,7 +26,7 @@ index d6598893c06a6..0b1adcf999dac 100644
if (cpu != 'x64'): if (cpu != 'x64'):
# x64 is default target CPU thus any other CPU requires a target set # x64 is default target CPU thus any other CPU requires a target set
diff --git build/vs_toolchain.py build/vs_toolchain.py diff --git build/vs_toolchain.py build/vs_toolchain.py
index e0f89a555492c..0f8dc1dbb3525 100755 index 61b3229502571..6bb14f7cf7e28 100755
--- build/vs_toolchain.py --- build/vs_toolchain.py
+++ build/vs_toolchain.py +++ build/vs_toolchain.py
@@ -136,9 +136,16 @@ def SetEnvironmentAndGetRuntimeDllDirs(): @@ -136,9 +136,16 @@ def SetEnvironmentAndGetRuntimeDllDirs():

View File

@@ -127,7 +127,7 @@ index 8014bb16d8108..bc8e80e9eb9c3 100644
base::FilePath transport_security_persister_file_name; base::FilePath transport_security_persister_file_name;
if (GetFullDataFilePath(params_->file_paths, if (GetFullDataFilePath(params_->file_paths,
diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom
index a9c82bcf9a4eb..61afe5bf737ce 100644 index feed273c8c77d..ca999f5ed75d5 100644
--- services/network/public/mojom/network_context.mojom --- services/network/public/mojom/network_context.mojom
+++ services/network/public/mojom/network_context.mojom +++ services/network/public/mojom/network_context.mojom
@@ -361,6 +361,9 @@ struct NetworkContextParams { @@ -361,6 +361,9 @@ struct NetworkContextParams {

View File

@@ -254,12 +254,12 @@ index b4cb7c83a3e4c..562e096930147 100644
std::unique_ptr<SelectionController> selection_controller_; std::unique_ptr<SelectionController> selection_controller_;
diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc
index c5f3700f8f04b..84b0d56977dbd 100644 index 74dd82258742f..4fa18ef92247f 100644
--- ui/views/controls/menu/menu_controller.cc --- ui/views/controls/menu/menu_controller.cc
+++ ui/views/controls/menu/menu_controller.cc +++ ui/views/controls/menu/menu_controller.cc
@@ -589,7 +589,8 @@ void MenuController::Run(Widget* parent, @@ -599,7 +599,8 @@ void MenuController::Run(Widget* parent,
ui::mojom::MenuSourceType source_type, ui::mojom::MenuSourceType source_type,
bool context_menu, MenuType menu_type,
bool is_nested_drag, bool is_nested_drag,
- gfx::NativeView native_view_for_gestures) { - gfx::NativeView native_view_for_gestures) {
+ gfx::NativeView native_view_for_gestures, + gfx::NativeView native_view_for_gestures,
@@ -267,7 +267,7 @@ index c5f3700f8f04b..84b0d56977dbd 100644
exit_type_ = ExitType::kNone; exit_type_ = ExitType::kNone;
possible_drag_ = false; possible_drag_ = false;
drag_in_progress_ = false; drag_in_progress_ = false;
@@ -658,6 +659,7 @@ void MenuController::Run(Widget* parent, @@ -668,6 +669,7 @@ void MenuController::Run(Widget* parent,
} }
native_view_for_gestures_ = native_view_for_gestures; native_view_for_gestures_ = native_view_for_gestures;
@@ -275,7 +275,7 @@ index c5f3700f8f04b..84b0d56977dbd 100644
// Only create a MenuPreTargetHandler for non-nested menus. Nested menus // Only create a MenuPreTargetHandler for non-nested menus. Nested menus
// will use the existing one. // will use the existing one.
@@ -2386,6 +2388,7 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) { @@ -2396,6 +2398,7 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
params.do_capture = do_capture; params.do_capture = do_capture;
params.native_view_for_gestures = native_view_for_gestures_; params.native_view_for_gestures = native_view_for_gestures_;
params.owned_window_anchor = anchor; params.owned_window_anchor = anchor;
@@ -283,7 +283,7 @@ index c5f3700f8f04b..84b0d56977dbd 100644
if (item->GetParentMenuItem()) { if (item->GetParentMenuItem()) {
params.context = item->GetWidget(); params.context = item->GetWidget();
// (crbug.com/1414232) The item to be open is a submenu. Make sure // (crbug.com/1414232) The item to be open is a submenu. Make sure
@@ -3099,7 +3102,11 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem( @@ -3119,7 +3122,11 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem(
void MenuController::OpenSubmenuChangeSelectionIfCan() { void MenuController::OpenSubmenuChangeSelectionIfCan() {
MenuItemView* item = pending_state_.item; MenuItemView* item = pending_state_.item;
@@ -296,7 +296,7 @@ index c5f3700f8f04b..84b0d56977dbd 100644
return; return;
} }
@@ -3124,6 +3131,7 @@ void MenuController::CloseSubmenu() { @@ -3144,6 +3151,7 @@ void MenuController::CloseSubmenu() {
MenuItemView* item = state_.item; MenuItemView* item = state_.item;
DCHECK(item); DCHECK(item);
if (!item->GetParentMenuItem()) { if (!item->GetParentMenuItem()) {
@@ -305,12 +305,12 @@ index c5f3700f8f04b..84b0d56977dbd 100644
} }
if (item->SubmenuIsShowing()) { if (item->SubmenuIsShowing()) {
diff --git ui/views/controls/menu/menu_controller.h ui/views/controls/menu/menu_controller.h diff --git ui/views/controls/menu/menu_controller.h ui/views/controls/menu/menu_controller.h
index 737b5dd9a243e..44b088afd01c8 100644 index 2a42f071fcfad..3de8c2be46058 100644
--- ui/views/controls/menu/menu_controller.h --- ui/views/controls/menu/menu_controller.h
+++ ui/views/controls/menu/menu_controller.h +++ ui/views/controls/menu/menu_controller.h
@@ -140,7 +140,8 @@ class VIEWS_EXPORT MenuController final : public gfx::AnimationDelegate, @@ -146,7 +146,8 @@ class VIEWS_EXPORT MenuController final : public gfx::AnimationDelegate,
ui::mojom::MenuSourceType source_type = ui::mojom::MenuSourceType::kNone, ui::mojom::MenuSourceType source_type = ui::mojom::MenuSourceType::kNone,
bool context_menu = false, MenuType menu_type = MenuType::kNormal,
bool is_nested_drag = false, bool is_nested_drag = false,
- gfx::NativeView native_view_for_gestures = gfx::NativeView()); - gfx::NativeView native_view_for_gestures = gfx::NativeView());
+ gfx::NativeView native_view_for_gestures = gfx::NativeView(), + gfx::NativeView native_view_for_gestures = gfx::NativeView(),
@@ -318,7 +318,7 @@ index 737b5dd9a243e..44b088afd01c8 100644
bool for_drop() const { return for_drop_; } bool for_drop() const { return for_drop_; }
@@ -740,6 +741,8 @@ class VIEWS_EXPORT MenuController final : public gfx::AnimationDelegate, @@ -746,6 +747,8 @@ class VIEWS_EXPORT MenuController final : public gfx::AnimationDelegate,
// RunType::SEND_GESTURE_EVENTS_TO_OWNER is set. // RunType::SEND_GESTURE_EVENTS_TO_OWNER is set.
gfx::NativeView native_view_for_gestures_ = gfx::NativeView(); gfx::NativeView native_view_for_gestures_ = gfx::NativeView();
@@ -567,10 +567,10 @@ index 87739aa15210f..e785faf160c2e 100644
} }
diff --git ui/views/controls/menu/menu_runner.h ui/views/controls/menu/menu_runner.h diff --git ui/views/controls/menu/menu_runner.h ui/views/controls/menu/menu_runner.h
index c60b13df53aae..2e2b9174938f7 100644 index cb9d9d46eea37..a9ffb74761fce 100644
--- ui/views/controls/menu/menu_runner.h --- ui/views/controls/menu/menu_runner.h
+++ ui/views/controls/menu/menu_runner.h +++ ui/views/controls/menu/menu_runner.h
@@ -160,6 +160,8 @@ class VIEWS_EXPORT MenuRunner { @@ -164,6 +164,8 @@ class VIEWS_EXPORT MenuRunner {
MenuAnchorPosition anchor, MenuAnchorPosition anchor,
ui::mojom::MenuSourceType source_type, ui::mojom::MenuSourceType source_type,
gfx::NativeView native_view_for_gestures = gfx::NativeView(), gfx::NativeView native_view_for_gestures = gfx::NativeView(),
@@ -580,7 +580,7 @@ index c60b13df53aae..2e2b9174938f7 100644
std::optional<std::string> show_menu_host_duration_histogram = std::optional<std::string> show_menu_host_duration_histogram =
std::nullopt); std::nullopt);
diff --git ui/views/controls/menu/menu_runner_impl.cc ui/views/controls/menu/menu_runner_impl.cc diff --git ui/views/controls/menu/menu_runner_impl.cc ui/views/controls/menu/menu_runner_impl.cc
index bf7f7c6d8d31e..b7054a59a8876 100644 index 3793390d203db..d56aa411470ab 100644
--- ui/views/controls/menu/menu_runner_impl.cc --- ui/views/controls/menu/menu_runner_impl.cc
+++ ui/views/controls/menu/menu_runner_impl.cc +++ ui/views/controls/menu/menu_runner_impl.cc
@@ -119,6 +119,7 @@ void MenuRunnerImpl::RunMenuAt( @@ -119,6 +119,7 @@ void MenuRunnerImpl::RunMenuAt(
@@ -591,9 +591,9 @@ index bf7f7c6d8d31e..b7054a59a8876 100644
std::optional<gfx::RoundedCornersF> corners, std::optional<gfx::RoundedCornersF> corners,
std::optional<std::string> show_menu_host_duration_histogram) { std::optional<std::string> show_menu_host_duration_histogram) {
closing_event_time_ = base::TimeTicks(); closing_event_time_ = base::TimeTicks();
@@ -193,7 +194,7 @@ void MenuRunnerImpl::RunMenuAt( @@ -199,7 +200,7 @@ void MenuRunnerImpl::RunMenuAt(
controller->Run(parent, button_controller, menu_.get(), bounds, anchor, controller->Run(parent, button_controller, menu_.get(), bounds, anchor,
source_type, (run_types & MenuRunner::CONTEXT_MENU) != 0, source_type, menu_type,
(run_types & MenuRunner::NESTED_DRAG) != 0, (run_types & MenuRunner::NESTED_DRAG) != 0,
- native_view_for_gestures); - native_view_for_gestures);
+ native_view_for_gestures, parent_widget); + native_view_for_gestures, parent_widget);

View File

@@ -500,10 +500,10 @@ index 2ee5e4b4673f4..62a6776b27ad9 100644
// the implementation of ::ShowCursor() is based on a counter, so making this // the implementation of ::ShowCursor() is based on a counter, so making this
// member static ensures that ::ShowCursor() is always called exactly once // member static ensures that ::ShowCursor() is always called exactly once
diff --git ui/views/widget/native_widget_mac.mm ui/views/widget/native_widget_mac.mm diff --git ui/views/widget/native_widget_mac.mm ui/views/widget/native_widget_mac.mm
index ac690f3f12836..9457f936fd96d 100644 index 4aa1343bd447f..f0e7cf3988e9d 100644
--- ui/views/widget/native_widget_mac.mm --- ui/views/widget/native_widget_mac.mm
+++ ui/views/widget/native_widget_mac.mm +++ ui/views/widget/native_widget_mac.mm
@@ -718,6 +718,7 @@ void NativeWidgetMac::Show(ui::mojom::WindowShowState show_state, @@ -719,6 +719,7 @@ void NativeWidgetMac::Show(ui::mojom::WindowShowState show_state,
break; break;
case ui::mojom::WindowShowState::kMaximized: case ui::mojom::WindowShowState::kMaximized:
case ui::mojom::WindowShowState::kFullscreen: case ui::mojom::WindowShowState::kFullscreen:
@@ -593,7 +593,7 @@ index b294759923814..719686b4db165 100644
// focus when the window is restored. // focus when the window is restored.
if (v) { if (v) {
diff --git ui/views/widget/widget.h ui/views/widget/widget.h diff --git ui/views/widget/widget.h ui/views/widget/widget.h
index 4d1c7d95c338b..f2b45e10dc831 100644 index 44c9248daecd6..db3ef6ebdf91a 100644
--- ui/views/widget/widget.h --- ui/views/widget/widget.h
+++ ui/views/widget/widget.h +++ ui/views/widget/widget.h
@@ -437,6 +437,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, @@ -437,6 +437,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,

View File

@@ -1,8 +1,8 @@
diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc
index f80d8ecc385df..b879741c441af 100644 index 2896b2b15d9c2..8e12c2134117c 100644
--- content/browser/web_contents/web_contents_impl.cc --- content/browser/web_contents/web_contents_impl.cc
+++ content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc
@@ -3916,6 +3916,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, @@ -3922,6 +3922,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
params.main_frame_name, GetOpener(), primary_main_frame_policy, params.main_frame_name, GetOpener(), primary_main_frame_policy,
base::UnguessableToken::Create()); base::UnguessableToken::Create());
@@ -15,7 +15,7 @@ index f80d8ecc385df..b879741c441af 100644
std::unique_ptr<WebContentsViewDelegate> delegate = std::unique_ptr<WebContentsViewDelegate> delegate =
GetContentClient()->browser()->GetWebContentsViewDelegate(this); GetContentClient()->browser()->GetWebContentsViewDelegate(this);
@@ -3926,6 +3932,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, @@ -3932,6 +3938,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
view_ = CreateWebContentsView(this, std::move(delegate), view_ = CreateWebContentsView(this, std::move(delegate),
&render_view_host_delegate_view_); &render_view_host_delegate_view_);
} }
@@ -23,7 +23,7 @@ index f80d8ecc385df..b879741c441af 100644
CHECK(render_view_host_delegate_view_); CHECK(render_view_host_delegate_view_);
CHECK(view_.get()); CHECK(view_.get());
@@ -4136,6 +4143,9 @@ void WebContentsImpl::RenderWidgetCreated( @@ -4142,6 +4149,9 @@ void WebContentsImpl::RenderWidgetCreated(
"render_widget_host", render_widget_host); "render_widget_host", render_widget_host);
CHECK(!created_widgets_.contains(render_widget_host->GetFrameSinkId())); CHECK(!created_widgets_.contains(render_widget_host->GetFrameSinkId()));
created_widgets_[render_widget_host->GetFrameSinkId()] = render_widget_host; created_widgets_[render_widget_host->GetFrameSinkId()] = render_widget_host;
@@ -33,7 +33,7 @@ index f80d8ecc385df..b879741c441af 100644
} }
void WebContentsImpl::RenderWidgetDeleted( void WebContentsImpl::RenderWidgetDeleted(
@@ -5055,6 +5065,15 @@ FrameTree* WebContentsImpl::CreateNewWindow( @@ -5061,6 +5071,15 @@ FrameTree* WebContentsImpl::CreateNewWindow(
create_params.picture_in_picture_options = *(params.pip_options); create_params.picture_in_picture_options = *(params.pip_options);
} }
@@ -49,7 +49,7 @@ index f80d8ecc385df..b879741c441af 100644
// Check whether there is an available prerendered page for this navigation if // Check whether there is an available prerendered page for this navigation if
// this is not for guest. If it exists, take WebContents pre-created for // this is not for guest. If it exists, take WebContents pre-created for
// hosting the prerendered page instead of creating new WebContents. // hosting the prerendered page instead of creating new WebContents.
@@ -9764,6 +9783,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, @@ -9777,6 +9796,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node,
} }
CloseListenerManager::DidChangeFocusedFrame(this); CloseListenerManager::DidChangeFocusedFrame(this);
@@ -59,7 +59,7 @@ index f80d8ecc385df..b879741c441af 100644
} }
FrameTree* WebContentsImpl::GetOwnedPictureInPictureFrameTree() { FrameTree* WebContentsImpl::GetOwnedPictureInPictureFrameTree() {
@@ -10411,6 +10433,11 @@ void WebContentsImpl::Resize(const gfx::Rect& new_bounds) { @@ -10424,6 +10446,11 @@ void WebContentsImpl::Resize(const gfx::Rect& new_bounds) {
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::Resize"); OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::Resize");
#if defined(USE_AURA) #if defined(USE_AURA)
aura::Window* window = GetNativeView(); aura::Window* window = GetNativeView();
@@ -71,7 +71,7 @@ index f80d8ecc385df..b879741c441af 100644
window->SetBounds(gfx::Rect(window->bounds().origin(), new_bounds.size())); window->SetBounds(gfx::Rect(window->bounds().origin(), new_bounds.size()));
#elif BUILDFLAG(IS_ANDROID) #elif BUILDFLAG(IS_ANDROID)
content::RenderWidgetHostView* view = GetRenderWidgetHostView(); content::RenderWidgetHostView* view = GetRenderWidgetHostView();
@@ -10423,6 +10450,11 @@ void WebContentsImpl::Resize(const gfx::Rect& new_bounds) { @@ -10436,6 +10463,11 @@ void WebContentsImpl::Resize(const gfx::Rect& new_bounds) {
gfx::Size WebContentsImpl::GetSize() { gfx::Size WebContentsImpl::GetSize() {
#if defined(USE_AURA) #if defined(USE_AURA)
aura::Window* window = GetNativeView(); aura::Window* window = GetNativeView();
@@ -179,10 +179,10 @@ index da319cb207331..bcd4de085fa6b 100644
// typically happens when popups are created. // typically happens when popups are created.
virtual void WebContentsCreated(WebContents* source_contents, virtual void WebContentsCreated(WebContents* source_contents,
diff --git content/public/browser/web_contents_observer.h content/public/browser/web_contents_observer.h diff --git content/public/browser/web_contents_observer.h content/public/browser/web_contents_observer.h
index 9f9f4cc755886..305095e5ef2f2 100644 index e06a02965a79f..0f587338a513e 100644
--- content/public/browser/web_contents_observer.h --- content/public/browser/web_contents_observer.h
+++ content/public/browser/web_contents_observer.h +++ content/public/browser/web_contents_observer.h
@@ -255,6 +255,9 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { @@ -259,6 +259,9 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver {
// to forwardGestures(), whichever the case ends up being. // to forwardGestures(), whichever the case ends up being.
virtual void OnCapturedSurfaceControl() {} virtual void OnCapturedSurfaceControl() {}
@@ -192,7 +192,7 @@ index 9f9f4cc755886..305095e5ef2f2 100644
// This method is invoked when the `blink::WebView` of the current // This method is invoked when the `blink::WebView` of the current
// RenderViewHost is ready, e.g. because we recreated it after a crash. // RenderViewHost is ready, e.g. because we recreated it after a crash.
virtual void RenderViewReady() {} virtual void RenderViewReady() {}
@@ -949,6 +952,10 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { @@ -953,6 +956,10 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver {
// WebContents has gained/lost focus. // WebContents has gained/lost focus.
virtual void OnFocusChangedInPage(FocusedNodeDetails* details) {} virtual void OnFocusChangedInPage(FocusedNodeDetails* details) {}

View File

@@ -1,5 +1,5 @@
diff --git third_party/blink/public/web/web_view.h third_party/blink/public/web/web_view.h diff --git third_party/blink/public/web/web_view.h third_party/blink/public/web/web_view.h
index b1689844282d6..a8f3b3432517d 100644 index b1689844282d6..a4288bf5d3ba2 100644
--- third_party/blink/public/web/web_view.h --- third_party/blink/public/web/web_view.h
+++ third_party/blink/public/web/web_view.h +++ third_party/blink/public/web/web_view.h
@@ -344,6 +344,7 @@ class BLINK_EXPORT WebView { @@ -344,6 +344,7 @@ class BLINK_EXPORT WebView {
@@ -10,6 +10,18 @@ index b1689844282d6..a8f3b3432517d 100644
// Cancels and hides the current popup (datetime, select...) if any. // Cancels and hides the current popup (datetime, select...) if any.
virtual void CancelPagePopup() = 0; virtual void CancelPagePopup() = 0;
@@ -486,6 +487,11 @@ class BLINK_EXPORT WebView {
virtual void SetPageAttributionSupport(
network::mojom::AttributionSupport support) = 0;
+ // Sets whether to allow the use of JavaScript moveTo/By() and resizeTo/By()
+ // (without user activation) with Document picture-in-picture popups.
+ virtual void SetMovePictureInPictureEnabled(bool enabled) = 0;
+ virtual bool MovePictureInPictureEnabled() const = 0;
+
protected:
~WebView() = default;
};
diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc
index 1af1fa035b3da..f92d9b70fbd32 100644 index 1af1fa035b3da..f92d9b70fbd32 100644
--- third_party/blink/renderer/core/exported/web_view_impl.cc --- third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -39,7 +51,7 @@ index 1af1fa035b3da..f92d9b70fbd32 100644
fullscreen_controller_(std::make_unique<FullscreenController>(this)), fullscreen_controller_(std::make_unique<FullscreenController>(this)),
page_base_background_color_( page_base_background_color_(
diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h
index 06f7cf79b4526..58ad11da45137 100644 index 06f7cf79b4526..e0d395867f552 100644
--- third_party/blink/renderer/core/exported/web_view_impl.h --- third_party/blink/renderer/core/exported/web_view_impl.h
+++ third_party/blink/renderer/core/exported/web_view_impl.h +++ third_party/blink/renderer/core/exported/web_view_impl.h
@@ -140,7 +140,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, @@ -140,7 +140,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -52,7 +64,21 @@ index 06f7cf79b4526..58ad11da45137 100644
// Returns whether frames under this WebView are backed by a compositor. // Returns whether frames under this WebView are backed by a compositor.
bool does_composite() const { return does_composite_; } bool does_composite() const { return does_composite_; }
@@ -882,6 +883,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, @@ -326,6 +327,13 @@ class CORE_EXPORT WebViewImpl final : public WebView,
void UpdateColorProviders(
const ColorProviderColorMaps& color_provider_colors) override;
+ void SetMovePictureInPictureEnabled(bool enabled) override {
+ move_pip_enabled_ = enabled;
+ }
+ bool MovePictureInPictureEnabled() const override {
+ return move_pip_enabled_;
+ }
+
void DispatchPersistedPageshow(base::TimeTicks navigation_start);
void DispatchPagehide(mojom::blink::PagehideDispatch pagehide_dispatch);
void HookBackForwardCacheEviction(bool hook);
@@ -882,6 +890,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
float fake_page_scale_animation_page_scale_factor_ = 0.f; float fake_page_scale_animation_page_scale_factor_ = 0.f;
bool fake_page_scale_animation_use_anchor_ = false; bool fake_page_scale_animation_use_anchor_ = false;
@@ -61,6 +87,115 @@ index 06f7cf79b4526..58ad11da45137 100644
float compositor_device_scale_factor_override_ = 0.f; float compositor_device_scale_factor_override_ = 0.f;
gfx::Transform device_emulation_transform_; gfx::Transform device_emulation_transform_;
@@ -1011,6 +1021,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
// CSS property.
bool supports_draggable_regions_ = false;
+ bool move_pip_enabled_ = false;
+
// All the registered observers.
base::ObserverList<WebViewObserver> observers_;
};
diff --git third_party/blink/renderer/core/frame/local_dom_window.cc third_party/blink/renderer/core/frame/local_dom_window.cc
index f4a1ed78679c5..711b072977662 100644
--- third_party/blink/renderer/core/frame/local_dom_window.cc
+++ third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -52,6 +52,7 @@
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/web/web_picture_in_picture_window_options.h"
+#include "third_party/blink/public/web/web_view.h"
#include "third_party/blink/renderer/bindings/core/v8/binding_security.h"
#include "third_party/blink/renderer/bindings/core/v8/capture_source_location.h"
#include "third_party/blink/renderer/bindings/core/v8/isolated_world_csp.h"
@@ -110,6 +111,7 @@
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/viewport_data.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
+#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/html/custom/custom_element_registry.h"
#include "third_party/blink/renderer/core/html/fenced_frame/fence.h"
#include "third_party/blink/renderer/core/html/forms/form_controller.h"
@@ -1914,8 +1916,9 @@ void LocalDOMWindow::moveBy(int x, int y) const {
return;
}
- if (IsPictureInPictureWindow())
+ if (IsPictureInPictureWindow() && !MovePictureInPictureEnabled()) {
return;
+ }
LocalFrame* frame = GetFrame();
Page* page = frame->GetPage();
@@ -1935,8 +1938,9 @@ void LocalDOMWindow::moveTo(int x, int y) const {
return;
}
- if (IsPictureInPictureWindow())
+ if (IsPictureInPictureWindow() && !MovePictureInPictureEnabled()) {
return;
+ }
LocalFrame* frame = GetFrame();
Page* page = frame->GetPage();
@@ -1959,7 +1963,8 @@ void LocalDOMWindow::resizeBy(int x,
}
if (IsPictureInPictureWindow()) {
- if (!LocalFrame::ConsumeTransientUserActivation(GetFrame())) {
+ if (!MovePictureInPictureEnabled() &&
+ !LocalFrame::ConsumeTransientUserActivation(GetFrame())) {
exception_state.ThrowDOMException(
DOMExceptionCode::kNotAllowedError,
"resizeBy() requires user activation in document picture-in-picture");
@@ -1987,7 +1992,8 @@ void LocalDOMWindow::resizeTo(int width,
}
if (IsPictureInPictureWindow()) {
- if (!LocalFrame::ConsumeTransientUserActivation(GetFrame())) {
+ if (!MovePictureInPictureEnabled() &&
+ !LocalFrame::ConsumeTransientUserActivation(GetFrame())) {
exception_state.ThrowDOMException(
DOMExceptionCode::kNotAllowedError,
"resizeTo() requires user activation in document picture-in-picture");
@@ -2456,6 +2462,12 @@ DOMWindow* LocalDOMWindow::openPictureInPictureWindow(
To<LocalDOMWindow>(result.frame->DomWindow());
pip_dom_window->SetIsPictureInPictureWindow();
+ if (WebLocalFrameImpl::FromFrame(entered_window->GetFrame())
+ ->View()
+ ->MovePictureInPictureEnabled()) {
+ pip_dom_window->SetMovePictureInPictureEnabled(true);
+ }
+
// Ensure that we're using the same compatibility mode as the opener document.
pip_dom_window->document()->SetCompatibilityMode(
entered_window->document()->GetCompatibilityMode());
diff --git third_party/blink/renderer/core/frame/local_dom_window.h third_party/blink/renderer/core/frame/local_dom_window.h
index 615d1851fa041..a97811623a2e2 100644
--- third_party/blink/renderer/core/frame/local_dom_window.h
+++ third_party/blink/renderer/core/frame/local_dom_window.h
@@ -566,6 +566,11 @@ class CORE_EXPORT LocalDOMWindow final : public DOMWindow,
void SetIsPictureInPictureWindow();
+ void SetMovePictureInPictureEnabled(bool enabled) {
+ move_pip_enabled_ = enabled;
+ }
+ bool MovePictureInPictureEnabled() const { return move_pip_enabled_; }
+
// Return the viewport size including scrollbars.
gfx::Size GetViewportSize() const;
@@ -668,6 +673,8 @@ class CORE_EXPORT LocalDOMWindow final : public DOMWindow,
// https://wicg.github.io/document-picture-in-picture/
bool is_picture_in_picture_window_ = false;
+ bool move_pip_enabled_ = false;
+
// The navigation id of a document is to identify navigation of special types
// like bfcache navigation or soft navigation. It changes when navigations
// of these types occur.
diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc
index e3888bb31414a..78dfff2048a67 100644 index e3888bb31414a..78dfff2048a67 100644
--- third_party/blink/renderer/core/page/chrome_client_impl.cc --- third_party/blink/renderer/core/page/chrome_client_impl.cc

View File

@@ -1,5 +1,5 @@
diff --git sandbox/policy/win/sandbox_win.cc sandbox/policy/win/sandbox_win.cc diff --git sandbox/policy/win/sandbox_win.cc sandbox/policy/win/sandbox_win.cc
index 4fb8e2a9d7a6e..46e3db1d36f73 100644 index 4fb8e2a9d7a6e..797e5af27ca56 100644
--- sandbox/policy/win/sandbox_win.cc --- sandbox/policy/win/sandbox_win.cc
+++ sandbox/policy/win/sandbox_win.cc +++ sandbox/policy/win/sandbox_win.cc
@@ -939,6 +939,17 @@ ResultCode SandboxWin::StartSandboxedProcess( @@ -939,6 +939,17 @@ ResultCode SandboxWin::StartSandboxedProcess(
@@ -20,3 +20,21 @@ index 4fb8e2a9d7a6e..46e3db1d36f73 100644
SandboxLaunchTimer timer; SandboxLaunchTimer timer;
// Avoid making a policy if we won't use it. // Avoid making a policy if we won't use it.
@@ -1015,10 +1026,16 @@ void SandboxWin::FinishStartSandboxedProcess(
// static
ResultCode SandboxWin::GetPolicyDiagnostics(
base::OnceCallback<void(base::Value)> response) {
- CHECK(g_broker_services);
CHECK(!response.is_null());
auto receiver = std::make_unique<ServiceManagerDiagnosticsReceiver>(
base::SequencedTaskRunner::GetCurrentDefault(), std::move(response));
+ // Will be nullptr if SandboxInterfaceInfo was not initialized by the CEF
+ // client, meaning that the sandbox is implicitly disabled. Match the
+ // failure behavior in BrokerServicesBase::GetPolicyDiagnostics.
+ if (!g_broker_services) {
+ receiver->OnError(SBOX_ERROR_GENERIC);
+ return SBOX_ERROR_GENERIC;
+ }
return g_broker_services->GetPolicyDiagnostics(std::move(receiver));
}

View File

@@ -530,6 +530,13 @@ bool ViewsWindow::UseFramelessWindowForPictureInPicture(
return hide_pip_frame_; return hide_pip_frame_;
} }
#if CEF_API_ADDED(13601)
bool ViewsWindow::AllowMoveForPictureInPicture(
CefRefPtr<CefBrowserView> browser_view) {
return move_pip_enabled_;
}
#endif
cef_runtime_style_t ViewsWindow::GetBrowserRuntimeStyle() { cef_runtime_style_t ViewsWindow::GetBrowserRuntimeStyle() {
if (use_alloy_style_) { if (use_alloy_style_) {
return CEF_RUNTIME_STYLE_ALLOY; return CEF_RUNTIME_STYLE_ALLOY;
@@ -1160,6 +1167,7 @@ ViewsWindow::ViewsWindow(WindowType type,
use_window_modal_dialog_ = use_window_modal_dialog_ =
command_line->HasSwitch(switches::kUseWindowModalDialog); command_line->HasSwitch(switches::kUseWindowModalDialog);
hide_pip_frame_ = command_line->HasSwitch(switches::kHidePipFrame); hide_pip_frame_ = command_line->HasSwitch(switches::kHidePipFrame);
move_pip_enabled_ = command_line->HasSwitch(switches::kMovePipEnabled);
} }
void ViewsWindow::SetBrowserView(CefRefPtr<CefBrowserView> browser_view) { void ViewsWindow::SetBrowserView(CefRefPtr<CefBrowserView> browser_view) {

View File

@@ -145,6 +145,10 @@ class ViewsWindow : public CefBrowserViewDelegate,
CefRefPtr<CefBrowserView> browser_view) override; CefRefPtr<CefBrowserView> browser_view) override;
bool UseFramelessWindowForPictureInPicture( bool UseFramelessWindowForPictureInPicture(
CefRefPtr<CefBrowserView> browser_view) override; CefRefPtr<CefBrowserView> browser_view) override;
#if CEF_API_ADDED(13601)
bool AllowMoveForPictureInPicture(
CefRefPtr<CefBrowserView> browser_view) override;
#endif
cef_runtime_style_t GetBrowserRuntimeStyle() override; cef_runtime_style_t GetBrowserRuntimeStyle() override;
// CefButtonDelegate methods: // CefButtonDelegate methods:
@@ -271,6 +275,7 @@ class ViewsWindow : public CefBrowserViewDelegate,
bool use_window_modal_dialog_; bool use_window_modal_dialog_;
bool use_bottom_controls_; bool use_bottom_controls_;
bool hide_pip_frame_; bool hide_pip_frame_;
bool move_pip_enabled_;
bool accepts_first_mouse_; bool accepts_first_mouse_;
CefRefPtr<CefWindow> window_; CefRefPtr<CefWindow> window_;

View File

@@ -53,6 +53,7 @@ const char kShowWindowButtons[] = "show-window-buttons";
const char kUseWindowModalDialog[] = "use-window-modal-dialog"; const char kUseWindowModalDialog[] = "use-window-modal-dialog";
const char kUseBottomControls[] = "use-bottom-controls"; const char kUseBottomControls[] = "use-bottom-controls";
const char kHidePipFrame[] = "hide-pip-frame"; const char kHidePipFrame[] = "hide-pip-frame";
const char kMovePipEnabled[] = "move-pip-enabled";
const char kHideChromeBubbles[] = "hide-chrome-bubbles"; const char kHideChromeBubbles[] = "hide-chrome-bubbles";
const char kHideWindowOnClose[] = "hide-window-on-close"; const char kHideWindowOnClose[] = "hide-window-on-close";
const char kAcceptsFirstMouse[] = "accepts-first-mouse"; const char kAcceptsFirstMouse[] = "accepts-first-mouse";

View File

@@ -47,6 +47,7 @@ extern const char kShowWindowButtons[];
extern const char kUseWindowModalDialog[]; extern const char kUseWindowModalDialog[];
extern const char kUseBottomControls[]; extern const char kUseBottomControls[];
extern const char kHidePipFrame[]; extern const char kHidePipFrame[];
extern const char kMovePipEnabled[];
extern const char kHideChromeBubbles[]; extern const char kHideChromeBubbles[];
extern const char kHideWindowOnClose[]; extern const char kHideWindowOnClose[];
extern const char kAcceptsFirstMouse[]; extern const char kAcceptsFirstMouse[];