Compare commits

..

25 Commits
5615 ... 5563

Author SHA1 Message Date
Marshall Greenblatt
ebf5d6ab43 Update to Chromium version 111.0.5563.148 2023-03-30 14:17:12 +00:00
Nik Pavlov
491d2383ef views: mac: Support dynamic resize of title bar height (see #3189)
This is intended for usage with frameless windows that show the standard window
buttons, where resizing the title bar height changes the button offset. Returning a
different value from CefWindowDelegate::GetTitlebarHeight and forcing a resize of
the NSWindow's theme frame (see ViewsWindow::NudgeWindow) will update the
title bar height.

To test:
1. Run `cefclient --use-views --hide-frame --show-window-buttons --url=http://tests/window`
2. Enter a new value for title bar height and click the "Set Titlebar Height" button
2023-03-16 13:23:55 -04:00
Nik Pavlov
4eb0508671 views: mac: Enable WindowTestRunnerViews 2023-03-16 13:23:49 -04:00
Marshall Greenblatt
49cae3707a chrome: Move ThreadProfiler initialization to the UI thread (fixes #3465)
ThreadProfiler::CreateAndStartOnMainThread and SetMainThreadTaskRunnerImpl
should be called on the same thread.
2023-03-14 15:12:06 -04:00
Marshall Greenblatt
3215aaebef Rewrite issue links to GitHub (see #3464) 2023-03-13 13:55:43 -04:00
Marshall Greenblatt
1b83ff6471 Update to Chromium version 111.0.5563.65 2023-03-09 14:44:44 +00:00
Nik Pavlov
870da3087f views: mac: Show standard window buttons with frame by default (see issue #3189)
This restores the previous default behavior for framed windows.
2023-03-08 12:57:04 -05:00
Nik Pavlov
f6de0344cb views: mac: Fix frameless window behavior (fixes issue #3189)
Frameless windows now display as expected. Default traffic light buttons can
optionally be shown at configurable vertical position. Layout respects text
direction.
2023-03-08 12:56:45 -05:00
Marshall Greenblatt
6926287894 Update to Chromium version 111.0.5563.64 2023-03-07 14:33:24 +00:00
Marshall Greenblatt
0d4c466645 chrome: Don't show gray background during browser load (fixes issue #3459) 2023-03-06 15:42:12 -05:00
Marshall Greenblatt
1b930decca Update API hash for commit 80b61f0417 2023-03-06 15:41:39 -05:00
Sergey Markelov
80b61f0417 Fix compile error: this function declaration is not a prototype
`cef_basetime_now()` failed to compile if `-Wstrict-prototypes` is set in clang
or gcc.
2023-03-06 11:53:07 -05:00
梅迎朝
a7a5eee369 cefclient: Fix incorrect logic in PassThruResponseFilter 2023-03-06 11:53:07 -05:00
Marshall Greenblatt
e9397c53ff tools: mac: Add missing README.sandbox.txt (fixes issue #3453) 2023-03-06 11:53:07 -05:00
Marshall Greenblatt
eb023d18e0 Update to Chromium version 111.0.5563.50 2023-03-02 14:36:13 +00:00
Marshall Greenblatt
f98481d327 Update to Chromium version 111.0.5563.41 2023-02-24 16:14:25 +00:00
Marshall Greenblatt
0d82c3ffc0 alloy: Fix theme configuration on startup (fixes issue #3449) 2023-02-22 17:13:37 -05:00
Marshall Greenblatt
fb44f128e9 Update to Chromium version 111.0.5563.33 2023-02-18 17:08:43 +00:00
Marshall Greenblatt
565ad7bb99 chrome: cefclient: Add default handler for request tests (see issue #3444)
Support loading of request tests (e.g. http://tests/other_tests) inside default
browsers created via "New window" and "New incognito window" commands.
2023-02-17 16:04:44 -05:00
Marshall Greenblatt
d4c8104ca8 chrome: Fix request interception with active extension (fixes issue #3444)
Support chaining of proxies in WillCreateURLLoaderFactory.
2023-02-17 16:04:35 -05:00
Marshall Greenblatt
b7ba0b9a66 chrome: Make primary user profile the default global context (see issue #3444)
Chrome is always loading the primary user profile by default, so with this
change the CEF behavior more accurately reflects reality. Incognito contexts
can still be created explicitly via CefRequestContext::CreateContext.

Prior to this change, the default for the global context was an Incognito
profile based on the primary user profile. That caused request interception
to be bypassed in WillCreateURLLoaderFactory for profiles associated with
the "New window" and "New incognito window" commands. Those profiles, while
also being (or based on) the primary user profile, did not match the specific
Incognito profile assigned to the default global context.

After this change, the "New window" and "New incognito window" commands will
match the default global context when executed on a browser that was created
using the primary user profile.
2023-02-17 16:04:28 -05:00
Marshall Greenblatt
719fe7691b chrome: Fix crash on display of browser via "New window" command 2023-02-17 16:04:20 -05:00
Marshall Greenblatt
82dc13a870 chrome: Use default Browser creation for picture-in-picture popups (see issue #3448) 2023-02-10 14:35:18 -05:00
Marshall Greenblatt
371f7f3409 Update to Chromium version 111.0.5563.19 2023-02-10 16:26:06 +00:00
Marshall Greenblatt
01fe00c6fd Update to Chromium version 111.0.5563.12 2023-02-07 10:46:41 -05:00
127 changed files with 1927 additions and 1652 deletions

View File

@@ -933,6 +933,8 @@ source_set("libcef_static") {
"libcef/renderer/render_frame_util.h",
"libcef/renderer/render_manager.cc",
"libcef/renderer/render_manager.h",
"libcef/renderer/render_urlrequest_impl.cc",
"libcef/renderer/render_urlrequest_impl.h",
"libcef/renderer/thread_util.h",
"libcef/renderer/v8_impl.cc",
"libcef/renderer/v8_impl.h",

View File

@@ -7,6 +7,6 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/112.0.5615.165',
'depot_tools_checkout': '424814829a'
'chromium_checkout': 'refs/tags/111.0.5563.148',
'depot_tools_checkout': '963e01c76c'
}

View File

@@ -538,11 +538,9 @@ if(OS_WINDOWS)
psapi.lib
SetupAPI.lib
Shell32.lib
Shcore.lib
Userenv.lib
version.lib
wbemuuid.lib
WindowsApp.lib
winmm.lib
)

View File

@@ -123,7 +123,7 @@ class SupportsWeakPtr;
template <typename T>
class WeakPtr;
namespace cef_internal {
namespace internal {
// These classes are part of the WeakPtr implementation.
// DO NOT USE THESE CLASSES DIRECTLY YOURSELF.
@@ -197,7 +197,7 @@ class WeakPtrBase {
WeakPtrBase& operator=(WeakPtrBase&& other) noexcept = default;
void reset() {
ref_ = cef_internal::WeakReference();
ref_ = internal::WeakReference();
ptr_ = 0;
}
@@ -225,7 +225,7 @@ class SupportsWeakPtrBase {
template <typename Derived>
static WeakPtr<Derived> StaticAsWeakPtr(Derived* t) {
static_assert(
std::is_base_of<cef_internal::SupportsWeakPtrBase, Derived>::value,
std::is_base_of<internal::SupportsWeakPtrBase, Derived>::value,
"AsWeakPtr argument must inherit from SupportsWeakPtr");
return AsWeakPtrImpl<Derived>(t);
}
@@ -242,7 +242,7 @@ class SupportsWeakPtrBase {
}
};
} // namespace cef_internal
} // namespace internal
template <typename T>
class WeakPtrFactory;
@@ -264,7 +264,7 @@ class WeakPtrFactory;
/// </pre>
///
template <typename T>
class WeakPtr : public cef_internal::WeakPtrBase {
class WeakPtr : public internal::WeakPtrBase {
public:
WeakPtr() = default;
WeakPtr(std::nullptr_t) {}
@@ -325,13 +325,13 @@ class WeakPtr : public cef_internal::WeakPtrBase {
bool WasInvalidated() const { return ptr_ && !ref_.IsValid(); }
private:
friend class cef_internal::SupportsWeakPtrBase;
friend class internal::SupportsWeakPtrBase;
template <typename U>
friend class WeakPtr;
friend class SupportsWeakPtr<T>;
friend class WeakPtrFactory<T>;
WeakPtr(const cef_internal::WeakReference& ref, T* ptr)
WeakPtr(const internal::WeakReference& ref, T* ptr)
: WeakPtrBase(ref, reinterpret_cast<uintptr_t>(ptr)) {}
};
@@ -355,15 +355,15 @@ bool operator==(std::nullptr_t, const WeakPtr<T>& weak_ptr) {
return weak_ptr == nullptr;
}
namespace cef_internal {
namespace internal {
class WeakPtrFactoryBase {
protected:
WeakPtrFactoryBase(uintptr_t ptr);
~WeakPtrFactoryBase();
cef_internal::WeakReferenceOwner weak_reference_owner_;
internal::WeakReferenceOwner weak_reference_owner_;
uintptr_t ptr_;
};
} // namespace cef_internal
} // namespace internal
///
/// A class may be composed of a WeakPtrFactory and thereby control how it
@@ -374,7 +374,7 @@ class WeakPtrFactoryBase {
/// bool.
///
template <class T>
class WeakPtrFactory : public cef_internal::WeakPtrFactoryBase {
class WeakPtrFactory : public internal::WeakPtrFactoryBase {
public:
WeakPtrFactory() = delete;
@@ -416,7 +416,7 @@ class WeakPtrFactory : public cef_internal::WeakPtrFactoryBase {
/// destroyed, its use can lead to subtle use-after-destroy issues.
///
template <class T>
class SupportsWeakPtr : public cef_internal::SupportsWeakPtrBase {
class SupportsWeakPtr : public internal::SupportsWeakPtrBase {
public:
SupportsWeakPtr() = default;
@@ -431,7 +431,7 @@ class SupportsWeakPtr : public cef_internal::SupportsWeakPtrBase {
~SupportsWeakPtr() = default;
private:
cef_internal::WeakReferenceOwner weak_reference_owner_;
internal::WeakReferenceOwner weak_reference_owner_;
};
///
@@ -459,7 +459,7 @@ class SupportsWeakPtr : public cef_internal::SupportsWeakPtrBase {
///
template <typename Derived>
WeakPtr<Derived> AsWeakPtr(Derived* t) {
return cef_internal::SupportsWeakPtrBase::StaticAsWeakPtr<Derived>(t);
return internal::SupportsWeakPtrBase::StaticAsWeakPtr<Derived>(t);
}
} // namespace base

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=0cbb756a64d2aca1075480b5188b36cae533864d$
// $hash=46817ef557307a55a9b7138134c4f5c32562f2d7$
//
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_HANDLER_CAPI_H_
@@ -71,46 +71,6 @@ typedef struct _cef_command_handler_t {
struct _cef_browser_t* browser,
int command_id,
cef_window_open_disposition_t disposition);
///
/// Called to check if a Chrome app menu item should be visible. Values for
/// |command_id| can be found in the cef_command_ids.h file. Only called for
/// menu items that would be visible by default. Only used with the Chrome
/// runtime.
///
int(CEF_CALLBACK* is_chrome_app_menu_item_visible)(
struct _cef_command_handler_t* self,
struct _cef_browser_t* browser,
int command_id);
///
/// Called to check if a Chrome app menu item should be enabled. Values for
/// |command_id| can be found in the cef_command_ids.h file. Only called for
/// menu items that would be enabled by default. Only used with the Chrome
/// runtime.
///
int(CEF_CALLBACK* is_chrome_app_menu_item_enabled)(
struct _cef_command_handler_t* self,
struct _cef_browser_t* browser,
int command_id);
///
/// Called during browser creation to check if a Chrome page action icon
/// should be visible. Only called for icons that would be visible by default.
/// Only used with the Chrome runtime.
///
int(CEF_CALLBACK* is_chrome_page_action_icon_visible)(
struct _cef_command_handler_t* self,
cef_chrome_page_action_icon_type_t icon_type);
///
/// Called during browser creation to check if a Chrome toolbar button should
/// be visible. Only called for buttons that would be visible by default. Only
/// used with the Chrome runtime.
///
int(CEF_CALLBACK* is_chrome_toolbar_button_visible)(
struct _cef_command_handler_t* self,
cef_chrome_toolbar_button_type_t button_type);
} cef_command_handler_t;
#ifdef __cplusplus

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5bed8359f09a821f4b5ec8ebfad0aa5720bf39f9$
// $hash=b9b1308311999efcfd2aa678472f934ca783492c$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
@@ -216,16 +216,24 @@ typedef struct _cef_frame_t {
///
/// Create a new URL request that will be treated as originating from this
/// frame and the associated browser. Use cef_urlrequest_t::Create instead if
/// you do not want the request to have this association, in which case it may
/// be handled differently (see documentation on that function). A request
/// created with this function may only originate from the browser process,
/// and will behave as follows:
/// - It may be intercepted by the client via CefResourceRequestHandler or
/// CefSchemeHandlerFactory.
/// frame and the associated browser. This request may be intercepted by the
/// client via cef_resource_request_handler_t or cef_scheme_handler_factory_t.
/// Use cef_urlrequest_t::Create instead if you do not want the request to
/// have this association, in which case it may be handled differently (see
/// documentation on that function). Requests may originate from both the
/// browser process and the render process.
///
/// For requests originating from the browser process:
/// - POST data may only contain a single element of type PDE_TYPE_FILE or
/// PDE_TYPE_BYTES.
///
/// For requests originating from the render process:
/// - POST data may only contain a single element of type PDE_TYPE_BYTES.
/// - If the response contains Content-Disposition or Mime-Type header
/// values that would not normally be rendered then the response may
/// receive special handling inside the browser (for example, via the
/// file download code path instead of the URL request code path).
///
/// The |request| object will be marked as read-only after calling this
/// function.
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=7201d268e16fc89f255b6ccd00d043f34fe77584$
// $hash=9f0389a439e6787282880d53375369829adb6a3d$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_
@@ -139,7 +139,7 @@ typedef struct _cef_window_delegate_t {
///
/// Return true (1) if |window| should be created with standard window buttons
/// like close, minimize and zoom. This function is only supported on macOS.
/// like close, minimize and zoom.
///
int(CEF_CALLBACK* with_standard_window_buttons)(
struct _cef_window_delegate_t* self,
@@ -198,17 +198,6 @@ typedef struct _cef_window_delegate_t {
int(CEF_CALLBACK* on_key_event)(struct _cef_window_delegate_t* self,
struct _cef_window_t* window,
const cef_key_event_t* event);
///
/// Called when the |window| is transitioning to or from fullscreen mode. The
/// transition occurs in two stages, with |is_competed| set to false (0) when
/// the transition starts and true (1) when the transition completes. This
/// function is only supported on macOS.
///
void(CEF_CALLBACK* on_window_fullscreen_transition)(
struct _cef_window_delegate_t* self,
struct _cef_window_t* window,
int is_completed);
} cef_window_delegate_t;
#ifdef __cplusplus

View File

@@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "7c7515822b869395898c705bcc350222c26e8734"
#define CEF_API_HASH_UNIVERSAL "1d8347d8e06dc0dd17f882ca253e1c7bf43d5863"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "54e2eed5aee11d5dbd88808a54f3e93a7bc17b0c"
#define CEF_API_HASH_PLATFORM "b6865f1992a10dcefc0bbc450cf296b648003271"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "0f491b440d7e9e318146ed06cdeca86972e801c5"
#define CEF_API_HASH_PLATFORM "d04c2a5ab471493c185eb7c7aa894bc4a79d5a7c"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "b5a01a70d1d15078988ca7d694c355503d5b5ad6"
#define CEF_API_HASH_PLATFORM "d7d4cbffa4a798fea97e7b9f3610b5cb803d949e"
#endif
#ifdef __cplusplus

View File

@@ -63,52 +63,6 @@ class CefCommandHandler : public virtual CefBaseRefCounted {
cef_window_open_disposition_t disposition) {
return false;
}
///
/// Called to check if a Chrome app menu item should be visible. Values for
/// |command_id| can be found in the cef_command_ids.h file. Only called for
/// menu items that would be visible by default. Only used with the Chrome
/// runtime.
///
/*--cef()--*/
virtual bool IsChromeAppMenuItemVisible(CefRefPtr<CefBrowser> browser,
int command_id) {
return true;
}
///
/// Called to check if a Chrome app menu item should be enabled. Values for
/// |command_id| can be found in the cef_command_ids.h file. Only called for
/// menu items that would be enabled by default. Only used with the Chrome
/// runtime.
///
/*--cef()--*/
virtual bool IsChromeAppMenuItemEnabled(CefRefPtr<CefBrowser> browser,
int command_id) {
return true;
}
///
/// Called during browser creation to check if a Chrome page action icon
/// should be visible. Only called for icons that would be visible by default.
/// Only used with the Chrome runtime.
///
/*--cef(optional_param=browser)--*/
virtual bool IsChromePageActionIconVisible(
cef_chrome_page_action_icon_type_t icon_type) {
return true;
}
///
/// Called during browser creation to check if a Chrome toolbar button
/// should be visible. Only called for buttons that would be visible by
/// default. Only used with the Chrome runtime.
///
/*--cef(optional_param=browser)--*/
virtual bool IsChromeToolbarButtonVisible(
cef_chrome_toolbar_button_type_t button_type) {
return true;
}
};
#endif // CEF_INCLUDE_CEF_COMMAND_HANDLER_H_

View File

@@ -221,16 +221,24 @@ class CefFrame : public virtual CefBaseRefCounted {
///
/// Create a new URL request that will be treated as originating from this
/// frame and the associated browser. Use CefURLRequest::Create instead if you
/// do not want the request to have this association, in which case it may be
/// handled differently (see documentation on that method). A request created
/// with this method may only originate from the browser process, and will
/// behave as follows:
/// - It may be intercepted by the client via CefResourceRequestHandler or
/// CefSchemeHandlerFactory.
/// frame and the associated browser. This request may be intercepted by the
/// client via CefResourceRequestHandler or CefSchemeHandlerFactory. Use
/// CefURLRequest::Create instead if you do not want the request to have this
/// association, in which case it may be handled differently (see
/// documentation on that method). Requests may originate from both the
/// browser process and the render process.
///
/// For requests originating from the browser process:
/// - POST data may only contain a single element of type PDE_TYPE_FILE or
/// PDE_TYPE_BYTES.
///
/// For requests originating from the render process:
/// - POST data may only contain a single element of type PDE_TYPE_BYTES.
/// - If the response contains Content-Disposition or Mime-Type header
/// values that would not normally be rendered then the response may
/// receive special handling inside the browser (for example, via the
/// file download code path instead of the URL request code path).
///
/// The |request| object will be marked as read-only after calling this
/// method.
///

View File

@@ -86,6 +86,13 @@ CEF_EXPORT int cef_run_main_with_preferred_stack_size(mainPtr main,
char* argv[]);
#endif // defined(ARCH_CPU_32_BITS)
///
/// Call during process startup to enable High-DPI support on Windows 7 or
/// newer. Older versions of Windows should be left DPI-unaware because they do
/// not support DirectWrite and GDI fonts are kerned very badly.
///
CEF_EXPORT void cef_enable_highdpi_support(void);
///
/// Set to true (1) before calling Windows APIs like TrackPopupMenu that enter a
/// modal message loop. Set to false (0) after exiting the modal message loop.

View File

@@ -3251,7 +3251,7 @@ typedef enum {
} cef_text_field_commands_t;
///
/// Chrome toolbar types.
/// Supported Chrome toolbar types.
///
typedef enum {
CEF_CTT_NONE = 1,
@@ -3259,51 +3259,6 @@ typedef enum {
CEF_CTT_LOCATION,
} cef_chrome_toolbar_type_t;
///
/// Chrome page action icon types. Should be kept in sync with Chromium's
/// PageActionIconType type.
///
typedef enum {
CEF_CPAIT_BOOKMARK_STAR = 0,
CEF_CPAIT_CLICK_TO_CALL,
CEF_CPAIT_COOKIE_CONTROLS,
CEF_CPAIT_FILE_SYSTEM_ACCESS,
CEF_CPAIT_FIND,
CEF_CPAIT_HIGH_EFFICIENCY,
CEF_CPAIT_INTENT_PICKER,
CEF_CPAIT_LOCAL_CARD_MIGRATION,
CEF_CPAIT_MANAGE_PASSWORDS,
CEF_CPAIT_PAYMENTS_OFFER_NOTIFICATION,
CEF_CPAIT_PRICE_TRACKING,
CEF_CPAIT_PWA_INSTALL,
CEF_CPAIT_QR_CODE_GENERATOR,
CEF_CPAIT_READER_MODE,
CEF_CPAIT_SAVE_AUTOFILL_ADDRESS,
CEF_CPAIT_SAVE_CARD,
CEF_CPAIT_SEND_TAB_TO_SELF,
CEF_CPAIT_SHARING_HUB,
CEF_CPAIT_SIDE_SEARCH,
CEF_CPAIT_SMS_REMOTE_FETCHER,
CEF_CPAIT_TRANSLATE,
CEF_CPAIT_VIRTUAL_CARD_ENROLL,
CEF_CPAIT_VIRTUAL_CARD_MANUAL_FALLBACK,
CEF_CPAIT_ZOOM,
CEF_CPAIT_SAVE_IBAN,
CEF_CPAIT_MAX_VALUE = CEF_CPAIT_SAVE_IBAN,
} cef_chrome_page_action_icon_type_t;
///
/// Chrome toolbar button types. Should be kept in sync with CEF's internal
/// ToolbarButtonType type.
///
typedef enum {
CEF_CTBT_CAST = 0,
CEF_CTBT_DOWNLOAD,
CEF_CTBT_SEND_TAB_TO_SELF,
CEF_CTBT_SIDE_PANEL,
CEF_CTBT_MAX_VALUE = CEF_CTBT_SIDE_PANEL,
} cef_chrome_toolbar_button_type_t;
///
/// Docking modes supported by CefWindow::AddOverlay.
///

View File

@@ -168,6 +168,13 @@ int CefRunWinMainWithPreferredStackSize(wWinMainPtr wWinMain,
int CefRunMainWithPreferredStackSize(mainPtr main, int argc, char* argv[]);
#endif // defined(ARCH_CPU_32_BITS)
///
/// Call during process startup to enable High-DPI support on Windows 7 or
/// newer. Older versions of Windows should be left DPI-unaware because they do
/// not support DirectWrite and GDI fonts are kerned very badly.
///
void CefEnableHighDPISupport();
///
/// Set to true before calling Windows APIs like TrackPopupMenu that enter a
/// modal message loop. Set to false after exiting the modal message loop.

View File

@@ -130,7 +130,7 @@ class CefWindowDelegate : public CefPanelDelegate {
///
/// Return true if |window| should be created with standard window buttons
/// like close, minimize and zoom. This method is only supported on macOS.
/// like close, minimize and zoom.
///
/*--cef()--*/
virtual bool WithStandardWindowButtons(CefRefPtr<CefWindow> window) {
@@ -196,16 +196,6 @@ class CefWindowDelegate : public CefPanelDelegate {
const CefKeyEvent& event) {
return false;
}
///
/// Called when the |window| is transitioning to or from fullscreen mode. The
/// transition occurs in two stages, with |is_competed| set to false when the
/// transition starts and true when the transition completes.
/// This method is only supported on macOS.
///
/*--cef()--*/
virtual void OnWindowFullscreenTransition(CefRefPtr<CefWindow> window,
bool is_completed) {}
};
#endif // CEF_INCLUDE_VIEWS_CEF_WINDOW_DELEGATE_H_

View File

@@ -29,7 +29,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/media/router/chrome_media_router_factory.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/ui/color/chrome_color_mixers.h"
#include "chrome/browser/ui/javascript_dialogs/chrome_javascript_app_modal_dialog_view_factory.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/common/chrome_switches.h"
@@ -188,11 +187,6 @@ void AlloyBrowserMainParts::ToolkitInitialized() {
#else
InstallChromeJavaScriptAppModalDialogViewFactory();
#endif
// On GTK that builds the native theme that, in turn, adds the GTK core color
// mixer; core mixers should all be added before we add chrome mixers.
ui::ColorProviderManager::Get().AppendColorProviderInitializer(
base::BindRepeating(AddChromeColorMixers));
}
void AlloyBrowserMainParts::PreCreateMainMessageLoop() {

View File

@@ -52,6 +52,7 @@
#include "base/stl_util.h"
#include "base/threading/thread_restrictions.h"
#include "cef/grit/cef_resources.h"
#include "chrome/browser/accessibility/live_caption_unavailability_notifier.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h"
@@ -81,7 +82,6 @@
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/services/printing/printing_service.h"
#include "chrome/services/speech/buildflags/buildflags.h"
#include "components/content_settings/core/browser/cookie_settings.h"
#include "components/embedder_support/switches.h"
#include "components/embedder_support/user_agent_utils.h"
@@ -157,12 +157,9 @@
#endif
#if BUILDFLAG(IS_WIN)
#if BUILDFLAG(ENABLE_SPEECH_SERVICE)
#include "media/mojo/mojom/renderer_extensions.mojom.h"
#endif
#include "net/ssl/client_cert_store_win.h"
#include "sandbox/win/src/sandbox_policy.h"
#endif // BUILDFLAG(IS_WIN)
#endif
#if BUILDFLAG(USE_NSS_CERTS)
#include "net/ssl/client_cert_store_nss.h"
@@ -287,12 +284,10 @@ void BindBadgeServiceForServiceWorker(
const content::ServiceWorkerVersionBaseInfo& info,
mojo::PendingReceiver<blink::mojom::BadgeService> receiver) {}
#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_SPEECH_SERVICE)
void BindMediaFoundationRendererNotifierHandler(
content::RenderFrameHost* frame_host,
mojo::PendingReceiver<media::mojom::MediaFoundationRendererNotifier>
receiver) {}
#endif
void BindNetworkHintsHandler(
content::RenderFrameHost* frame_host,
@@ -1255,10 +1250,8 @@ void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForFrame(
map);
map->Add<blink::mojom::BadgeService>(base::BindRepeating(&BindBadgeService));
#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_SPEECH_SERVICE)
map->Add<media::mojom::MediaFoundationRendererNotifier>(
base::BindRepeating(&BindMediaFoundationRendererNotifierHandler));
#endif
map->Add<network_hints::mojom::NetworkHintsHandler>(
base::BindRepeating(&BindNetworkHintsHandler));
@@ -1365,8 +1358,10 @@ bool AlloyContentBrowserClient::ArePersistentMediaDeviceIDsAllowed(
// Persistent MediaDevice IDs are allowed if cookies are allowed.
return CookieSettingsFactory::GetForProfile(
Profile::FromBrowserContext(browser_context))
->IsFullCookieAccessAllowed(url, site_for_cookies, top_frame_origin,
net::CookieSettingOverrides());
->IsFullCookieAccessAllowed(
url, site_for_cookies, top_frame_origin,
net::CookieSettingOverrides(),
content_settings::CookieSettings::QueryReason::kSiteStorage);
}
void AlloyContentBrowserClient::OnWebContentsCreated(

View File

@@ -9,7 +9,6 @@
#include <memory>
#include "base/memory/scoped_refptr.h"
#include "chrome/browser/ui/page_action/page_action_icon_type.h"
#include "content/public/browser/web_contents_delegate.h"
#include "ui/base/window_open_disposition.h"
@@ -66,32 +65,6 @@ class BrowserDelegate : public content::WebContentsDelegate {
return false;
}
// Return true if the app menu item should be visible. ID values come from
// chrome/app/chrome_command_ids.h.
virtual bool IsAppMenuItemVisible(int command_id) { return true; }
// Return true if the app menu item should be enabled. ID values come from
// chrome/app/chrome_command_ids.h.
virtual bool IsAppMenuItemEnabled(int command_id) { return true; }
// Return true if the page action icon should be visible.
virtual bool IsPageActionIconVisible(PageActionIconType icon_type) {
return true;
}
enum class ToolbarButtonType {
kCast = 0,
kDownload,
kSendTabToSelf,
kSidePanel,
kMaxValue = kSidePanel,
};
// Return true if the toolbar button should be visible.
virtual bool IsToolbarButtonVisible(ToolbarButtonType button_type) {
return true;
}
// Same as RequestMediaAccessPermission but returning |callback| if the
// request is unhandled.
[[nodiscard]] virtual content::MediaResponseCallback

View File

@@ -122,60 +122,6 @@ bool ChromeBrowserDelegate::HandleCommand(int command_id,
return false;
}
bool ChromeBrowserDelegate::IsAppMenuItemVisible(int command_id) {
if (auto browser = ChromeBrowserHostImpl::GetBrowserForBrowser(browser_)) {
if (auto client = browser->GetClient()) {
if (auto handler = client->GetCommandHandler()) {
return handler->IsChromeAppMenuItemVisible(browser.get(), command_id);
}
}
}
return true;
}
bool ChromeBrowserDelegate::IsAppMenuItemEnabled(int command_id) {
if (auto browser = ChromeBrowserHostImpl::GetBrowserForBrowser(browser_)) {
if (auto client = browser->GetClient()) {
if (auto handler = client->GetCommandHandler()) {
return handler->IsChromeAppMenuItemEnabled(browser.get(), command_id);
}
}
}
return true;
}
bool ChromeBrowserDelegate::IsPageActionIconVisible(
PageActionIconType icon_type) {
// Verify that our enum matches Chromium's values.
static_assert(static_cast<int>(CEF_CPAIT_MAX_VALUE) ==
static_cast<int>(PageActionIconType::kMaxValue),
"enum mismatch");
if (auto client = create_params_.client) {
if (auto handler = client->GetCommandHandler()) {
return handler->IsChromePageActionIconVisible(
static_cast<cef_chrome_page_action_icon_type_t>(icon_type));
}
}
return true;
}
bool ChromeBrowserDelegate::IsToolbarButtonVisible(
ToolbarButtonType button_type) {
// Verify that our enum matches BrowserDelegate's values.
static_assert(static_cast<int>(CEF_CTBT_MAX_VALUE) ==
static_cast<int>(ToolbarButtonType::kMaxValue),
"enum mismatch");
if (auto client = create_params_.client) {
if (auto handler = client->GetCommandHandler()) {
return handler->IsChromeToolbarButtonVisible(
static_cast<cef_chrome_toolbar_button_type_t>(button_type));
}
}
return true;
}
content::MediaResponseCallback
ChromeBrowserDelegate::RequestMediaAccessPermissionEx(
content::WebContents* web_contents,

View File

@@ -56,10 +56,6 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
bool ShowStatusBubble(bool show_by_default) override;
bool HandleCommand(int command_id,
WindowOpenDisposition disposition) override;
bool IsAppMenuItemVisible(int command_id) override;
bool IsAppMenuItemEnabled(int command_id) override;
bool IsPageActionIconVisible(PageActionIconType icon_type) override;
bool IsToolbarButtonVisible(ToolbarButtonType button_type) override;
[[nodiscard]] content::MediaResponseCallback RequestMediaAccessPermissionEx(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,

View File

@@ -30,7 +30,6 @@
#include "base/path_service.h"
#include "chrome/browser/chrome_browser_main.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "content/public/browser/navigation_throttle.h"

View File

@@ -23,6 +23,7 @@
#if BUILDFLAG(IS_WIN)
#include "base/debug/alias.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/win_util.h"
#include "chrome/chrome_elf/chrome_elf_main.h"
#include "chrome/install_static/initialize_from_primary_module.h"
#include "include/internal/cef_win.h"
@@ -400,6 +401,10 @@ int CefRunMainWithPreferredStackSize(mainPtr main, int argc, char* argv[]) {
}
#endif // defined(ARCH_CPU_32_BITS)
void CefEnableHighDPISupport() {
base::win::EnableHighDPISupport();
}
void CefSetOSModalLoop(bool osModalLoop) {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {

View File

@@ -195,12 +195,8 @@ bool TabsUpdateFunction::UpdateURL(const std::string& url_string,
int tab_id,
std::string* error) {
GURL url;
auto url_expected =
ExtensionTabUtil::PrepareURLForNavigation(url_string, extension());
if (url_expected.has_value()) {
url = *url_expected;
} else {
*error = std::move(url_expected.error());
if (!ExtensionTabUtil::PrepareURLForNavigation(url_string, extension(), &url,
error)) {
return false;
}

View File

@@ -43,7 +43,6 @@ const char* const kSupportedAPIs[] = {
ContentSettingsContentSettingGetResourceIdentifiersFunction),
"pdfViewerPrivate",
EXTENSION_FUNCTION_NAME(PdfViewerPrivateIsAllowedLocalFileAccessFunction),
EXTENSION_FUNCTION_NAME(PdfViewerPrivateIsPdfOcrAlwaysActiveFunction),
"resourcesPrivate",
EXTENSION_FUNCTION_NAME(ResourcesPrivateGetStringsFunction),
"storage",
@@ -92,7 +91,6 @@ void ChromeFunctionRegistry::RegisterAll(ExtensionFunctionRegistry* registry) {
ContentSettingsContentSettingGetResourceIdentifiersFunction>();
registry
->RegisterFunction<PdfViewerPrivateIsAllowedLocalFileAccessFunction>();
registry->RegisterFunction<PdfViewerPrivateIsPdfOcrAlwaysActiveFunction>();
registry->RegisterFunction<ResourcesPrivateGetStringsFunction>();
registry->RegisterFunction<StorageStorageAreaGetFunction>();
registry->RegisterFunction<StorageStorageAreaSetFunction>();

View File

@@ -324,12 +324,9 @@ std::unique_ptr<api::tabs::Tab> CefExtensionFunctionDetails::OpenTab(
GURL url;
if (params.url.has_value()) {
auto url_expected = ExtensionTabUtil::PrepareURLForNavigation(
*params.url, function()->extension());
if (url_expected.has_value()) {
url = *url_expected;
} else {
*error_message = std::move(url_expected.error());
std::string url_string = *params.url;
if (!ExtensionTabUtil::PrepareURLForNavigation(
url_string, function()->extension(), &url, error_message)) {
return nullptr;
}
}

View File

@@ -34,7 +34,7 @@ void CefExtensionHostDelegate::CreateTab(
std::unique_ptr<content::WebContents> web_contents,
const std::string& extension_id,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& window_features,
const gfx::Rect& initial_rect,
bool user_gesture) {
// TODO(cef): Add support for extensions opening popup windows.
NOTIMPLEMENTED();

View File

@@ -27,7 +27,7 @@ class CefExtensionHostDelegate : public ExtensionHostDelegate {
void CreateTab(std::unique_ptr<content::WebContents> web_contents,
const std::string& extension_id,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& window_features,
const gfx::Rect& initial_rect,
bool user_gesture) override;
void ProcessMediaAccessRequest(content::WebContents* web_contents,
const content::MediaStreamRequest& request,

View File

@@ -12,7 +12,6 @@
#include "libcef/browser/context.h"
#include "libcef/browser/thread_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/file_select_helper.h"
#include "content/public/browser/file_select_listener.h"
#include "content/public/browser/render_frame_host.h"

View File

@@ -251,14 +251,16 @@ bool CefBrowserPlatformDelegateNativeWin::CreateHostWindow() {
// Add a reference that will later be released in DestroyBrowser().
browser_->AddRef();
if (!called_enable_non_client_dpi_scaling_ && has_frame_) {
if (!called_enable_non_client_dpi_scaling_ && has_frame_ &&
base::win::IsProcessPerMonitorDpiAware()) {
// This call gets Windows to scale the non-client area when WM_DPICHANGED
// is fired on Windows versions < 10.0.14393.0.
// Derived signature; not available in headers.
using EnableChildWindowDpiMessagePtr = LRESULT(WINAPI*)(HWND, BOOL);
static const auto enable_child_window_dpi_message_func =
reinterpret_cast<EnableChildWindowDpiMessagePtr>(
base::win::GetUser32FunctionPointer("EnableChildWindowDpiMessage"));
static auto enable_child_window_dpi_message_func = []() {
using EnableChildWindowDpiMessagePtr = LRESULT(WINAPI*)(HWND, BOOL);
return reinterpret_cast<EnableChildWindowDpiMessagePtr>(GetProcAddress(
GetModuleHandle(L"user32.dll"), "EnableChildWindowDpiMessage"));
}();
if (enable_child_window_dpi_message_func) {
enable_child_window_dpi_message_func(window_info_.window, TRUE);
}
@@ -620,15 +622,15 @@ LRESULT CALLBACK CefBrowserPlatformDelegateNativeWin::WndProc(HWND hwnd,
gfx::SetWindowUserData(hwnd, platform_delegate);
platform_delegate->window_info_.window = hwnd;
if (platform_delegate->has_frame_) {
if (platform_delegate->has_frame_ &&
base::win::IsProcessPerMonitorDpiAware()) {
// This call gets Windows to scale the non-client area when
// WM_DPICHANGED is fired on Windows versions >= 10.0.14393.0.
using EnableNonClientDpiScalingPtr =
decltype(::EnableNonClientDpiScaling)*;
static const auto enable_non_client_dpi_scaling_func =
reinterpret_cast<EnableNonClientDpiScalingPtr>(
base::win::GetUser32FunctionPointer(
"EnableNonClientDpiScaling"));
static auto enable_non_client_dpi_scaling_func = []() {
return reinterpret_cast<decltype(::EnableNonClientDpiScaling)*>(
GetProcAddress(GetModuleHandle(L"user32.dll"),
"EnableNonClientDpiScaling"));
}();
platform_delegate->called_enable_non_client_dpi_scaling_ =
!!(enable_non_client_dpi_scaling_func &&
enable_non_client_dpi_scaling_func(hwnd));

View File

@@ -433,8 +433,7 @@ class CefBrowserURLRequest::Context
}
}
void OnRedirect(const GURL& url_before_redirect,
const net::RedirectInfo& redirect_info,
void OnRedirect(const net::RedirectInfo& redirect_info,
const network::mojom::URLResponseHead& response_head,
std::vector<std::string>* removed_headers) {
DCHECK(CalledOnValidThread());

View File

@@ -111,10 +111,8 @@ struct PopulateAxNodeAttributes {
case ax::mojom::IntAttribute::kDropeffect:
case ax::mojom::IntAttribute::kMemberOfId:
case ax::mojom::IntAttribute::kNextFocusId:
case ax::mojom::IntAttribute::kNextWindowFocusId:
case ax::mojom::IntAttribute::kNextOnLineId:
case ax::mojom::IntAttribute::kPreviousFocusId:
case ax::mojom::IntAttribute::kPreviousWindowFocusId:
case ax::mojom::IntAttribute::kPreviousOnLineId:
case ax::mojom::IntAttribute::kSetSize:
case ax::mojom::IntAttribute::kPosInSet:

View File

@@ -908,17 +908,15 @@ void CefRenderWidgetHostViewOSR::NotifyHostAndDelegateOnWasShown(
NOTREACHED();
}
void CefRenderWidgetHostViewOSR::
RequestSuccessfulPresentationTimeFromHostOrDelegate(
blink::mojom::RecordContentToVisibleTimeRequestPtr
visible_time_request) {
void CefRenderWidgetHostViewOSR::RequestPresentationTimeFromHostOrDelegate(
blink::mojom::RecordContentToVisibleTimeRequestPtr visible_time_request) {
// We don't call RenderWidgetHostViewBase::OnShowWithPageVisibility, so this
// method should not be called.
NOTREACHED();
}
void CefRenderWidgetHostViewOSR::
CancelSuccessfulPresentationTimeRequestForHostAndDelegate() {
CancelPresentationTimeRequestForHostAndDelegate() {
// We don't call RenderWidgetHostViewBase::OnShowWithPageVisibility, so this
// method should not be called.
NOTREACHED();

View File

@@ -198,10 +198,10 @@ class CefRenderWidgetHostViewOSR
void NotifyHostAndDelegateOnWasShown(
blink::mojom::RecordContentToVisibleTimeRequestPtr visible_time_request)
override;
void RequestSuccessfulPresentationTimeFromHostOrDelegate(
void RequestPresentationTimeFromHostOrDelegate(
blink::mojom::RecordContentToVisibleTimeRequestPtr visible_time_request)
override;
void CancelSuccessfulPresentationTimeRequestForHostAndDelegate() override;
void CancelPresentationTimeRequestForHostAndDelegate() override;
void OnFrameComplete(const viz::BeginFrameAck& ack);

View File

@@ -26,6 +26,7 @@
#include "chrome/browser/media/webrtc/permission_bubble_media_access_handler.h"
#include "chrome/browser/net/profile_network_context_service.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/plugins/plugin_info_host_impl.h"
#include "chrome/browser/prefetch/prefetch_prefs.h"
#include "chrome/browser/prefs/chrome_command_line_pref_store.h"
#include "chrome/browser/printing/print_preview_sticky_settings.h"
@@ -73,10 +74,9 @@
#endif
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
#include "chrome/browser/profiles/profile_key.h"
#include "chrome/browser/supervised_user/supervised_user_pref_store.h"
#include "chrome/browser/supervised_user/supervised_user_settings_service.h"
#include "chrome/browser/supervised_user/supervised_user_settings_service_factory.h"
#include "components/supervised_user/core/browser/supervised_user_settings_service.h"
#endif
namespace browser_prefs {
@@ -176,7 +176,7 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
if (profile) {
// Used to store supervised user preferences.
auto* supervised_user_settings =
SupervisedUserSettingsService* supervised_user_settings =
SupervisedUserSettingsServiceFactory::GetForKey(
profile->GetProfileKey());
@@ -223,6 +223,7 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
certificate_transparency::prefs::RegisterPrefs(registry.get());
flags_ui::PrefServiceFlagsStorage::RegisterPrefs(registry.get());
media_router::RegisterLocalStatePrefs(registry.get());
PluginInfoHostImpl::RegisterUserPrefs(registry.get());
PrefProxyConfigTrackerImpl::RegisterPrefs(registry.get());
ProfileNetworkContextService::RegisterLocalStatePrefs(registry.get());
SSLConfigServiceManager::RegisterPrefs(registry.get());
@@ -309,10 +310,6 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
registry->RegisterBooleanPref(
prefs::kAccessControlAllowMethodsInCORSPreflightSpecConformant, true);
// Based on browser_prefs::RegisterProfilePrefs.
registry->RegisterBooleanPref(prefs::kAccessibilityPdfOcrAlwaysActive,
false);
// Spell checking preferences.
// Modify defaults from SpellcheckServiceFactory::RegisterProfilePrefs.
std::string spellcheck_lang =

View File

@@ -29,7 +29,7 @@ const char* GetTypeString(base::Value::Type type) {
return "STRING";
case base::Value::Type::BINARY:
return "BINARY";
case base::Value::Type::DICT:
case base::Value::Type::DICTIONARY:
return "DICTIONARY";
case base::Value::Type::LIST:
return "LIST";
@@ -57,7 +57,7 @@ CefRefPtr<CefValue> GetPreference(PrefService* pref_service,
CefRefPtr<CefDictionaryValue> GetAllPreferences(PrefService* pref_service,
bool include_defaults) {
// Returns a DeepCopy of the value.
auto values = pref_service->GetPreferenceValues(
base::Value values = pref_service->GetPreferenceValues(
include_defaults ? PrefService::INCLUDE_DEFAULTS
: PrefService::EXCLUDE_DEFAULTS);

View File

@@ -30,8 +30,6 @@ class CefNativeWidgetMac : public views::NativeWidgetMac {
void GetWindowFrameTitlebarHeight(bool* override_titlebar_height,
float* titlebar_height) override;
void OnWindowFullscreenTransitionStart() override;
void OnWindowFullscreenTransitionComplete() override;
private:
const CefRefPtr<CefWindow> window_;

View File

@@ -52,13 +52,3 @@ void CefNativeWidgetMac::GetWindowFrameTitlebarHeight(
override_titlebar_height, titlebar_height);
}
}
void CefNativeWidgetMac::OnWindowFullscreenTransitionStart() {
views::NativeWidgetMac::OnWindowFullscreenTransitionStart();
window_delegate_->OnWindowFullscreenTransition(window_, false);
}
void CefNativeWidgetMac::OnWindowFullscreenTransitionComplete() {
views::NativeWidgetMac::OnWindowFullscreenTransitionComplete();
window_delegate_->OnWindowFullscreenTransition(window_, true);
}

View File

@@ -23,6 +23,9 @@
#include "ui/aura/test/ui_controls_factory_aura.h"
#include "ui/aura/window.h"
#include "ui/base/test/ui_controls_aura.h"
#if BUILDFLAG(IS_OZONE)
#include "ui/views/test/ui_controls_factory_desktop_aura_ozone.h"
#endif
#endif // defined(USE_AURA)
#if BUILDFLAG(IS_WIN)
@@ -42,7 +45,8 @@ void InitializeUITesting() {
ui_controls::InstallUIControlsAura(
aura::test::CreateUIControlsAura(nullptr));
#elif BUILDFLAG(IS_OZONE)
ui_controls::EnableUIControls();
ui_controls::InstallUIControlsAura(
views::test::CreateUIControlsDesktopAuraOzone());
#endif
#endif // defined(USE_AURA)

View File

@@ -33,6 +33,7 @@
#include "components/component_updater/component_updater_paths.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/embedder_support/switches.h"
#include "components/spellcheck/common/spellcheck_features.h"
#include "components/viz/common/features.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
@@ -259,6 +260,12 @@ absl::optional<int> AlloyMainDelegate::BasicStartupComplete() {
// parent windows (see issue #2805).
disable_features.push_back(features::kCalculateNativeWinOcclusion.name);
}
if (spellcheck::kWinUseBrowserSpellChecker.default_state ==
base::FEATURE_ENABLED_BY_DEFAULT) {
// TODO: Add support for windows spellcheck service (see issue #3055).
disable_features.push_back(spellcheck::kWinUseBrowserSpellChecker.name);
}
#endif // BUILDFLAG(IS_WIN)
if (features::kBackForwardCache.default_state ==

View File

@@ -17,10 +17,6 @@
#include "content/public/app/content_main_delegate.h"
#if BUILDFLAG(IS_WIN)
#include "components/spellcheck/common/spellcheck_features.h"
#endif
namespace base {
class CommandLine;
}
@@ -94,12 +90,6 @@ class AlloyMainDelegate : public content::ContentMainDelegate,
AlloyContentClient content_client_;
CefResourceBundleDelegate resource_bundle_delegate_;
#if BUILDFLAG(IS_WIN)
// TODO: Add support for windows spellcheck service (see issue #3055).
spellcheck::ScopedDisableBrowserSpellCheckerForTesting
disable_browser_spellchecker_;
#endif
};
#endif // CEF_LIBCEF_COMMON_ALLOY_ALLOY_MAIN_DELEGATE_H_

View File

@@ -418,7 +418,7 @@ void CefValueImpl::SetValueInternal(absl::optional<base::Value> value) {
case base::Value::Type::BINARY:
binary_value_ = new CefBinaryValueImpl(std::move(*value));
break;
case base::Value::Type::DICT:
case base::Value::Type::DICTIONARY:
dictionary_value_ =
new CefDictionaryValueImpl(std::move(*value), /*read_only=*/false);
break;
@@ -828,7 +828,7 @@ CefValueType CefDictionaryValueImpl::GetType(const CefString& key) {
return VTYPE_STRING;
case base::Value::Type::BINARY:
return VTYPE_BINARY;
case base::Value::Type::DICT:
case base::Value::Type::DICTIONARY:
return VTYPE_DICTIONARY;
case base::Value::Type::LIST:
return VTYPE_LIST;
@@ -1275,7 +1275,7 @@ CefValueType CefListValueImpl::GetType(size_t index) {
return VTYPE_STRING;
case base::Value::Type::BINARY:
return VTYPE_BINARY;
case base::Value::Type::DICT:
case base::Value::Type::DICTIONARY:
return VTYPE_DICTIONARY;
case base::Value::Type::LIST:
return VTYPE_LIST;

View File

@@ -72,7 +72,6 @@
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "content/public/renderer/render_frame.h"
#include "extensions/common/manifest_handlers/csp_info.h"
#include "extensions/common/switches.h"
#include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container_manager.h"

View File

@@ -6,6 +6,7 @@
#include "libcef/renderer/blink_glue.h"
#include "third_party/blink/public/mojom/v8_cache_options.mojom-blink.h"
#include "third_party/blink/public/platform/scheduler/web_resource_loading_task_runner_handle.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url_response.h"
#include "third_party/blink/public/web/web_document.h"
@@ -36,6 +37,8 @@
#include "third_party/blink/renderer/platform/bindings/v8_binding.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_response.h"
#include "third_party/blink/renderer/platform/loader/fetch/script_fetch_options.h"
#include "third_party/blink/renderer/platform/scheduler/public/frame_scheduler.h"
#include "third_party/blink/renderer/platform/scheduler/public/page_scheduler.h"
#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h"
#undef LOG
@@ -315,4 +318,21 @@ void StartNavigation(blink::WebLocalFrame* frame,
.StartNavigation(frame_load_request, blink::WebFrameLoadType::kStandard);
}
std::unique_ptr<blink::scheduler::WebResourceLoadingTaskRunnerHandle>
CreateResourceLoadingTaskRunnerHandle(blink::WebLocalFrame* frame) {
blink::Frame* core_frame = blink::WebFrame::ToCoreFrame(*frame);
return blink::To<blink::LocalFrame>(core_frame)
->GetFrameScheduler()
->CreateResourceLoadingTaskRunnerHandle();
}
std::unique_ptr<blink::scheduler::WebResourceLoadingTaskRunnerHandle>
CreateResourceLoadingMaybeUnfreezableTaskRunnerHandle(
blink::WebLocalFrame* frame) {
blink::Frame* core_frame = blink::WebFrame::ToCoreFrame(*frame);
return blink::To<blink::LocalFrame>(core_frame)
->GetFrameScheduler()
->CreateResourceLoadingMaybeUnfreezableTaskRunnerHandle();
}
} // namespace blink_glue

View File

@@ -25,6 +25,10 @@ class WebString;
class WebURLRequest;
class WebURLResponse;
class WebView;
namespace scheduler {
class WebResourceLoadingTaskRunnerHandle;
}
} // namespace blink
namespace blink_glue {
@@ -124,6 +128,15 @@ BLINK_EXPORT bool HasPluginFrameOwner(blink::WebLocalFrame* frame);
BLINK_EXPORT void StartNavigation(blink::WebLocalFrame* frame,
const blink::WebURLRequest& request);
// Used by CefFrameImpl::CreateURLLoader.
BLINK_EXPORT
std::unique_ptr<blink::scheduler::WebResourceLoadingTaskRunnerHandle>
CreateResourceLoadingTaskRunnerHandle(blink::WebLocalFrame* frame);
BLINK_EXPORT
std::unique_ptr<blink::scheduler::WebResourceLoadingTaskRunnerHandle>
CreateResourceLoadingMaybeUnfreezableTaskRunnerHandle(
blink::WebLocalFrame* frame);
} // namespace blink_glue
#endif // CEF_LIBCEF_RENDERER_BLINK_GLUE_H_

View File

@@ -17,7 +17,6 @@
#endif
#endif
#include "include/cef_urlrequest.h"
#include "libcef/common/app_manager.h"
#include "libcef/common/frame_util.h"
#include "libcef/common/net/http_header_utils.h"
@@ -29,6 +28,7 @@
#include "libcef/renderer/browser_impl.h"
#include "libcef/renderer/dom_document_impl.h"
#include "libcef/renderer/render_frame_util.h"
#include "libcef/renderer/render_urlrequest_impl.h"
#include "libcef/renderer/thread_util.h"
#include "libcef/renderer/v8_impl.h"
@@ -37,9 +37,11 @@
#include "content/renderer/render_frame_impl.h"
#include "third_party/blink/public/mojom/frame/frame.mojom-blink.h"
#include "third_party/blink/public/mojom/frame/lifecycle.mojom-blink.h"
#include "third_party/blink/public/platform/web_back_forward_cache_loader_helper.h"
#include "third_party/blink/public/platform/web_data.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url.h"
#include "third_party/blink/public/platform/web_url_loader.h"
#include "third_party/blink/public/web/blink.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_document_loader.h"
@@ -258,7 +260,17 @@ void CefFrameImpl::VisitDOM(CefRefPtr<CefDOMVisitor> visitor) {
CefRefPtr<CefURLRequest> CefFrameImpl::CreateURLRequest(
CefRefPtr<CefRequest> request,
CefRefPtr<CefURLRequestClient> client) {
NOTREACHED() << "CreateURLRequest cannot be called from the render process";
CEF_REQUIRE_RT_RETURN(nullptr);
if (!request || !client || !frame_) {
return nullptr;
}
CefRefPtr<CefRenderURLRequest> impl =
new CefRenderURLRequest(this, request, client);
if (impl->Start()) {
return impl.get();
}
return nullptr;
}
@@ -297,6 +309,42 @@ void CefFrameImpl::SendProcessMessage(CefProcessId target_process,
}
}
std::unique_ptr<blink::WebURLLoader> CefFrameImpl::CreateURLLoader() {
CEF_REQUIRE_RT();
if (!frame_) {
return nullptr;
}
if (!url_loader_factory_) {
auto render_frame = content::RenderFrameImpl::FromWebFrame(frame_);
if (render_frame) {
url_loader_factory_ = render_frame->CreateURLLoaderFactory();
}
}
if (!url_loader_factory_) {
return nullptr;
}
return url_loader_factory_->CreateURLLoader(
blink::WebURLRequest(),
blink_glue::CreateResourceLoadingTaskRunnerHandle(frame_),
blink_glue::CreateResourceLoadingMaybeUnfreezableTaskRunnerHandle(frame_),
/*keep_alive_handle=*/mojo::NullRemote(),
blink::WebBackForwardCacheLoaderHelper());
}
std::unique_ptr<blink::ResourceLoadInfoNotifierWrapper>
CefFrameImpl::CreateResourceLoadInfoNotifierWrapper() {
CEF_REQUIRE_RT();
if (frame_) {
auto render_frame = content::RenderFrameImpl::FromWebFrame(frame_);
if (render_frame) {
return render_frame->CreateResourceLoadInfoNotifierWrapper();
}
}
return nullptr;
}
void CefFrameImpl::OnAttached() {
// Called indirectly from RenderFrameCreated.
ConnectBrowserFrame(ConnectReason::RENDER_FRAME_CREATED);
@@ -413,6 +461,7 @@ void CefFrameImpl::OnDetached() {
OnDisconnect(DisconnectReason::DETACHED);
browser_ = nullptr;
url_loader_factory_.reset();
// In case we never attached.
while (!queued_browser_actions_.empty()) {

View File

@@ -27,6 +27,8 @@ class ListValue;
namespace blink {
class ResourceLoadInfoNotifierWrapper;
class WebLocalFrame;
class WebURLLoader;
class WebURLLoaderFactory;
} // namespace blink
class GURL;
@@ -82,6 +84,11 @@ class CefFrameImpl
void SendProcessMessage(CefProcessId target_process,
CefRefPtr<CefProcessMessage> message) override;
// Used by CefRenderURLRequest.
std::unique_ptr<blink::WebURLLoader> CreateURLLoader();
std::unique_ptr<blink::ResourceLoadInfoNotifierWrapper>
CreateResourceLoadInfoNotifierWrapper();
// Forwarded from CefRenderFrameObserver.
void OnAttached();
void OnWasShown();
@@ -190,6 +197,8 @@ class CefFrameImpl
std::queue<std::pair<std::string, BrowserFrameAction>>
queued_browser_actions_;
std::unique_ptr<blink::WebURLLoaderFactory> url_loader_factory_;
mojo::Receiver<cef::mojom::RenderFrame> receiver_{this};
mojo::Remote<cef::mojom::BrowserFrame> browser_frame_;

View File

@@ -0,0 +1,501 @@
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that can
// be found in the LICENSE file.
#include "libcef/renderer/render_urlrequest_impl.h"
#include <stdint.h>
#include "libcef/common/request_impl.h"
#include "libcef/common/response_impl.h"
#include "libcef/renderer/blink_glue.h"
#include "libcef/renderer/frame_impl.h"
#include "libcef/renderer/thread_util.h"
#include "base/logging.h"
#include "net/base/request_priority.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom.h"
#include "third_party/blink/public/mojom/loader/resource_load_info.mojom.h"
#include "third_party/blink/public/platform/resource_load_info_notifier_wrapper.h"
#include "third_party/blink/public/platform/web_security_origin.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url.h"
#include "third_party/blink/public/platform/web_url_error.h"
#include "third_party/blink/public/platform/web_url_loader.h"
#include "third_party/blink/public/platform/web_url_loader_client.h"
#include "third_party/blink/public/platform/web_url_request.h"
#include "third_party/blink/public/platform/web_url_request_extra_data.h"
#include "third_party/blink/public/platform/web_url_response.h"
using blink::WebString;
using blink::WebURL;
using blink::WebURLError;
using blink::WebURLLoader;
using blink::WebURLRequest;
using blink::WebURLResponse;
namespace {
class CefWebURLLoaderClient : public blink::WebURLLoaderClient {
public:
CefWebURLLoaderClient(CefRenderURLRequest::Context* context,
int request_flags);
~CefWebURLLoaderClient() override;
// blink::WebURLLoaderClient methods.
void DidSendData(uint64_t bytes_sent,
uint64_t total_bytes_to_be_sent) override;
void DidReceiveResponse(const WebURLResponse& response) override;
void DidReceiveData(const char* data, int dataLength) override;
void DidFinishLoading(
base::TimeTicks finish_time,
int64_t total_encoded_data_length,
uint64_t total_encoded_body_length,
int64_t total_decoded_body_length,
bool should_report_corb_blocking,
absl::optional<bool> pervasive_payload_requested) override;
void DidFail(const WebURLError&,
base::TimeTicks finish_time,
int64_t total_encoded_data_length,
uint64_t total_encoded_body_length,
int64_t total_decoded_body_length) override;
void DidStartLoadingResponseBody(
mojo::ScopedDataPipeConsumerHandle response_body) override;
bool WillFollowRedirect(const WebURL& new_url,
const net::SiteForCookies& new_site_for_cookies,
const WebString& new_referrer,
network::mojom::ReferrerPolicy new_referrer_policy,
const WebString& new_method,
const WebURLResponse& passed_redirect_response,
bool& report_raw_headers,
std::vector<std::string>* removed_headers,
bool insecure_scheme_was_upgraded) override;
protected:
// The context_ pointer will outlive this object.
CefRenderURLRequest::Context* context_;
int request_flags_;
};
} // namespace
// CefRenderURLRequest::Context -----------------------------------------------
class CefRenderURLRequest::Context
: public base::RefCountedThreadSafe<CefRenderURLRequest::Context> {
public:
Context(CefRefPtr<CefRenderURLRequest> url_request,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request,
CefRefPtr<CefURLRequestClient> client)
: url_request_(url_request),
frame_(frame),
request_(request),
client_(client),
status_(UR_IO_PENDING),
error_code_(ERR_NONE),
body_watcher_(FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::MANUAL),
response_was_cached_(false),
upload_data_size_(0),
got_upload_progress_complete_(false),
download_data_received_(0),
download_data_total_(-1) {
// Mark the request as read-only.
static_cast<CefRequestImpl*>(request_.get())->SetReadOnly(true);
}
bool Start() {
GURL url = GURL(request_->GetURL().ToString());
if (!url.is_valid()) {
return false;
}
url_client_.reset(new CefWebURLLoaderClient(this, request_->GetFlags()));
std::unique_ptr<network::ResourceRequest> resource_request =
std::make_unique<network::ResourceRequest>();
static_cast<CefRequestImpl*>(request_.get())
->Get(resource_request.get(), false);
resource_request->priority = net::MEDIUM;
// Behave the same as a subresource load.
resource_request->resource_type =
static_cast<int>(blink::mojom::ResourceType::kSubResource);
// Need load timing info for WebURLLoaderImpl::PopulateURLResponse to
// properly set cached status.
resource_request->enable_load_timing = true;
// Set the origin to match the request. The requirement for an origin is
// DCHECK'd in ResourceDispatcherHostImpl::ContinuePendingBeginRequest.
resource_request->request_initiator = url::Origin::Create(url);
if (request_->GetFlags() & UR_FLAG_ALLOW_STORED_CREDENTIALS) {
// Include SameSite cookies.
resource_request->site_for_cookies =
net::SiteForCookies::FromOrigin(*resource_request->request_initiator);
}
if (resource_request->request_body) {
const auto& elements = *resource_request->request_body->elements();
if (elements.size() > 0) {
const auto& element = elements[0];
if (element.type() == network::DataElement::Tag::kBytes) {
const auto& bytes_element = element.As<network::DataElementBytes>();
upload_data_size_ = bytes_element.bytes().size();
}
}
}
auto frame_impl = static_cast<CefFrameImpl*>(frame_.get());
loader_ = frame_impl->CreateURLLoader();
loader_->LoadAsynchronously(
std::move(resource_request), /*extra_data=*/nullptr,
/*no_mime_sniffing=*/false,
frame_impl->CreateResourceLoadInfoNotifierWrapper(), url_client_.get());
return true;
}
void Cancel() {
// The request may already be complete.
if (!loader_.get() || status_ != UR_IO_PENDING) {
return;
}
status_ = UR_CANCELED;
error_code_ = ERR_ABORTED;
// Will result in a call to OnError().
loader_->Cancel();
}
void OnStopRedirect(const WebURL& redirect_url,
const WebURLResponse& response) {
response_was_cached_ = blink_glue::ResponseWasCached(response);
response_ = CefResponse::Create();
CefResponseImpl* responseImpl =
static_cast<CefResponseImpl*>(response_.get());
// In case of StopOnRedirect we only set these fields. Everything else is
// left blank. This also replicates the behaviour of the browser urlrequest
// fetcher.
responseImpl->SetStatus(response.HttpStatusCode());
responseImpl->SetURL(redirect_url.GetString().Utf16());
responseImpl->SetReadOnly(true);
status_ = UR_CANCELED;
error_code_ = ERR_ABORTED;
OnComplete();
}
void OnResponse(const WebURLResponse& response) {
response_was_cached_ = blink_glue::ResponseWasCached(response);
response_ = CefResponse::Create();
CefResponseImpl* responseImpl =
static_cast<CefResponseImpl*>(response_.get());
responseImpl->Set(response);
responseImpl->SetReadOnly(true);
download_data_total_ = response.ExpectedContentLength();
}
void OnError(const WebURLError& error) {
if (status_ == UR_IO_PENDING) {
status_ = UR_FAILED;
error_code_ = static_cast<cef_errorcode_t>(error.reason());
}
OnComplete();
}
void OnComplete() {
if (body_handle_.is_valid()) {
return;
}
if (status_ == UR_IO_PENDING) {
status_ = UR_SUCCESS;
NotifyUploadProgressIfNecessary();
}
if (loader_.get()) {
loader_.reset(nullptr);
}
DCHECK(url_request_.get());
client_->OnRequestComplete(url_request_.get());
// This may result in the Context object being deleted.
url_request_ = nullptr;
}
void OnBodyReadable(MojoResult, const mojo::HandleSignalsState&) {
const void* buffer = nullptr;
uint32_t read_bytes = 0;
MojoResult result = body_handle_->BeginReadData(&buffer, &read_bytes,
MOJO_READ_DATA_FLAG_NONE);
if (result == MOJO_RESULT_SHOULD_WAIT) {
body_watcher_.ArmOrNotify();
return;
}
if (result == MOJO_RESULT_FAILED_PRECONDITION) {
// Whole body has been read.
body_handle_.reset();
body_watcher_.Cancel();
OnComplete();
return;
}
if (result != MOJO_RESULT_OK) {
// Something went wrong.
body_handle_.reset();
body_watcher_.Cancel();
OnComplete();
return;
}
download_data_received_ += read_bytes;
client_->OnDownloadProgress(url_request_.get(), download_data_received_,
download_data_total_);
if (!(request_->GetFlags() & UR_FLAG_NO_DOWNLOAD_DATA)) {
client_->OnDownloadData(url_request_.get(), buffer, read_bytes);
}
body_handle_->EndReadData(read_bytes);
body_watcher_.ArmOrNotify();
}
void OnStartLoadingResponseBody(
mojo::ScopedDataPipeConsumerHandle response_body) {
DCHECK(response_body);
DCHECK(!body_handle_);
body_handle_ = std::move(response_body);
body_watcher_.Watch(
body_handle_.get(),
MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED,
base::BindRepeating(&CefRenderURLRequest::Context::OnBodyReadable,
base::Unretained(this)));
body_watcher_.ArmOrNotify();
}
void OnDownloadProgress(int64_t current) {
DCHECK(url_request_.get());
NotifyUploadProgressIfNecessary();
download_data_received_ += current;
client_->OnDownloadProgress(url_request_.get(), download_data_received_,
download_data_total_);
}
void OnDownloadData(const char* data, int dataLength) {
DCHECK(url_request_.get());
client_->OnDownloadData(url_request_.get(), data, dataLength);
}
void OnUploadProgress(int64_t current, int64_t total) {
DCHECK(url_request_.get());
if (current == total) {
got_upload_progress_complete_ = true;
}
client_->OnUploadProgress(url_request_.get(), current, total);
}
CefRefPtr<CefRequest> request() const { return request_; }
CefRefPtr<CefURLRequestClient> client() const { return client_; }
CefURLRequest::Status status() const { return status_; }
CefURLRequest::ErrorCode error_code() const { return error_code_; }
CefRefPtr<CefResponse> response() const { return response_; }
bool response_was_cached() const { return response_was_cached_; }
private:
friend class base::RefCountedThreadSafe<CefRenderURLRequest::Context>;
virtual ~Context() {}
void NotifyUploadProgressIfNecessary() {
if (!got_upload_progress_complete_ && upload_data_size_ > 0) {
// Upload notifications are sent using a timer and may not occur if the
// request completes too quickly. We therefore send the notification here
// if necessary.
url_client_->DidSendData(upload_data_size_, upload_data_size_);
got_upload_progress_complete_ = true;
}
}
// Members only accessed on the initialization thread.
CefRefPtr<CefRenderURLRequest> url_request_;
CefRefPtr<CefFrame> frame_;
CefRefPtr<CefRequest> request_;
CefRefPtr<CefURLRequestClient> client_;
CefURLRequest::Status status_;
CefURLRequest::ErrorCode error_code_;
CefRefPtr<CefResponse> response_;
mojo::ScopedDataPipeConsumerHandle body_handle_;
mojo::SimpleWatcher body_watcher_;
bool response_was_cached_;
std::unique_ptr<blink::WebURLLoader> loader_;
std::unique_ptr<CefWebURLLoaderClient> url_client_;
int64_t upload_data_size_;
bool got_upload_progress_complete_;
int64_t download_data_received_;
int64_t download_data_total_;
};
// CefWebURLLoaderClient --------------------------------------------------
namespace {
CefWebURLLoaderClient::CefWebURLLoaderClient(
CefRenderURLRequest::Context* context,
int request_flags)
: context_(context), request_flags_(request_flags) {}
CefWebURLLoaderClient::~CefWebURLLoaderClient() {}
void CefWebURLLoaderClient::DidSendData(uint64_t bytes_sent,
uint64_t total_bytes_to_be_sent) {
if (request_flags_ & UR_FLAG_REPORT_UPLOAD_PROGRESS) {
context_->OnUploadProgress(bytes_sent, total_bytes_to_be_sent);
}
}
void CefWebURLLoaderClient::DidReceiveResponse(const WebURLResponse& response) {
context_->OnResponse(response);
}
void CefWebURLLoaderClient::DidReceiveData(const char* data, int dataLength) {
context_->OnDownloadProgress(dataLength);
if (!(request_flags_ & UR_FLAG_NO_DOWNLOAD_DATA)) {
context_->OnDownloadData(data, dataLength);
}
}
void CefWebURLLoaderClient::DidFinishLoading(
base::TimeTicks finish_time,
int64_t total_encoded_data_length,
uint64_t total_encoded_body_length,
int64_t total_decoded_body_length,
bool should_report_corb_blocking,
absl::optional<bool> pervasive_payload_requested) {
context_->OnComplete();
}
void CefWebURLLoaderClient::DidFail(const WebURLError& error,
base::TimeTicks finish_time,
int64_t total_encoded_data_length,
uint64_t total_encoded_body_length,
int64_t total_decoded_body_length) {
context_->OnError(error);
}
void CefWebURLLoaderClient::DidStartLoadingResponseBody(
mojo::ScopedDataPipeConsumerHandle response_body) {
context_->OnStartLoadingResponseBody(std::move(response_body));
}
bool CefWebURLLoaderClient::WillFollowRedirect(
const WebURL& new_url,
const net::SiteForCookies& new_site_for_cookies,
const WebString& new_referrer,
network::mojom::ReferrerPolicy new_referrer_policy,
const WebString& new_method,
const WebURLResponse& passed_redirect_response,
bool& report_raw_headers,
std::vector<std::string>* removed_headers,
bool insecure_scheme_was_upgraded) {
if (request_flags_ & UR_FLAG_STOP_ON_REDIRECT) {
context_->OnStopRedirect(new_url, passed_redirect_response);
return false;
}
return true;
}
} // namespace
// CefRenderURLRequest --------------------------------------------------------
CefRenderURLRequest::CefRenderURLRequest(
CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request,
CefRefPtr<CefURLRequestClient> client) {
DCHECK(frame);
DCHECK(request);
DCHECK(client);
context_ = new Context(this, frame, request, client);
}
CefRenderURLRequest::~CefRenderURLRequest() {}
bool CefRenderURLRequest::Start() {
if (!VerifyContext()) {
return false;
}
return context_->Start();
}
CefRefPtr<CefRequest> CefRenderURLRequest::GetRequest() {
if (!VerifyContext()) {
return nullptr;
}
return context_->request();
}
CefRefPtr<CefURLRequestClient> CefRenderURLRequest::GetClient() {
if (!VerifyContext()) {
return nullptr;
}
return context_->client();
}
CefURLRequest::Status CefRenderURLRequest::GetRequestStatus() {
if (!VerifyContext()) {
return UR_UNKNOWN;
}
return context_->status();
}
CefURLRequest::ErrorCode CefRenderURLRequest::GetRequestError() {
if (!VerifyContext()) {
return ERR_NONE;
}
return context_->error_code();
}
CefRefPtr<CefResponse> CefRenderURLRequest::GetResponse() {
if (!VerifyContext()) {
return nullptr;
}
return context_->response();
}
bool CefRenderURLRequest::ResponseWasCached() {
if (!VerifyContext()) {
return false;
}
return context_->response_was_cached();
}
void CefRenderURLRequest::Cancel() {
if (!VerifyContext()) {
return;
}
return context_->Cancel();
}
bool CefRenderURLRequest::VerifyContext() {
DCHECK(context_.get());
if (!CEF_CURRENTLY_ON_RT()) {
NOTREACHED() << "called on invalid thread";
return false;
}
return true;
}

View File

@@ -0,0 +1,44 @@
// Copyright (c) 2012 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_RENDER_URLREQUEST_IMPL_H_
#define CEF_LIBCEF_RENDERER_RENDER_URLREQUEST_IMPL_H_
#include "include/cef_frame.h"
#include "include/cef_urlrequest.h"
#include "base/memory/ref_counted.h"
class CefRenderURLRequest : public CefURLRequest {
public:
class Context;
// If |frame| is nullptr the default URLLoaderFactory will be used. That
// factory only supports http(s) and blob requests that cannot be
// intercepted in the browser process.
CefRenderURLRequest(CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request,
CefRefPtr<CefURLRequestClient> client);
~CefRenderURLRequest() override;
bool Start();
// CefURLRequest methods.
CefRefPtr<CefRequest> GetRequest() override;
CefRefPtr<CefURLRequestClient> GetClient() override;
Status GetRequestStatus() override;
ErrorCode GetRequestError() override;
CefRefPtr<CefResponse> GetResponse() override;
bool ResponseWasCached() override;
void Cancel() override;
private:
bool VerifyContext();
scoped_refptr<Context> context_;
IMPLEMENT_REFCOUNTING(CefRenderURLRequest);
};
#endif // CEF_LIBCEF_RENDERER_RENDER_URLREQUEST_IMPL_H_

View File

@@ -5,7 +5,7 @@
#include "include/base/cef_weak_ptr.h"
namespace base {
namespace cef_internal {
namespace internal {
WeakReference::Flag::Flag() {
// Flags only become bound when checked for validity, or invalidated,
@@ -97,5 +97,5 @@ WeakPtrFactoryBase::~WeakPtrFactoryBase() {
ptr_ = 0;
}
} // namespace cef_internal
} // namespace internal
} // namespace base

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=7b58140cd5e363a79adf4e420ceae009a7d10811$
// $hash=bf815bb565ccf2570c6f6b881009fe7df20805f0$
//
#include "libcef_dll/cpptoc/command_handler_cpptoc.h"
@@ -47,114 +47,12 @@ command_handler_on_chrome_command(struct _cef_command_handler_t* self,
return _retval;
}
int CEF_CALLBACK command_handler_is_chrome_app_menu_item_visible(
struct _cef_command_handler_t* self,
cef_browser_t* browser,
int command_id) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self) {
return 0;
}
// Verify param: browser; type: refptr_diff
DCHECK(browser);
if (!browser) {
return 0;
}
// Execute
bool _retval = CefCommandHandlerCppToC::Get(self)->IsChromeAppMenuItemVisible(
CefBrowserCToCpp::Wrap(browser), command_id);
// Return type: bool
return _retval;
}
int CEF_CALLBACK command_handler_is_chrome_app_menu_item_enabled(
struct _cef_command_handler_t* self,
cef_browser_t* browser,
int command_id) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self) {
return 0;
}
// Verify param: browser; type: refptr_diff
DCHECK(browser);
if (!browser) {
return 0;
}
// Execute
bool _retval = CefCommandHandlerCppToC::Get(self)->IsChromeAppMenuItemEnabled(
CefBrowserCToCpp::Wrap(browser), command_id);
// Return type: bool
return _retval;
}
int CEF_CALLBACK command_handler_is_chrome_page_action_icon_visible(
struct _cef_command_handler_t* self,
cef_chrome_page_action_icon_type_t icon_type) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self) {
return 0;
}
// Execute
bool _retval =
CefCommandHandlerCppToC::Get(self)->IsChromePageActionIconVisible(
icon_type);
// Return type: bool
return _retval;
}
int CEF_CALLBACK command_handler_is_chrome_toolbar_button_visible(
struct _cef_command_handler_t* self,
cef_chrome_toolbar_button_type_t button_type) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self) {
return 0;
}
// Execute
bool _retval =
CefCommandHandlerCppToC::Get(self)->IsChromeToolbarButtonVisible(
button_type);
// Return type: bool
return _retval;
}
} // namespace
// CONSTRUCTOR - Do not edit by hand.
CefCommandHandlerCppToC::CefCommandHandlerCppToC() {
GetStruct()->on_chrome_command = command_handler_on_chrome_command;
GetStruct()->is_chrome_app_menu_item_visible =
command_handler_is_chrome_app_menu_item_visible;
GetStruct()->is_chrome_app_menu_item_enabled =
command_handler_is_chrome_app_menu_item_enabled;
GetStruct()->is_chrome_page_action_icon_visible =
command_handler_is_chrome_page_action_icon_visible;
GetStruct()->is_chrome_toolbar_button_visible =
command_handler_is_chrome_toolbar_button_visible;
}
// DESTRUCTOR - Do not edit by hand.

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=c7e5e137df27a4986c13e6f4e2b98eac19a48193$
// $hash=18f715de465689a4e8484bbced8ad92d9434438a$
//
#include "libcef_dll/cpptoc/views/window_delegate_cpptoc.h"
@@ -484,29 +484,6 @@ window_delegate_on_key_event(struct _cef_window_delegate_t* self,
return _retval;
}
void CEF_CALLBACK window_delegate_on_window_fullscreen_transition(
struct _cef_window_delegate_t* self,
cef_window_t* window,
int is_completed) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self) {
return;
}
// Verify param: window; type: refptr_diff
DCHECK(window);
if (!window) {
return;
}
// Execute
CefWindowDelegateCppToC::Get(self)->OnWindowFullscreenTransition(
CefWindowCToCpp::Wrap(window), is_completed ? true : false);
}
cef_size_t CEF_CALLBACK
window_delegate_get_preferred_size(struct _cef_view_delegate_t* self,
cef_view_t* view) {
@@ -793,8 +770,6 @@ CefWindowDelegateCppToC::CefWindowDelegateCppToC() {
GetStruct()->can_close = window_delegate_can_close;
GetStruct()->on_accelerator = window_delegate_on_accelerator;
GetStruct()->on_key_event = window_delegate_on_key_event;
GetStruct()->on_window_fullscreen_transition =
window_delegate_on_window_fullscreen_transition;
GetStruct()->base.base.get_preferred_size =
window_delegate_get_preferred_size;
GetStruct()->base.base.get_minimum_size = window_delegate_get_minimum_size;

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=f374fda38406905546bc5601c01764a9b437a7d0$
// $hash=af3697f4c41762086c8edff7f63a794e8bf95b25$
//
#include "libcef_dll/ctocpp/command_handler_ctocpp.h"
@@ -46,98 +46,6 @@ bool CefCommandHandlerCToCpp::OnChromeCommand(
return _retval ? true : false;
}
NO_SANITIZE("cfi-icall")
bool CefCommandHandlerCToCpp::IsChromeAppMenuItemVisible(
CefRefPtr<CefBrowser> browser,
int command_id) {
shutdown_checker::AssertNotShutdown();
cef_command_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, is_chrome_app_menu_item_visible)) {
return false;
}
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: browser; type: refptr_diff
DCHECK(browser.get());
if (!browser.get()) {
return false;
}
// Execute
int _retval = _struct->is_chrome_app_menu_item_visible(
_struct, CefBrowserCppToC::Wrap(browser), command_id);
// Return type: bool
return _retval ? true : false;
}
NO_SANITIZE("cfi-icall")
bool CefCommandHandlerCToCpp::IsChromeAppMenuItemEnabled(
CefRefPtr<CefBrowser> browser,
int command_id) {
shutdown_checker::AssertNotShutdown();
cef_command_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, is_chrome_app_menu_item_enabled)) {
return false;
}
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: browser; type: refptr_diff
DCHECK(browser.get());
if (!browser.get()) {
return false;
}
// Execute
int _retval = _struct->is_chrome_app_menu_item_enabled(
_struct, CefBrowserCppToC::Wrap(browser), command_id);
// Return type: bool
return _retval ? true : false;
}
NO_SANITIZE("cfi-icall")
bool CefCommandHandlerCToCpp::IsChromePageActionIconVisible(
cef_chrome_page_action_icon_type_t icon_type) {
shutdown_checker::AssertNotShutdown();
cef_command_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, is_chrome_page_action_icon_visible)) {
return false;
}
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->is_chrome_page_action_icon_visible(_struct, icon_type);
// Return type: bool
return _retval ? true : false;
}
NO_SANITIZE("cfi-icall")
bool CefCommandHandlerCToCpp::IsChromeToolbarButtonVisible(
cef_chrome_toolbar_button_type_t button_type) {
shutdown_checker::AssertNotShutdown();
cef_command_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, is_chrome_toolbar_button_visible)) {
return false;
}
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->is_chrome_toolbar_button_visible(_struct, button_type);
// Return type: bool
return _retval ? true : false;
}
// CONSTRUCTOR - Do not edit by hand.
CefCommandHandlerCToCpp::CefCommandHandlerCToCpp() {}

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=ad0096887a1662a2cc3804248365e56fc20d6eaa$
// $hash=1def18706fb8efd9d28a718b505905d366a0d057$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_COMMAND_HANDLER_CTOCPP_H_
@@ -38,14 +38,6 @@ class CefCommandHandlerCToCpp
bool OnChromeCommand(CefRefPtr<CefBrowser> browser,
int command_id,
cef_window_open_disposition_t disposition) override;
bool IsChromeAppMenuItemVisible(CefRefPtr<CefBrowser> browser,
int command_id) override;
bool IsChromeAppMenuItemEnabled(CefRefPtr<CefBrowser> browser,
int command_id) override;
bool IsChromePageActionIconVisible(
cef_chrome_page_action_icon_type_t icon_type) override;
bool IsChromeToolbarButtonVisible(
cef_chrome_toolbar_button_type_t button_type) override;
};
#endif // CEF_LIBCEF_DLL_CTOCPP_COMMAND_HANDLER_CTOCPP_H_

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=5d3fd8439bbc051bac61497b125a7ac35859881d$
// $hash=40aea12873a3c8803c9d2d6c06a0270197ead58e$
//
#include "libcef_dll/ctocpp/views/window_delegate_ctocpp.h"
@@ -462,30 +462,6 @@ bool CefWindowDelegateCToCpp::OnKeyEvent(CefRefPtr<CefWindow> window,
return _retval ? true : false;
}
NO_SANITIZE("cfi-icall")
void CefWindowDelegateCToCpp::OnWindowFullscreenTransition(
CefRefPtr<CefWindow> window,
bool is_completed) {
shutdown_checker::AssertNotShutdown();
cef_window_delegate_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, on_window_fullscreen_transition)) {
return;
}
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: window; type: refptr_diff
DCHECK(window.get());
if (!window.get()) {
return;
}
// Execute
_struct->on_window_fullscreen_transition(
_struct, CefWindowCppToC::Wrap(window), is_completed);
}
NO_SANITIZE("cfi-icall")
CefSize CefWindowDelegateCToCpp::GetPreferredSize(CefRefPtr<CefView> view) {
shutdown_checker::AssertNotShutdown();

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=bf87c473a5bafd3f8c30bd06c033b0182f65a7b7$
// $hash=d100d8866a7eab2a163d4ddb3cacd00141f65757$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_DELEGATE_CTOCPP_H_
@@ -60,8 +60,6 @@ class CefWindowDelegateCToCpp
bool OnAccelerator(CefRefPtr<CefWindow> window, int command_id) override;
bool OnKeyEvent(CefRefPtr<CefWindow> window,
const CefKeyEvent& event) override;
void OnWindowFullscreenTransition(CefRefPtr<CefWindow> window,
bool is_completed) override;
// CefPanelDelegate methods.

View File

@@ -67,6 +67,10 @@ CEF_EXPORT int cef_run_main_with_preferred_stack_size(mainPtr main,
}
#endif // defined(ARCH_CPU_32_BITS)
CEF_EXPORT void cef_enable_highdpi_support() {
CefEnableHighDPISupport();
}
CEF_EXPORT void cef_set_osmodal_loop(int osModalLoop) {
CefSetOSModalLoop(osModalLoop ? true : false);
}

View File

@@ -44,6 +44,17 @@ int CefRunMainWithPreferredStackSize(mainPtr main, int argc, char* argv[]) {
}
#endif // defined(ARCH_CPU_32_BITS)
NO_SANITIZE("cfi-icall") void CefEnableHighDPISupport() {
const char* api_hash = cef_api_hash(0);
if (strcmp(api_hash, CEF_API_HASH_PLATFORM)) {
// The libcef API hash does not match the current header API hash.
NOTREACHED();
return;
}
cef_enable_highdpi_support();
}
NO_SANITIZE("cfi-icall") void CefSetOSModalLoop(bool osModalLoop) {
cef_set_osmodal_loop(osModalLoop);
}

View File

@@ -31,10 +31,7 @@ patches = [
#
# Windows: Add cc_wrapper support for sccache builds.
# https://github.com/chromiumembedded/cef/issues/2432
#
# Windows: Add GN arg windows_sdk_version.
# https://bugs.chromium.org/p/chromium/issues/detail?id=1420723
'name': 'gn_config',
'name': 'gn_config',
},
{
# Patches that must be applied after `gclient sync --nohooks` and before
@@ -42,6 +39,9 @@ patches = [
#
# Support custom VS toolchain on Windows.
# https://bugs.chromium.org/p/chromium/issues/detail?id=623342
#
# Don't copy dbghelp.dll/dbgcore.dll from the Windows SDK.
# https://github.com/chromiumembedded/cef/issues/3356
'name': 'runhooks',
},
{
@@ -471,6 +471,11 @@ patches = [
# http://crrev.com/3955c9f9eb
'name': 'set_resize_background_color',
},
{
# Restore WebUrlLoader Cancel method.
# https://chromium-review.googlesource.com/c/chromium/src/+/1617042
'name': 'web_url_loader_cancel_1617042',
},
{
# Avoid a shutdown crash with multi-threaded message loop caused by
# |g_browser_task_executor->browser_ui_thread_scheduler_| being null when
@@ -609,13 +614,15 @@ patches = [
'name': 'linux_glib_deprecated_volatile'
},
{
# Restore low-level attribute access from WebElement which was removed in
# https://chromium-review.googlesource.com/c/chromium/src/+/4200240
'name': 'blink_web_element_4200240'
# Specify an output name for the pdfium build component to fix PDF
# loading with component build.
# https://pdfium-review.googlesource.com/c/pdfium/+/103501
'name': 'pdfium_103501',
'path': 'third_party/pdfium'
},
{
# win: Add missing process_handle.h include for cef_sandbox build.
# https://chromium-review.googlesource.com/c/chromium/src/+/4294575
'name': 'base_logging_4294575'
# Windows: Fix cef_sandbox compile error related to unsafe narrowing.
# https://chromium-review.googlesource.com/c/chromium/src/+/4219163
'name': 'win_power_monitor_4219163'
}
]

View File

@@ -1,20 +0,0 @@
diff --git base/logging.cc base/logging.cc
index 496e68dfcd33a..b1b0af0710f28 100644
--- base/logging.cc
+++ base/logging.cc
@@ -20,6 +20,7 @@
#include "base/debug/crash_logging.h"
#include "base/immediate_crash.h"
#include "base/pending_task.h"
+#include "base/process/process_handle.h"
#include "base/strings/string_piece.h"
#include "base/task/common/task_annotator.h"
#include "base/trace_event/base_tracing.h"
@@ -72,7 +73,6 @@ typedef HANDLE FileHandle;
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
-#include "base/process/process_handle.h"
#define MAX_PATH PATH_MAX
typedef FILE* FileHandle;
#endif

View File

@@ -1,5 +1,5 @@
diff --git base/BUILD.gn base/BUILD.gn
index 422702cb196c5..7118ae9c9f467 100644
index 1f0e5cc5f0fae..6f2003a67c9ce 100644
--- base/BUILD.gn
+++ base/BUILD.gn
@@ -39,6 +39,7 @@ import("//build/config/ui.gni")
@@ -10,7 +10,7 @@ index 422702cb196c5..7118ae9c9f467 100644
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
@@ -1509,7 +1510,11 @@ component("base") {
@@ -1960,7 +1961,11 @@ component("base") {
"hash/md5_constexpr_internal.h",
"hash/sha1.h",
]
@@ -23,7 +23,7 @@ index 422702cb196c5..7118ae9c9f467 100644
sources += [
"hash/md5_nacl.cc",
"hash/md5_nacl.h",
@@ -1909,6 +1914,12 @@ component("base") {
@@ -2104,6 +2109,12 @@ component("base") {
defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ]
}
@@ -35,9 +35,9 @@ index 422702cb196c5..7118ae9c9f467 100644
+
libs += [
"cfgmgr32.lib",
"ntdll.lib",
"powrprof.lib",
diff --git base/allocator/dispatcher/dispatcher.cc base/allocator/dispatcher/dispatcher.cc
index 09ce0dc0c5016..8b847a24918f5 100644
index fd6e8a1696c94..df996398c1e78 100644
--- base/allocator/dispatcher/dispatcher.cc
+++ base/allocator/dispatcher/dispatcher.cc
@@ -13,6 +13,7 @@

View File

@@ -1,43 +0,0 @@
diff --git third_party/blink/public/web/web_element.h third_party/blink/public/web/web_element.h
index a23dd0a402704..91e4d3615fb6a 100644
--- third_party/blink/public/web/web_element.h
+++ third_party/blink/public/web/web_element.h
@@ -81,6 +81,9 @@ class BLINK_EXPORT WebElement : public WebNode {
void SetAttribute(const WebString& name, const WebString& value);
WebString TextContent() const;
WebString InnerHTML() const;
+ WebString AttributeLocalName(unsigned index) const;
+ WebString AttributeValue(unsigned index) const;
+ unsigned AttributeCount() const;
// Returns all <label> elements associated to this element.
WebVector<WebLabelElement> Labels() const;
diff --git third_party/blink/renderer/core/exported/web_element.cc third_party/blink/renderer/core/exported/web_element.cc
index 31c5027c972a7..ae418a4c1d004 100644
--- third_party/blink/renderer/core/exported/web_element.cc
+++ third_party/blink/renderer/core/exported/web_element.cc
@@ -106,6 +106,24 @@ void WebElement::SetAttribute(const WebString& attr_name,
IGNORE_EXCEPTION_FOR_TESTING);
}
+unsigned WebElement::AttributeCount() const {
+ if (!ConstUnwrap<Element>()->hasAttributes())
+ return 0;
+ return ConstUnwrap<Element>()->Attributes().size();
+}
+
+WebString WebElement::AttributeLocalName(unsigned index) const {
+ if (index >= AttributeCount())
+ return WebString();
+ return ConstUnwrap<Element>()->Attributes().at(index).LocalName();
+}
+
+WebString WebElement::AttributeValue(unsigned index) const {
+ if (index >= AttributeCount())
+ return WebString();
+ return ConstUnwrap<Element>()->Attributes().at(index).Value();
+}
+
WebString WebElement::TextContent() const {
return ConstUnwrap<Element>()->textContent();
}

View File

@@ -20,10 +20,10 @@ index 4dbf8a2811c9e..917b6a2e7b56f 100644
// Make an exception to allow most visited tiles to commit in
diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc
index d979fc0def505..aa41b2a792e4e 100644
index 4b552797303b8..0e39c982b5803 100644
--- content/browser/renderer_host/navigation_request.cc
+++ content/browser/renderer_host/navigation_request.cc
@@ -7021,10 +7021,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
@@ -6942,10 +6942,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
bool use_opaque_origin =
(sandbox_flags & network::mojom::WebSandboxFlags::kOrigin) ==
network::mojom::WebSandboxFlags::kOrigin;
@@ -47,7 +47,7 @@ index d979fc0def505..aa41b2a792e4e 100644
}
return origin_and_debug_info;
@@ -7054,6 +7066,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
@@ -6975,6 +6987,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
SandboxFlagsToCommit());

View File

@@ -1,8 +1,8 @@
diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn
index 9afb4425840b9..cc12baba6d36e 100644
index ef3285ae74e1b..c669380332eb9 100644
--- build/config/compiler/BUILD.gn
+++ build/config/compiler/BUILD.gn
@@ -1920,8 +1920,6 @@ config("thin_archive") {
@@ -1911,8 +1911,6 @@ config("thin_archive") {
# confuses lldb.
if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) {
arflags = [ "-T" ]

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
index 0ddbd541f7ef4..a0d78f2db93a6 100644
index 42712ea4134e1..eee57ad898aa9 100644
--- chrome/browser/BUILD.gn
+++ chrome/browser/BUILD.gn
@@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni")
@@ -10,7 +10,7 @@ index 0ddbd541f7ef4..a0d78f2db93a6 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/browser/downgrade/buildflags.gni")
import("//chrome/common/features.gni")
@@ -1984,6 +1985,7 @@ static_library("browser") {
@@ -1974,6 +1975,7 @@ static_library("browser") {
"//build/config/chromebox_for_meetings:buildflags",
"//build/config/compiler:compiler_buildflags",
"//cc",
@@ -18,7 +18,7 @@ index 0ddbd541f7ef4..a0d78f2db93a6 100644
"//chrome:extra_resources",
"//chrome:resources",
"//chrome:strings",
@@ -2552,6 +2554,10 @@ static_library("browser") {
@@ -2537,6 +2539,10 @@ static_library("browser") {
]
}
@@ -29,7 +29,7 @@ index 0ddbd541f7ef4..a0d78f2db93a6 100644
if (is_android) {
sources += [
"after_startup_task_utils_android.cc",
@@ -6102,8 +6108,6 @@ static_library("browser") {
@@ -6076,8 +6082,6 @@ static_library("browser") {
sources += [
"enterprise/chrome_browser_main_extra_parts_enterprise.cc",
"enterprise/chrome_browser_main_extra_parts_enterprise.h",

View File

@@ -13,7 +13,7 @@ index 370d6ab102471..fe1e4111780ed 100644
return false;
}
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
index 94f900fb2e05e..2d5719c3bc936 100644
index 03a6d3a2ee5e8..a19224279243c 100644
--- chrome/browser/ui/BUILD.gn
+++ chrome/browser/ui/BUILD.gn
@@ -9,6 +9,7 @@ import("//build/config/compiler/compiler.gni")
@@ -24,7 +24,7 @@ index 94f900fb2e05e..2d5719c3bc936 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/common/features.gni")
import("//chromeos/ash/components/assistant/assistant.gni")
@@ -362,6 +363,10 @@ static_library("ui") {
@@ -361,6 +362,10 @@ static_library("ui") {
"//build/config/compiler:wexit_time_destructors",
]
@@ -35,7 +35,7 @@ index 94f900fb2e05e..2d5719c3bc936 100644
# Since browser and browser_ui actually depend on each other,
# we must omit the dependency from browser_ui to browser.
# However, this means browser_ui and browser should more or less
@@ -386,6 +391,7 @@ static_library("ui") {
@@ -385,6 +390,7 @@ static_library("ui") {
"//build:chromeos_buildflags",
"//build/config/chromebox_for_meetings:buildflags",
"//cc/paint",
@@ -43,7 +43,7 @@ index 94f900fb2e05e..2d5719c3bc936 100644
"//chrome:extra_resources",
"//chrome:resources",
"//chrome:strings",
@@ -2543,6 +2549,8 @@ static_library("ui") {
@@ -2527,6 +2533,8 @@ static_library("ui") {
"views/apps/app_dialog/app_block_dialog_view.h",
"views/apps/app_dialog/app_pause_dialog_view.cc",
"views/apps/app_dialog/app_pause_dialog_view.h",
@@ -52,7 +52,7 @@ index 94f900fb2e05e..2d5719c3bc936 100644
"views/apps/app_info_dialog/arc_app_info_links_panel.cc",
"views/apps/app_info_dialog/arc_app_info_links_panel.h",
"views/apps/chrome_app_window_client_views_chromeos.cc",
@@ -4321,8 +4329,6 @@ static_library("ui") {
@@ -4292,8 +4300,6 @@ static_library("ui") {
"views/accessibility/theme_tracking_non_accessible_image_view.h",
"views/apps/app_dialog/app_dialog_view.cc",
"views/apps/app_dialog/app_dialog_view.h",
@@ -61,7 +61,7 @@ index 94f900fb2e05e..2d5719c3bc936 100644
"views/apps/app_info_dialog/app_info_dialog_container.cc",
"views/apps/app_info_dialog/app_info_dialog_container.h",
"views/apps/app_info_dialog/app_info_dialog_views.cc",
@@ -5853,6 +5859,7 @@ static_library("ui") {
@@ -5799,6 +5805,7 @@ static_library("ui") {
if (enable_printing) {
deps += [
"//components/printing/browser",
@@ -70,10 +70,10 @@ index 94f900fb2e05e..2d5719c3bc936 100644
]
}
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
index 8e86697ca27ec..7d2dd1dd23c24 100644
index 13a07ce16ad4f..66ae1d0afba7d 100644
--- chrome/browser/ui/browser.cc
+++ chrome/browser/ui/browser.cc
@@ -263,6 +263,25 @@
@@ -264,6 +264,25 @@
#include "components/captive_portal/content/captive_portal_tab_helper.h"
#endif
@@ -99,7 +99,7 @@ index 8e86697ca27ec..7d2dd1dd23c24 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_browser_window_helper.h"
#endif
@@ -509,6 +528,13 @@ Browser::Browser(const CreateParams& params)
@@ -510,6 +529,13 @@ Browser::Browser(const CreateParams& params)
tab_strip_model_->AddObserver(this);
@@ -113,7 +113,7 @@ index 8e86697ca27ec..7d2dd1dd23c24 100644
location_bar_model_ = std::make_unique<LocationBarModelImpl>(
location_bar_model_delegate_.get(), content::kMaxURLDisplayChars);
@@ -648,6 +674,12 @@ Browser::~Browser() {
@@ -649,6 +675,12 @@ Browser::~Browser() {
// away so they don't try and call back to us.
if (select_file_dialog_.get())
select_file_dialog_->ListenerDestroyed();
@@ -126,7 +126,7 @@ index 8e86697ca27ec..7d2dd1dd23c24 100644
}
///////////////////////////////////////////////////////////////////////////////
@@ -1357,6 +1389,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
@@ -1358,6 +1390,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
if (exclusive_access_manager_->HandleUserKeyEvent(event))
return content::KeyboardEventProcessingResult::HANDLED;
@@ -141,7 +141,7 @@ index 8e86697ca27ec..7d2dd1dd23c24 100644
return window()->PreHandleKeyboardEvent(event);
}
@@ -1364,8 +1404,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
@@ -1365,8 +1405,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
const NativeWebKeyboardEvent& event) {
DevToolsWindow* devtools_window =
DevToolsWindow::GetInstanceForInspectedWebContents(source);
@@ -162,7 +162,7 @@ index 8e86697ca27ec..7d2dd1dd23c24 100644
}
bool Browser::TabsNeedBeforeUnloadFired() {
@@ -1568,6 +1618,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source,
@@ -1574,6 +1624,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source,
return window->OpenURLFromTab(source, params);
}
@@ -177,7 +177,7 @@ index 8e86697ca27ec..7d2dd1dd23c24 100644
NavigateParams nav_params(this, params.url, params.transition);
nav_params.FillNavigateParamsFromOpenURLParams(params);
nav_params.source_contents = source;
@@ -1725,6 +1783,8 @@ void Browser::LoadingStateChanged(WebContents* source,
@@ -1729,6 +1787,8 @@ void Browser::LoadingStateChanged(WebContents* source,
bool should_show_loading_ui) {
ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD);
UpdateWindowForLoadingStateChanged(source, should_show_loading_ui);
@@ -186,7 +186,7 @@ index 8e86697ca27ec..7d2dd1dd23c24 100644
}
void Browser::CloseContents(WebContents* source) {
@@ -1752,6 +1812,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
@@ -1756,6 +1816,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
}
void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
@@ -195,7 +195,7 @@ index 8e86697ca27ec..7d2dd1dd23c24 100644
if (!GetStatusBubble())
return;
@@ -1759,6 +1821,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
@@ -1763,6 +1825,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
GetStatusBubble()->SetURL(url);
}
@@ -213,7 +213,7 @@ index 8e86697ca27ec..7d2dd1dd23c24 100644
void Browser::ContentsMouseEvent(WebContents* source,
bool motion,
bool exited) {
@@ -1783,6 +1856,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
@@ -1787,6 +1860,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
return false;
}
@@ -233,7 +233,7 @@ index 8e86697ca27ec..7d2dd1dd23c24 100644
void Browser::BeforeUnloadFired(WebContents* web_contents,
bool proceed,
bool* proceed_to_fire_unload) {
@@ -1875,6 +1961,10 @@ void Browser::WebContentsCreated(WebContents* source_contents,
@@ -1879,6 +1965,10 @@ void Browser::WebContentsCreated(WebContents* source_contents,
// Make the tab show up in the task manager.
task_manager::WebContentsTags::CreateForTabContents(new_contents);
@@ -244,7 +244,7 @@ index 8e86697ca27ec..7d2dd1dd23c24 100644
}
void Browser::PortalWebContentsCreated(WebContents* portal_web_contents) {
@@ -1986,11 +2076,15 @@ void Browser::EnterFullscreenModeForTab(
@@ -1990,11 +2080,15 @@ void Browser::EnterFullscreenModeForTab(
const blink::mojom::FullscreenOptions& options) {
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
requesting_frame, options.display_id);
@@ -260,7 +260,7 @@ index 8e86697ca27ec..7d2dd1dd23c24 100644
}
bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) {
@@ -2192,6 +2286,15 @@ void Browser::RequestMediaAccessPermission(
@@ -2188,6 +2282,15 @@ void Browser::RequestMediaAccessPermission(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
content::MediaResponseCallback callback) {
@@ -276,7 +276,7 @@ index 8e86697ca27ec..7d2dd1dd23c24 100644
const extensions::Extension* extension =
GetExtensionForOrigin(profile_, request.security_origin);
MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
@@ -2732,13 +2835,20 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
@@ -2724,13 +2827,20 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
// Browser, Getters for UI (private):
StatusBubble* Browser::GetStatusBubble() {
@@ -298,7 +298,7 @@ index 8e86697ca27ec..7d2dd1dd23c24 100644
return window_ ? window_->GetStatusBubble() : nullptr;
}
@@ -2872,6 +2982,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
@@ -2862,6 +2972,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this);
web_contents_collection_.StopObserving(web_contents);
}
@@ -308,7 +308,7 @@ index 8e86697ca27ec..7d2dd1dd23c24 100644
void Browser::TabDetachedAtImpl(content::WebContents* contents,
diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h
index b8c8af5f2bace..6a0bbc591ab78 100644
index 10105dd979aa4..9277cd507ae8e 100644
--- chrome/browser/ui/browser.h
+++ chrome/browser/ui/browser.h
@@ -22,6 +22,7 @@
@@ -319,7 +319,7 @@ index b8c8af5f2bace..6a0bbc591ab78 100644
#include "chrome/browser/tab_contents/web_contents_collection.h"
#include "chrome/browser/themes/theme_service_observer.h"
#include "chrome/browser/ui/bookmarks/bookmark_bar.h"
@@ -49,6 +50,10 @@
@@ -48,6 +49,10 @@
#include "ui/gfx/geometry/rect.h"
#include "ui/shell_dialogs/select_file_dialog.h"
@@ -330,7 +330,7 @@ index b8c8af5f2bace..6a0bbc591ab78 100644
#if BUILDFLAG(IS_ANDROID)
#error This file should only be included on desktop.
#endif
@@ -324,6 +329,11 @@ class Browser : public TabStripModelObserver,
@@ -315,6 +320,11 @@ class Browser : public TabStripModelObserver,
double initial_aspect_ratio = 1.0;
bool lock_aspect_ratio = false;
@@ -342,7 +342,7 @@ index b8c8af5f2bace..6a0bbc591ab78 100644
private:
friend class Browser;
friend class WindowSizerChromeOSTest;
@@ -399,6 +409,13 @@ class Browser : public TabStripModelObserver,
@@ -390,6 +400,13 @@ class Browser : public TabStripModelObserver,
force_skip_warning_user_on_close_ = force_skip_warning_user_on_close;
}
@@ -356,7 +356,7 @@ index b8c8af5f2bace..6a0bbc591ab78 100644
// Accessors ////////////////////////////////////////////////////////////////
const CreateParams& create_params() const { return create_params_; }
@@ -472,6 +489,12 @@ class Browser : public TabStripModelObserver,
@@ -463,6 +480,12 @@ class Browser : public TabStripModelObserver,
base::WeakPtr<Browser> AsWeakPtr();
@@ -369,7 +369,7 @@ index b8c8af5f2bace..6a0bbc591ab78 100644
// Get the FindBarController for this browser, creating it if it does not
// yet exist.
FindBarController* GetFindBarController();
@@ -848,11 +871,19 @@ class Browser : public TabStripModelObserver,
@@ -839,11 +862,19 @@ class Browser : public TabStripModelObserver,
void SetContentsBounds(content::WebContents* source,
const gfx::Rect& bounds) override;
void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
@@ -389,7 +389,7 @@ index b8c8af5f2bace..6a0bbc591ab78 100644
void BeforeUnloadFired(content::WebContents* source,
bool proceed,
bool* proceed_to_fire_unload) override;
@@ -1256,6 +1287,8 @@ class Browser : public TabStripModelObserver,
@@ -1248,6 +1279,8 @@ class Browser : public TabStripModelObserver,
const std::string initial_workspace_;
bool initial_visible_on_all_workspaces_state_;
@@ -398,7 +398,7 @@ index b8c8af5f2bace..6a0bbc591ab78 100644
CreationSource creation_source_ = CreationSource::kUnknown;
UnloadController unload_controller_;
@@ -1320,6 +1353,10 @@ class Browser : public TabStripModelObserver,
@@ -1312,6 +1345,10 @@ class Browser : public TabStripModelObserver,
extension_browser_window_helper_;
#endif
@@ -410,10 +410,10 @@ index b8c8af5f2bace..6a0bbc591ab78 100644
// The opener browser of the document picture-in-picture browser. Null if the
diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc
index baf326245646a..1b631e80ac3f0 100644
index dda3f5ba7f9a3..67b0eaaddfd3b 100644
--- chrome/browser/ui/browser_navigator.cc
+++ chrome/browser/ui/browser_navigator.cc
@@ -554,6 +554,13 @@ std::unique_ptr<content::WebContents> CreateTargetContents(
@@ -534,6 +534,13 @@ std::unique_ptr<content::WebContents> CreateTargetContents(
std::unique_ptr<WebContents> target_contents =
WebContents::Create(create_params);
@@ -428,10 +428,10 @@ index baf326245646a..1b631e80ac3f0 100644
// tab helpers, so the entire set of tab helpers needs to be set up
// immediately.
diff --git chrome/browser/ui/browser_tabstrip.cc chrome/browser/ui/browser_tabstrip.cc
index 535d038f7023b..f861a0f37bf85 100644
index a3dbf97b6f943..799a64e17fca5 100644
--- chrome/browser/ui/browser_tabstrip.cc
+++ chrome/browser/ui/browser_tabstrip.cc
@@ -32,9 +32,13 @@ void AddTabAt(Browser* browser,
@@ -33,9 +33,13 @@ void AddTabAt(Browser* browser,
// Time new tab page creation time. We keep track of the timing data in
// WebContents, but we want to include the time it takes to create the
// WebContents object too.
@@ -446,7 +446,7 @@ index 535d038f7023b..f861a0f37bf85 100644
params.disposition = foreground ? WindowOpenDisposition::NEW_FOREGROUND_TAB
: WindowOpenDisposition::NEW_BACKGROUND_TAB;
params.tabstrip_index = idx;
@@ -70,6 +74,16 @@ void AddWebContents(Browser* browser,
@@ -71,6 +75,16 @@ void AddWebContents(Browser* browser,
// Can't create a new contents for the current tab - invalid case.
DCHECK(disposition != WindowOpenDisposition::CURRENT_TAB);

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/content_settings/host_content_settings_map_factory.cc chrome/browser/content_settings/host_content_settings_map_factory.cc
index 9a405503f15bd..7edad568f1bb4 100644
index c8a0156b69cc3..6a6fac072143d 100644
--- chrome/browser/content_settings/host_content_settings_map_factory.cc
+++ chrome/browser/content_settings/host_content_settings_map_factory.cc
@@ -9,6 +9,7 @@
@@ -10,7 +10,7 @@ index 9a405503f15bd..7edad568f1bb4 100644
#include "chrome/browser/content_settings/one_time_geolocation_permission_provider.h"
#include "chrome/browser/permissions/last_tab_standing_tracker_factory.h"
#include "chrome/browser/profiles/off_the_record_profile_impl.h"
@@ -23,6 +24,10 @@
@@ -22,6 +23,10 @@
#include "extensions/buildflags/buildflags.h"
#include "ui/webui/webui_allowlist_provider.h"
@@ -21,7 +21,7 @@ index 9a405503f15bd..7edad568f1bb4 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "base/trace_event/trace_event.h"
#include "extensions/browser/api/content_settings/content_settings_custom_extension_provider.h"
@@ -62,7 +67,13 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory()
@@ -61,7 +66,13 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory()
DependsOn(TemplateURLServiceFactory::GetInstance());
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -35,7 +35,7 @@ index 9a405503f15bd..7edad568f1bb4 100644
#endif
// Used by way of ShouldRestoreOldSessionCookies().
#if BUILDFLAG(ENABLE_SESSION_SERVICE)
@@ -136,6 +147,9 @@ scoped_refptr<RefcountedKeyedService>
@@ -135,6 +146,9 @@ scoped_refptr<RefcountedKeyedService>
}
#if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -45,7 +45,7 @@ index 9a405503f15bd..7edad568f1bb4 100644
// These must be registered before before the HostSettings are passed over to
// the IOThread. Simplest to do this on construction.
settings_map->RegisterProvider(
@@ -148,6 +162,9 @@ scoped_refptr<RefcountedKeyedService>
@@ -147,6 +161,9 @@ scoped_refptr<RefcountedKeyedService>
// the case where profile->IsOffTheRecord() is true? And what is the
// interaction with profile->IsGuestSession()?
false));
@@ -54,7 +54,7 @@ index 9a405503f15bd..7edad568f1bb4 100644
+#endif
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
supervised_user::SupervisedUserSettingsService* supervised_service =
SupervisedUserSettingsService* supervised_service =
diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc
index c65b17d8ee9e2..1c6e91858ba9e 100644
--- components/content_settings/renderer/content_settings_agent_impl.cc

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/renderer_context_menu/render_view_context_menu.cc chrome/browser/renderer_context_menu/render_view_context_menu.cc
index a56e3f1fb8e08..d1b230cd66c63 100644
index 320f0cbcd14f9..b199f7a33e6d1 100644
--- chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -315,6 +315,13 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() {
@@ -313,6 +313,13 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() {
return callback.get();
}
@@ -16,7 +16,7 @@ index a56e3f1fb8e08..d1b230cd66c63 100644
enum class UmaEnumIdLookupType {
GeneralEnumId,
ContextSpecificEnumId,
@@ -561,6 +568,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) {
@@ -555,6 +562,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) {
if (ContextMenuMatcher::IsExtensionsCustomCommandId(id))
return 1;
@@ -27,7 +27,7 @@ index a56e3f1fb8e08..d1b230cd66c63 100644
id = CollapseCommandsForUMA(id);
const auto& map = GetIdcToUmaMap(type);
auto it = map.find(id);
@@ -774,6 +785,14 @@ RenderViewContextMenu::RenderViewContextMenu(
@@ -756,6 +767,14 @@ RenderViewContextMenu::RenderViewContextMenu(
#if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
pdf_ocr_submenu_model_ = std::make_unique<ui::SimpleMenuModel>(this);
#endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
@@ -42,7 +42,7 @@ index a56e3f1fb8e08..d1b230cd66c63 100644
}
RenderViewContextMenu::~RenderViewContextMenu() = default;
@@ -1187,6 +1206,12 @@ void RenderViewContextMenu::InitMenu() {
@@ -1170,6 +1189,12 @@ void RenderViewContextMenu::InitMenu() {
// menu, meaning that each menu item added/removed in this function will cause
// it to visibly jump on the screen (see b/173569669).
AppendQuickAnswersItems();
@@ -55,7 +55,7 @@ index a56e3f1fb8e08..d1b230cd66c63 100644
}
Profile* RenderViewContextMenu::GetProfile() const {
@@ -3128,6 +3153,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting(
@@ -3050,6 +3075,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting(
execute_plugin_action_callback_ = std::move(cb);
}
@@ -69,7 +69,7 @@ index a56e3f1fb8e08..d1b230cd66c63 100644
RenderViewContextMenu::GetHandlersForLinkUrl() {
custom_handlers::ProtocolHandlerRegistry::ProtocolHandlerList handlers =
diff --git chrome/browser/renderer_context_menu/render_view_context_menu.h chrome/browser/renderer_context_menu/render_view_context_menu.h
index dfafe093f5ec6..8af3aff4f8958 100644
index f0c2e640e7373..5bf9f35335878 100644
--- chrome/browser/renderer_context_menu/render_view_context_menu.h
+++ chrome/browser/renderer_context_menu/render_view_context_menu.h
@@ -139,6 +139,12 @@ class RenderViewContextMenu
@@ -85,7 +85,7 @@ index dfafe093f5ec6..8af3aff4f8958 100644
protected:
Profile* GetProfile() const;
@@ -384,6 +390,9 @@ class RenderViewContextMenu
@@ -386,6 +392,9 @@ class RenderViewContextMenu
// built.
bool is_protocol_submenu_valid_ = false;
@@ -110,7 +110,7 @@ index ab018dd1ce675..1d80631a0c2ec 100644
// that Ctrl+C, Ctrl+V, Ctrl+X, Ctrl-A, etc do what they normally do.
switch (command_id) {
diff --git components/renderer_context_menu/render_view_context_menu_base.cc components/renderer_context_menu/render_view_context_menu_base.cc
index 965a283dea477..74c1ee8258485 100644
index 62142213ca3e9..f2187cadb6cdf 100644
--- components/renderer_context_menu/render_view_context_menu_base.cc
+++ components/renderer_context_menu/render_view_context_menu_base.cc
@@ -382,6 +382,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const {
@@ -132,10 +132,10 @@ index 965a283dea477..74c1ee8258485 100644
command_executed_ = true;
RecordUsedItem(id);
diff --git components/renderer_context_menu/render_view_context_menu_base.h components/renderer_context_menu/render_view_context_menu_base.h
index ee6e005771119..91b5867cd16bf 100644
index 8a555391c8712..3c54143ba61c3 100644
--- components/renderer_context_menu/render_view_context_menu_base.h
+++ components/renderer_context_menu/render_view_context_menu_base.h
@@ -87,6 +87,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate,
@@ -86,6 +86,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate,
const ui::SimpleMenuModel& menu_model() const { return menu_model_; }
const content::ContextMenuParams& params() const { return params_; }
@@ -145,7 +145,7 @@ index ee6e005771119..91b5867cd16bf 100644
// Returns true if the specified command id is known and valid for
// this menu. If the command is known |enabled| is set to indicate
@@ -95,6 +98,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate,
@@ -94,6 +97,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate,
// SimpleMenuModel::Delegate implementation.
bool IsCommandIdChecked(int command_id) const override;

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/file_select_helper.cc chrome/browser/file_select_helper.cc
index 3f7a0625e997f..d0e5a1a05af4b 100644
index 24b1b799392ce..be2d605ab8907 100644
--- chrome/browser/file_select_helper.cc
+++ chrome/browser/file_select_helper.cc
@@ -20,6 +20,7 @@
@@ -8,9 +8,9 @@ index 3f7a0625e997f..d0e5a1a05af4b 100644
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/connectors/common.h"
#include "chrome/browser/platform_util.h"
@@ -254,6 +255,13 @@ void FileSelectHelper::OnListFile(
#include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager.h"
#include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager_factory.h"
@@ -257,6 +258,13 @@ void FileSelectHelper::OnListFile(
void FileSelectHelper::LaunchConfirmationDialog(
const base::FilePath& path,
std::vector<ui::SelectedFileInfo> selected_files) {
@@ -24,7 +24,7 @@ index 3f7a0625e997f..d0e5a1a05af4b 100644
ShowFolderUploadConfirmationDialog(
path,
base::BindOnce(&FileSelectHelper::ConvertToFileChooserFileInfoList, this),
@@ -338,6 +346,12 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded(
@@ -341,6 +349,12 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded(
if (AbortIfWebContentsDestroyed())
return;
@@ -37,7 +37,7 @@ index 3f7a0625e997f..d0e5a1a05af4b 100644
#if BUILDFLAG(FULL_SAFE_BROWSING)
enterprise_connectors::ContentAnalysisDelegate::Data data;
if (enterprise_connectors::ContentAnalysisDelegate::IsEnabled(
@@ -526,7 +540,8 @@ bool FileSelectHelper::IsDirectoryEnumerationStartedForTesting() {
@@ -529,7 +543,8 @@ bool FileSelectHelper::IsDirectoryEnumerationStartedForTesting() {
std::unique_ptr<ui::SelectFileDialog::FileTypeInfo>
FileSelectHelper::GetFileTypesFromAcceptType(
@@ -47,7 +47,7 @@ index 3f7a0625e997f..d0e5a1a05af4b 100644
auto base_file_type = std::make_unique<ui::SelectFileDialog::FileTypeInfo>();
if (accept_types.empty())
return base_file_type;
@@ -539,17 +554,24 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -542,17 +557,24 @@ FileSelectHelper::GetFileTypesFromAcceptType(
std::vector<base::FilePath::StringType>* extensions =
&file_type->extensions.back();
@@ -73,7 +73,7 @@ index 3f7a0625e997f..d0e5a1a05af4b 100644
} else {
if (!base::IsStringASCII(accept_type))
continue;
@@ -560,10 +582,18 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -563,10 +585,18 @@ FileSelectHelper::GetFileTypesFromAcceptType(
description_id = IDS_AUDIO_FILES;
else if (ascii_type == "video/*")
description_id = IDS_VIDEO_FILES;
@@ -94,7 +94,7 @@ index 3f7a0625e997f..d0e5a1a05af4b 100644
if (extensions->size() > old_extension_size)
valid_type_count++;
}
@@ -588,6 +618,15 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -591,6 +621,15 @@ FileSelectHelper::GetFileTypesFromAcceptType(
l10n_util::GetStringUTF16(description_id));
}
@@ -110,7 +110,7 @@ index 3f7a0625e997f..d0e5a1a05af4b 100644
return file_type;
}
@@ -595,7 +634,8 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -598,7 +637,8 @@ FileSelectHelper::GetFileTypesFromAcceptType(
void FileSelectHelper::RunFileChooser(
content::RenderFrameHost* render_frame_host,
scoped_refptr<content::FileSelectListener> listener,
@@ -120,7 +120,7 @@ index 3f7a0625e997f..d0e5a1a05af4b 100644
Profile* profile = Profile::FromBrowserContext(
render_frame_host->GetProcess()->GetBrowserContext());
@@ -614,6 +654,7 @@ void FileSelectHelper::RunFileChooser(
@@ -617,6 +657,7 @@ void FileSelectHelper::RunFileChooser(
// message.
scoped_refptr<FileSelectHelper> file_select_helper(
new FileSelectHelper(profile));
@@ -128,7 +128,7 @@ index 3f7a0625e997f..d0e5a1a05af4b 100644
file_select_helper->RunFileChooser(render_frame_host, std::move(listener),
params.Clone());
}
@@ -667,7 +708,8 @@ void FileSelectHelper::RunFileChooser(
@@ -670,7 +711,8 @@ void FileSelectHelper::RunFileChooser(
}
void FileSelectHelper::GetFileTypesInThreadPool(FileChooserParamsPtr params) {

View File

@@ -112,7 +112,7 @@ index 51ed6bcf6b540..9ae4737e0737e 100644
virtual gfx::Point GetDialogPosition(const gfx::Size& size) = 0;
// Returns whether a dialog currently about to be shown should be activated.
diff --git ui/views/window/dialog_delegate.cc ui/views/window/dialog_delegate.cc
index dfd41ce139940..b695144ceaf48 100644
index fca1500246f01..e0c719b90f5da 100644
--- ui/views/window/dialog_delegate.cc
+++ ui/views/window/dialog_delegate.cc
@@ -54,10 +54,12 @@ DialogDelegate::DialogDelegate() {

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/extensions/api/chrome_extensions_api_client.cc chrome/browser/extensions/api/chrome_extensions_api_client.cc
index cc2cce154cbbf..4298bd8ab3f1c 100644
index e49e111d2e867..83f3c9221fa1e 100644
--- chrome/browser/extensions/api/chrome_extensions_api_client.cc
+++ chrome/browser/extensions/api/chrome_extensions_api_client.cc
@@ -13,6 +13,7 @@
@@ -10,7 +10,7 @@ index cc2cce154cbbf..4298bd8ab3f1c 100644
#include "chrome/browser/extensions/api/automation_internal/chrome_automation_internal_api_delegate.h"
#include "chrome/browser/extensions/api/chrome_device_permissions_prompt.h"
#include "chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h"
@@ -84,6 +85,10 @@
@@ -83,6 +84,10 @@
#include "chrome/browser/extensions/clipboard_extension_helper_chromeos.h"
#endif
@@ -21,7 +21,7 @@ index cc2cce154cbbf..4298bd8ab3f1c 100644
#if BUILDFLAG(ENABLE_PDF)
#include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h"
#include "components/pdf/browser/pdf_web_contents_helper.h"
@@ -306,6 +311,11 @@ ChromeExtensionsAPIClient::CreateGuestViewManagerDelegate(
@@ -305,6 +310,11 @@ ChromeExtensionsAPIClient::CreateGuestViewManagerDelegate(
std::unique_ptr<MimeHandlerViewGuestDelegate>
ChromeExtensionsAPIClient::CreateMimeHandlerViewGuestDelegate(
MimeHandlerViewGuest* guest) const {

View File

@@ -100,7 +100,7 @@ index 5e3e2bd6f1e69..4594213db914f 100644
delegates.media_stream_device_enumerator =
MediaCaptureDevicesDispatcher::GetInstance();
diff --git chrome/browser/storage/durable_storage_permission_context.cc chrome/browser/storage/durable_storage_permission_context.cc
index c96408b160973..8bda825517235 100644
index 9836207f50e5b..09d8f5549820c 100644
--- chrome/browser/storage/durable_storage_permission_context.cc
+++ chrome/browser/storage/durable_storage_permission_context.cc
@@ -8,6 +8,7 @@
@@ -111,7 +111,7 @@ index c96408b160973..8bda825517235 100644
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
@@ -56,7 +57,9 @@ void DurableStoragePermissionContext::DecidePermission(
@@ -55,7 +56,9 @@ void DurableStoragePermissionContext::DecidePermission(
// Durable is only allowed to be granted to the top-level origin. Embedding
// origin is the last committed navigation origin to the web contents.

View File

@@ -44,10 +44,10 @@ index caa20ec03434a..2a3ca921445c1 100644
avatar_toolbar_button, GetBrowser().profile(), type);
DCHECK_EQ(nullptr, bubble_tracker_.view());
diff --git chrome/browser/ui/views/profiles/incognito_menu_view.cc chrome/browser/ui/views/profiles/incognito_menu_view.cc
index f5f266328283d..672609d94d1b7 100644
index 723920ef96f9a..cb3cbbd18a957 100644
--- chrome/browser/ui/views/profiles/incognito_menu_view.cc
+++ chrome/browser/ui/views/profiles/incognito_menu_view.cc
@@ -36,7 +36,9 @@
@@ -37,7 +37,9 @@
IncognitoMenuView::IncognitoMenuView(views::Button* anchor_button,
Browser* browser)
: ProfileMenuViewBase(anchor_button, browser) {

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/profiles/off_the_record_profile_impl.cc chrome/browser/profiles/off_the_record_profile_impl.cc
index 43431d7a42fe5..a440d7732f7dd 100644
index 45357cf77c472..c5a4104a3414f 100644
--- chrome/browser/profiles/off_the_record_profile_impl.cc
+++ chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -659,7 +659,9 @@ std::unique_ptr<Profile> Profile::CreateOffTheRecordProfile(
@@ -656,7 +656,9 @@ std::unique_ptr<Profile> Profile::CreateOffTheRecordProfile(
#endif
if (!profile)
profile = std::make_unique<OffTheRecordProfileImpl>(parent, otr_profile_id);
@@ -84,10 +84,10 @@ index 1e6a22d95a53f..6ec4182bfc5e7 100644
// Returns whether the user has signed in this profile to an account.
diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc
index 6836199037155..5e0ad06d62fe9 100644
index 1340e751c0381..a0875155ddad2 100644
--- chrome/browser/profiles/profile_impl.cc
+++ chrome/browser/profiles/profile_impl.cc
@@ -1018,7 +1018,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id,
@@ -1013,7 +1013,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id,
otr_profiles_[otr_profile_id] = std::move(otr_profile);
@@ -99,10 +99,10 @@ index 6836199037155..5e0ad06d62fe9 100644
return raw_otr_profile;
}
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
index 145d5d837ae86..6eeb39eddc79b 100644
index 4f6dd066df3de..4d04f0ad554df 100644
--- chrome/browser/profiles/profile_manager.cc
+++ chrome/browser/profiles/profile_manager.cc
@@ -385,7 +385,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
@@ -381,7 +381,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
base::Unretained(this)));
#endif

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn
index 038a280213b6a..f823d021afa1e 100644
index da80c70f42a61..31441ecc1ee83 100644
--- chrome/browser/safe_browsing/BUILD.gn
+++ chrome/browser/safe_browsing/BUILD.gn
@@ -32,6 +32,7 @@ static_library("safe_browsing") {
@@ -30,6 +30,7 @@ static_library("safe_browsing") {
"//components/browser_sync",
"//components/enterprise:enterprise",
"//components/enterprise/common:strings",

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc
index cb9253cf1ab6a..b46c6b92a30ce 100644
index f59ecb8fa3246..bb55ea9d91a73 100644
--- chrome/browser/plugins/plugin_info_host_impl.cc
+++ chrome/browser/plugins/plugin_info_host_impl.cc
@@ -140,6 +140,10 @@ bool IsPluginLoadingAccessibleResourceInWebView(
@@ -142,6 +142,10 @@ bool IsPluginLoadingAccessibleResourceInWebView(
extensions::ExtensionRegistry* extension_registry,
int process_id,
const GURL& resource) {
@@ -42,10 +42,10 @@ index 8b3f569882aeb..afc8007a6228b 100644
const extensions::Extension* extension =
registry->enabled_extensions().GetByID(extension_id);
diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc
index a91227b208c16..d89e3d6ba0ad7 100644
index eab276d6ebe23..aa6ca12d1b8bc 100644
--- chrome/renderer/chrome_content_renderer_client.cc
+++ chrome/renderer/chrome_content_renderer_client.cc
@@ -983,6 +983,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -971,6 +971,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
if ((status == chrome::mojom::PluginStatus::kUnauthorized ||
status == chrome::mojom::PluginStatus::kBlocked) &&
@@ -53,7 +53,7 @@ index a91227b208c16..d89e3d6ba0ad7 100644
content_settings_agent_delegate->IsPluginTemporarilyAllowed(
identifier)) {
status = chrome::mojom::PluginStatus::kAllowed;
@@ -1150,7 +1151,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1138,7 +1139,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
plugin_auth_host.BindNewEndpointAndPassReceiver());
plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier);
@@ -63,7 +63,7 @@ index a91227b208c16..d89e3d6ba0ad7 100644
break;
}
case chrome::mojom::PluginStatus::kBlocked: {
@@ -1159,7 +1161,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1147,7 +1149,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
placeholder->AllowLoading();
RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked"));
@@ -73,7 +73,7 @@ index a91227b208c16..d89e3d6ba0ad7 100644
break;
}
case chrome::mojom::PluginStatus::kBlockedByPolicy: {
@@ -1169,7 +1172,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1157,7 +1160,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
group_name));
RenderThread::Get()->RecordAction(
UserMetricsAction("Plugin_BlockedByPolicy"));
@@ -105,7 +105,7 @@ index ad5f1925735fd..a871f4a7792a7 100644
BrowserPluginEmbedder(const BrowserPluginEmbedder&) = delete;
BrowserPluginEmbedder& operator=(const BrowserPluginEmbedder&) = delete;
diff --git content/browser/browser_plugin/browser_plugin_guest.cc content/browser/browser_plugin/browser_plugin_guest.cc
index a7501a57c5149..1c148767f67a6 100644
index a731c5ef5b714..99e313b92c242 100644
--- content/browser/browser_plugin/browser_plugin_guest.cc
+++ content/browser/browser_plugin/browser_plugin_guest.cc
@@ -80,6 +80,8 @@ void BrowserPluginGuest::InitInternal(WebContentsImpl* owner_web_contents) {
@@ -118,19 +118,19 @@ index a7501a57c5149..1c148767f67a6 100644
BrowserPluginGuest::~BrowserPluginGuest() = default;
diff --git content/browser/browser_plugin/browser_plugin_guest.h content/browser/browser_plugin/browser_plugin_guest.h
index 17e98b60e8f7e..41f05cdd88d40 100644
index aec6a0eb9cbd0..286e7de6887a7 100644
--- content/browser/browser_plugin/browser_plugin_guest.h
+++ content/browser/browser_plugin/browser_plugin_guest.h
@@ -70,6 +70,8 @@ class BrowserPluginGuest : public WebContentsObserver {
@@ -68,6 +68,8 @@ class BrowserPluginGuest : public WebContentsObserver {
WebContentsImpl* GetWebContents() const;
RenderFrameHostImpl* GetProspectiveOuterDocument();
+ WebContentsImpl* owner_web_contents() const { return owner_web_contents_; }
+
private:
// BrowserPluginGuest is a WebContentsObserver of |web_contents| and
// |web_contents| has to stay valid for the lifetime of BrowserPluginGuest.
@@ -79,6 +81,8 @@ class BrowserPluginGuest : public WebContentsObserver {
@@ -77,6 +79,8 @@ class BrowserPluginGuest : public WebContentsObserver {
void InitInternal(WebContentsImpl* owner_web_contents);
const raw_ptr<BrowserPluginGuestDelegate, DanglingUntriaged> delegate_;

View File

@@ -1,5 +1,5 @@
diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn
index 53733390bf73d..215112f3f5723 100644
index 6a646ba3e1975..8849ea7e53996 100644
--- chrome/renderer/BUILD.gn
+++ chrome/renderer/BUILD.gn
@@ -5,6 +5,7 @@
@@ -10,7 +10,7 @@ index 53733390bf73d..215112f3f5723 100644
import("//chrome/common/features.gni")
import("//components/nacl/features.gni")
import("//components/offline_pages/buildflags/features.gni")
@@ -122,6 +123,7 @@ static_library("renderer") {
@@ -124,6 +125,7 @@ static_library("renderer") {
deps = [
"//base/allocator:buildflags",
"//build:chromeos_buildflags",
@@ -18,7 +18,7 @@ index 53733390bf73d..215112f3f5723 100644
"//chrome:resources",
"//chrome:strings",
"//chrome/common",
@@ -220,6 +222,10 @@ static_library("renderer") {
@@ -221,6 +223,10 @@ static_library("renderer") {
configs += [ "//build/config/compiler:wexit_time_destructors" ]

View File

@@ -1,5 +1,5 @@
diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc
index 18b59a7014ea2..82f2fd1b32897 100644
index 6ecb3aeadd6e3..cdeca82d8bfe6 100644
--- chrome/app/chrome_main_delegate.cc
+++ chrome/app/chrome_main_delegate.cc
@@ -39,6 +39,7 @@
@@ -10,7 +10,7 @@ index 18b59a7014ea2..82f2fd1b32897 100644
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/chrome_resource_bundle_helper.h"
#include "chrome/browser/defaults.h"
@@ -503,6 +504,8 @@ struct MainFunction {
@@ -527,6 +528,8 @@ struct MainFunction {
// Initializes the user data dir. Must be called before InitializeLocalState().
void InitializeUserDataDir(base::CommandLine* command_line) {
@@ -19,7 +19,7 @@ index 18b59a7014ea2..82f2fd1b32897 100644
#if BUILDFLAG(IS_WIN)
// Reach out to chrome_elf for the truth on the user data directory.
// Note that in tests, this links to chrome_elf_test_stubs.
@@ -652,6 +655,10 @@ ChromeMainDelegate::~ChromeMainDelegate() {
@@ -676,6 +679,10 @@ ChromeMainDelegate::~ChromeMainDelegate() {
ChromeMainDelegate::~ChromeMainDelegate() = default;
#endif // !BUILDFLAG(IS_ANDROID)
@@ -30,17 +30,17 @@ index 18b59a7014ea2..82f2fd1b32897 100644
absl::optional<int> ChromeMainDelegate::PostEarlyInitialization(
InvokedIn invoked_in) {
DCHECK(base::ThreadPoolInstance::Get());
@@ -857,7 +864,8 @@ absl::optional<int> ChromeMainDelegate::PostEarlyInitialization(
@@ -959,7 +966,9 @@ void ChromeMainDelegate::CommonEarlyInitialization() {
}
if (base::FeatureList::IsEnabled(
features::kWriteBasicSystemProfileToPersistentHistogramsFile)) {
- bool record = true;
+ // Avoid CEF crash with multi-threaded-message-loop.
+ bool record = !cef::IsChromeRuntimeEnabled();
#if BUILDFLAG(IS_ANDROID)
record =
base::FeatureList::IsEnabled(chrome::android::kUmaBackgroundSessions);
@@ -1310,6 +1318,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
#if BUILDFLAG(IS_WIN)
+ if (!cef::IsChromeRuntimeEnabled()) {
SetUpExtendedCrashReporting(is_browser_process);
+ }
base::sequence_manager::internal::ThreadControllerPowerMonitor::
InitializeOnMainThread();
base::InitializePlatformThreadFeatures();
@@ -1324,6 +1333,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
@@ -48,7 +48,7 @@ index 18b59a7014ea2..82f2fd1b32897 100644
crash_reporter::InitializeCrashKeys();
#if BUILDFLAG(IS_POSIX)
@@ -1320,6 +1329,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1334,6 +1344,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
InitMacCrashReporter(command_line, process_type);
SetUpInstallerPreferences(command_line);
#endif
@@ -56,7 +56,7 @@ index 18b59a7014ea2..82f2fd1b32897 100644
#if BUILDFLAG(IS_WIN)
child_process_logging::Init();
@@ -1514,6 +1524,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1528,6 +1539,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
}
@@ -64,7 +64,7 @@ index 18b59a7014ea2..82f2fd1b32897 100644
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
// Zygote needs to call InitCrashReporter() in RunZygote().
if (process_type != switches::kZygoteProcess) {
@@ -1557,6 +1568,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1571,6 +1583,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
// After all the platform Breakpads have been initialized, store the command
// line for crash reporting.
crash_keys::SetCrashKeysFromCommandLine(command_line);
@@ -72,7 +72,7 @@ index 18b59a7014ea2..82f2fd1b32897 100644
#if BUILDFLAG(ENABLE_PDF)
MaybePatchGdiGetFontData();
@@ -1680,6 +1692,7 @@ void ChromeMainDelegate::ZygoteForked() {
@@ -1672,6 +1685,7 @@ void ChromeMainDelegate::ZygoteForked() {
SetUpProfilingShutdownHandler();
}
@@ -80,7 +80,7 @@ index 18b59a7014ea2..82f2fd1b32897 100644
// Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets
// this up for the browser process in a different manner.
const base::CommandLine* command_line =
@@ -1702,6 +1715,7 @@ void ChromeMainDelegate::ZygoteForked() {
@@ -1694,6 +1708,7 @@ void ChromeMainDelegate::ZygoteForked() {
// Reset the command line for the newly spawned process.
crash_keys::SetCrashKeysFromCommandLine(*command_line);
@@ -102,7 +102,7 @@ index bfafb0a895b0f..f42ebc52d4a1a 100644
// content::ContentMainDelegate:
absl::optional<int> BasicStartupComplete() override;
diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc
index b05ce3c764ddd..92be5fda315cf 100644
index a09033cda2e09..df8f48d6d0403 100644
--- chrome/browser/chrome_browser_main.cc
+++ chrome/browser/chrome_browser_main.cc
@@ -51,6 +51,7 @@
@@ -113,7 +113,7 @@ index b05ce3c764ddd..92be5fda315cf 100644
#include "chrome/browser/about_flags.h"
#include "chrome/browser/active_use_util.h"
#include "chrome/browser/after_startup_task_utils.h"
@@ -1475,7 +1476,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1473,7 +1474,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
}
#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
@@ -122,7 +122,7 @@ index b05ce3c764ddd..92be5fda315cf 100644
// Handle special early return paths (which couldn't be processed even earlier
// as they require the process singleton to be held) first.
@@ -1522,7 +1523,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1520,7 +1521,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
return content::RESULT_CODE_NORMAL_EXIT;
#endif // BUILDFLAG(IS_WIN)
}
@@ -131,7 +131,7 @@ index b05ce3c764ddd..92be5fda315cf 100644
#if BUILDFLAG(IS_WIN)
// Check if there is any machine level Chrome installed on the current
@@ -1577,12 +1578,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1573,12 +1574,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
browser_process_->local_state());
}
@@ -146,7 +146,7 @@ index b05ce3c764ddd..92be5fda315cf 100644
#if BUILDFLAG(IS_ANDROID)
page_info::SetPageInfoClient(new ChromePageInfoClient());
@@ -1731,6 +1734,10 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1727,6 +1730,10 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
@@ -157,7 +157,7 @@ index b05ce3c764ddd..92be5fda315cf 100644
// This step is costly and is already measured in
// Startup.StartupBrowserCreator_Start.
// See the comment above for an explanation of |process_command_line|.
@@ -1769,11 +1776,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1765,11 +1772,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
// Create the RunLoop for MainMessageLoopRun() to use and transfer
// ownership of the browser's lifetime to the BrowserProcess.
@@ -211,10 +211,10 @@ index 194833d0bae43..21564d96466c0 100644
+#endif
}
diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc
index 600dd1ab9abc4..b4bc133b4a445 100644
index 6170a5656eb83..8d4ae07b4fd58 100644
--- chrome/browser/chrome_content_browser_client.cc
+++ chrome/browser/chrome_content_browser_client.cc
@@ -37,6 +37,7 @@
@@ -36,6 +36,7 @@
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
@@ -222,7 +222,7 @@ index 600dd1ab9abc4..b4bc133b4a445 100644
#include "chrome/browser/accessibility/accessibility_labels_service.h"
#include "chrome/browser/accessibility/accessibility_labels_service_factory.h"
#include "chrome/browser/after_startup_task_utils.h"
@@ -1527,6 +1528,8 @@ void HandleStringData(
@@ -1515,6 +1516,8 @@ void HandleStringData(
} // namespace
ChromeContentBrowserClient::ChromeContentBrowserClient() {
@@ -231,7 +231,7 @@ index 600dd1ab9abc4..b4bc133b4a445 100644
#if BUILDFLAG(ENABLE_PLUGINS)
extra_parts_.push_back(new ChromeContentBrowserClientPluginsPart);
#endif
@@ -1552,6 +1555,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() {
@@ -1540,6 +1543,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() {
extra_parts_.clear();
}
@@ -243,7 +243,7 @@ index 600dd1ab9abc4..b4bc133b4a445 100644
// static
void ChromeContentBrowserClient::RegisterLocalStatePrefs(
PrefRegistrySimple* registry) {
@@ -4313,9 +4321,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
@@ -4280,9 +4288,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
&search::HandleNewTabURLReverseRewrite);
#endif // BUILDFLAG(IS_ANDROID)
@@ -255,7 +255,7 @@ index 600dd1ab9abc4..b4bc133b4a445 100644
}
base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() {
@@ -6213,7 +6223,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated(
@@ -6159,7 +6169,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated(
network_service);
}
@@ -264,7 +264,7 @@ index 600dd1ab9abc4..b4bc133b4a445 100644
content::BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -6231,6 +6241,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams(
@@ -6177,6 +6187,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams(
network_context_params->user_agent = GetUserAgentBasedOnPolicy(context);
network_context_params->accept_language = GetApplicationLocale();
}
@@ -273,7 +273,7 @@ index 600dd1ab9abc4..b4bc133b4a445 100644
}
std::vector<base::FilePath>
@@ -7137,10 +7149,10 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted(
@@ -7083,10 +7095,10 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted(
const auto now = base::TimeTicks::Now();
const auto timeout = GetKeepaliveTimerTimeout(context);
keepalive_deadline_ = std::max(keepalive_deadline_, now + timeout);
@@ -286,7 +286,7 @@ index 600dd1ab9abc4..b4bc133b4a445 100644
FROM_HERE, keepalive_deadline_ - now,
base::BindOnce(
&ChromeContentBrowserClient::OnKeepaliveTimerFired,
@@ -7159,7 +7171,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() {
@@ -7105,7 +7117,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() {
--num_keepalive_requests_;
if (num_keepalive_requests_ == 0) {
DVLOG(1) << "Stopping the keepalive timer";
@@ -296,7 +296,7 @@ index 600dd1ab9abc4..b4bc133b4a445 100644
// This deletes the keep alive handle attached to the timer function and
// unblock the shutdown sequence.
}
@@ -7295,7 +7308,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired(
@@ -7241,7 +7254,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired(
const auto now = base::TimeTicks::Now();
const auto then = keepalive_deadline_;
if (now < then) {
@@ -306,7 +306,7 @@ index 600dd1ab9abc4..b4bc133b4a445 100644
base::BindOnce(&ChromeContentBrowserClient::OnKeepaliveTimerFired,
weak_factory_.GetWeakPtr(),
diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h
index 7ecb90a89f1d7..c80ce831382db 100644
index 071a3dd11e61b..7b15b6f4abb24 100644
--- chrome/browser/chrome_content_browser_client.h
+++ chrome/browser/chrome_content_browser_client.h
@@ -121,6 +121,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
@@ -318,7 +318,7 @@ index 7ecb90a89f1d7..c80ce831382db 100644
// TODO(https://crbug.com/787567): This file is about calls from content/ out
// to chrome/ to get values or notify about events, but both of these
// functions are from chrome/ to chrome/ and don't involve content/ at all.
@@ -602,7 +604,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
@@ -601,7 +603,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
override;
void OnNetworkServiceCreated(
network::mojom::NetworkService* network_service) override;
@@ -327,7 +327,7 @@ index 7ecb90a89f1d7..c80ce831382db 100644
content::BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -966,7 +968,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
@@ -962,7 +964,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
#if !BUILDFLAG(IS_ANDROID)
uint64_t num_keepalive_requests_ = 0;
@@ -337,7 +337,7 @@ index 7ecb90a89f1d7..c80ce831382db 100644
#endif
diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc
index 3b9ce2a93d09d..049fd4e069aab 100644
index 193d174d20d45..9b8d8a6b4a051 100644
--- chrome/browser/prefs/browser_prefs.cc
+++ chrome/browser/prefs/browser_prefs.cc
@@ -11,6 +11,7 @@
@@ -348,7 +348,7 @@ index 3b9ce2a93d09d..049fd4e069aab 100644
#include "chrome/browser/about_flags.h"
#include "chrome/browser/accessibility/accessibility_labels_service.h"
#include "chrome/browser/accessibility/accessibility_ui.h"
@@ -174,6 +175,10 @@
@@ -172,6 +173,10 @@
#include "chrome/browser/background/background_mode_manager.h"
#endif
@@ -359,7 +359,7 @@ index 3b9ce2a93d09d..049fd4e069aab 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/accessibility/animation_policy_prefs.h"
#include "chrome/browser/apps/platform_apps/shortcut_manager.h"
@@ -1306,6 +1311,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
@@ -1366,6 +1371,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
// This is intentionally last.
RegisterLocalStatePrefsForMigration(registry);
@@ -371,7 +371,7 @@ index 3b9ce2a93d09d..049fd4e069aab 100644
}
// Register prefs applicable to all profiles.
@@ -1705,6 +1715,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
@@ -1761,6 +1771,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
const std::string& locale) {
RegisterProfilePrefs(registry, locale);

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc
index f91c359d9792a..9fe7a7faf33bc 100644
index 100baefb933be..4e1501387aa6c 100644
--- chrome/browser/ui/browser_command_controller.cc
+++ chrome/browser/ui/browser_command_controller.cc
@@ -389,6 +389,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
@@ -390,6 +390,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
// choose to not implement CommandUpdaterDelegate inside this class and
// therefore command_updater_ doesn't have the delegate set).
if (!SupportsCommand(id) || !IsCommandEnabled(id)) {
@@ -10,7 +10,7 @@ index f91c359d9792a..9fe7a7faf33bc 100644
return false;
}
@@ -405,6 +406,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
@@ -406,6 +407,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
DCHECK(command_updater_.IsCommandEnabled(id))
<< "Invalid/disabled command " << id;
@@ -24,7 +24,7 @@ index f91c359d9792a..9fe7a7faf33bc 100644
// The order of commands in this switch statement must match the function
// declaration order in browser.h!
switch (id) {
@@ -1042,11 +1050,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
@@ -1040,11 +1048,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
// BrowserCommandController, private:
bool BrowserCommandController::IsShowingMainUI() {
@@ -40,184 +40,8 @@ index f91c359d9792a..9fe7a7faf33bc 100644
}
bool BrowserCommandController::IsWebAppOrCustomTab() const {
diff --git chrome/browser/ui/toolbar/app_menu_model.cc chrome/browser/ui/toolbar/app_menu_model.cc
index 655ce2353f106..e9dd7ed68b9c5 100644
--- chrome/browser/ui/toolbar/app_menu_model.cc
+++ chrome/browser/ui/toolbar/app_menu_model.cc
@@ -151,6 +151,57 @@ absl::optional<std::u16string> GetInstallPWAAppMenuItemName(Browser* browser) {
ui::EscapeMenuLabelAmpersands(app_name));
}
+#if BUILDFLAG(ENABLE_CEF)
+using IsVisibleCallback = base::RepeatingCallback<bool(int)>;
+
+void FilterMenuModel(ui::SimpleMenuModel* model,
+ const IsVisibleCallback& is_visible) {
+ absl::optional<size_t> last_separator;
+ size_t visible_ct = 0;
+ for (size_t i = 0; i < model->GetItemCount(); ++i) {
+ const auto type = model->GetTypeAt(i);
+ if (type == ui::MenuModel::TYPE_SEPARATOR) {
+ if (last_separator) {
+ // Remove multiple separators in a row. Prefer to remove a NORMAL
+ // separator if possible (as compared to zoom/edit controls which use
+ // UPPER/LOWER separators).
+ if (model->GetSeparatorTypeAt(*last_separator) ==
+ ui::NORMAL_SEPARATOR) {
+ model->RemoveItemAt(*last_separator);
+ i--;
+ last_separator = i;
+ } else {
+ model->RemoveItemAt(i);
+ i--;
+ }
+ } else if (visible_ct == 0) {
+ // Remove leading separator.
+ model->RemoveItemAt(i);
+ i--;
+ } else {
+ last_separator = i;
+ }
+ visible_ct = 0;
+ } else if (is_visible.Run(model->GetCommandIdAt(i))) {
+ last_separator = absl::nullopt;
+ visible_ct++;
+
+ if (type == ui::MenuModel::TYPE_SUBMENU) {
+ // Filter sub-menu.
+ auto sub_model =
+ static_cast<ui::SimpleMenuModel*>(model->GetSubmenuModelAt(i));
+ FilterMenuModel(sub_model, is_visible);
+ }
+ }
+ }
+
+ if (last_separator) {
+ // Remove trailing separator.
+ model->RemoveItemAt(*last_separator);
+ }
+}
+#endif // BUILDFLAG(ENABLE_CEF)
+
} // namespace
////////////////////////////////////////////////////////////////////////////////
@@ -756,7 +807,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const {
return false;
}
-bool AppMenuModel::IsCommandIdEnabled(int command_id) const {
+bool AppMenuModel::IsCommandIdEnabledInternal(int command_id) const {
GlobalError* error =
GlobalErrorServiceFactory::GetForProfile(browser_->profile())
->GetGlobalErrorByMenuItemCommandID(command_id);
@@ -771,7 +822,7 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const {
}
}
-bool AppMenuModel::IsCommandIdVisible(int command_id) const {
+bool AppMenuModel::IsCommandIdVisibleInternal(int command_id) const {
switch (command_id) {
case IDC_PIN_TO_START_SCREEN:
return false;
@@ -794,6 +845,34 @@ bool AppMenuModel::IsCommandIdVisible(int command_id) const {
}
}
+bool AppMenuModel::IsCommandIdEnabled(int command_id) const {
+ if (!IsCommandIdEnabledInternal(command_id)) {
+ return false;
+ }
+
+#if BUILDFLAG(ENABLE_CEF)
+ if (browser_->cef_delegate()) {
+ return browser_->cef_delegate()->IsAppMenuItemEnabled(command_id);
+ }
+#endif
+
+ return true;
+}
+
+bool AppMenuModel::IsCommandIdVisible(int command_id) const {
+ if (!IsCommandIdVisibleInternal(command_id)) {
+ return false;
+ }
+
+#if BUILDFLAG(ENABLE_CEF)
+ if (browser_->cef_delegate()) {
+ return browser_->cef_delegate()->IsAppMenuItemVisible(command_id);
+ }
+#endif
+
+ return true;
+}
+
bool AppMenuModel::IsCommandIdAlerted(int command_id) const {
if ((command_id == IDC_RECENT_TABS_MENU) ||
(command_id == AppMenuModel::kMinRecentTabsCommandId)) {
@@ -899,9 +978,13 @@ void AppMenuModel::Build() {
bookmark_sub_menu_model_.get());
}
- AddSeparator(ui::LOWER_SEPARATOR);
- CreateZoomMenu();
- AddSeparator(ui::UPPER_SEPARATOR);
+ if (IsCommandIdVisible(IDC_ZOOM_MENU)) {
+ AddSeparator(ui::LOWER_SEPARATOR);
+ CreateZoomMenu();
+ AddSeparator(ui::UPPER_SEPARATOR);
+ } else {
+ AddSeparator(ui::NORMAL_SEPARATOR);
+ }
AddItemWithStringId(IDC_PRINT, IDS_PRINT);
@@ -965,9 +1048,14 @@ void AppMenuModel::Build() {
sub_menus_.back().get());
SetElementIdentifierAt(GetIndexOfCommandId(IDC_MORE_TOOLS_MENU).value(),
kMoreToolsMenuItem);
- AddSeparator(ui::LOWER_SEPARATOR);
- CreateCutCopyPasteMenu();
- AddSeparator(ui::UPPER_SEPARATOR);
+
+ if (IsCommandIdVisible(IDC_EDIT_MENU)) {
+ AddSeparator(ui::LOWER_SEPARATOR);
+ CreateCutCopyPasteMenu();
+ AddSeparator(ui::UPPER_SEPARATOR);
+ } else {
+ AddSeparator(ui::NORMAL_SEPARATOR);
+ }
AddItemWithStringId(IDC_OPTIONS, IDS_SETTINGS);
// The help submenu is only displayed on official Chrome builds. As the
@@ -1004,6 +1092,11 @@ void AppMenuModel::Build() {
}
#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(ENABLE_CEF)
+ FilterMenuModel(this, base::BindRepeating(&AppMenuModel::IsCommandIdVisible,
+ base::Unretained(this)));
+#endif
+
uma_action_recorded_ = false;
}
diff --git chrome/browser/ui/toolbar/app_menu_model.h chrome/browser/ui/toolbar/app_menu_model.h
index fa3ceed419c16..522671662cbdf 100644
--- chrome/browser/ui/toolbar/app_menu_model.h
+++ chrome/browser/ui/toolbar/app_menu_model.h
@@ -208,6 +208,9 @@ class AppMenuModel : public ui::SimpleMenuModel,
// Appends a zoom menu (without separators).
void CreateZoomMenu();
+ bool IsCommandIdEnabledInternal(int command_id) const;
+ bool IsCommandIdVisibleInternal(int command_id) const;
+
private:
friend class ::MockAppMenuModel;
diff --git chrome/browser/ui/views/frame/browser_frame.cc chrome/browser/ui/views/frame/browser_frame.cc
index 090ad157308b7..d0534ffb8091c 100644
index 1b8cd7a3ff295..b837a9379bd04 100644
--- chrome/browser/ui/views/frame/browser_frame.cc
+++ chrome/browser/ui/views/frame/browser_frame.cc
@@ -67,15 +67,23 @@ bool IsUsingLinuxSystemTheme(Profile* profile) {
@@ -246,7 +70,7 @@ index 090ad157308b7..d0534ffb8091c 100644
}
BrowserFrame::~BrowserFrame() {}
@@ -166,6 +174,12 @@ void BrowserFrame::LayoutWebAppWindowTitle(
@@ -147,6 +155,12 @@ gfx::Rect BrowserFrame::GetBoundsForTabStripRegion(
}
int BrowserFrame::GetTopInset() const {
@@ -259,7 +83,7 @@ index 090ad157308b7..d0534ffb8091c 100644
return browser_frame_view_->GetTopInset(false);
}
@@ -182,6 +196,8 @@ BrowserNonClientFrameView* BrowserFrame::GetFrameView() const {
@@ -163,6 +177,8 @@ BrowserNonClientFrameView* BrowserFrame::GetFrameView() const {
}
bool BrowserFrame::UseCustomFrame() const {
@@ -268,7 +92,7 @@ index 090ad157308b7..d0534ffb8091c 100644
return native_browser_frame_->UseCustomFrame();
}
@@ -195,20 +211,30 @@ bool BrowserFrame::ShouldDrawFrameHeader() const {
@@ -176,20 +192,30 @@ bool BrowserFrame::ShouldDrawFrameHeader() const {
void BrowserFrame::GetWindowPlacement(gfx::Rect* bounds,
ui::WindowShowState* show_state) const {
@@ -299,7 +123,7 @@ index 090ad157308b7..d0534ffb8091c 100644
browser_frame_view_->OnBrowserViewInitViewsComplete();
}
@@ -270,7 +296,7 @@ const ui::ThemeProvider* BrowserFrame::GetThemeProvider() const {
@@ -251,7 +277,7 @@ const ui::ThemeProvider* BrowserFrame::GetThemeProvider() const {
ui::ColorProviderManager::ThemeInitializerSupplier*
BrowserFrame::GetCustomTheme() const {
// Do not return any custom theme if the browser has to use the dark theme.
@@ -308,7 +132,7 @@ index 090ad157308b7..d0534ffb8091c 100644
return nullptr;
Browser* browser = browser_view_->browser();
@@ -287,6 +313,8 @@ BrowserFrame::GetCustomTheme() const {
@@ -268,6 +294,8 @@ BrowserFrame::GetCustomTheme() const {
}
void BrowserFrame::OnNativeWidgetWorkspaceChanged() {
@@ -317,7 +141,7 @@ index 090ad157308b7..d0534ffb8091c 100644
chrome::SaveWindowWorkspace(browser_view_->browser(), GetWorkspace());
chrome::SaveWindowVisibleOnAllWorkspaces(browser_view_->browser(),
IsVisibleOnAllWorkspaces());
@@ -374,6 +402,8 @@ void BrowserFrame::SetTabDragKind(TabDragKind tab_drag_kind) {
@@ -355,6 +383,8 @@ void BrowserFrame::SetTabDragKind(TabDragKind tab_drag_kind) {
ui::ColorProviderManager::Key BrowserFrame::GetColorProviderKey() const {
auto key = Widget::GetColorProviderKey();
@@ -326,7 +150,7 @@ index 090ad157308b7..d0534ffb8091c 100644
key.frame_type = UseCustomFrame()
? ui::ColorProviderManager::FrameType::kChromium
: ui::ColorProviderManager::FrameType::kNative;
@@ -460,5 +490,7 @@ bool BrowserFrame::RegenerateFrameOnThemeChange(
@@ -441,5 +471,7 @@ bool BrowserFrame::RegenerateFrameOnThemeChange(
}
bool BrowserFrame::ShouldUseDarkTheme() const {
@@ -335,10 +159,10 @@ index 090ad157308b7..d0534ffb8091c 100644
return browser_view_->browser()->profile()->IsIncognitoProfile();
}
diff --git chrome/browser/ui/views/frame/browser_frame.h chrome/browser/ui/views/frame/browser_frame.h
index 89262a0c87266..f94cc5faafb90 100644
index 28085aa32d7d8..312911b8a4564 100644
--- chrome/browser/ui/views/frame/browser_frame.h
+++ chrome/browser/ui/views/frame/browser_frame.h
@@ -57,7 +57,9 @@ enum class TabDragKind {
@@ -56,7 +56,9 @@ enum class TabDragKind {
// This is a virtual interface that allows system specific browser frames.
class BrowserFrame : public views::Widget, public views::ContextMenuController {
public:
@@ -349,7 +173,7 @@ index 89262a0c87266..f94cc5faafb90 100644
BrowserFrame(const BrowserFrame&) = delete;
BrowserFrame& operator=(const BrowserFrame&) = delete;
diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc
index 7f4c8115e35fc..28331cec6c3c7 100644
index 8d1be7ef7470a..0a38b76e20597 100644
--- chrome/browser/ui/views/frame/browser_view.cc
+++ chrome/browser/ui/views/frame/browser_view.cc
@@ -307,11 +307,10 @@ using content::NativeWebKeyboardEvent;
@@ -367,7 +191,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644
#if BUILDFLAG(IS_CHROMEOS_ASH)
// UMA histograms that record animation smoothness for tab loading animation.
@@ -863,11 +862,22 @@ class BrowserView::SidePanelVisibilityController : public views::ViewObserver {
@@ -826,11 +825,22 @@ class BrowserView::SidePanelVisibilityController : public views::ViewObserver {
///////////////////////////////////////////////////////////////////////////////
// BrowserView, public:
@@ -391,7 +215,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644
SetShowIcon(
::ShouldShowWindowIcon(browser_.get(), AppUsesWindowControlsOverlay()));
@@ -912,7 +922,6 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
@@ -874,7 +884,6 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
}
browser_->tab_strip_model()->AddObserver(this);
@@ -399,7 +223,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644
// Top container holds tab strip region and toolbar and lives at the front of
// the view hierarchy.
@@ -969,8 +978,15 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
@@ -920,8 +929,15 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
contents_container->SetLayoutManager(std::make_unique<ContentsLayoutManager>(
devtools_web_view_, contents_web_view_));
@@ -417,7 +241,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644
contents_separator_ =
top_container_->AddChildView(std::make_unique<ContentsSeparator>());
@@ -1900,6 +1916,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const {
@@ -1841,6 +1857,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const {
if (immersive_mode_controller_->IsEnabled())
return false;
@@ -426,7 +250,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644
return frame_->GetFrameView()->ShouldHideTopUIForFullscreen();
}
@@ -2799,7 +2817,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() {
@@ -2736,7 +2754,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() {
}
DownloadBubbleUIController* BrowserView::GetDownloadBubbleUIController() {
@@ -436,7 +260,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644
if (auto* download_button = toolbar_button_provider_->GetDownloadButton())
return download_button->bubble_controller();
return nullptr;
@@ -3291,7 +3310,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
@@ -3228,7 +3247,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
if (top_container()->parent() == this)
return;
@@ -446,7 +270,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644
top_container()->DestroyLayer();
AddChildViewAt(top_container(), 0);
EnsureFocusOrder();
@@ -3850,8 +3870,10 @@ void BrowserView::Layout() {
@@ -3767,8 +3787,10 @@ void BrowserView::Layout() {
// TODO(jamescook): Why was this in the middle of layout code?
toolbar_->location_bar()->omnibox_view()->SetFocusBehavior(
@@ -459,7 +283,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644
// Some of the situations when the BrowserView is laid out are:
// - Enter/exit immersive fullscreen mode.
@@ -3917,6 +3939,11 @@ void BrowserView::AddedToWidget() {
@@ -3834,6 +3856,11 @@ void BrowserView::AddedToWidget() {
SetThemeProfileForWindow(GetNativeWindow(), browser_->profile());
#endif
@@ -471,7 +295,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644
toolbar_->Init();
// TODO(pbos): Manage this either inside SidePanel or the corresponding button
@@ -3973,13 +4000,9 @@ void BrowserView::AddedToWidget() {
@@ -3889,13 +3916,9 @@ void BrowserView::AddedToWidget() {
EnsureFocusOrder();
@@ -487,7 +311,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644
using_native_frame_ = frame_->ShouldUseNativeFrame();
MaybeInitializeWebUITabStrip();
@@ -4385,7 +4408,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
@@ -4304,7 +4327,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
// Undo our anti-jankiness hacks and force a re-layout.
in_process_fullscreen_ = false;
ToolbarSizeChanged(false);
@@ -497,7 +321,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644
}
bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const {
@@ -4733,6 +4757,8 @@ Profile* BrowserView::GetProfile() {
@@ -4652,6 +4676,8 @@ Profile* BrowserView::GetProfile() {
}
void BrowserView::UpdateUIForTabFullscreen() {
@@ -506,7 +330,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644
frame()->GetFrameView()->UpdateFullscreenTopUI();
}
@@ -4755,6 +4781,8 @@ void BrowserView::HideDownloadShelf() {
@@ -4674,6 +4700,8 @@ void BrowserView::HideDownloadShelf() {
}
bool BrowserView::CanUserExitFullscreen() const {
@@ -516,7 +340,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644
}
diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h
index d769d3914a123..6a94752bc96ea 100644
index 673e626f60cd4..1444e9db81cfc 100644
--- chrome/browser/ui/views/frame/browser_view.h
+++ chrome/browser/ui/views/frame/browser_view.h
@@ -124,11 +124,16 @@ class BrowserView : public BrowserWindow,
@@ -536,9 +360,9 @@ index d769d3914a123..6a94752bc96ea 100644
void set_frame(BrowserFrame* frame) {
frame_ = frame;
paint_as_active_subscription_ =
@@ -788,6 +793,12 @@ class BrowserView : public BrowserWindow,
return web_app_frame_toolbar();
}
@@ -777,6 +782,12 @@ class BrowserView : public BrowserWindow,
void SetLoadingAnimationStateChangeClosureForTesting(
base::OnceClosure closure);
+ protected:
+ virtual ToolbarView* OverrideCreateToolbar(Browser* browser,
@@ -550,12 +374,12 @@ index d769d3914a123..6a94752bc96ea 100644
// Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate
// 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
index c9b4becda8dfa..0284fd5f01bc6 100644
index 991e095456a35..2373048a30123 100644
--- chrome/browser/ui/views/frame/browser_view_layout.cc
+++ chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -48,6 +48,10 @@
@@ -46,6 +46,10 @@
#include "ui/views/widget/widget.h"
#include "ui/views/window/client_view.h"
#include "ui/views/window/hit_test_utils.h"
+#if BUILDFLAG(ENABLE_CEF)
+#include "cef/libcef/browser/chrome/views/chrome_views_util.h"
@@ -564,7 +388,7 @@ index c9b4becda8dfa..0284fd5f01bc6 100644
using views::View;
using web_modal::ModalDialogHostObserver;
using web_modal::WebContentsModalDialogHost;
@@ -564,6 +568,13 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) {
@@ -466,6 +470,13 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) {
int BrowserViewLayout::LayoutToolbar(int top) {
TRACE_EVENT0("ui", "BrowserViewLayout::LayoutToolbar");
@@ -594,28 +418,11 @@ index 5e059b9878fc2..c1f6fbcd40ec4 100644
}
ContentsWebView::~ContentsWebView() {
diff --git chrome/browser/ui/views/page_action/page_action_icon_controller.cc chrome/browser/ui/views/page_action/page_action_icon_controller.cc
index c26f017f45682..f9f875292c7d6 100644
--- chrome/browser/ui/views/page_action/page_action_icon_controller.cc
+++ chrome/browser/ui/views/page_action/page_action_icon_controller.cc
@@ -91,6 +91,12 @@ void PageActionIconController::Init(const PageActionIconParams& params,
};
for (PageActionIconType type : params.types_enabled) {
+#if BUILDFLAG(ENABLE_CEF)
+ if (params.browser && params.browser->cef_delegate() &&
+ !params.browser->cef_delegate()->IsPageActionIconVisible(type)) {
+ continue;
+ }
+#endif
switch (type) {
case PageActionIconType::kPaymentsOfferNotification:
add_page_action_icon(
diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index f4a5c3ad8cc9c..4f9c1a111e7ce 100644
index 4f04525fafb8e..eea2013607200 100644
--- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -565,33 +565,47 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
@@ -564,33 +564,47 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
}
bool BrowserTabStripController::IsFrameCondensed() const {
@@ -664,7 +471,7 @@ index f4a5c3ad8cc9c..4f9c1a111e7ce 100644
}
diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc
index 65ba764446ced..140ff05e1b276 100644
index 46ce747cfdec8..99a718aaffe01 100644
--- chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -164,12 +164,13 @@ auto& GetViewCommandMap() {
@@ -692,70 +499,11 @@ index 65ba764446ced..140ff05e1b276 100644
// Make sure the toolbar shows by default.
size_animation_.Reset(1);
@@ -224,6 +225,19 @@ void ToolbarView::Init() {
browser, command, ui::DispositionFromEventFlags(event.flags()));
};
+#if BUILDFLAG(ENABLE_CEF)
+ using ToolbarButtonType = cef::BrowserDelegate::ToolbarButtonType;
+ auto button_visible = [this](ToolbarButtonType type) {
+ if (this->browser_->cef_delegate()) {
+ return this->browser_->cef_delegate()->IsToolbarButtonVisible(type);
+ }
+ return true;
+ };
+ #define BUTTON_VISIBLE(type) button_visible(ToolbarButtonType::type)
+#else
+ #define BUTTON_VISIBLE(type) true
+#endif
+
std::unique_ptr<ToolbarButton> back = std::make_unique<BackForwardButton>(
BackForwardButton::Direction::kBack,
base::BindRepeating(callback, browser_, IDC_BACK), browser_);
@@ -248,8 +262,10 @@ void ToolbarView::Init() {
std::make_unique<ExtensionsToolbarContainer>(browser_);
}
std::unique_ptr<media_router::CastToolbarButton> cast;
- if (media_router::MediaRouterEnabled(browser_->profile()))
+ if (media_router::MediaRouterEnabled(browser_->profile()) &&
+ BUTTON_VISIBLE(kCast)) {
cast = media_router::CastToolbarButton::Create(browser_);
+ }
std::unique_ptr<MediaToolbarButtonView> media_button;
if (base::FeatureList::IsEnabled(media::kGlobalMediaControls)) {
@@ -258,21 +274,23 @@ void ToolbarView::Init() {
}
std::unique_ptr<DownloadToolbarButtonView> download_button;
- if (download::IsDownloadBubbleEnabled(browser_->profile())) {
+ if (download::IsDownloadBubbleEnabled(browser_->profile()) &&
+ BUTTON_VISIBLE(kDownload)) {
download_button =
std::make_unique<DownloadToolbarButtonView>(browser_view_);
}
std::unique_ptr<send_tab_to_self::SendTabToSelfToolbarIconView>
send_tab_to_self_button;
- if (!browser_->profile()->IsOffTheRecord()) {
+ if (!browser_->profile()->IsOffTheRecord() &&
+ BUTTON_VISIBLE(kSendTabToSelf)) {
send_tab_to_self_button =
std::make_unique<send_tab_to_self::SendTabToSelfToolbarIconView>(
browser_view_);
}
std::unique_ptr<SidePanelToolbarButton> side_panel_button;
- if (browser_view_->unified_side_panel()) {
+ if (browser_view_->unified_side_panel() && BUTTON_VISIBLE(kSidePanel)) {
side_panel_button = std::make_unique<SidePanelToolbarButton>(browser_);
}
diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h
index 05dfd39061580..29c677a735672 100644
index 8c2ea74023637..a24cab7c58f93 100644
--- chrome/browser/ui/views/toolbar/toolbar_view.h
+++ chrome/browser/ui/views/toolbar/toolbar_view.h
@@ -88,7 +88,8 @@ class ToolbarView : public views::AccessiblePaneView,
@@ -92,7 +92,8 @@ class ToolbarView : public views::AccessiblePaneView,
// needs to be displayed.
};

View File

@@ -1,5 +1,5 @@
diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h
index ba37a4f5c3604..be5d4c2020660 100644
index 7ea19dc8d32eb..f592668272a41 100644
--- content/browser/devtools/devtools_instrumentation.h
+++ content/browser/devtools/devtools_instrumentation.h
@@ -102,7 +102,7 @@ bool ApplyUserAgentMetadataOverrides(
@@ -68,10 +68,10 @@ index 97c7dc7c25000..63c42610bfd9c 100644
blink::mojom::V8CacheOptions GetV8CacheOptions();
diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn
index fcdf677c9772e..b7bfed642fff6 100644
index 2cf3784f871e2..df32d4ea7e027 100644
--- third_party/blink/renderer/controller/BUILD.gn
+++ third_party/blink/renderer/controller/BUILD.gn
@@ -36,6 +36,7 @@ component("controller") {
@@ -32,6 +32,7 @@ component("controller") {
configs += [
"//build/config/compiler:wexit_time_destructors",
@@ -79,7 +79,7 @@ index fcdf677c9772e..b7bfed642fff6 100644
"//third_party/blink/renderer:config",
"//third_party/blink/renderer:inside_blink",
"//third_party/blink/renderer:non_test_config",
@@ -61,6 +62,8 @@ component("controller") {
@@ -57,6 +58,8 @@ component("controller") {
"performance_manager/v8_detailed_memory_reporter_impl.h",
"performance_manager/v8_worker_memory_reporter.cc",
"performance_manager/v8_worker_memory_reporter.h",

View File

@@ -1,5 +1,5 @@
diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc
index b91c420730c5e..d69af17943fe7 100644
index a6e355d835004..9087d3cc485ea 100644
--- content/browser/devtools/devtools_http_handler.cc
+++ content/browser/devtools/devtools_http_handler.cc
@@ -589,7 +589,7 @@ void DevToolsHttpHandler::OnJsonRequest(
@@ -12,10 +12,10 @@ index b91c420730c5e..d69af17943fe7 100644
version.Set("V8-Version", V8_VERSION_STRING);
std::string host = info.GetHeaderValue("host");
diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc
index 22fe0e4ff65ce..e38329c932bf2 100644
index 059dca9146bde..ef5537248308f 100644
--- content/browser/loader/navigation_url_loader_impl.cc
+++ content/browser/loader/navigation_url_loader_impl.cc
@@ -721,6 +721,17 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest() {
@@ -712,6 +712,17 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest() {
resource_request_->has_user_gesture, initiating_origin,
initiator_document_.AsRenderFrameHostIfValid(), &loader_factory);
@@ -34,7 +34,7 @@ index 22fe0e4ff65ce..e38329c932bf2 100644
factory = base::MakeRefCounted<network::WrapperSharedURLLoaderFactory>(
std::move(loader_factory));
diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc
index 78ae48dcbed95..a5a77e9ad81ce 100644
index 75dbea1be3e60..3c9d427c9b790 100644
--- content/public/browser/content_browser_client.cc
+++ content/public/browser/content_browser_client.cc
@@ -965,7 +965,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload(
@@ -55,7 +55,7 @@ index 78ae48dcbed95..a5a77e9ad81ce 100644
std::vector<base::FilePath>
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
index ceff9665cdb15..657f88d32efd4 100644
index 868dd480c66e3..4c788029e9c52 100644
--- content/public/browser/content_browser_client.h
+++ content/public/browser/content_browser_client.h
@@ -35,6 +35,7 @@
@@ -66,7 +66,7 @@ index ceff9665cdb15..657f88d32efd4 100644
#include "content/public/common/alternative_error_page_override_info.mojom-forward.h"
#include "content/public/common/page_visibility_state.h"
#include "content/public/common/window_container_type.mojom-forward.h"
@@ -1776,7 +1777,7 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1775,7 +1776,7 @@ class CONTENT_EXPORT ContentBrowserClient {
//
// If |relative_partition_path| is the empty string, it means this needs to
// create the default NetworkContext for the BrowserContext.
@@ -75,7 +75,7 @@ index ceff9665cdb15..657f88d32efd4 100644
BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -1979,6 +1980,19 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1978,6 +1979,19 @@ class CONTENT_EXPORT ContentBrowserClient {
RenderFrameHost* initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory);
@@ -95,7 +95,7 @@ index ceff9665cdb15..657f88d32efd4 100644
// Creates an OverlayWindow to be used for video or Picture-in-Picture.
// This window will house the content shown when in Picture-in-Picture mode.
// This will return a new OverlayWindow.
@@ -2035,6 +2049,10 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -2034,6 +2048,10 @@ class CONTENT_EXPORT ContentBrowserClient {
// Used as part of the user agent string.
virtual std::string GetProduct();
@@ -132,10 +132,10 @@ index 77f2c4fbf8c88..ddbacedde912a 100644
// started.
virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {}
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
index 11759a9fcbe02..87936d85135d9 100644
index 2fb8a5e9b9f18..12a07a0619514 100644
--- content/renderer/render_thread_impl.cc
+++ content/renderer/render_thread_impl.cc
@@ -628,6 +628,8 @@ void RenderThreadImpl::Init() {
@@ -620,6 +620,8 @@ void RenderThreadImpl::Init() {
GetContentClient()->renderer()->CreateURLLoaderThrottleProvider(
blink::URLLoaderThrottleProviderType::kFrame);
@@ -145,10 +145,10 @@ index 11759a9fcbe02..87936d85135d9 100644
base::BindRepeating(&RenderThreadImpl::OnRendererInterfaceReceiver,
base::Unretained(this)));
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
index e63b39bbeda10..06bd7d40d0f5c 100644
index a0811daead7bc..2beb0d03cd671 100644
--- content/renderer/renderer_blink_platform_impl.cc
+++ content/renderer/renderer_blink_platform_impl.cc
@@ -976,6 +976,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() {
@@ -1001,6 +1001,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() {
//------------------------------------------------------------------------------
@@ -165,10 +165,10 @@ index e63b39bbeda10..06bd7d40d0f5c 100644
RendererBlinkPlatformImpl::CreateWebV8ValueConverter() {
return std::make_unique<V8ValueConverterImpl>();
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
index 1c83b5a848a35..909f986cc09df 100644
index f9b61ff32e3e7..ea649425e7b34 100644
--- content/renderer/renderer_blink_platform_impl.h
+++ content/renderer/renderer_blink_platform_impl.h
@@ -231,6 +231,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
@@ -235,6 +235,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
uint64_t private_memory_footprint_bytes) override;
#endif
@@ -179,11 +179,11 @@ index 1c83b5a848a35..909f986cc09df 100644
// plus eTLD+1, such as https://google.com), or to a more specific origin.
void SetIsLockedToSite();
diff --git headless/lib/browser/headless_content_browser_client.cc headless/lib/browser/headless_content_browser_client.cc
index fab5d1d83f08c..012f4efe4f63e 100644
index 5c1f3a069c00b..db5f4250330ad 100644
--- headless/lib/browser/headless_content_browser_client.cc
+++ headless/lib/browser/headless_content_browser_client.cc
@@ -299,7 +299,7 @@ bool HeadlessContentBrowserClient::IsSharedStorageSelectURLAllowed(
return true;
@@ -284,7 +284,7 @@ bool HeadlessContentBrowserClient::ShouldEnableStrictSiteIsolation() {
return false;
}
-void HeadlessContentBrowserClient::ConfigureNetworkContextParams(
@@ -191,7 +191,7 @@ index fab5d1d83f08c..012f4efe4f63e 100644
content::BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -309,6 +309,7 @@ void HeadlessContentBrowserClient::ConfigureNetworkContextParams(
@@ -294,6 +294,7 @@ void HeadlessContentBrowserClient::ConfigureNetworkContextParams(
HeadlessBrowserContextImpl::From(context)->ConfigureNetworkContextParams(
in_memory, relative_partition_path, network_context_params,
cert_verifier_creation_params);
@@ -200,12 +200,12 @@ index fab5d1d83f08c..012f4efe4f63e 100644
std::string HeadlessContentBrowserClient::GetProduct() {
diff --git headless/lib/browser/headless_content_browser_client.h headless/lib/browser/headless_content_browser_client.h
index 603ebb3aadfec..b189791360362 100644
index c96642d57f5cd..bfcf88fa2559d 100644
--- headless/lib/browser/headless_content_browser_client.h
+++ headless/lib/browser/headless_content_browser_client.h
@@ -79,7 +79,7 @@ class HeadlessContentBrowserClient : public content::ContentBrowserClient {
const url::Origin& top_frame_origin,
const url::Origin& accessing_origin) override;
@@ -71,7 +71,7 @@ class HeadlessContentBrowserClient : public content::ContentBrowserClient {
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
bool ShouldEnableStrictSiteIsolation() override;
- void ConfigureNetworkContextParams(
+ bool ConfigureNetworkContextParams(

View File

@@ -1,8 +1,8 @@
diff --git content/app/content_main.cc content/app/content_main.cc
index a3cc7fabebb07..d1e88823f7931 100644
index f646abaa56f8b..59d4a1f0817e6 100644
--- content/app/content_main.cc
+++ content/app/content_main.cc
@@ -173,11 +173,8 @@ ContentMainParams::~ContentMainParams() = default;
@@ -172,11 +172,8 @@ ContentMainParams::~ContentMainParams() = default;
ContentMainParams::ContentMainParams(ContentMainParams&&) = default;
ContentMainParams& ContentMainParams::operator=(ContentMainParams&&) = default;
@@ -17,9 +17,9 @@ index a3cc7fabebb07..d1e88823f7931 100644
#if BUILDFLAG(IS_CHROMEOS_LACROS)
// Lacros is launched with inherited priority. Revert to normal priority
@@ -185,9 +182,6 @@ RunContentProcess(ContentMainParams params,
base::PlatformThread::SetCurrentThreadType(base::ThreadType::kDefault);
#endif
int exit_code = -1;
base::debug::GlobalActivityTracker* tracker = nullptr;
-#if BUILDFLAG(IS_MAC)
- std::unique_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool;
-#endif
@@ -39,25 +39,36 @@ index a3cc7fabebb07..d1e88823f7931 100644
InitializeMac();
#endif
@@ -321,16 +309,49 @@ RunContentProcess(ContentMainParams params,
@@ -318,8 +306,18 @@ RunContentProcess(ContentMainParams params,
if (IsSubprocess())
CommonSubprocessInit();
- exit_code = content_main_runner->Run();
+ return exit_code;
+}
+
+// This function must be marked with NO_STACK_PROTECTOR or it may crash on
+// return, see the --change-stack-guard-on-fork command line flag.
+int NO_STACK_PROTECTOR
+ContentMainRun(ContentMainRunner* content_main_runner) {
+ int exit_code = content_main_runner->Run();
+
+ base::debug::GlobalActivityTracker* tracker =
+ base::debug::GlobalActivityTracker::Get();
if (tracker) {
if (exit_code == 0) {
tracker->SetProcessPhaseIfEnabled(
@@ -331,14 +329,41 @@ RunContentProcess(ContentMainParams params,
}
}
-#if BUILDFLAG(IS_MAC)
- autorelease_pool.reset();
-#endif
+ return exit_code;
+}
+// This function must be marked with NO_STACK_PROTECTOR or it may crash on
+// return, see the --change-stack-guard-on-fork command line flag.
+int NO_STACK_PROTECTOR
+ContentMainRun(ContentMainRunner* content_main_runner) {
+ return content_main_runner->Run();
+}
+
+void ContentMainShutdown(ContentMainRunner* content_main_runner) {
#if !BUILDFLAG(IS_ANDROID)
content_main_runner->Shutdown();
@@ -94,7 +105,7 @@ index a3cc7fabebb07..d1e88823f7931 100644
}
diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc
index 8bfbf0e73fb8d..f80f322b65535 100644
index 5029cbe44e4bd..fc6616da947eb 100644
--- content/app/content_main_runner_impl.cc
+++ content/app/content_main_runner_impl.cc
@@ -46,6 +46,7 @@
@@ -105,7 +116,7 @@ index 8bfbf0e73fb8d..f80f322b65535 100644
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
@@ -1306,6 +1307,12 @@ void ContentMainRunnerImpl::Shutdown() {
@@ -1290,6 +1291,12 @@ void ContentMainRunnerImpl::Shutdown() {
is_shutdown_ = true;
}
@@ -119,7 +130,7 @@ index 8bfbf0e73fb8d..f80f322b65535 100644
std::unique_ptr<ContentMainRunner> ContentMainRunner::Create() {
return ContentMainRunnerImpl::Create();
diff --git content/app/content_main_runner_impl.h content/app/content_main_runner_impl.h
index 22173f344ae14..fe63790ef128f 100644
index ea9b5233820cd..aba62b3384134 100644
--- content/app/content_main_runner_impl.h
+++ content/app/content_main_runner_impl.h
@@ -27,7 +27,7 @@ class DiscardableSharedMemoryManager;
@@ -141,7 +152,7 @@ index 22173f344ae14..fe63790ef128f 100644
int RunBrowser(MainFunctionParams main_function_params,
bool start_minimal_browser);
diff --git content/common/set_process_title.cc content/common/set_process_title.cc
index 283161145d792..9f3f635abdd1c 100644
index 04a08015aaff6..694f5c43a29e1 100644
--- content/common/set_process_title.cc
+++ content/common/set_process_title.cc
@@ -54,7 +54,7 @@ void SetProcessTitleFromCommandLine(const char** main_argv) {

View File

@@ -81,7 +81,7 @@ index 27a803784eb9e..a8b033f475cb4 100644
g_crash_helper_enabled = true;
return true;
diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc
index 819bffbbe47c1..c00e3e6925cfe 100644
index f748d2dd47946..98371cf551a75 100644
--- chrome/common/crash_keys.cc
+++ chrome/common/crash_keys.cc
@@ -6,6 +6,8 @@
@@ -93,9 +93,9 @@ index 819bffbbe47c1..c00e3e6925cfe 100644
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/format_macros.h"
@@ -90,8 +92,10 @@ void HandleEnableDisableFeatures(const base::CommandLine& command_line) {
"commandline-disabled-feature");
@@ -93,8 +95,10 @@ void HandleEnableDisableFeatures(const base::CommandLine& command_line) {
}
#endif
+} // namespace
+
@@ -105,14 +105,16 @@ index 819bffbbe47c1..c00e3e6925cfe 100644
static const char* const kIgnoreSwitches[] = {
switches::kEnableLogging,
switches::kFlagSwitchesBegin,
@@ -149,11 +153,9 @@ bool IsBoringSwitch(const std::string& flag) {
@@ -154,13 +158,11 @@ bool IsBoringSwitch(const std::string& flag) {
return false;
}
-} // namespace
-
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) {
#if BUILDFLAG(IS_CHROMEOS)
HandleEnableDisableFeatures(command_line);
#endif
- SetSwitchesFromCommandLine(command_line, &IsBoringSwitch);
+ SetSwitchesFromCommandLine(command_line, &IsBoringChromeSwitch);
}

View File

@@ -1,5 +1,5 @@
diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc
index f213668d18044..32a2d4bcfb1b8 100644
index e7fe1c565aac5..45980ceed2c50 100644
--- components/embedder_support/user_agent_utils.cc
+++ components/embedder_support/user_agent_utils.cc
@@ -17,6 +17,7 @@
@@ -21,7 +21,7 @@ index f213668d18044..32a2d4bcfb1b8 100644
namespace embedder_support {
namespace {
@@ -351,6 +356,14 @@ std::string GetMajorVersionForUserAgentString(
@@ -339,6 +344,14 @@ std::string GetMajorVersionForUserAgentString(
std::string GetProductAndVersion(
ForceMajorVersionToMinorPosition force_major_to_minor,
UserAgentReductionEnterprisePolicyState user_agent_reduction) {

View File

@@ -60,7 +60,7 @@ index cead7cfa14bae..24142c2e4896f 100644
std::unique_ptr<StreamContainer> stream_container(
new StreamContainer(tab_id, embedded, handler_url, extension_id,
diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc
index 91928c8b7811e..a9c5913f4f5d0 100644
index 4d29671429220..e0f287f785668 100644
--- extensions/browser/extension_host.cc
+++ extensions/browser/extension_host.cc
@@ -62,11 +62,12 @@ ExtensionHost::ExtensionHost(const Extension* extension,
@@ -161,7 +161,7 @@ index 9ba85048d1fcf..f3a5b8bc9bda0 100644
// A pointer to the current or speculative main frame in `host_contents_`. We
// can't access this frame through the `host_contents_` directly as it does
diff --git extensions/browser/extension_registry.cc extensions/browser/extension_registry.cc
index f142a40362c75..ed283ef8f1251 100644
index 10d751cceab73..128af05925e07 100644
--- extensions/browser/extension_registry.cc
+++ extensions/browser/extension_registry.cc
@@ -6,9 +6,14 @@
@@ -179,7 +179,7 @@ index f142a40362c75..ed283ef8f1251 100644
namespace extensions {
ExtensionRegistry::ExtensionRegistry(content::BrowserContext* browser_context)
@@ -17,6 +22,11 @@ ExtensionRegistry::~ExtensionRegistry() = default;
@@ -17,6 +22,11 @@ ExtensionRegistry::~ExtensionRegistry() {}
// static
ExtensionRegistry* ExtensionRegistry::Get(content::BrowserContext* context) {
@@ -192,10 +192,10 @@ index f142a40362c75..ed283ef8f1251 100644
}
diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h
index 2b0287529078a..e4144e0755e4b 100644
index bb7a1c1860f7f..25f9d0c47e5ab 100644
--- extensions/browser/extensions_browser_client.h
+++ extensions/browser/extensions_browser_client.h
@@ -30,6 +30,7 @@
@@ -31,6 +31,7 @@
#include "url/gurl.h"
class ExtensionFunctionRegistry;
@@ -203,7 +203,7 @@ index 2b0287529078a..e4144e0755e4b 100644
class PrefService;
namespace base {
@@ -74,6 +75,7 @@ class ComponentExtensionResourceManager;
@@ -73,6 +74,7 @@ class ComponentExtensionResourceManager;
class Extension;
class ExtensionCache;
class ExtensionError;
@@ -211,7 +211,7 @@ index 2b0287529078a..e4144e0755e4b 100644
class ExtensionHostDelegate;
class ExtensionSet;
class ExtensionSystem;
@@ -249,6 +251,14 @@ class ExtensionsBrowserClient {
@@ -248,6 +250,14 @@ class ExtensionsBrowserClient {
virtual std::unique_ptr<ExtensionHostDelegate>
CreateExtensionHostDelegate() = 0;
@@ -227,10 +227,10 @@ index 2b0287529078a..e4144e0755e4b 100644
// once each time the extensions system is loaded per browser_context. The
// implementation may wish to use the BrowserContext to record the current
diff --git extensions/browser/process_manager.cc extensions/browser/process_manager.cc
index 115f31f9ce46d..914b2564d5a21 100644
index 0a9fa13f82250..2d0ed7c2396c4 100644
--- extensions/browser/process_manager.cc
+++ extensions/browser/process_manager.cc
@@ -379,9 +379,17 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension,
@@ -380,9 +380,17 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension,
return true; // TODO(kalman): return false here? It might break things...
DVLOG(1) << "CreateBackgroundHost " << extension->id();

View File

@@ -12,7 +12,7 @@ index a9b0a5a827fc8..9a0fd388756f3 100644
# https://crbug.com/474506.
"//clank/java/BUILD.gn",
diff --git BUILD.gn BUILD.gn
index 057b4081c95e5..9817b4c62a89e 100644
index 7cfadb4724141..e59835c875ec6 100644
--- BUILD.gn
+++ BUILD.gn
@@ -18,6 +18,7 @@ import("//build/config/sanitizers/sanitizers.gni")
@@ -23,7 +23,7 @@ index 057b4081c95e5..9817b4c62a89e 100644
import("//chrome/browser/buildflags.gni")
import("//components/nacl/features.gni")
import("//device/vr/buildflags/buildflags.gni")
@@ -279,6 +280,10 @@ group("gn_all") {
@@ -274,6 +275,10 @@ group("gn_all") {
deps += root_extra_deps
@@ -35,18 +35,10 @@ index 057b4081c95e5..9817b4c62a89e 100644
deps += [ "//printing:printing_unittests" ]
}
diff --git build/config/win/visual_studio_version.gni build/config/win/visual_studio_version.gni
index 2314ab505bfa2..f10698a79102e 100644
index d9024468296e7..11bfae65b7b02 100644
--- build/config/win/visual_studio_version.gni
+++ build/config/win/visual_studio_version.gni
@@ -5,21 +5,23 @@
declare_args() {
# Path to Visual Studio. If empty, the default is used which is to use the
# automatic toolchain in depot_tools. If set, you must also set the
- # visual_studio_version and wdk_path.
+ # visual_studio_version, wdk_path and windows_sdk_version.
visual_studio_path = ""
# Version of Visual Studio pointed to by the visual_studio_path.
@@ -12,9 +12,8 @@ declare_args() {
# Currently always "2015".
visual_studio_version = ""
@@ -58,16 +50,8 @@ index 2314ab505bfa2..f10698a79102e 100644
# Full path to the Windows SDK, not including a backslash at the end.
# This value is the default location, override if you have a different
# installation location.
windows_sdk_path = "C:\Program Files (x86)\Windows Kits\10"
+
+ # Version of the Windows SDK pointed to by the windows_sdk_path.
+ windows_sdk_version = ""
}
if (visual_studio_path == "") {
@@ -29,12 +31,13 @@ if (visual_studio_path == "") {
windows_sdk_version = toolchain_data.sdk_version
@@ -28,12 +27,11 @@ if (visual_studio_path == "") {
visual_studio_path = toolchain_data.vs_path
windows_sdk_path = toolchain_data.sdk_path
visual_studio_version = toolchain_data.vs_version
- wdk_path = toolchain_data.wdk_dir
@@ -78,8 +62,6 @@ index 2314ab505bfa2..f10698a79102e 100644
- assert(wdk_path != "",
- "You must set the wdk_path if you set the visual studio path")
- visual_studio_runtime_dirs = []
+ assert(windows_sdk_version != "",
+ "You must set the windows_sdk_version if you set the path")
+ assert(visual_studio_runtime_dirs != "",
+ "You must set the visual_studio_runtime_dirs if you set the visual " +
+ "studio path")
@@ -98,7 +80,7 @@ index 60f573a736ba5..90dd6d0b37314 100644
+_OBJC_METACLASS_$_UnderlayOpenGLHostingWindow
+
diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni
index b3f457a9ce656..1af43bc3bb657 100644
index a16658689a69e..36515332da633 100644
--- chrome/chrome_paks.gni
+++ chrome/chrome_paks.gni
@@ -6,6 +6,7 @@ import("//ash/ambient/resources/resources.gni")
@@ -109,7 +91,7 @@ index b3f457a9ce656..1af43bc3bb657 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/common/features.gni")
import("//extensions/buildflags/buildflags.gni")
@@ -79,6 +80,10 @@ template("chrome_repack_percent") {
@@ -73,6 +74,10 @@ template("chrome_repack_percent") {
"//ui/chromeos/resources",
]
}

View File

@@ -1,8 +1,8 @@
diff --git tools/gritsettings/resource_ids.spec tools/gritsettings/resource_ids.spec
index d8a54f29cdc9b..127f545f967ee 100644
index 15e77b25cc0b1..96d70a5ba039f 100644
--- tools/gritsettings/resource_ids.spec
+++ tools/gritsettings/resource_ids.spec
@@ -1121,6 +1121,15 @@
@@ -1110,6 +1110,15 @@
# END "everything else" section.
# Everything but chrome/, components/, content/, and ios/

View File

@@ -1,5 +1,5 @@
diff --git content/browser/child_process_launcher_helper_linux.cc content/browser/child_process_launcher_helper_linux.cc
index 1b4f9c8e3b79a..0a6e83421a6d6 100644
index b7f21237e87fa..11e4c166ab8a6 100644
--- content/browser/child_process_launcher_helper_linux.cc
+++ content/browser/child_process_launcher_helper_linux.cc
@@ -183,7 +183,7 @@ ZygoteCommunication* ChildProcessLauncherHelper::GetZygoteForLaunch() {

View File

@@ -1,5 +1,5 @@
diff --git device/bluetooth/BUILD.gn device/bluetooth/BUILD.gn
index b434121d8f4ea..3c70588acfbec 100644
index 0b526044dcc7c..349ffa6a6ceca 100644
--- device/bluetooth/BUILD.gn
+++ device/bluetooth/BUILD.gn
@@ -46,10 +46,12 @@ source_set("deprecated_experimental_mojo") {

View File

@@ -1,5 +1,5 @@
diff --git chrome/common/media/component_widevine_cdm_hint_file_linux.cc chrome/common/media/component_widevine_cdm_hint_file_linux.cc
index ba25a6223d60e..508bb0e59f512 100644
index 85a55fdd22a4f..0b935334136cb 100644
--- chrome/common/media/component_widevine_cdm_hint_file_linux.cc
+++ chrome/common/media/component_widevine_cdm_hint_file_linux.cc
@@ -16,6 +16,7 @@
@@ -44,7 +44,7 @@ index ba25a6223d60e..508bb0e59f512 100644
- &hint_file_path));
+ CHECK(GetHintFilePath(&hint_file_path));
base::Value dict(base::Value::Type::DICT);
base::Value dict(base::Value::Type::DICTIONARY);
dict.SetStringPath(kPath, cdm_base_path.value());
@@ -62,8 +82,7 @@ bool UpdateWidevineCdmHintFile(const base::FilePath& cdm_base_path) {

View File

@@ -1,5 +1,5 @@
diff --git ui/accessibility/platform/BUILD.gn ui/accessibility/platform/BUILD.gn
index ebc2470893838..dd3b924499c9c 100644
index 3bec9f0f7d46f..59c527bdd29cd 100644
--- ui/accessibility/platform/BUILD.gn
+++ ui/accessibility/platform/BUILD.gn
@@ -285,6 +285,10 @@ component("platform") {
@@ -14,10 +14,10 @@ index ebc2470893838..dd3b924499c9c 100644
}
}
diff --git ui/gtk/BUILD.gn ui/gtk/BUILD.gn
index 76ab8c9765bec..8bc3cdd0fec96 100644
index 4fc6b6d617832..77f17ecf4caf0 100644
--- ui/gtk/BUILD.gn
+++ ui/gtk/BUILD.gn
@@ -174,4 +174,8 @@ component("gtk") {
@@ -176,4 +176,8 @@ component("gtk") {
# TODO: This should be removed.
deps += [ "//ui/ozone" ]

View File

@@ -1,5 +1,5 @@
diff --git printing/printing_context_linux.cc printing/printing_context_linux.cc
index 63af3dd95eada..dc89a9c5c5e47 100644
index 5520e15c232c8..2648037fcf37e 100644
--- printing/printing_context_linux.cc
+++ printing/printing_context_linux.cc
@@ -69,11 +69,11 @@ mojom::ResultCode PrintingContextLinux::UseDefaultSettings() {
@@ -13,10 +13,10 @@ index 63af3dd95eada..dc89a9c5c5e47 100644
if (!print_dialog_)
- print_dialog_ = ui::LinuxUi::instance()->CreatePrintDialog(this);
+ print_dialog_ = ui::PrintingContextLinuxDelegate::instance()->CreatePrintDialog(this);
print_dialog_->UseDefaultSettings();
#endif
if (print_dialog_) {
print_dialog_->UseDefaultSettings();
@@ -85,8 +85,8 @@ mojom::ResultCode PrintingContextLinux::UseDefaultSettings() {
@@ -82,8 +82,8 @@ mojom::ResultCode PrintingContextLinux::UseDefaultSettings() {
gfx::Size PrintingContextLinux::GetPdfPaperSizeDeviceUnits() {
#if BUILDFLAG(IS_LINUX)
@@ -27,7 +27,7 @@ index 63af3dd95eada..dc89a9c5c5e47 100644
#endif
return gfx::Size();
@@ -98,11 +98,11 @@ mojom::ResultCode PrintingContextLinux::UpdatePrinterSettings(
@@ -95,11 +95,11 @@ mojom::ResultCode PrintingContextLinux::UpdatePrinterSettings(
DCHECK(!in_print_job_);
#if BUILDFLAG(IS_LINUX)
@@ -39,8 +39,8 @@ index 63af3dd95eada..dc89a9c5c5e47 100644
- print_dialog_ = ui::LinuxUi::instance()->CreatePrintDialog(this);
+ print_dialog_ = ui::PrintingContextLinuxDelegate::instance()->CreatePrintDialog(this);
if (print_dialog_) {
// PrintDialogGtk::UpdateSettings() calls InitWithSettings() so settings_ will
// PrintDialogGtk::UpdateSettings() calls InitWithSettings() so settings_ will
// remain non-null after this line.
diff --git ui/linux/linux_ui.cc ui/linux/linux_ui.cc
index 29db798e8b171..f8b9546b90321 100644
--- ui/linux/linux_ui.cc
@@ -76,7 +76,7 @@ index 29db798e8b171..f8b9546b90321 100644
}
diff --git ui/linux/linux_ui.h ui/linux/linux_ui.h
index 82d40cb5fa1b9..0a08bec8a6e61 100644
index b5fd57741d2f4..eaab5f1bd2b0b 100644
--- ui/linux/linux_ui.h
+++ ui/linux/linux_ui.h
@@ -18,6 +18,10 @@

View File

@@ -1,5 +1,5 @@
diff --git base/message_loop/message_pump_win.cc base/message_loop/message_pump_win.cc
index 7f5be88878bc6..f72a323b0c8b6 100644
index e0969d4ad3087..267ac89aab806 100644
--- base/message_loop/message_pump_win.cc
+++ base/message_loop/message_pump_win.cc
@@ -2,6 +2,7 @@
@@ -10,7 +10,7 @@ index 7f5be88878bc6..f72a323b0c8b6 100644
#include "base/message_loop/message_pump_win.h"
#include <algorithm>
@@ -487,7 +488,17 @@ bool MessagePumpForUI::ProcessNextWindowsMessage() {
@@ -491,7 +492,17 @@ bool MessagePumpForUI::ProcessNextWindowsMessage() {
ctx.event()->set_chrome_message_pump();
msg_pump_data->set_sent_messages_in_queue(more_work_is_plausible);
});

View File

@@ -1,8 +1,8 @@
diff --git base/message_loop/message_pump_mac.mm base/message_loop/message_pump_mac.mm
index 26223d7db1757..aa3261d2d3e7e 100644
index 25ee65396cfb7..3c9b433cb31bb 100644
--- base/message_loop/message_pump_mac.mm
+++ base/message_loop/message_pump_mac.mm
@@ -786,7 +786,8 @@ void MessagePumpUIApplication::Detach() {
@@ -813,7 +813,8 @@ void MessagePumpUIApplication::Detach() {
#else
ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() {
@@ -12,7 +12,7 @@ index 26223d7db1757..aa3261d2d3e7e 100644
DCHECK_EQ(kNSApplicationModalSafeModeMask, g_app_pump->GetModeMask());
// Pumping events in private runloop modes is known to interact badly with
// app modal windows like NSAlert.
@@ -796,7 +797,8 @@ ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() {
@@ -823,7 +824,8 @@ ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() {
}
ScopedPumpMessagesInPrivateModes::~ScopedPumpMessagesInPrivateModes() {

View File

@@ -12,7 +12,7 @@ index ddf25382e49fc..fe64fa31a7a85 100644
virtual ~WebContentsView() = default;
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
index 44d0b99677a74..843c49ccaecc3 100644
index ec5521a6e2005..a9f3f55ffd176 100644
--- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
+++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
@@ -228,6 +228,8 @@ void MimeHandlerViewGuest::CreateWebContents(
@@ -35,7 +35,7 @@ index 44d0b99677a74..843c49ccaecc3 100644
DCHECK(stream_->handler_url().SchemeIs(extensions::kExtensionScheme));
GetController().LoadURL(stream_->handler_url(), content::Referrer(),
ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string());
@@ -497,6 +503,14 @@ void MimeHandlerViewGuest::DidFinishNavigation(
@@ -493,6 +499,14 @@ void MimeHandlerViewGuest::DidFinishNavigation(
}
}
@@ -51,10 +51,10 @@ index 44d0b99677a74..843c49ccaecc3 100644
mojo::PendingReceiver<mime_handler::BeforeUnloadControl> receiver) {
if (!pending_before_unload_control_)
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
index 2ade4d0b28ba4..8ba6293863a93 100644
index 810289b11cba7..714b7c64c9ba2 100644
--- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
+++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
@@ -196,6 +196,7 @@ class MimeHandlerViewGuest
@@ -193,6 +193,7 @@ class MimeHandlerViewGuest
void ReadyToCommitNavigation(
content::NavigationHandle* navigation_handle) final;
void DidFinishNavigation(content::NavigationHandle* navigation_handle) final;
@@ -62,7 +62,7 @@ index 2ade4d0b28ba4..8ba6293863a93 100644
std::unique_ptr<MimeHandlerViewGuestDelegate> delegate_;
std::unique_ptr<StreamContainer> stream_;
@@ -204,6 +205,7 @@ class MimeHandlerViewGuest
@@ -201,6 +202,7 @@ class MimeHandlerViewGuest
content::ChildProcessHost::kInvalidUniqueID, MSG_ROUTING_NONE};
int embedder_widget_routing_id_ = MSG_ROUTING_NONE;

View File

@@ -10,10 +10,10 @@ index f936d951fe272..90a3165172dce 100644
+// This load will not send any cookies. For CEF usage.
+LOAD_FLAG(DO_NOT_SEND_COOKIES, 1 << 17)
diff --git net/url_request/url_request_http_job.cc net/url_request/url_request_http_job.cc
index 48d7ae0d56f20..f8546bd81957c 100644
index 31b8af59f7b5e..162d54de19abf 100644
--- net/url_request/url_request_http_job.cc
+++ net/url_request/url_request_http_job.cc
@@ -1714,7 +1714,8 @@ bool URLRequestHttpJob::ShouldAddCookieHeader() const {
@@ -1705,7 +1705,8 @@ bool URLRequestHttpJob::ShouldAddCookieHeader() const {
// Read cookies whenever allow_credentials() is true, even if the PrivacyMode
// is being overridden by NetworkDelegate and will eventually block them, as
// blocked cookies still need to be logged in that case.

View File

@@ -1,8 +1,8 @@
diff --git net/test/embedded_test_server/embedded_test_server.cc net/test/embedded_test_server/embedded_test_server.cc
index c7cfa008b872f..e401aef2c54e2 100644
index d112bec7c7dce..ca88a6df95e5d 100644
--- net/test/embedded_test_server/embedded_test_server.cc
+++ net/test/embedded_test_server/embedded_test_server.cc
@@ -984,7 +984,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWait(base::OnceClosure closure) {
@@ -982,7 +982,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWait(base::OnceClosure closure) {
if (!base::CurrentThread::Get())
temporary_loop = std::make_unique<base::SingleThreadTaskExecutor>();
@@ -11,7 +11,7 @@ index c7cfa008b872f..e401aef2c54e2 100644
if (!io_thread_->task_runner()->PostTaskAndReply(
FROM_HERE, std::move(closure), run_loop.QuitClosure())) {
return false;
@@ -1011,7 +1011,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWaitWithResult(
@@ -1009,7 +1009,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWaitWithResult(
if (!base::CurrentThread::Get())
temporary_loop = std::make_unique<base::SingleThreadTaskExecutor>();

View File

@@ -1,5 +1,5 @@
diff --git content/browser/renderer_host/input/fling_scheduler.cc content/browser/renderer_host/input/fling_scheduler.cc
index 431df5d50debe..0fcc9ea8fbb1a 100644
index 84e5d2a493556..160478790e261 100644
--- content/browser/renderer_host/input/fling_scheduler.cc
+++ content/browser/renderer_host/input/fling_scheduler.cc
@@ -68,6 +68,9 @@ void FlingScheduler::ProgressFlingOnBeginFrameIfneeded(
@@ -9,9 +9,9 @@ index 431df5d50debe..0fcc9ea8fbb1a 100644
+ if (compositor_) {
+ return compositor_;
+ }
if (!host_->GetView()) {
return nullptr;
}
#if defined(USE_AURA)
if (host_->GetView() && host_->GetView()->GetNativeView() &&
host_->GetView()->GetNativeView()->GetHost() &&
diff --git content/browser/renderer_host/input/fling_scheduler_base.h content/browser/renderer_host/input/fling_scheduler_base.h
index afefe3cd83dee..6668463247644 100644
--- content/browser/renderer_host/input/fling_scheduler_base.h
@@ -41,7 +41,7 @@ index afefe3cd83dee..6668463247644 100644
} // namespace content
diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc
index 5c162ee2f6edd..c6f31297e33fe 100644
index a689c6e60b5d5..5a1204c01f04a 100644
--- content/browser/renderer_host/render_widget_host_impl.cc
+++ content/browser/renderer_host/render_widget_host_impl.cc
@@ -3144,6 +3144,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() {
@@ -57,7 +57,7 @@ index 5c162ee2f6edd..c6f31297e33fe 100644
const WebInputEvent& event) {
if ((base::FeatureList::IsEnabled(
diff --git content/browser/renderer_host/render_widget_host_impl.h content/browser/renderer_host/render_widget_host_impl.h
index 5b2482ee77ef3..54fa2ea322206 100644
index 3910d3a1642ab..8738df72afced 100644
--- content/browser/renderer_host/render_widget_host_impl.h
+++ content/browser/renderer_host/render_widget_host_impl.h
@@ -791,6 +791,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl

View File

@@ -0,0 +1,12 @@
diff --git BUILD.gn BUILD.gn
index a8532128d..f5a098afa 100644
--- BUILD.gn
+++ BUILD.gn
@@ -338,6 +338,7 @@ group("pdfium_public_headers") {
}
component("pdfium") {
+ output_name = "pdfium"
libs = []
configs += [ ":pdfium_strict_config" ]
public_configs = [ ":pdfium_public_config" ]

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/download/download_prefs.cc chrome/browser/download/download_prefs.cc
index 4b7fcf619a55d..139fd5b4a2bd0 100644
index 35c194b2d8dc4..8b9cc3095906c 100644
--- chrome/browser/download/download_prefs.cc
+++ chrome/browser/download/download_prefs.cc
@@ -24,6 +24,7 @@
@@ -10,8 +10,8 @@ index 4b7fcf619a55d..139fd5b4a2bd0 100644
#include "chrome/browser/download/chrome_download_manager_delegate.h"
#include "chrome/browser/download/download_core_service_factory.h"
#include "chrome/browser/download/download_core_service_impl.h"
@@ -64,6 +65,10 @@
#include "chrome/browser/download/bubble/download_bubble_prefs.h"
@@ -61,6 +62,10 @@
#include "chrome/browser/ui/pdf/adobe_reader_info_win.h"
#endif
+#if BUILDFLAG(ENABLE_CEF)
@@ -21,7 +21,7 @@ index 4b7fcf619a55d..139fd5b4a2bd0 100644
using content::BrowserContext;
using content::BrowserThread;
using content::DownloadManager;
@@ -358,6 +363,11 @@ DownloadPrefs* DownloadPrefs::FromDownloadManager(
@@ -348,6 +353,11 @@ DownloadPrefs* DownloadPrefs::FromDownloadManager(
// static
DownloadPrefs* DownloadPrefs::FromBrowserContext(
content::BrowserContext* context) {
@@ -34,7 +34,7 @@ index 4b7fcf619a55d..139fd5b4a2bd0 100644
}
diff --git chrome/browser/printing/print_preview_dialog_controller.cc chrome/browser/printing/print_preview_dialog_controller.cc
index f2dca42faf347..458703a565501 100644
index b848ee0d185ec..c3ddbc8932f66 100644
--- chrome/browser/printing/print_preview_dialog_controller.cc
+++ chrome/browser/printing/print_preview_dialog_controller.cc
@@ -15,6 +15,7 @@
@@ -46,10 +46,10 @@ index f2dca42faf347..458703a565501 100644
#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/task_manager/web_contents_tags.h"
diff --git chrome/browser/printing/print_view_manager_base.cc chrome/browser/printing/print_view_manager_base.cc
index a2adc3c992aba..8cd9aa18e2383 100644
index 34d6001efd674..d8c99f9f01e3c 100644
--- chrome/browser/printing/print_view_manager_base.cc
+++ chrome/browser/printing/print_view_manager_base.cc
@@ -625,13 +625,14 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -610,13 +610,14 @@ void PrintViewManagerBase::UpdatePrintSettings(
job_settings.Set(kSettingRasterizePdfDpi, value);
}
@@ -104,10 +104,10 @@ index d5767fe27db0d..5778847a68208 100644
}
diff --git chrome/browser/ui/webui/print_preview/print_preview_ui.cc chrome/browser/ui/webui/print_preview/print_preview_ui.cc
index e51bf24fcc74f..ed48fb4d6968d 100644
index 2680a3e16f53f..a925307664c15 100644
--- chrome/browser/ui/webui/print_preview/print_preview_ui.cc
+++ chrome/browser/ui/webui/print_preview/print_preview_ui.cc
@@ -22,6 +22,7 @@
@@ -23,6 +23,7 @@
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
@@ -115,7 +115,7 @@ index e51bf24fcc74f..ed48fb4d6968d 100644
#include "chrome/browser/browser_process.h"
#include "chrome/browser/pdf/pdf_extension_util.h"
#include "chrome/browser/policy/management_utils.h"
@@ -100,6 +101,13 @@ const char16_t kBasicPrintShortcut[] = u"\u0028\u21e7\u2318\u0050\u0029";
@@ -101,6 +102,13 @@ const char16_t kBasicPrintShortcut[] = u"\u0028\u21e7\u2318\u0050\u0029";
const char16_t kBasicPrintShortcut[] = u"(Ctrl+Shift+P)";
#endif
@@ -129,7 +129,7 @@ index e51bf24fcc74f..ed48fb4d6968d 100644
constexpr char kInvalidArgsForDidStartPreview[] =
"Invalid arguments for DidStartPreview";
constexpr char kInvalidPageNumberForDidPreviewPage[] =
@@ -328,7 +336,7 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) {
@@ -329,7 +337,7 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) {
source->AddLocalizedStrings(kLocalizedStrings);
#if !BUILDFLAG(IS_CHROMEOS)

View File

@@ -28,10 +28,10 @@ index a013ab393c6b0..1187c26bb65f8 100644
void ResourceBundle::InitSharedInstance(Delegate* delegate) {
DCHECK(g_shared_instance_ == nullptr) << "ResourceBundle initialized twice";
diff --git ui/base/resource/resource_bundle.h ui/base/resource/resource_bundle.h
index a60f965097653..4e7819d776a2c 100644
index 1ea959098a63a..82afff58caf65 100644
--- ui/base/resource/resource_bundle.h
+++ ui/base/resource/resource_bundle.h
@@ -220,6 +220,11 @@ class COMPONENT_EXPORT(UI_BASE) ResourceBundle {
@@ -216,6 +216,11 @@ class COMPONENT_EXPORT(UI_BASE) ResourceBundle {
ResourceBundle(const ResourceBundle&) = delete;
ResourceBundle& operator=(const ResourceBundle&) = delete;

View File

@@ -1,8 +1,8 @@
diff --git build/toolchain/win/setup_toolchain.py build/toolchain/win/setup_toolchain.py
index d2f5798ce6535..64d6d388c9a27 100644
index 026bcc96c3439..cbc827b27a0ba 100644
--- build/toolchain/win/setup_toolchain.py
+++ build/toolchain/win/setup_toolchain.py
@@ -167,13 +167,17 @@ def _LoadToolchainEnv(cpu, toolchain_root, sdk_dir, target_store):
@@ -165,13 +165,17 @@ def _LoadToolchainEnv(cpu, toolchain_root, sdk_dir, target_store):
del os.environ['LIB']
if 'LIBPATH' in os.environ:
del os.environ['LIBPATH']
@@ -26,10 +26,10 @@ index d2f5798ce6535..64d6d388c9a27 100644
if (cpu != 'x64'):
# x64 is default target CPU thus any other CPU requires a target set
diff --git build/vs_toolchain.py build/vs_toolchain.py
index a420dad636df4..f1ef2e914cd5e 100755
index 6ca0be49fe8ed..28e134716c116 100755
--- build/vs_toolchain.py
+++ build/vs_toolchain.py
@@ -112,9 +112,16 @@ def SetEnvironmentAndGetRuntimeDllDirs():
@@ -106,9 +106,16 @@ def SetEnvironmentAndGetRuntimeDllDirs():
runtime_path = os.path.pathsep.join(vs_runtime_dll_dirs)
os.environ['PATH'] = runtime_path + os.path.pathsep + os.environ['PATH']
elif sys.platform == 'win32' and not depot_tools_win_toolchain:
@@ -46,7 +46,7 @@ index a420dad636df4..f1ef2e914cd5e 100755
# When using an installed toolchain these files aren't needed in the output
# directory in order to run binaries locally, but they are needed in order
# to create isolates or the mini_installer. Copying them to the output
@@ -163,6 +170,10 @@ def _RegistryGetValue(key, value):
@@ -157,6 +164,10 @@ def _RegistryGetValue(key, value):
def GetVisualStudioVersion():
"""Return best available version of Visual Studio.
"""
@@ -57,3 +57,12 @@ index a420dad636df4..f1ef2e914cd5e 100755
supported_versions = list(MSVS_VERSIONS.keys())
# VS installed in depot_tools for Googlers
@@ -430,7 +441,7 @@ def _CopyDebugger(target_dir, target_cpu):
# List of debug files that should be copied, the first element of the tuple is
# the name of the file and the second indicates if it's optional.
- debug_files = [('dbghelp.dll', False), ('dbgcore.dll', True)]
+ debug_files = []
# The UCRT is not a redistributable component on arm64.
if target_cpu != 'arm64':
debug_files.extend([('api-ms-win-downlevel-kernel32-l2-1-0.dll', False),

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