Compare commits

..

25 Commits
5672 ... 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
566 changed files with 3398 additions and 3335 deletions

View File

@@ -1,35 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen and what happened instead.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Versions (please complete the following information):**
- OS: [e.g. Windows 10, MacOS 13.2, Ubuntu 22.10]
- CEF Version: [e.g. 111.2.2]
**Additional context**
Does the problem reproduce with the cefclient or cefsimple sample application at the same version?
Does the problem reproduce with Google Chrome at the same version?
Add any other context about the problem here.

View File

@@ -1,20 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

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/113.0.5672.129',
'depot_tools_checkout': '2075f733e8'
'chromium_checkout': 'refs/tags/111.0.5563.148',
'depot_tools_checkout': '963e01c76c'
}

View File

@@ -13,7 +13,7 @@
#
# Linux: Ninja, GCC 7.5.0+, Unix Makefiles
# MacOS: Ninja, Xcode 12.2 to 13.0
# Windows: Ninja, Visual Studio 2022
# Windows: Ninja, Visual Studio 2019+
#
# Ninja is a cross-platform open-source tool for running fast builds using
# pre-installed platform toolchains (GNU, clang, Xcode or MSVC). It can be
@@ -54,9 +54,9 @@
# recommended.
#
# - Windows requirements:
# Visual Studio 2022 building on Windows 10 or newer. Windows 10/11 64-bit is
# recommended. Newer versions will likely also work but may not have been
# tested.
# Visual Studio 2019 or newer building on Windows 10 or newer. Windows 10
# 64-bit is recommended. Newer versions will likely also work but may not have
# been tested.
#
# BUILD EXAMPLES
#
@@ -96,35 +96,35 @@
# > ninja cefclient cefsimple
#
# To perform a Windows build using a 32-bit CEF binary distribution:
# Using the Visual Studio 2022 IDE:
# > cmake -G "Visual Studio 17" -A Win32 ..
# Using the Visual Studio 2019 IDE:
# > cmake -G "Visual Studio 16" -A Win32 ..
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
#
# Using Ninja with Visual Studio 2022 command-line tools:
# Using Ninja with Visual Studio 2019 command-line tools:
# (this path may be different depending on your Visual Studio installation)
# > "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars32.bat"
# > "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars32.bat"
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
# > ninja cefclient cefsimple
#
# To perform a Windows build using a 64-bit CEF binary distribution:
# Using the Visual Studio 2022 IDE:
# > cmake -G "Visual Studio 17" -A x64 ..
# Using the Visual Studio 2019 IDE:
# > cmake -G "Visual Studio 16" -A x64 ..
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
#
# Using Ninja with Visual Studio 2022 command-line tools:
# Using Ninja with Visual Studio 2019 command-line tools:
# (this path may be different depending on your Visual Studio installation)
# > "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars64.bat"
# > "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat"
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
# > ninja cefclient cefsimple
#
# To perform a Windows build using an ARM64 CEF binary distribution:
# Using the Visual Studio 2022 IDE:
# > cmake -G "Visual Studio 17" -A arm64 ..
# Using the Visual Studio 2019 IDE:
# > cmake -G "Visual Studio 16" -A arm64 ..
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
#
# Using Ninja with Visual Studio 2022 command-line tools:
# Using Ninja with Visual Studio 2019 command-line tools:
# (this path may be different depending on your Visual Studio installation)
# > "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
# > "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
# > ninja cefsimple
@@ -132,8 +132,8 @@
# Global setup.
#
# For VS2022 and Xcode 12+ support.
cmake_minimum_required(VERSION 3.21)
# For VS2019 and Xcode 12+ support.
cmake_minimum_required(VERSION 3.19)
# Only generate Debug and Release configuration types.
set(CMAKE_CONFIGURATION_TYPES Debug Release)

View File

@@ -461,7 +461,7 @@ if(OS_WINDOWS)
# only) uses fibers to switch to a 4MiB stack at runtime via
# CefRunWinMainWithPreferredStackSize().
list(APPEND CEF_EXE_LINKER_FLAGS
/STACK:0x80000
/STACK:0x8000
)
else()
# Increase the initial stack size to 8MiB from the default 1MiB.
@@ -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=94e93810316b74e54eb315d97c6fc6f1cc0c9cc5$
// $hash=e38c41a553d518abcd1b912d32281e99b93c4fd7$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_DELEGATE_CAPI_H_
@@ -120,18 +120,6 @@ typedef struct _cef_browser_view_delegate_t {
///
cef_chrome_toolbar_type_t(CEF_CALLBACK* get_chrome_toolbar_type)(
struct _cef_browser_view_delegate_t* self);
///
/// Called when |browser_view| receives a gesture command. Return true (1) to
/// handle (or disable) a |gesture_command| or false (0) to propagate the
/// gesture to the browser for default handling. This function will only be
/// called with the Alloy runtime. To handle these commands with the Chrome
/// runtime implement cef_command_handler_t::OnChromeCommand instead.
///
int(CEF_CALLBACK* on_gesture_command)(
struct _cef_browser_view_delegate_t* self,
struct _cef_browser_view_t* browser_view,
cef_gesture_command_t gesture_command);
} cef_browser_view_delegate_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=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 "509090f3945a0c74991845085f47240f11389523"
#define CEF_API_HASH_UNIVERSAL "1d8347d8e06dc0dd17f882ca253e1c7bf43d5863"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "1c9ed9d86408e2d84cf88d4a8c865a2872eb40bd"
#define CEF_API_HASH_PLATFORM "b6865f1992a10dcefc0bbc450cf296b648003271"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "8cc9baa9653847ce54b2da84431d573bc3669505"
#define CEF_API_HASH_PLATFORM "d04c2a5ab471493c185eb7c7aa894bc4a79d5a7c"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "741b042aa3d663f9e4ffad0b59d1bfb4faa03e70"
#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

@@ -3000,8 +3000,8 @@ typedef enum {
/// Structure representing a range.
///
typedef struct _cef_range_t {
uint32_t from;
uint32_t to;
int from;
int to;
} cef_range_t;
///
@@ -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.
///
@@ -3488,14 +3443,6 @@ typedef enum {
CEF_PREFERENCES_TYPE_REQUEST_CONTEXT,
} cef_preferences_type_t;
///
/// Specifies the gesture commands.
///
typedef enum {
CEF_GESTURE_COMMAND_BACK,
CEF_GESTURE_COMMAND_FORWARD,
} cef_gesture_command_t;
#ifdef __cplusplus
}
#endif

View File

@@ -31,8 +31,6 @@
#define CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_
#pragma once
#include <limits>
#include "include/internal/cef_string.h"
#include "include/internal/cef_string_list.h"
#include "include/internal/cef_types.h"
@@ -217,12 +215,7 @@ class CefRange : public cef_range_t {
public:
CefRange() : cef_range_t{} {}
CefRange(const cef_range_t& r) : cef_range_t(r) {}
CefRange(uint32_t from, uint32_t to) : cef_range_t{from, to} {}
static CefRange InvalidRange() {
return CefRange((std::numeric_limits<uint32_t>::max)(),
(std::numeric_limits<uint32_t>::max)());
}
CefRange(int from, int to) : cef_range_t{from, to} {}
void Set(int from_val, int to_val) { from = from_val, to = to_val; }
};

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

@@ -114,19 +114,6 @@ class CefBrowserViewDelegate : public CefViewDelegate {
///
/*--cef(default_retval=CEF_CTT_NONE)--*/
virtual ChromeToolbarType GetChromeToolbarType() { return CEF_CTT_NONE; }
///
/// Called when |browser_view| receives a gesture command. Return true to
/// handle (or disable) a |gesture_command| or false to propagate the gesture
/// to the browser for default handling. This method will only be called with
/// the Alloy runtime. To handle these commands with the Chrome runtime
/// implement CefCommandHandler::OnChromeCommand instead.
///
/*--cef()--*/
virtual bool OnGestureCommand(CefRefPtr<CefBrowserView> browser_view,
cef_gesture_command_t gesture_command) {
return false;
}
};
#endif // CEF_INCLUDE_VIEWS_CEF_BROWSER_VIEW_DELEGATE_H_

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

@@ -440,30 +440,30 @@ ProfileKey* AlloyBrowserContext::GetProfileKey() const {
policy::SchemaRegistryService*
AlloyBrowserContext::GetPolicySchemaRegistryService() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
policy::UserCloudPolicyManager*
AlloyBrowserContext::GetUserCloudPolicyManager() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
policy::ProfilePolicyConnector*
AlloyBrowserContext::GetProfilePolicyConnector() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
const policy::ProfilePolicyConnector*
AlloyBrowserContext::GetProfilePolicyConnector() const {
DCHECK(false);
NOTREACHED();
return nullptr;
}
bool AlloyBrowserContext::IsNewProfile() const {
DCHECK(false);
NOTREACHED();
return false;
}

View File

@@ -296,7 +296,7 @@ void AlloyBrowserHostImpl::CloseBrowser(bool force_close) {
bool AlloyBrowserHostImpl::TryCloseBrowser() {
if (!CEF_CURRENTLY_ON_UIT()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return false;
}
@@ -333,7 +333,7 @@ CefWindowHandle AlloyBrowserHostImpl::GetOpenerWindowHandle() {
double AlloyBrowserHostImpl::GetZoomLevel() {
// Verify that this method is being called on the UI thread.
if (!CEF_CURRENTLY_ON_UIT()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return 0;
}
@@ -416,7 +416,7 @@ void AlloyBrowserHostImpl::CloseDevTools() {
bool AlloyBrowserHostImpl::HasDevTools() {
if (!CEF_CURRENTLY_ON_UIT()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return false;
}
@@ -481,7 +481,7 @@ void AlloyBrowserHostImpl::WasResized() {
void AlloyBrowserHostImpl::WasHidden(bool hidden) {
if (!IsWindowless()) {
DCHECK(false) << "Window rendering is not disabled";
NOTREACHED() << "Window rendering is not disabled";
return;
}
@@ -498,7 +498,7 @@ void AlloyBrowserHostImpl::WasHidden(bool hidden) {
void AlloyBrowserHostImpl::NotifyScreenInfoChanged() {
if (!IsWindowless()) {
DCHECK(false) << "Window rendering is not disabled";
NOTREACHED() << "Window rendering is not disabled";
return;
}
@@ -516,7 +516,7 @@ void AlloyBrowserHostImpl::NotifyScreenInfoChanged() {
void AlloyBrowserHostImpl::Invalidate(PaintElementType type) {
if (!IsWindowless()) {
DCHECK(false) << "Window rendering is not disabled";
NOTREACHED() << "Window rendering is not disabled";
return;
}
@@ -533,7 +533,7 @@ void AlloyBrowserHostImpl::Invalidate(PaintElementType type) {
void AlloyBrowserHostImpl::SendExternalBeginFrame() {
if (!IsWindowless()) {
DCHECK(false) << "Window rendering is not disabled";
NOTREACHED() << "Window rendering is not disabled";
return;
}
@@ -551,7 +551,7 @@ void AlloyBrowserHostImpl::SendExternalBeginFrame() {
void AlloyBrowserHostImpl::SendTouchEvent(const CefTouchEvent& event) {
if (!IsWindowless()) {
DCHECK(false) << "Window rendering is not disabled";
NOTREACHED() << "Window rendering is not disabled";
return;
}
@@ -582,7 +582,7 @@ void AlloyBrowserHostImpl::SendCaptureLostEvent() {
int AlloyBrowserHostImpl::GetWindowlessFrameRate() {
// Verify that this method is being called on the UI thread.
if (!CEF_CURRENTLY_ON_UIT()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return 0;
}
@@ -795,7 +795,7 @@ void AlloyBrowserHostImpl::ImeSetComposition(
const CefRange& replacement_range,
const CefRange& selection_range) {
if (!IsWindowless()) {
DCHECK(false) << "Window rendering is not disabled";
NOTREACHED() << "Window rendering is not disabled";
return;
}
@@ -817,7 +817,7 @@ void AlloyBrowserHostImpl::ImeCommitText(const CefString& text,
const CefRange& replacement_range,
int relative_cursor_pos) {
if (!IsWindowless()) {
DCHECK(false) << "Window rendering is not disabled";
NOTREACHED() << "Window rendering is not disabled";
return;
}
@@ -836,7 +836,7 @@ void AlloyBrowserHostImpl::ImeCommitText(const CefString& text,
void AlloyBrowserHostImpl::ImeFinishComposingText(bool keep_selection) {
if (!IsWindowless()) {
DCHECK(false) << "Window rendering is not disabled";
NOTREACHED() << "Window rendering is not disabled";
return;
}
@@ -854,7 +854,7 @@ void AlloyBrowserHostImpl::ImeFinishComposingText(bool keep_selection) {
void AlloyBrowserHostImpl::ImeCancelComposition() {
if (!IsWindowless()) {
DCHECK(false) << "Window rendering is not disabled";
NOTREACHED() << "Window rendering is not disabled";
return;
}
@@ -875,7 +875,7 @@ void AlloyBrowserHostImpl::DragTargetDragEnter(
const CefMouseEvent& event,
CefBrowserHost::DragOperationsMask allowed_ops) {
if (!IsWindowless()) {
DCHECK(false) << "Window rendering is not disabled";
NOTREACHED() << "Window rendering is not disabled";
return;
}
@@ -887,7 +887,7 @@ void AlloyBrowserHostImpl::DragTargetDragEnter(
}
if (!drag_data.get()) {
DCHECK(false);
NOTREACHED();
return;
}
@@ -900,7 +900,7 @@ void AlloyBrowserHostImpl::DragTargetDragOver(
const CefMouseEvent& event,
CefBrowserHost::DragOperationsMask allowed_ops) {
if (!IsWindowless()) {
DCHECK(false) << "Window rendering is not disabled";
NOTREACHED() << "Window rendering is not disabled";
return;
}
@@ -918,7 +918,7 @@ void AlloyBrowserHostImpl::DragTargetDragOver(
void AlloyBrowserHostImpl::DragTargetDragLeave() {
if (!IsWindowless()) {
DCHECK(false) << "Window rendering is not disabled";
NOTREACHED() << "Window rendering is not disabled";
return;
}
@@ -936,7 +936,7 @@ void AlloyBrowserHostImpl::DragTargetDragLeave() {
void AlloyBrowserHostImpl::DragTargetDrop(const CefMouseEvent& event) {
if (!IsWindowless()) {
DCHECK(false) << "Window rendering is not disabled";
NOTREACHED() << "Window rendering is not disabled";
return;
}
@@ -953,7 +953,7 @@ void AlloyBrowserHostImpl::DragTargetDrop(const CefMouseEvent& event) {
void AlloyBrowserHostImpl::DragSourceSystemDragEnded() {
if (!IsWindowless()) {
DCHECK(false) << "Window rendering is not disabled";
NOTREACHED() << "Window rendering is not disabled";
return;
}
@@ -974,7 +974,7 @@ void AlloyBrowserHostImpl::DragSourceEndedAt(
int y,
CefBrowserHost::DragOperationsMask op) {
if (!IsWindowless()) {
DCHECK(false) << "Window rendering is not disabled";
NOTREACHED() << "Window rendering is not disabled";
return;
}
@@ -1004,7 +1004,7 @@ void AlloyBrowserHostImpl::SetAudioMuted(bool mute) {
bool AlloyBrowserHostImpl::IsAudioMuted() {
if (!CEF_CURRENTLY_ON_UIT()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return false;
}
if (!web_contents()) {

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"
@@ -75,7 +74,7 @@
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
#include "components/os_crypt/sync/os_crypt.h"
#include "components/os_crypt/os_crypt.h"
#endif
#if BUILDFLAG(IS_LINUX)
@@ -84,7 +83,7 @@
#include "chrome/browser/ui/views/theme_profile_key.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/grit/chromium_strings.h"
#include "components/os_crypt/sync/key_storage_config_linux.h"
#include "components/os_crypt/key_storage_config_linux.h"
#include "libcef/browser/printing/print_dialog_linux.h"
#include "ui/base/cursor/cursor_factory.h"
#include "ui/base/ime/input_method.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"
@@ -89,7 +89,6 @@
#include "components/pdf/browser/pdf_url_loader_request_interceptor.h"
#include "components/pdf/browser/pdf_web_contents_helper.h"
#include "components/pdf/common/internal_plugin_helpers.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "components/spellcheck/common/spellcheck.mojom.h"
#include "components/version_info/version_info.h"
#include "content/browser/plugin_service_impl.h"
@@ -158,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"
@@ -288,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,
@@ -924,10 +918,8 @@ AlloyContentBrowserClient::CreateURLLoaderThrottles(
Profile* profile = Profile::FromBrowserContext(browser_context);
chrome::mojom::DynamicParams dynamic_params = {
profile->GetPrefs()->GetBoolean(
policy::policy_prefs::kForceGoogleSafeSearch),
profile->GetPrefs()->GetInteger(
policy::policy_prefs::kForceYouTubeRestrict),
profile->GetPrefs()->GetBoolean(prefs::kForceGoogleSafeSearch),
profile->GetPrefs()->GetInteger(prefs::kForceYouTubeRestrict),
profile->GetPrefs()->GetString(prefs::kAllowedDomainsForApps)};
result.push_back(
std::make_unique<GoogleURLLoaderThrottle>(std::move(dynamic_params)));
@@ -1258,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));
@@ -1368,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

@@ -219,7 +219,7 @@ void CefBrowserPlatformDelegateAlloy::CreateExtensionHost(
extension, web_contents_, url, host_type);
// Load will be triggered by ProcessManager::CreateBackgroundHost.
} else {
DCHECK(false) << " Unsupported extension host type: " << host_type;
NOTREACHED() << " Unsupported extension host type: " << host_type;
}
}

View File

@@ -32,7 +32,6 @@
#include "content/public/browser/network_service_instance.h"
#include "content/public/common/content_switches.h"
#include "net/log/net_log_capture_mode.h"
#include "services/device/public/cpp/geolocation/geolocation_manager.h"
#include "services/network/public/cpp/network_switches.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
@@ -136,27 +135,22 @@ void ChromeBrowserProcessAlloy::CleanupOnUIThread() {
}
void ChromeBrowserProcessAlloy::EndSession() {
DCHECK(false);
NOTREACHED();
}
void ChromeBrowserProcessAlloy::FlushLocalStateAndReply(
base::OnceClosure reply) {
DCHECK(false);
}
device::GeolocationManager* ChromeBrowserProcessAlloy::geolocation_manager() {
DCHECK(false);
return nullptr;
NOTREACHED();
}
metrics_services_manager::MetricsServicesManager*
ChromeBrowserProcessAlloy::GetMetricsServicesManager() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
metrics::MetricsService* ChromeBrowserProcessAlloy::metrics_service() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
@@ -168,7 +162,7 @@ ChromeBrowserProcessAlloy::system_network_context_manager() {
network::NetworkQualityTracker*
ChromeBrowserProcessAlloy::network_quality_tracker() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
@@ -197,17 +191,17 @@ PrefService* ChromeBrowserProcessAlloy::local_state() {
scoped_refptr<network::SharedURLLoaderFactory>
ChromeBrowserProcessAlloy::shared_url_loader_factory() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
variations::VariationsService* ChromeBrowserProcessAlloy::variations_service() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
BrowserProcessPlatformPart* ChromeBrowserProcessAlloy::platform_part() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
@@ -218,21 +212,16 @@ ChromeBrowserProcessAlloy::extension_event_router_forwarder() {
}
NotificationUIManager* ChromeBrowserProcessAlloy::notification_ui_manager() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
NotificationPlatformBridge*
ChromeBrowserProcessAlloy::notification_platform_bridge() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
void ChromeBrowserProcessAlloy::SetGeolocationManager(
std::unique_ptr<device::GeolocationManager> geolocation_manager) {
DCHECK(false);
}
policy::ChromeBrowserPolicyConnector*
ChromeBrowserProcessAlloy::browser_policy_connector() {
if (!browser_policy_connector_) {
@@ -247,25 +236,25 @@ policy::PolicyService* ChromeBrowserProcessAlloy::policy_service() {
}
IconManager* ChromeBrowserProcessAlloy::icon_manager() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
GpuModeManager* ChromeBrowserProcessAlloy::gpu_mode_manager() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
void ChromeBrowserProcessAlloy::CreateDevToolsProtocolHandler() {
DCHECK(false);
NOTREACHED();
}
void ChromeBrowserProcessAlloy::CreateDevToolsAutoOpener() {
DCHECK(false);
NOTREACHED();
}
bool ChromeBrowserProcessAlloy::IsShuttingDown() {
DCHECK(false);
NOTREACHED();
return false;
}
@@ -294,7 +283,7 @@ ChromeBrowserProcessAlloy::background_printing_manager() {
IntranetRedirectDetector*
ChromeBrowserProcessAlloy::intranet_redirect_detector() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
@@ -309,29 +298,29 @@ void ChromeBrowserProcessAlloy::SetApplicationLocale(
}
DownloadStatusUpdater* ChromeBrowserProcessAlloy::download_status_updater() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
DownloadRequestLimiter* ChromeBrowserProcessAlloy::download_request_limiter() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
BackgroundModeManager* ChromeBrowserProcessAlloy::background_mode_manager() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
void ChromeBrowserProcessAlloy::set_background_mode_manager_for_test(
std::unique_ptr<BackgroundModeManager> manager) {
DCHECK(false);
NOTREACHED();
}
#endif
StatusTray* ChromeBrowserProcessAlloy::status_tray() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
@@ -342,12 +331,12 @@ ChromeBrowserProcessAlloy::safe_browsing_service() {
subresource_filter::RulesetService*
ChromeBrowserProcessAlloy::subresource_filter_ruleset_service() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
StartupData* ChromeBrowserProcessAlloy::startup_data() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
@@ -379,55 +368,61 @@ ChromeBrowserProcessAlloy::component_updater() {
MediaFileSystemRegistry*
ChromeBrowserProcessAlloy::media_file_system_registry() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
WebRtcLogUploader* ChromeBrowserProcessAlloy::webrtc_log_uploader() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
network_time::NetworkTimeTracker*
ChromeBrowserProcessAlloy::network_time_tracker() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
gcm::GCMDriver* ChromeBrowserProcessAlloy::gcm_driver() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
resource_coordinator::TabManager* ChromeBrowserProcessAlloy::GetTabManager() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
resource_coordinator::ResourceCoordinatorParts*
ChromeBrowserProcessAlloy::resource_coordinator_parts() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
BuildState* ChromeBrowserProcessAlloy::GetBuildState() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
SerialPolicyAllowedPorts*
ChromeBrowserProcessAlloy::serial_policy_allowed_ports() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
HidPolicyAllowedDevices*
ChromeBrowserProcessAlloy::hid_policy_allowed_devices() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
breadcrumbs::BreadcrumbPersistentStorageManager*
ChromeBrowserProcessAlloy::GetBreadcrumbPersistentStorageManager() {
NOTREACHED();
return nullptr;
}
HidSystemTrayIcon* ChromeBrowserProcessAlloy::hid_system_tray_icon() {
DCHECK(false);
NOTREACHED();
return nullptr;
}

View File

@@ -51,7 +51,6 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
// BrowserProcess implementation.
void EndSession() override;
void FlushLocalStateAndReply(base::OnceClosure reply) override;
device::GeolocationManager* geolocation_manager() override;
metrics_services_manager::MetricsServicesManager* GetMetricsServicesManager()
override;
metrics::MetricsService* metrics_service() override;
@@ -66,8 +65,6 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
extensions::EventRouterForwarder* extension_event_router_forwarder() override;
NotificationUIManager* notification_ui_manager() override;
NotificationPlatformBridge* notification_platform_bridge() override;
void SetGeolocationManager(
std::unique_ptr<device::GeolocationManager> geolocation_manager) override;
policy::ChromeBrowserPolicyConnector* browser_policy_connector() override;
policy::PolicyService* policy_service() override;
IconManager* icon_manager() override;
@@ -110,6 +107,8 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
BuildState* GetBuildState() override;
SerialPolicyAllowedPorts* serial_policy_allowed_ports() override;
HidPolicyAllowedDevices* hid_policy_allowed_devices() override;
breadcrumbs::BreadcrumbPersistentStorageManager*
GetBreadcrumbPersistentStorageManager() override;
HidSystemTrayIcon* hid_system_tray_icon() override;
private:

View File

@@ -54,7 +54,7 @@ bool ChromeProfileAlloy::IsOffTheRecord() const {
}
const Profile::OTRProfileID& ChromeProfileAlloy::GetOTRProfileID() const {
DCHECK(false);
NOTREACHED();
static base::NoDestructor<Profile::OTRProfileID> otr_profile_id(
Profile::OTRProfileID::PrimaryID());
return *otr_profile_id;
@@ -68,19 +68,19 @@ variations::VariationsClient* ChromeProfileAlloy::GetVariationsClient() {
}
scoped_refptr<base::SequencedTaskRunner> ChromeProfileAlloy::GetIOTaskRunner() {
DCHECK(false);
NOTREACHED();
return scoped_refptr<base::SequencedTaskRunner>();
}
std::string ChromeProfileAlloy::GetProfileUserName() const {
DCHECK(false);
NOTREACHED();
return std::string();
}
Profile* ChromeProfileAlloy::GetOffTheRecordProfile(
const Profile::OTRProfileID& otr_profile_id,
bool create_if_needed) {
DCHECK(false);
NOTREACHED();
return nullptr;
}
@@ -89,7 +89,7 @@ std::vector<Profile*> ChromeProfileAlloy::GetAllOffTheRecordProfiles() {
}
void ChromeProfileAlloy::DestroyOffTheRecordProfile(Profile* otr_profile) {
DCHECK(false);
NOTREACHED();
}
bool ChromeProfileAlloy::HasOffTheRecordProfile(
@@ -115,17 +115,17 @@ bool ChromeProfileAlloy::IsChild() const {
ExtensionSpecialStoragePolicy*
ChromeProfileAlloy::GetExtensionSpecialStoragePolicy() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
bool ChromeProfileAlloy::IsSameOrParent(Profile* profile) {
DCHECK(false);
NOTREACHED();
return false;
}
base::Time ChromeProfileAlloy::GetStartTime() const {
DCHECK(false);
NOTREACHED();
return base::Time();
}
@@ -139,30 +139,30 @@ void ChromeProfileAlloy::set_last_selected_directory(
}
GURL ChromeProfileAlloy::GetHomePage() {
DCHECK(false);
NOTREACHED();
return GURL();
}
bool ChromeProfileAlloy::WasCreatedByVersionOrLater(
const std::string& version) {
DCHECK(false);
NOTREACHED();
return false;
}
base::Time ChromeProfileAlloy::GetCreationTime() const {
DCHECK(false);
NOTREACHED();
return base::Time();
}
void ChromeProfileAlloy::SetCreationTimeForTesting(base::Time creation_time) {
DCHECK(false);
NOTREACHED();
}
void ChromeProfileAlloy::RecordPrimaryMainFrameNavigation() {
DCHECK(false);
NOTREACHED();
}
bool ChromeProfileAlloy::IsSignedIn() {
DCHECK(false);
NOTREACHED();
return false;
}

View File

@@ -29,7 +29,7 @@ class AlloyConstrainedWindowViewsClient
if (auto browser = GetPreferredBrowser(parent)) {
return browser->platform_delegate()->GetWebContentsModalDialogHost();
}
DCHECK(false);
NOTREACHED();
return nullptr;
}
@@ -73,4 +73,4 @@ class AlloyConstrainedWindowViewsClient
std::unique_ptr<constrained_window::ConstrainedWindowViewsClient>
CreateAlloyConstrainedWindowViewsClient() {
return std::make_unique<AlloyConstrainedWindowViewsClient>();
}
}

View File

@@ -33,7 +33,7 @@ bool AlloyWebContentsDialogHelper::IsWebContentsVisible(
} else if (auto native_view = web_contents->GetNativeView()) {
return platform_util::IsVisible(native_view);
}
DCHECK(false);
NOTREACHED();
return false;
}
@@ -51,7 +51,7 @@ gfx::NativeView AlloyWebContentsDialogHelper::GetHostView() const {
if (auto widget = browser_delegate_->GetWindowWidget()) {
return widget->GetNativeView();
}
DCHECK(false);
NOTREACHED();
return gfx::NativeView();
}
@@ -66,7 +66,7 @@ gfx::AcceleratedWidget AlloyWebContentsDialogHelper::GetHostWidget() const {
return parent_widget;
}
#endif // defined(USE_AURA)
DCHECK(false);
NOTREACHED();
return gfx::kNullAcceleratedWidget;
}

View File

@@ -77,6 +77,6 @@ CefRefPtr<CefFrameHostImpl> CefBrowserFrame::GetFrameHost(
return browser->browser_info()->GetFrameForHost(rfh, nullptr,
prefer_speculative);
}
DCHECK(false);
NOTREACHED();
return nullptr;
}

View File

@@ -493,7 +493,7 @@ void CefBrowserHostBase::GetNavigationEntries(
CefRefPtr<CefNavigationEntry> CefBrowserHostBase::GetVisibleNavigationEntry() {
if (!CEF_CURRENTLY_ON_UIT()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return nullptr;
}

View File

@@ -53,20 +53,20 @@ bool CefBrowserHost::CreateBrowser(
CefRefPtr<CefRequestContext> request_context) {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return false;
}
// Verify that the settings structure is a valid size.
if (settings.size != sizeof(cef_browser_settings_t)) {
DCHECK(false) << "invalid CefBrowserSettings structure size";
NOTREACHED() << "invalid CefBrowserSettings structure size";
return false;
}
// Verify windowless rendering requirements.
if (windowInfo.windowless_rendering_enabled &&
!client->GetRenderHandler().get()) {
DCHECK(false) << "CefRenderHandler implementation is required";
NOTREACHED() << "CefRenderHandler implementation is required";
return false;
}
@@ -110,13 +110,13 @@ CefRefPtr<CefBrowser> CefBrowserHost::CreateBrowserSync(
CefRefPtr<CefRequestContext> request_context) {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return nullptr;
}
// Verify that the settings structure is a valid size.
if (settings.size != sizeof(cef_browser_settings_t)) {
DCHECK(false) << "invalid CefBrowserSettings structure size";
NOTREACHED() << "invalid CefBrowserSettings structure size";
return nullptr;
}
@@ -134,7 +134,7 @@ CefRefPtr<CefBrowser> CefBrowserHost::CreateBrowserSync(
// Verify windowless rendering requirements.
if (windowInfo.windowless_rendering_enabled &&
!client->GetRenderHandler().get()) {
DCHECK(false) << "CefRenderHandler implementation is required";
NOTREACHED() << "CefRenderHandler implementation is required";
return nullptr;
}

View File

@@ -358,7 +358,7 @@ void CefBrowserInfoManager::RemoveBrowserInfo(
}
}
DCHECK(false);
NOTREACHED();
}
void CefBrowserInfoManager::DestroyAllBrowsers() {

View File

@@ -20,14 +20,14 @@ CefBrowserPlatformDelegate::~CefBrowserPlatformDelegate() {
content::WebContents* CefBrowserPlatformDelegate::CreateWebContents(
CefBrowserCreateParams& create_params,
bool& own_web_contents) {
DCHECK(false);
NOTREACHED();
return nullptr;
}
void CefBrowserPlatformDelegate::CreateViewForWebContents(
content::WebContentsView** view,
content::RenderViewHostDelegateView** delegate_view) {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::WebContentsCreated(
@@ -48,7 +48,7 @@ void CefBrowserPlatformDelegate::AddNewContents(
const blink::mojom::WindowFeatures& window_features,
bool user_gesture,
bool* was_blocked) {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::WebContentsDestroyed(
@@ -87,12 +87,12 @@ void CefBrowserPlatformDelegate::CreateExtensionHost(
const extensions::Extension* extension,
const GURL& url,
extensions::mojom::ViewType host_type) {
DCHECK(false);
NOTREACHED();
}
extensions::ExtensionHost* CefBrowserPlatformDelegate::GetExtensionHost()
const {
DCHECK(false);
NOTREACHED();
return nullptr;
}
@@ -109,32 +109,32 @@ void CefBrowserPlatformDelegate::BrowserDestroyed(CefBrowserHostBase* browser) {
}
bool CefBrowserPlatformDelegate::CreateHostWindow() {
DCHECK(false);
NOTREACHED();
return true;
}
void CefBrowserPlatformDelegate::CloseHostWindow() {
DCHECK(false);
NOTREACHED();
}
CefWindowHandle CefBrowserPlatformDelegate::GetHostWindowHandle() const {
DCHECK(false);
NOTREACHED();
return kNullWindowHandle;
}
views::Widget* CefBrowserPlatformDelegate::GetWindowWidget() const {
DCHECK(false);
NOTREACHED();
return nullptr;
}
CefRefPtr<CefBrowserView> CefBrowserPlatformDelegate::GetBrowserView() const {
DCHECK(false);
NOTREACHED();
return nullptr;
}
web_modal::WebContentsModalDialogHost*
CefBrowserPlatformDelegate::GetWebContentsModalDialogHost() const {
DCHECK(false);
NOTREACHED();
return nullptr;
}
@@ -150,12 +150,12 @@ void CefBrowserPlatformDelegate::PopupBrowserCreated(
bool is_devtools) {}
SkColor CefBrowserPlatformDelegate::GetBackgroundColor() const {
DCHECK(false);
NOTREACHED();
return SkColor();
}
void CefBrowserPlatformDelegate::WasResized() {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::SendKeyEvent(const CefKeyEvent& event) {
@@ -200,7 +200,7 @@ void CefBrowserPlatformDelegate::SizeTo(int width, int height) {}
gfx::Point CefBrowserPlatformDelegate::GetScreenPoint(
const gfx::Point& view,
bool want_dip_coords) const {
DCHECK(false);
NOTREACHED();
return gfx::Point();
}
@@ -210,7 +210,7 @@ void CefBrowserPlatformDelegate::ViewText(const std::string& text) {
bool CefBrowserPlatformDelegate::HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) {
DCHECK(false);
NOTREACHED();
return false;
}
@@ -227,7 +227,7 @@ bool CefBrowserPlatformDelegate::IsNeverComposited(
CefEventHandle CefBrowserPlatformDelegate::GetEventHandle(
const content::NativeWebKeyboardEvent& event) const {
DCHECK(false);
NOTREACHED();
return kNullEventHandle;
}
@@ -256,28 +256,28 @@ bool CefBrowserPlatformDelegate::HasExternalParent() const {
}
void CefBrowserPlatformDelegate::WasHidden(bool hidden) {
DCHECK(false);
NOTREACHED();
}
bool CefBrowserPlatformDelegate::IsHidden() const {
DCHECK(false);
NOTREACHED();
return false;
}
void CefBrowserPlatformDelegate::NotifyScreenInfoChanged() {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::Invalidate(cef_paint_element_type_t type) {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::SendExternalBeginFrame() {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::SetWindowlessFrameRate(int frame_rate) {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::ImeSetComposition(
@@ -285,43 +285,43 @@ void CefBrowserPlatformDelegate::ImeSetComposition(
const std::vector<CefCompositionUnderline>& underlines,
const CefRange& replacement_range,
const CefRange& selection_range) {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::ImeCommitText(
const CefString& text,
const CefRange& replacement_range,
int relative_cursor_pos) {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::ImeFinishComposingText(bool keep_selection) {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::ImeCancelComposition() {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::DragTargetDragEnter(
CefRefPtr<CefDragData> drag_data,
const CefMouseEvent& event,
cef_drag_operations_mask_t allowed_ops) {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::DragTargetDragOver(
const CefMouseEvent& event,
cef_drag_operations_mask_t allowed_ops) {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::DragTargetDragLeave() {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::DragTargetDrop(const CefMouseEvent& event) {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::StartDragging(
@@ -331,33 +331,33 @@ void CefBrowserPlatformDelegate::StartDragging(
const gfx::Vector2d& image_offset,
const blink::mojom::DragEventSourceInfo& event_info,
content::RenderWidgetHostImpl* source_rwh) {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::UpdateDragCursor(
ui::mojom::DragOperation operation) {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::DragSourceEndedAt(
int x,
int y,
cef_drag_operations_mask_t op) {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::DragSourceSystemDragEnded() {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::AccessibilityEventReceived(
const content::AXEventNotificationDetails& eventData) {
DCHECK(false);
NOTREACHED();
}
void CefBrowserPlatformDelegate::AccessibilityLocationChangesReceived(
const std::vector<content::AXLocationChangeNotificationDetails>& locData) {
DCHECK(false);
NOTREACHED();
}
gfx::Point CefBrowserPlatformDelegate::GetDialogPosition(

View File

@@ -138,6 +138,6 @@ std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
return std::move(native_delegate);
}
DCHECK(false);
NOTREACHED();
return nullptr;
}

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

@@ -56,7 +56,7 @@ CefBrowserPlatformDelegateChrome::GetWebContentsModalDialogHost() const {
ChromeWebModalDialogManagerDelegate* manager = chrome_browser_;
return manager->GetWebContentsModalDialogHost();
}
DCHECK(false);
NOTREACHED();
return nullptr;
}
@@ -143,6 +143,6 @@ gfx::NativeWindow CefBrowserPlatformDelegateChrome::GetNativeWindow() const {
if (chrome_browser_ && chrome_browser_->window()) {
return chrome_browser_->window()->GetNativeWindow();
}
DCHECK(false);
NOTREACHED();
return gfx::NativeWindow();
}

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"
@@ -299,7 +300,7 @@ bool CefInitialize(const CefMainArgs& args,
}
if (settings.size != sizeof(cef_settings_t)) {
DCHECK(false) << "invalid CefSettings structure size";
NOTREACHED() << "invalid CefSettings structure size";
return false;
}
@@ -314,13 +315,13 @@ bool CefInitialize(const CefMainArgs& args,
void CefShutdown() {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return;
}
// Must always be called on the same thread as Initialize.
if (!g_context->OnInitThread()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return;
}
@@ -335,13 +336,13 @@ void CefShutdown() {
void CefDoMessageLoopWork() {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return;
}
// Must always be called on the same thread as Initialize.
if (!g_context->OnInitThread()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return;
}
@@ -352,13 +353,13 @@ void CefDoMessageLoopWork() {
void CefRunMessageLoop() {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return;
}
// Must always be called on the same thread as Initialize.
if (!g_context->OnInitThread()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return;
}
@@ -368,13 +369,13 @@ void CefRunMessageLoop() {
void CefQuitMessageLoop() {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return;
}
// Must always be called on the same thread as Initialize.
if (!g_context->OnInitThread()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return;
}
@@ -400,10 +401,14 @@ 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()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return;
}

View File

@@ -227,7 +227,7 @@ class CefDevToolsFrontend::NetworkResourceLoader
bindings_->loaders_.erase(bindings_->loaders_.find(this));
}
void OnRetry(base::OnceClosure start_retry) override { DCHECK(false); }
void OnRetry(base::OnceClosure start_retry) override { NOTREACHED(); }
const int stream_id_;
CefDevToolsFrontend* const bindings_;

View File

@@ -94,7 +94,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
base::FilePath dir_path = suggested_path.DirName();
if (!base::DirectoryExists(dir_path) &&
!base::CreateDirectory(dir_path)) {
DCHECK(false) << "failed to create the download directory";
NOTREACHED() << "failed to create the download directory";
suggested_path.clear();
}
}

View File

@@ -54,7 +54,7 @@ CefRefPtr<CefExtensionHandler> CefExtensionImpl::GetHandler() {
CefRefPtr<CefRequestContext> CefExtensionImpl::GetLoaderContext() {
if (!CEF_CURRENTLY_ON_UIT()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return nullptr;
}
@@ -63,7 +63,7 @@ CefRefPtr<CefRequestContext> CefExtensionImpl::GetLoaderContext() {
bool CefExtensionImpl::IsLoaded() {
if (!CEF_CURRENTLY_ON_UIT()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return false;
}

View File

@@ -69,9 +69,9 @@ ExtensionFunction::ResponseAction TabsGetFunction::Run() {
TabsCreateFunction::TabsCreateFunction() : cef_details_(this) {}
ExtensionFunction::ResponseAction TabsCreateFunction::Run() {
absl::optional<tabs::Create::Params> params =
tabs::Create::Params::Create(args());
EXTENSION_FUNCTION_VALIDATE(params);
std::unique_ptr<tabs::Create::Params> params(
tabs::Create::Params::Create(args()));
EXTENSION_FUNCTION_VALIDATE(params.get());
CefExtensionFunctionDetails::OpenTabParams options;
options.window_id = params->create_properties.window_id;
@@ -108,9 +108,9 @@ content::WebContents* BaseAPIFunction::GetWebContents(int tab_id) {
}
ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
absl::optional<tabs::Update::Params> params =
tabs::Update::Params::Create(args());
EXTENSION_FUNCTION_VALIDATE(params);
std::unique_ptr<tabs::Update::Params> params(
tabs::Update::Params::Create(args()));
EXTENSION_FUNCTION_VALIDATE(params.get());
tab_id_ = params->tab_id ? *params->tab_id : -1;
content::WebContents* web_contents = GetWebContents(tab_id_);
@@ -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(), browser_context());
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;
}
@@ -278,7 +274,7 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() {
return set_init_result(VALIDATION_FAILURE);
}
std::unique_ptr<InjectDetails> details(new InjectDetails());
if (!InjectDetails::Populate(details_value.GetDict(), *details)) {
if (!InjectDetails::Populate(details_value, details.get())) {
return set_init_result(VALIDATION_FAILURE);
}
@@ -419,8 +415,8 @@ bool TabsRemoveCSSFunction::ShouldRemoveCSS() const {
}
ExtensionFunction::ResponseAction TabsSetZoomFunction::Run() {
absl::optional<tabs::SetZoom::Params> params =
tabs::SetZoom::Params::Create(args());
std::unique_ptr<tabs::SetZoom::Params> params(
tabs::SetZoom::Params::Create(args()));
EXTENSION_FUNCTION_VALIDATE(params);
int tab_id = params->tab_id ? *params->tab_id : -1;
@@ -451,8 +447,8 @@ ExtensionFunction::ResponseAction TabsSetZoomFunction::Run() {
}
ExtensionFunction::ResponseAction TabsGetZoomFunction::Run() {
absl::optional<tabs::GetZoom::Params> params =
tabs::GetZoom::Params::Create(args());
std::unique_ptr<tabs::GetZoom::Params> params(
tabs::GetZoom::Params::Create(args()));
EXTENSION_FUNCTION_VALIDATE(params);
int tab_id = params->tab_id ? *params->tab_id : -1;
@@ -471,8 +467,8 @@ ExtensionFunction::ResponseAction TabsGetZoomFunction::Run() {
ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() {
using api::tabs::ZoomSettings;
absl::optional<tabs::SetZoomSettings::Params> params =
tabs::SetZoomSettings::Params::Create(args());
std::unique_ptr<tabs::SetZoomSettings::Params> params(
tabs::SetZoomSettings::Params::Create(args()));
EXTENSION_FUNCTION_VALIDATE(params);
int tab_id = params->tab_id ? *params->tab_id : -1;
@@ -522,8 +518,8 @@ ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() {
}
ExtensionFunction::ResponseAction TabsGetZoomSettingsFunction::Run() {
absl::optional<tabs::GetZoomSettings::Params> params =
tabs::GetZoomSettings::Params::Create(args());
std::unique_ptr<tabs::GetZoomSettings::Params> params(
tabs::GetZoomSettings::Params::Create(args()));
EXTENSION_FUNCTION_VALIDATE(params);
int tab_id = params->tab_id ? *params->tab_id : -1;

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(), function()->browser_context());
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

@@ -26,7 +26,7 @@ void CefExtensionHostDelegate::OnMainFrameCreatedForBackgroundPage(
content::JavaScriptDialogManager*
CefExtensionHostDelegate::GetJavaScriptDialogManager() {
// Never routed here from AlloyBrowserHostImpl.
DCHECK(false);
NOTREACHED();
return nullptr;
}
@@ -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();
@@ -46,7 +46,7 @@ void CefExtensionHostDelegate::ProcessMediaAccessRequest(
content::MediaResponseCallback callback,
const Extension* extension) {
// Never routed here from AlloyBrowserHostImpl.
DCHECK(false);
NOTREACHED();
}
bool CefExtensionHostDelegate::CheckMediaAccessPermission(
@@ -55,18 +55,18 @@ bool CefExtensionHostDelegate::CheckMediaAccessPermission(
blink::mojom::MediaStreamType type,
const Extension* extension) {
// Never routed here from AlloyBrowserHostImpl.
DCHECK(false);
NOTREACHED();
return false;
}
content::PictureInPictureResult CefExtensionHostDelegate::EnterPictureInPicture(
content::WebContents* web_contents) {
DCHECK(false);
NOTREACHED();
return content::PictureInPictureResult::kNotSupported;
}
void CefExtensionHostDelegate::ExitPictureInPicture() {
DCHECK(false);
NOTREACHED();
}
} // namespace extensions

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

@@ -500,20 +500,20 @@ void CefExtensionSystem::InstallUpdate(
const base::FilePath& temp_dir,
bool install_immediately,
InstallUpdateCallback install_update_callback) {
DCHECK(false);
NOTREACHED();
base::DeletePathRecursively(temp_dir);
}
void CefExtensionSystem::PerformActionBasedOnOmahaAttributes(
const std::string& extension_id,
const base::Value& attributes) {
DCHECK(false);
NOTREACHED();
}
bool CefExtensionSystem::FinishDelayedInstallationIfReady(
const std::string& extension_id,
bool install_immediately) {
DCHECK(false);
NOTREACHED();
return false;
}

View File

@@ -28,7 +28,7 @@ CefExtensionsAPIClient::CefExtensionsAPIClient() {}
AppViewGuestDelegate* CefExtensionsAPIClient::CreateAppViewGuestDelegate()
const {
// TODO(extensions): Implement to support Apps.
DCHECK(false);
NOTREACHED();
return nullptr;
}

View File

@@ -246,7 +246,7 @@ ProcessManagerDelegate* CefExtensionsBrowserClient::GetProcessManagerDelegate()
std::unique_ptr<ExtensionHostDelegate>
CefExtensionsBrowserClient::CreateExtensionHostDelegate() {
// CEF does not use the ExtensionHost constructor that calls this method.
DCHECK(false);
NOTREACHED();
return std::unique_ptr<ExtensionHostDelegate>();
}
@@ -353,7 +353,7 @@ std::unique_ptr<RuntimeAPIDelegate>
CefExtensionsBrowserClient::CreateRuntimeAPIDelegate(
content::BrowserContext* context) const {
// TODO(extensions): Implement to support Apps.
DCHECK(false);
NOTREACHED();
return nullptr;
}
@@ -378,7 +378,7 @@ void CefExtensionsBrowserClient::BroadcastEventToRenderers(
ExtensionCache* CefExtensionsBrowserClient::GetExtensionCache() {
// Only used by Chrome via ExtensionService.
DCHECK(false);
NOTREACHED();
return nullptr;
}

View File

@@ -34,19 +34,19 @@ void CefValueStore::set_status_code(StatusCode status_code) {
size_t CefValueStore::GetBytesInUse(const std::string& key) {
// Let SettingsStorageQuotaEnforcer implement this.
DCHECK(false) << "Not implemented";
NOTREACHED() << "Not implemented";
return 0;
}
size_t CefValueStore::GetBytesInUse(const std::vector<std::string>& keys) {
// Let SettingsStorageQuotaEnforcer implement this.
DCHECK(false) << "Not implemented";
NOTREACHED() << "Not implemented";
return 0;
}
size_t CefValueStore::GetBytesInUse() {
// Let SettingsStorageQuotaEnforcer implement this.
DCHECK(false) << "Not implemented";
NOTREACHED() << "Not implemented";
return 0;
}

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"
@@ -491,7 +490,7 @@ CefFileDialogManager::MaybeRunDelegate(
mode = FILE_DIALOG_SAVE;
break;
default:
DCHECK(false);
NOTREACHED();
break;
}

View File

@@ -227,12 +227,12 @@ CefRefPtr<CefBrowser> CefFrameHostImpl::GetBrowser() {
}
CefRefPtr<CefV8Context> CefFrameHostImpl::GetV8Context() {
DCHECK(false) << "GetV8Context cannot be called from the browser process";
NOTREACHED() << "GetV8Context cannot be called from the browser process";
return nullptr;
}
void CefFrameHostImpl::VisitDOM(CefRefPtr<CefDOMVisitor> visitor) {
DCHECK(false) << "VisitDOM cannot be called from the browser process";
NOTREACHED() << "VisitDOM cannot be called from the browser process";
}
CefRefPtr<CefURLRequest> CefFrameHostImpl::CreateURLRequest(
@@ -243,7 +243,7 @@ CefRefPtr<CefURLRequest> CefFrameHostImpl::CreateURLRequest(
}
if (!CefTaskRunnerImpl::GetCurrentTaskRunner()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return nullptr;
}

View File

@@ -46,7 +46,7 @@ CefRefPtr<CefPreferenceManager>
CefPreferenceManager::GetGlobalPreferenceManager() {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return nullptr;
}

View File

@@ -26,7 +26,7 @@ SkColorType GetSkColorType(cef_color_type_t color_type) {
break;
}
DCHECK(false);
NOTREACHED();
return kUnknown_SkColorType;
}
@@ -42,7 +42,7 @@ SkAlphaType GetSkAlphaType(cef_alpha_type_t alpha_type) {
break;
}
DCHECK(false);
NOTREACHED();
return kUnknown_SkAlphaType;
}

View File

@@ -230,12 +230,12 @@ bool CefMainRunner::Initialize(CefSettings* settings,
const int exit_code =
ContentMainInitialize(args, windows_sandbox_info, &settings->no_sandbox);
if (exit_code >= 0) {
DCHECK(false) << "ContentMainInitialize failed";
NOTREACHED() << "ContentMainInitialize failed";
return false;
}
if (!ContentMainRun(initialized, std::move(context_initialized))) {
DCHECK(false) << "ContentMainRun failed";
NOTREACHED() << "ContentMainRun failed";
return false;
}
@@ -385,13 +385,9 @@ int CefMainRunner::ContentMainInitialize(const CefMainArgs& args,
bool CefMainRunner::ContentMainRun(bool* initialized,
base::OnceClosure context_initialized) {
main_delegate_->BeforeMainThreadRun(multi_threaded_message_loop_);
main_delegate_->BeforeMainThreadRun();
if (multi_threaded_message_loop_) {
// Detach the CommandLine from the main thread so that it can be
// attached and modified from the UI thread going forward.
base::CommandLine::ForCurrentProcess()->DetachFromCurrentSequence();
base::WaitableEvent uithread_startup_event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);

View File

@@ -130,7 +130,7 @@ class CefRegistrationImpl : public CefRegistration,
case blink::mojom::PresentationConnectionState::TERMINATED:
return CEF_MRCS_TERMINATED;
}
DCHECK(false);
NOTREACHED();
return CEF_MRCS_UNKNOWN;
}

View File

@@ -54,7 +54,7 @@ class CefSimpleMenuModel : public ui::MenuModel {
case MENUITEMTYPE_SUBMENU:
return TYPE_SUBMENU;
default:
DCHECK(false);
NOTREACHED();
return TYPE_COMMAND;
}
}
@@ -1109,7 +1109,7 @@ void CefMenuModelImpl::OnMenuClosed() {
bool CefMenuModelImpl::VerifyContext() {
if (base::PlatformThread::CurrentId() != supported_thread_id_) {
// This object should only be accessed from the thread that created it.
DCHECK(false);
NOTREACHED();
return false;
}

View File

@@ -161,7 +161,7 @@ ui::MouseEvent CefBrowserPlatformDelegateNativeAura::TranslateUiClickEvent(
changed_button_flags |= ui::EF_RIGHT_MOUSE_BUTTON;
break;
default:
DCHECK(false);
NOTREACHED();
}
ui::MouseEvent result(event_type, location, root_location, time_stamp, flags,

View File

@@ -276,7 +276,7 @@ ui::KeyEvent CefBrowserPlatformDelegateNativeLinux::TranslateUiKeyEvent(
type = ui::ET_KEY_RELEASED;
break;
default:
DCHECK(false);
NOTREACHED();
}
#if BUILDFLAG(OZONE_PLATFORM_X11)

View File

@@ -23,6 +23,7 @@
#include "third_party/blink/public/common/input/web_input_event.h"
#include "third_party/blink/public/common/input/web_mouse_event.h"
#include "third_party/blink/public/common/input/web_mouse_wheel_event.h"
#import "ui/base/cocoa/cocoa_base_utils.h"
#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
#include "ui/display/screen.h"
#include "ui/events/base_event_utils.h"
@@ -438,7 +439,8 @@ gfx::Point CefBrowserPlatformDelegateNativeMac::GetScreenPoint(
NSPoint view_pt = {static_cast<CGFloat>(view.x()),
bounds.size.height - static_cast<CGFloat>(view.y())};
NSPoint window_pt = [nsview convertPoint:view_pt toView:nil];
NSPoint screen_pt = [[nsview window] convertPointToScreen:window_pt];
NSPoint screen_pt =
ui::ConvertPointFromWindowToScreen([nsview window], window_pt);
return gfx::Point(screen_pt.x, screen_pt.y);
}
return gfx::Point();
@@ -563,7 +565,7 @@ CefBrowserPlatformDelegateNativeMac::TranslateWebClickEvent(
result.button = blink::WebMouseEvent::Button::kRight;
break;
default:
DCHECK(false);
NOTREACHED();
}
result.click_count = clickCount;

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);
}
@@ -466,7 +468,7 @@ bool CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent(
msg.message = event.is_system_key ? WM_SYSCHAR : WM_CHAR;
break;
default:
DCHECK(false);
NOTREACHED();
return false;
}
@@ -521,7 +523,7 @@ ui::KeyEvent CefBrowserPlatformDelegateNativeWin::TranslateUiKeyEvent(
type = ui::ET_KEY_RELEASED;
break;
default:
DCHECK(false);
NOTREACHED();
}
ui::DomKey dom_key =
@@ -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

@@ -70,7 +70,7 @@ display::Display::Rotation OrientationAngleToRotation(
if (orientation_angle == 270) {
return display::Display::ROTATE_90;
}
DCHECK(false);
NOTREACHED();
return display::Display::ROTATE_0;
}

View File

@@ -363,7 +363,7 @@ bool OnLicenseUI(std::string* mime_type, std::string* output) {
ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(
IDR_CEF_LICENSE_TXT);
if (piece.empty()) {
DCHECK(false) << "Failed to load license txt resource.";
NOTREACHED() << "Failed to load license txt resource.";
return false;
}
@@ -381,7 +381,7 @@ bool OnVersionUI(Profile* profile,
ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(
IDR_CEF_VERSION_HTML);
if (tmpl.empty()) {
DCHECK(false) << "Failed to load version html resource.";
NOTREACHED() << "Failed to load version html resource.";
return false;
}

View File

@@ -38,7 +38,7 @@ void LoadFromDisk(const base::FilePath& path) {
void CefLoadCRLSetsFile(const CefString& path) {
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return;
}

View File

@@ -50,7 +50,7 @@ std::string GetMimeType(const std::string& filename) {
return "application/font-woff2";
}
DCHECK(false) << "No known mime type for file: " << filename.c_str();
NOTREACHED() << "No known mime type for file: " << filename.c_str();
return "text/plain";
}
@@ -80,7 +80,7 @@ class RedirectHandler : public CefResourceHandler {
int bytes_to_read,
int& bytes_read,
CefRefPtr<CefResourceReadCallback> callback) override {
DCHECK(false);
NOTREACHED();
return false;
}
@@ -177,8 +177,8 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory {
ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(
action.resource_id);
if (str.empty()) {
DCHECK(false) << "Failed to load internal resource for id: "
<< action.resource_id << " URL: " << url.spec().c_str();
NOTREACHED() << "Failed to load internal resource for id: "
<< action.resource_id << " URL: " << url.spec().c_str();
return nullptr;
}
action.bytes =

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());
@@ -695,7 +694,7 @@ void CefBrowserURLRequest::Cancel() {
bool CefBrowserURLRequest::VerifyContext() {
if (!context_->CalledOnValidThread()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return false;
}

View File

@@ -553,7 +553,7 @@ void StreamReaderURLLoader::FollowRedirect(
const net::HttpRequestHeaders& modified_headers,
const net::HttpRequestHeaders& modified_cors_exempt_headers,
const absl::optional<GURL>& new_url) {
DCHECK(false);
NOTREACHED();
}
void StreamReaderURLLoader::SetPriority(net::RequestPriority priority,
@@ -852,4 +852,4 @@ bool StreamReaderURLLoader::byte_range_valid() const {
return byte_range_.IsValid() && byte_range_.first_byte_position() >= 0;
}
} // namespace net_service
} // namespace net_service

View File

@@ -214,14 +214,14 @@ bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin,
bool allow_target_subdomains) {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false);
NOTREACHED();
return false;
}
std::string source_url = source_origin;
GURL gurl = GURL(source_url);
if (gurl.is_empty() || !gurl.is_valid()) {
DCHECK(false) << "Invalid source_origin URL: " << source_url;
NOTREACHED() << "Invalid source_origin URL: " << source_url;
return false;
}
@@ -245,14 +245,14 @@ bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin,
bool allow_target_subdomains) {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false);
NOTREACHED();
return false;
}
std::string source_url = source_origin;
GURL gurl = GURL(source_url);
if (gurl.is_empty() || !gurl.is_valid()) {
DCHECK(false) << "Invalid source_origin URL: " << source_url;
NOTREACHED() << "Invalid source_origin URL: " << source_url;
return false;
}
@@ -273,7 +273,7 @@ bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin,
bool CefClearCrossOriginWhitelist() {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false);
NOTREACHED();
return false;
}

View File

@@ -26,7 +26,7 @@ ui::MotionEvent::ToolType CefPointerTypeToMotionEventToolType(
case CEF_POINTER_TYPE_UNKNOWN:
return ui::MotionEvent::ToolType::UNKNOWN;
}
DCHECK(false);
NOTREACHED();
return ui::MotionEvent::ToolType::UNKNOWN;
}

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

@@ -175,7 +175,7 @@ ui::ImeTextSpan::UnderlineStyle GetImeUnderlineStyle(
return ui::ImeTextSpan::UnderlineStyle::kNone;
}
DCHECK(false);
NOTREACHED();
return ui::ImeTextSpan::UnderlineStyle::kSolid;
}
@@ -489,7 +489,7 @@ CefRenderWidgetHostViewOSR::GetDisplayFeature() {
void CefRenderWidgetHostViewOSR::SetDisplayFeatureForTesting(
const content::DisplayFeature* display_feature) {
DCHECK(false);
NOTREACHED();
}
blink::mojom::PointerLockResult CefRenderWidgetHostViewOSR::LockMouse(
@@ -905,23 +905,21 @@ void CefRenderWidgetHostViewOSR::NotifyHostAndDelegateOnWasShown(
blink::mojom::RecordContentToVisibleTimeRequestPtr visible_time_request) {
// We don't call RenderWidgetHostViewBase::OnShowWithPageVisibility, so this
// method should not be called.
DCHECK(false);
NOTREACHED();
}
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::
RequestSuccessfulPresentationTimeFromHostOrDelegate(
blink::mojom::RecordContentToVisibleTimeRequestPtr
visible_time_request) {
CancelPresentationTimeRequestForHostAndDelegate() {
// We don't call RenderWidgetHostViewBase::OnShowWithPageVisibility, so this
// method should not be called.
DCHECK(false);
}
void CefRenderWidgetHostViewOSR::
CancelSuccessfulPresentationTimeRequestForHostAndDelegate() {
// We don't call RenderWidgetHostViewBase::OnShowWithPageVisibility, so this
// method should not be called.
DCHECK(false);
NOTREACHED();
}
std::unique_ptr<content::SyntheticGestureTarget>

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

@@ -315,16 +315,16 @@ bool CefTouchSelectionControllerClientOSR::SupportsAnimation() const {
bool CefTouchSelectionControllerClientOSR::InternalClient::SupportsAnimation()
const {
DCHECK(false);
NOTREACHED();
return false;
}
void CefTouchSelectionControllerClientOSR::SetNeedsAnimate() {
DCHECK(false);
NOTREACHED();
}
void CefTouchSelectionControllerClientOSR::InternalClient::SetNeedsAnimate() {
DCHECK(false);
NOTREACHED();
}
void CefTouchSelectionControllerClientOSR::MoveCaret(
@@ -405,7 +405,7 @@ void CefTouchSelectionControllerClientOSR::OnSelectionEvent(
void CefTouchSelectionControllerClientOSR::InternalClient::OnSelectionEvent(
ui::SelectionEventType event) {
DCHECK(false);
NOTREACHED();
}
void CefTouchSelectionControllerClientOSR::OnDragUpdate(
@@ -415,7 +415,7 @@ void CefTouchSelectionControllerClientOSR::OnDragUpdate(
void CefTouchSelectionControllerClientOSR::InternalClient::OnDragUpdate(
const ui::TouchSelectionDraggable::Type type,
const gfx::PointF& position) {
DCHECK(false);
NOTREACHED();
}
std::unique_ptr<ui::TouchHandleDrawable>
@@ -427,12 +427,12 @@ void CefTouchSelectionControllerClientOSR::DidScroll() {}
std::unique_ptr<ui::TouchHandleDrawable>
CefTouchSelectionControllerClientOSR::InternalClient::CreateDrawable() {
DCHECK(false);
NOTREACHED();
return nullptr;
}
void CefTouchSelectionControllerClientOSR::InternalClient::DidScroll() {
DCHECK(false);
NOTREACHED();
}
bool CefTouchSelectionControllerClientOSR::IsCommandIdEnabled(

View File

@@ -43,7 +43,7 @@ bool CefGetPath(PathKey key, CefString& path) {
pref_key = chrome::DIR_RESOURCES;
break;
default:
DCHECK(false) << "invalid argument";
NOTREACHED() << "invalid argument";
return false;
}

View File

@@ -225,7 +225,7 @@ cef_permission_request_types_t GetCefRequestType(
return CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT;
}
DCHECK(false);
NOTREACHED();
return CEF_PERMISSION_TYPE_NONE;
}

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"
@@ -35,6 +36,7 @@
#include "chrome/browser/ui/webui/print_preview/policy_settings.h"
#include "chrome/common/buildflags.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/net/safe_search_util.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/locale_settings.h"
#include "components/certificate_transparency/pref_names.h"
@@ -47,7 +49,6 @@
#include "components/language/core/browser/language_prefs.h"
#include "components/language/core/browser/pref_names.h"
#include "components/permissions/permission_actions_history.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/json_pref_store.h"
#include "components/prefs/pref_filter.h"
@@ -57,7 +58,6 @@
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "components/proxy_config/proxy_config_dictionary.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "components/safe_search_api/safe_search_util.h"
#include "components/spellcheck/browser/pref_names.h"
#include "components/sync_preferences/pref_service_syncable.h"
#include "components/sync_preferences/pref_service_syncable_factory.h"
@@ -70,14 +70,13 @@
#include "ui/base/ui_base_switches.h"
#if BUILDFLAG(IS_WIN)
#include "components/os_crypt/sync/os_crypt.h"
#include "components/os_crypt/os_crypt.h"
#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 {
@@ -177,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());
@@ -224,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());
@@ -282,10 +282,9 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
// Print preferences.
// Based on ProfileImpl::RegisterProfilePrefs.
registry->RegisterBooleanPref(policy::policy_prefs::kForceGoogleSafeSearch,
false);
registry->RegisterIntegerPref(policy::policy_prefs::kForceYouTubeRestrict,
safe_search_api::YOUTUBE_RESTRICT_OFF);
registry->RegisterBooleanPref(prefs::kForceGoogleSafeSearch, false);
registry->RegisterIntegerPref(prefs::kForceYouTubeRestrict,
safe_search_util::YOUTUBE_RESTRICT_OFF);
registry->RegisterStringPref(prefs::kAllowedDomainsForApps, std::string());
registry->RegisterBooleanPref(prefs::kPrintingEnabled, true);
registry->RegisterBooleanPref(prefs::kPrintPreviewDisabled,
@@ -311,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,13 +29,13 @@ 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";
}
DCHECK(false);
NOTREACHED();
return "UNKNOWN";
}
@@ -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

@@ -74,7 +74,7 @@ class CefPreferenceRegistrarImpl : public CefPreferenceRegistrar {
} else if (impl_value.type() == base::Value::Type::LIST) {
registry_->RegisterListPref(name, std::move(impl_value));
} else {
DCHECK(false);
NOTREACHED();
}
}

View File

@@ -196,7 +196,7 @@ blink::mojom::PreferredColorScheme ToBlinkPreferredColorScheme(
return blink::mojom::PreferredColorScheme::kLight;
}
DCHECK(false);
NOTREACHED();
}
// From chrome/browser/chrome_content_browser_client.cc

View File

@@ -12,12 +12,12 @@
bool CefLaunchProcess(CefRefPtr<CefCommandLine> command_line) {
if (!command_line.get()) {
DCHECK(false) << "invalid parameter";
NOTREACHED() << "invalid parameter";
return false;
}
if (!content::CurrentlyOnProcessLauncherTaskRunner()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return false;
}

View File

@@ -94,7 +94,7 @@ class ResolveHostHelper : public network::ResolveHostClientBase {
CefRefPtr<CefRequestContext> CefRequestContext::GetGlobalContext() {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return nullptr;
}
@@ -109,7 +109,7 @@ CefRefPtr<CefRequestContext> CefRequestContext::CreateContext(
CefRefPtr<CefRequestContextHandler> handler) {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return nullptr;
}
@@ -126,7 +126,7 @@ CefRefPtr<CefRequestContext> CefRequestContext::CreateContext(
CefRefPtr<CefRequestContextHandler> handler) {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return nullptr;
}
@@ -183,12 +183,12 @@ CefRequestContextImpl::GetOrCreateForRequestContext(
bool CefRequestContextImpl::VerifyBrowserContext() const {
if (!CEF_CURRENTLY_ON_UIT()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return false;
}
if (!browser_context() || !browser_context()->IsInitialized()) {
DCHECK(false) << "Uninitialized context";
NOTREACHED() << "Uninitialized context";
return false;
}

View File

@@ -13,7 +13,7 @@ bool CefRegisterSchemeHandlerFactory(
CefRefPtr<CefSchemeHandlerFactory> factory) {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return false;
}
@@ -24,7 +24,7 @@ bool CefRegisterSchemeHandlerFactory(
bool CefClearSchemeHandlerFactories() {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return false;
}

View File

@@ -25,16 +25,16 @@
#define CEF_CURRENTLY_ON_HT() CurrentlyOnHandlerThread()
#define CEF_REQUIRE_HT() DCHECK(CEF_CURRENTLY_ON_HT())
#define CEF_REQUIRE_HT_RETURN(var) \
if (!CEF_CURRENTLY_ON_HT()) { \
DCHECK(false) << "called on invalid thread"; \
return var; \
#define CEF_REQUIRE_HT_RETURN(var) \
if (!CEF_CURRENTLY_ON_HT()) { \
NOTREACHED() << "called on invalid thread"; \
return var; \
}
#define CEF_REQUIRE_HT_RETURN_VOID() \
if (!CEF_CURRENTLY_ON_HT()) { \
DCHECK(false) << "called on invalid thread"; \
return; \
#define CEF_REQUIRE_HT_RETURN_VOID() \
if (!CEF_CURRENTLY_ON_HT()) { \
NOTREACHED() << "called on invalid thread"; \
return; \
}
#define CEF_POST_TASK_HT(task) task_runner_->PostTask(FROM_HERE, task);

View File

@@ -540,7 +540,7 @@ bool CefSimpleMenuModelImpl::SetFontListAt(int index,
bool CefSimpleMenuModelImpl::VerifyContext() {
if (base::PlatformThread::CurrentId() != supported_thread_id_) {
// This object should only be accessed from the thread that created it.
DCHECK(false);
NOTREACHED();
return false;
}

View File

@@ -25,18 +25,18 @@
#define CEF_REQUIRE_UIT() CEF_REQUIRE(CEF_UIT)
#define CEF_REQUIRE_IOT() CEF_REQUIRE(CEF_IOT)
#define CEF_REQUIRE_RETURN(id, var) \
if (!CEF_CURRENTLY_ON(id)) { \
DCHECK(false) << "called on invalid thread"; \
return var; \
#define CEF_REQUIRE_RETURN(id, var) \
if (!CEF_CURRENTLY_ON(id)) { \
NOTREACHED() << "called on invalid thread"; \
return var; \
}
#define CEF_REQUIRE_UIT_RETURN(var) CEF_REQUIRE_RETURN(CEF_UIT, var)
#define CEF_REQUIRE_IOT_RETURN(var) CEF_REQUIRE_RETURN(CEF_IOT, var)
#define CEF_REQUIRE_RETURN_VOID(id) \
if (!CEF_CURRENTLY_ON(id)) { \
DCHECK(false) << "called on invalid thread"; \
return; \
#define CEF_REQUIRE_RETURN_VOID(id) \
if (!CEF_CURRENTLY_ON(id)) { \
NOTREACHED() << "called on invalid thread"; \
return; \
}
#define CEF_REQUIRE_UIT_RETURN_VOID() CEF_REQUIRE_RETURN_VOID(CEF_UIT)
#define CEF_REQUIRE_IOT_RETURN_VOID() CEF_REQUIRE_RETURN_VOID(CEF_IOT)

View File

@@ -12,12 +12,12 @@
bool CefBeginTracing(const CefString& categories,
CefRefPtr<CefCompletionCallback> callback) {
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return false;
}
if (!CEF_CURRENTLY_ON_UIT()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return false;
}
@@ -32,12 +32,12 @@ bool CefBeginTracing(const CefString& categories,
bool CefEndTracing(const CefString& tracing_file,
CefRefPtr<CefEndTracingCallback> callback) {
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
NOTREACHED() << "context not valid";
return false;
}
if (!CEF_CURRENTLY_ON_UIT()) {
DCHECK(false) << "called on invalid thread";
NOTREACHED() << "called on invalid thread";
return false;
}

View File

@@ -218,23 +218,6 @@ void CefBrowserViewImpl::OnBoundsChanged() {
}
}
void CefBrowserViewImpl::OnGestureCommand(cef_gesture_command_t command) {
if (delegate()->OnGestureCommand(this, command)) {
return;
}
if (browser_) {
switch (command) {
case CEF_GESTURE_COMMAND_BACK:
browser_->GoBack();
break;
case CEF_GESTURE_COMMAND_FORWARD:
browser_->GoForward();
break;
}
}
}
CefBrowserViewImpl::CefBrowserViewImpl(
CefRefPtr<CefBrowserViewDelegate> delegate)
: ParentClass(delegate), weak_ptr_factory_(this) {}

View File

@@ -74,7 +74,6 @@ class CefBrowserViewImpl
// CefBrowserViewView::Delegate methods:
void OnBrowserViewAdded() override;
void OnBoundsChanged() override;
void OnGestureCommand(cef_gesture_command_t command) override;
// Return the WebView representation of this object.
views::WebView* web_view() const;

View File

@@ -4,28 +4,8 @@
#include "libcef/browser/views/browser_view_view.h"
#include <optional>
#include "libcef/browser/views/browser_view_impl.h"
namespace {
std::optional<cef_gesture_command_t> GetGestureCommand(
ui::GestureEvent* event) {
#if defined(OS_MAC)
if (event->details().type() == ui::ET_GESTURE_SWIPE) {
if (event->details().swipe_left()) {
return cef_gesture_command_t::CEF_GESTURE_COMMAND_BACK;
} else if (event->details().swipe_right()) {
return cef_gesture_command_t::CEF_GESTURE_COMMAND_FORWARD;
}
}
#endif
return std::nullopt;
}
} // namespace
CefBrowserViewView::CefBrowserViewView(CefBrowserViewDelegate* cef_delegate,
Delegate* browser_view_delegate)
: ParentClass(cef_delegate), browser_view_delegate_(browser_view_delegate) {
@@ -58,9 +38,3 @@ void CefBrowserViewView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
ParentClass::OnBoundsChanged(previous_bounds);
browser_view_delegate_->OnBoundsChanged();
}
void CefBrowserViewView::OnGestureEvent(ui::GestureEvent* event) {
if (auto command = GetGestureCommand(event)) {
browser_view_delegate_->OnGestureCommand(*command);
}
}

View File

@@ -41,9 +41,6 @@ class CefBrowserViewView
// Called when the BrowserView bounds have changed.
virtual void OnBoundsChanged() = 0;
// Called when the BrowserView receives a gesture command.
virtual void OnGestureCommand(cef_gesture_command_t command) = 0;
protected:
virtual ~Delegate() {}
};
@@ -57,7 +54,6 @@ class CefBrowserViewView
void ViewHierarchyChanged(
const views::ViewHierarchyChangedDetails& details) override;
void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
void OnGestureEvent(ui::GestureEvent* event) override;
private:
// Not owned by this object.

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

@@ -486,7 +486,7 @@ void CefXmlReaderImpl::AppendError(const CefString& error_str) {
bool CefXmlReaderImpl::VerifyContext() {
if (base::PlatformThread::CurrentId() != supported_thread_id_) {
// This object should only be accessed from the thread that created it.
DCHECK(false);
NOTREACHED();
return false;
}

View File

@@ -58,7 +58,7 @@ OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)) {
whence = SEEK_SET;
break;
default:
DCHECK(false);
NOTREACHED();
return -1;
}
return reader->Seek(offset, whence);
@@ -295,7 +295,7 @@ bool CefZipReaderImpl::GetFileInfo() {
bool CefZipReaderImpl::VerifyContext() {
if (base::PlatformThread::CurrentId() != supported_thread_id_) {
// This object should only be accessed from the thread that created it.
DCHECK(false);
NOTREACHED();
return false;
}

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 ==

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