mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
32 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
291f1df302 | ||
|
46651e0d26 | ||
|
3c2b68f976 | ||
|
fde72b57a8 | ||
|
16a215353c | ||
|
1296c82b59 | ||
|
732747fb99 | ||
|
75b1c96ec1 | ||
|
85aaba4cae | ||
|
59b475790b | ||
|
b3f93d506f | ||
|
6054757781 | ||
|
a3a017c8d8 | ||
|
a9eaf00d40 | ||
|
877cbe7e04 | ||
|
4d32741e1b | ||
|
2ad6ced9f0 | ||
|
2b645e2851 | ||
|
6eccee36d1 | ||
|
c12701592e | ||
|
7b14b637bb | ||
|
a39c50d09a | ||
|
d26cf55456 | ||
|
4e0237a1bf | ||
|
8022d433c7 | ||
|
ba12a2ed05 | ||
|
fa089408e9 | ||
|
2567ca15a9 | ||
|
f77a7a7336 | ||
|
7209750d46 | ||
|
05104b07e0 | ||
|
f3c7d2c89a |
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -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.
|
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -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.
|
14
BUILD.gn
14
BUILD.gn
@@ -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",
|
||||
@@ -1077,6 +1079,7 @@ source_set("libcef_static") {
|
||||
"libcef/browser/alloy/alloy_browser_main_win.cc",
|
||||
"libcef/browser/native/browser_platform_delegate_native_win.cc",
|
||||
"libcef/browser/native/browser_platform_delegate_native_win.h",
|
||||
"libcef/browser/native/cursor_util_win.cc",
|
||||
"libcef/browser/osr/browser_platform_delegate_osr_win.cc",
|
||||
"libcef/browser/osr/browser_platform_delegate_osr_win.h",
|
||||
]
|
||||
@@ -1105,6 +1108,7 @@ source_set("libcef_static") {
|
||||
sources += includes_linux + [
|
||||
"libcef/browser/native/browser_platform_delegate_native_linux.cc",
|
||||
"libcef/browser/native/browser_platform_delegate_native_linux.h",
|
||||
"libcef/browser/native/cursor_util_linux.cc",
|
||||
"libcef/browser/osr/browser_platform_delegate_osr_linux.cc",
|
||||
"libcef/browser/osr/browser_platform_delegate_osr_linux.h",
|
||||
"libcef/browser/printing/print_dialog_linux.cc",
|
||||
@@ -1136,17 +1140,12 @@ source_set("libcef_static") {
|
||||
sources += includes_mac + [
|
||||
"libcef/browser/native/browser_platform_delegate_native_mac.h",
|
||||
"libcef/browser/native/browser_platform_delegate_native_mac.mm",
|
||||
"libcef/browser/native/cursor_util_mac.mm",
|
||||
"libcef/browser/native/javascript_dialog_runner_mac.h",
|
||||
"libcef/browser/native/javascript_dialog_runner_mac.mm",
|
||||
"libcef/browser/native/menu_runner_mac.h",
|
||||
"libcef/browser/native/menu_runner_mac.mm",
|
||||
"libcef/browser/osr/browser_platform_delegate_osr_mac.h",
|
||||
"libcef/browser/osr/browser_platform_delegate_osr_mac.mm",
|
||||
"libcef/browser/views/native_widget_mac.h",
|
||||
"libcef/browser/views/native_widget_mac.mm",
|
||||
"libcef/browser/views/ns_window.h",
|
||||
"libcef/browser/views/ns_window.mm",
|
||||
"libcef/browser/views/view_util_mac.mm",
|
||||
"libcef/common/util_mac.h",
|
||||
"libcef/common/util_mac.mm",
|
||||
@@ -1169,7 +1168,6 @@ source_set("libcef_static") {
|
||||
sources += [
|
||||
"libcef/browser/native/browser_platform_delegate_native_aura.cc",
|
||||
"libcef/browser/native/browser_platform_delegate_native_aura.h",
|
||||
"libcef/browser/native/cursor_util_aura.cc",
|
||||
"libcef/browser/native/menu_runner_views_aura.cc",
|
||||
"libcef/browser/native/menu_runner_views_aura.h",
|
||||
"libcef/browser/views/view_util_aura.cc",
|
||||
@@ -1358,7 +1356,7 @@ make_pack_header("resources") {
|
||||
"$root_gen_dir/net/grit/net_resources.h",
|
||||
"$root_gen_dir/third_party/blink/public/resources/grit/blink_resources.h",
|
||||
"$root_gen_dir/ui/resources/grit/ui_resources.h",
|
||||
"$root_gen_dir/ui/resources/grit/webui_resources.h",
|
||||
"$root_gen_dir/ui/resources/grit/webui_generated_resources.h",
|
||||
"$root_gen_dir/ui/views/resources/grit/views_resources.h",
|
||||
]
|
||||
|
||||
@@ -1385,7 +1383,7 @@ make_pack_header("resources") {
|
||||
"//net:net_resources",
|
||||
"//third_party/blink/public:resources",
|
||||
"//ui/resources:ui_resources_grd",
|
||||
"//ui/resources:webui_resources_grd",
|
||||
"//ui/resources:webui_generated_resources_grd",
|
||||
"//ui/views/resources:resources_grd",
|
||||
]
|
||||
}
|
||||
|
@@ -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/110.0.5481.180',
|
||||
'depot_tools_checkout': '252b19866a'
|
||||
}
|
||||
|
@@ -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)
|
||||
|
@@ -9,7 +9,6 @@ The Chromium Embedded Framework (CEF) is a simple framework for embedding Chromi
|
||||
* Branches and Building - https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
* Announcements - https://groups.google.com/forum/#!forum/cef-announce
|
||||
* Support Forum - http://www.magpcss.org/ceforum/
|
||||
* Issue Tracker - https://github.com/chromiumembedded/cef/issues
|
||||
* C++ API Docs - [Stable release docs](https://cef-builds.spotifycdn.com/docs/stable.html) / [Beta release docs](https://cef-builds.spotifycdn.com/docs/beta.html)
|
||||
* Downloads - https://cef-builds.spotifycdn.com/index.html
|
||||
* Donations - http://www.magpcss.org/ceforum/donate.php
|
||||
@@ -58,7 +57,7 @@ If you're the maintainer of a project not listed above and would like your proje
|
||||
|
||||
CEF is still very much a work in progress. Some ways that you can help out:
|
||||
|
||||
\- Vote for issues in the [CEF issue tracker](https://github.com/chromiumembedded/cef/issues) that are important to you. This helps with development prioritization.
|
||||
\- Vote for issues in the [CEF issue tracker](https://bitbucket.org/chromiumembedded/cef/issues?status=new&status=open) that are important to you. This helps with development prioritization.
|
||||
|
||||
\- Report any bugs that you find or feature requests that are important to you. Make sure to first search for existing issues before creating new ones. Please use the [CEF Forum](http://magpcss.org/ceforum) and not the issue tracker for usage questions. Each CEF issue should:
|
||||
|
||||
@@ -69,7 +68,7 @@ CEF is still very much a work in progress. Some ways that you can help out:
|
||||
|
||||
\- Write unit tests for new or existing functionality.
|
||||
|
||||
\- Pull requests and patches are welcome. View open issues in the [CEF issue tracker](https://github.com/chromiumembedded/cef/issues) or search for TODO(cef) in the source code for ideas.
|
||||
\- Pull requests and patches are welcome. View open issues in the [CEF issue tracker](https://bitbucket.org/chromiumembedded/cef/issues?status=new&status=open) or search for TODO(cef) in the source code for ideas.
|
||||
|
||||
If you would like to contribute source code changes to CEF please follow the below guidelines:
|
||||
|
||||
|
@@ -237,8 +237,6 @@
|
||||
'tests/cefclient/browser/client_prefs.cc',
|
||||
'tests/cefclient/browser/client_prefs.h',
|
||||
'tests/cefclient/browser/client_types.h',
|
||||
'tests/cefclient/browser/default_client_handler.cc',
|
||||
'tests/cefclient/browser/default_client_handler.h',
|
||||
'tests/cefclient/browser/dialog_test.cc',
|
||||
'tests/cefclient/browser/dialog_test.h',
|
||||
'tests/cefclient/browser/image_cache.cc',
|
||||
@@ -393,7 +391,6 @@
|
||||
'tests/cefclient/browser/temp_window_mac.mm',
|
||||
'tests/cefclient/browser/text_input_client_osr_mac.h',
|
||||
'tests/cefclient/browser/text_input_client_osr_mac.mm',
|
||||
'tests/cefclient/browser/views_window_mac.mm',
|
||||
'tests/cefclient/browser/window_test_runner_mac.h',
|
||||
'tests/cefclient/browser/window_test_runner_mac.mm',
|
||||
'tests/cefclient/cefclient_mac.mm',
|
||||
|
@@ -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.
|
||||
@@ -531,18 +531,15 @@ if(OS_WINDOWS)
|
||||
Advapi32.lib
|
||||
dbghelp.lib
|
||||
Delayimp.lib
|
||||
ntdll.lib
|
||||
OleAut32.lib
|
||||
PowrProf.lib
|
||||
Propsys.lib
|
||||
psapi.lib
|
||||
SetupAPI.lib
|
||||
Shell32.lib
|
||||
Shcore.lib
|
||||
Userenv.lib
|
||||
version.lib
|
||||
wbemuuid.lib
|
||||
WindowsApp.lib
|
||||
winmm.lib
|
||||
)
|
||||
|
||||
|
@@ -71,7 +71,7 @@
|
||||
|
||||
#if defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/bind.h"
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
|
@@ -67,7 +67,7 @@
|
||||
|
||||
#if defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/callback.h"
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
|
@@ -34,7 +34,7 @@
|
||||
|
||||
#if defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/functional/callback_forward.h"
|
||||
#include "base/callback_forward.h"
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
|
@@ -39,7 +39,7 @@
|
||||
|
||||
#if defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/functional/callback_helpers.h"
|
||||
#include "base/callback_helpers.h"
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
|
@@ -86,7 +86,7 @@
|
||||
|
||||
#if defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/functional/callback_list.h"
|
||||
#include "base/callback_list.h"
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=ac8fd3a7da20cff1fe2f20a75b045bf27c0312f2$
|
||||
// $hash=1d0a15624fec8ca8bd1a5cdf7195b9b553dde44f$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
|
||||
@@ -159,14 +159,14 @@ typedef struct _cef_command_line_t {
|
||||
cef_string_map_t switches);
|
||||
|
||||
///
|
||||
/// Add a switch to the end of the command line.
|
||||
/// Add a switch to the end of the command line. If the switch has no value
|
||||
/// pass an NULL value string.
|
||||
///
|
||||
void(CEF_CALLBACK* append_switch)(struct _cef_command_line_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
/// Add a switch with the specified value to the end of the command line. If
|
||||
/// the switch has no value pass an NULL value string.
|
||||
/// Add a switch with the specified value to the end of the command line.
|
||||
///
|
||||
void(CEF_CALLBACK* append_switch_with_value)(struct _cef_command_line_t* self,
|
||||
const cef_string_t* name,
|
||||
|
@@ -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.
|
||||
///
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=de4a9b856c6951231f446991a9b1efb89096ad3b$
|
||||
// $hash=333350f8141cc925d16df2edc8c21a720a1008f0$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_
|
||||
@@ -257,6 +257,13 @@ typedef struct _cef_media_sink_t {
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_media_sink_t* self);
|
||||
|
||||
///
|
||||
/// Returns the description of this sink.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_description)(
|
||||
struct _cef_media_sink_t* self);
|
||||
|
||||
///
|
||||
/// Returns the icon type for this sink.
|
||||
///
|
||||
|
@@ -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
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=7201d268e16fc89f255b6ccd00d043f34fe77584$
|
||||
// $hash=019abf16be4e151d31181a6bdcb1ad8dfef03d00$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_
|
||||
@@ -137,25 +137,6 @@ typedef struct _cef_window_delegate_t {
|
||||
int(CEF_CALLBACK* is_frameless)(struct _cef_window_delegate_t* self,
|
||||
struct _cef_window_t* window);
|
||||
|
||||
///
|
||||
/// Return true (1) if |window| should be created with standard window buttons
|
||||
/// like close, minimize and zoom. This function is only supported on macOS.
|
||||
///
|
||||
int(CEF_CALLBACK* with_standard_window_buttons)(
|
||||
struct _cef_window_delegate_t* self,
|
||||
struct _cef_window_t* window);
|
||||
|
||||
///
|
||||
/// Return whether the titlebar height should be overridden, and sets the
|
||||
/// height of the titlebar in |titlebar_height|. On macOS, it can also be used
|
||||
/// to adjust the vertical position of the traffic light buttons in frameless
|
||||
/// windows. The buttons will be positioned halfway down the titlebar at a
|
||||
/// height of |titlebar_height| / 2.
|
||||
///
|
||||
int(CEF_CALLBACK* get_titlebar_height)(struct _cef_window_delegate_t* self,
|
||||
struct _cef_window_t* window,
|
||||
float* titlebar_height);
|
||||
|
||||
///
|
||||
/// Return true (1) if |window| can be resized.
|
||||
///
|
||||
@@ -198,17 +179,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
|
||||
|
@@ -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 "fc4393fe8a78980a4d8689ff8b13094fae3c3e50"
|
||||
#if defined(OS_WIN)
|
||||
#define CEF_API_HASH_PLATFORM "1c9ed9d86408e2d84cf88d4a8c865a2872eb40bd"
|
||||
#define CEF_API_HASH_PLATFORM "c41fbde76401eaecb7bdf4851d162e1416285ac1"
|
||||
#elif defined(OS_MAC)
|
||||
#define CEF_API_HASH_PLATFORM "8cc9baa9653847ce54b2da84431d573bc3669505"
|
||||
#define CEF_API_HASH_PLATFORM "031d539913b42e85711402dd5f17fa9aada7ebab"
|
||||
#elif defined(OS_LINUX)
|
||||
#define CEF_API_HASH_PLATFORM "741b042aa3d663f9e4ffad0b59d1bfb4faa03e70"
|
||||
#define CEF_API_HASH_PLATFORM "ceef4f8220761b7bd5bb9959bacd3d55a2dcc484"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -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_
|
||||
|
@@ -168,14 +168,14 @@ class CefCommandLine : public virtual CefBaseRefCounted {
|
||||
virtual void GetSwitches(SwitchMap& switches) = 0;
|
||||
|
||||
///
|
||||
/// Add a switch to the end of the command line.
|
||||
/// Add a switch to the end of the command line. If the switch has no value
|
||||
/// pass an empty value string.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void AppendSwitch(const CefString& name) = 0;
|
||||
|
||||
///
|
||||
/// Add a switch with the specified value to the end of the command line. If
|
||||
/// the switch has no value pass an empty value string.
|
||||
/// Add a switch with the specified value to the end of the command line.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void AppendSwitchWithValue(const CefString& name,
|
||||
|
@@ -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.
|
||||
///
|
||||
|
@@ -239,6 +239,12 @@ class CefMediaSink : public virtual CefBaseRefCounted {
|
||||
/*--cef()--*/
|
||||
virtual CefString GetName() = 0;
|
||||
|
||||
///
|
||||
/// Returns the description of this sink.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetDescription() = 0;
|
||||
|
||||
///
|
||||
/// Returns the icon type for this sink.
|
||||
///
|
||||
|
@@ -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.
|
||||
|
@@ -122,7 +122,7 @@ CEF_EXPORT int cef_time_now(cef_time_t* cef_time);
|
||||
///
|
||||
/// Retrieve the current system time.
|
||||
///
|
||||
CEF_EXPORT cef_basetime_t cef_basetime_now(void);
|
||||
CEF_EXPORT cef_basetime_t cef_basetime_now();
|
||||
|
||||
///
|
||||
/// Retrieve the delta in milliseconds between two time values. Returns true (1)
|
||||
|
@@ -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.
|
||||
///
|
||||
@@ -3413,22 +3368,21 @@ typedef enum {
|
||||
CEF_PERMISSION_TYPE_CAMERA_PAN_TILT_ZOOM = 1 << 2,
|
||||
CEF_PERMISSION_TYPE_CAMERA_STREAM = 1 << 3,
|
||||
CEF_PERMISSION_TYPE_CLIPBOARD = 1 << 4,
|
||||
CEF_PERMISSION_TYPE_TOP_LEVEL_STORAGE_ACCESS = 1 << 5,
|
||||
CEF_PERMISSION_TYPE_DISK_QUOTA = 1 << 6,
|
||||
CEF_PERMISSION_TYPE_LOCAL_FONTS = 1 << 7,
|
||||
CEF_PERMISSION_TYPE_GEOLOCATION = 1 << 8,
|
||||
CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 9,
|
||||
CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 10,
|
||||
CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 11,
|
||||
CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 12,
|
||||
CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 13,
|
||||
CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = 1 << 14,
|
||||
CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = 1 << 15,
|
||||
CEF_PERMISSION_TYPE_SECURITY_ATTESTATION = 1 << 16,
|
||||
CEF_PERMISSION_TYPE_STORAGE_ACCESS = 1 << 17,
|
||||
CEF_PERMISSION_TYPE_U2F_API_REQUEST = 1 << 18,
|
||||
CEF_PERMISSION_TYPE_VR_SESSION = 1 << 19,
|
||||
CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT = 1 << 20,
|
||||
CEF_PERMISSION_TYPE_DISK_QUOTA = 1 << 5,
|
||||
CEF_PERMISSION_TYPE_LOCAL_FONTS = 1 << 6,
|
||||
CEF_PERMISSION_TYPE_GEOLOCATION = 1 << 7,
|
||||
CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 8,
|
||||
CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 9,
|
||||
CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 10,
|
||||
CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 11,
|
||||
CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 12,
|
||||
CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = 1 << 13,
|
||||
CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = 1 << 14,
|
||||
CEF_PERMISSION_TYPE_SECURITY_ATTESTATION = 1 << 15,
|
||||
CEF_PERMISSION_TYPE_STORAGE_ACCESS = 1 << 16,
|
||||
CEF_PERMISSION_TYPE_U2F_API_REQUEST = 1 << 17,
|
||||
CEF_PERMISSION_TYPE_VR_SESSION = 1 << 18,
|
||||
CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT = 1 << 19,
|
||||
} cef_permission_request_types_t;
|
||||
|
||||
///
|
||||
@@ -3488,14 +3442,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
|
||||
|
@@ -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; }
|
||||
};
|
||||
|
@@ -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.
|
||||
|
@@ -81,7 +81,7 @@ class CefBrowserViewDelegate : public CefViewDelegate {
|
||||
/// popup will be a DevTools browser. Return the delegate that will be used
|
||||
/// for the new popup BrowserView.
|
||||
///
|
||||
/*--cef(optional_param=client)--*/
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefBrowserViewDelegate> GetDelegateForPopupBrowserView(
|
||||
CefRefPtr<CefBrowserView> browser_view,
|
||||
const CefBrowserSettings& settings,
|
||||
@@ -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_
|
||||
|
@@ -128,29 +128,6 @@ class CefWindowDelegate : public CefPanelDelegate {
|
||||
/*--cef()--*/
|
||||
virtual bool IsFrameless(CefRefPtr<CefWindow> window) { return false; }
|
||||
|
||||
///
|
||||
/// Return true if |window| should be created with standard window buttons
|
||||
/// like close, minimize and zoom. This method is only supported on macOS.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool WithStandardWindowButtons(CefRefPtr<CefWindow> window) {
|
||||
return !IsFrameless(window);
|
||||
}
|
||||
|
||||
///
|
||||
/// Return whether the titlebar height should be overridden,
|
||||
/// and sets the height of the titlebar in |titlebar_height|.
|
||||
/// On macOS, it can also be used to adjust the vertical position
|
||||
/// of the traffic light buttons in frameless windows.
|
||||
/// The buttons will be positioned halfway down the titlebar
|
||||
/// at a height of |titlebar_height| / 2.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool GetTitlebarHeight(CefRefPtr<CefWindow> window,
|
||||
float* titlebar_height) {
|
||||
return false;
|
||||
}
|
||||
|
||||
///
|
||||
/// Return true if |window| can be resized.
|
||||
///
|
||||
@@ -196,16 +173,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_
|
||||
|
@@ -264,8 +264,8 @@ void AlloyBrowserContext::LoadExtension(
|
||||
if (manifest && manifest->GetSize() > 0) {
|
||||
CefDictionaryValueImpl* value_impl =
|
||||
static_cast<CefDictionaryValueImpl*>(manifest.get());
|
||||
auto value = value_impl->CopyValue();
|
||||
extension_system()->LoadExtension(std::move(value.GetDict()),
|
||||
std::unique_ptr<base::DictionaryValue> value_copy(value_impl->CopyValue());
|
||||
extension_system()->LoadExtension(std::move(*value_copy).TakeDict(),
|
||||
root_directory, false /* builtin */,
|
||||
loader_context, handler);
|
||||
} else {
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -29,9 +29,9 @@
|
||||
#include "libcef/common/values_impl.h"
|
||||
#include "libcef/features/runtime_checks.h"
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/callback_helpers.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/functional/callback_helpers.h"
|
||||
#include "chrome/browser/file_select_helper.h"
|
||||
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
|
||||
#include "content/browser/gpu/compositor_util.h"
|
||||
@@ -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()) {
|
||||
@@ -1227,7 +1227,7 @@ void AlloyBrowserHostImpl::WebContentsCreated(
|
||||
target_url,
|
||||
frame_util::MakeGlobalId(opener_render_process_id,
|
||||
opener_render_frame_id),
|
||||
settings, client, platform_delegate, extra_info, new_contents);
|
||||
settings, client, platform_delegate, extra_info);
|
||||
|
||||
scoped_refptr<CefBrowserInfo> info =
|
||||
CefBrowserInfoManager::GetInstance()->CreatePopupBrowserInfo(
|
||||
@@ -1253,6 +1253,11 @@ void AlloyBrowserHostImpl::WebContentsCreated(
|
||||
std::move(platform_delegate), /*cef_extension=*/nullptr);
|
||||
}
|
||||
|
||||
void AlloyBrowserHostImpl::DidNavigatePrimaryMainFramePostCommit(
|
||||
content::WebContents* web_contents) {
|
||||
contents_delegate_->DidNavigatePrimaryMainFramePostCommit(web_contents);
|
||||
}
|
||||
|
||||
content::JavaScriptDialogManager*
|
||||
AlloyBrowserHostImpl::GetJavaScriptDialogManager(content::WebContents* source) {
|
||||
if (!javascript_dialog_manager_) {
|
||||
@@ -1348,9 +1353,9 @@ bool AlloyBrowserHostImpl::IsBackForwardCacheSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
content::PreloadingEligibility AlloyBrowserHostImpl::IsPrerender2Supported(
|
||||
bool AlloyBrowserHostImpl::IsPrerender2Supported(
|
||||
content::WebContents& web_contents) {
|
||||
return content::PreloadingEligibility::kEligible;
|
||||
return true;
|
||||
}
|
||||
|
||||
// content::WebContentsObserver methods.
|
||||
|
@@ -235,6 +235,8 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
|
||||
const std::string& frame_name,
|
||||
const GURL& target_url,
|
||||
content::WebContents* new_contents) override;
|
||||
void DidNavigatePrimaryMainFramePostCommit(
|
||||
content::WebContents* web_contents) override;
|
||||
content::JavaScriptDialogManager* GetJavaScriptDialogManager(
|
||||
content::WebContents* source) override;
|
||||
void RunFileChooser(content::RenderFrameHost* render_frame_host,
|
||||
@@ -270,8 +272,7 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
|
||||
content::WebContents* web_contents) override;
|
||||
void ExitPictureInPicture() override;
|
||||
bool IsBackForwardCacheSupported() override;
|
||||
content::PreloadingEligibility IsPrerender2Supported(
|
||||
content::WebContents& web_contents) override;
|
||||
bool IsPrerender2Supported(content::WebContents& web_contents) override;
|
||||
|
||||
// content::WebContentsObserver methods.
|
||||
using content::WebContentsObserver::BeforeUnloadFired;
|
||||
|
@@ -22,14 +22,13 @@
|
||||
#include "libcef/common/extensions/extensions_util.h"
|
||||
#include "libcef/common/net/net_resource_provider.h"
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/task/thread_pool.h"
|
||||
#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"
|
||||
@@ -175,7 +174,7 @@ void AlloyBrowserMainParts::ToolkitInitialized() {
|
||||
|
||||
auto printing_delegate = new CefPrintingContextLinuxDelegate();
|
||||
auto default_delegate =
|
||||
ui::PrintingContextLinuxDelegate::SetInstance(printing_delegate);
|
||||
printing::PrintingContextLinuxDelegate::SetInstance(printing_delegate);
|
||||
printing_delegate->SetDefaultDelegate(default_delegate);
|
||||
#endif // BUILDFLAG(IS_LINUX)
|
||||
|
||||
@@ -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() {
|
||||
|
@@ -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"
|
||||
@@ -122,7 +121,6 @@
|
||||
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
|
||||
#include "extensions/browser/info_map.h"
|
||||
#include "extensions/browser/process_map.h"
|
||||
#include "extensions/browser/renderer_startup_helper.h"
|
||||
#include "extensions/browser/url_loader_factory_manager.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "extensions/common/switches.h"
|
||||
@@ -158,12 +156,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 +283,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 +917,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)));
|
||||
@@ -985,9 +976,6 @@ void AlloyContentBrowserClient::ExposeInterfacesToRenderer(
|
||||
base::BindRepeating(
|
||||
&extensions::ExtensionsGuestView::CreateForExtensions,
|
||||
host->GetID()));
|
||||
associated_registry->AddInterface<extensions::mojom::RendererHost>(
|
||||
base::BindRepeating(&extensions::RendererStartupHelper::BindForRenderer,
|
||||
host->GetID()));
|
||||
}
|
||||
|
||||
CefBrowserManager::ExposeInterfacesToRenderer(registry, associated_registry,
|
||||
@@ -1258,10 +1246,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 +1354,9 @@ 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,
|
||||
content_settings::CookieSettings::QueryReason::kSiteStorage);
|
||||
}
|
||||
|
||||
void AlloyContentBrowserClient::OnWebContentsCreated(
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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:
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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>();
|
||||
}
|
||||
}
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#define CEF_LIBCEF_BROWSER_ALLOY_DIALOGS_ALLOY_WEB_CONTENTS_DIALOG_HELPER_H_
|
||||
#pragma once
|
||||
|
||||
#include "base/functional/callback_forward.h"
|
||||
#include "base/callback_forward.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "components/web_modal/modal_dialog_host.h"
|
||||
|
@@ -7,8 +7,8 @@
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/check_op.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/location.h"
|
||||
#include "content/browser/browser_main_loop.h"
|
||||
#include "content/browser/web_contents/web_contents_impl.h"
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#ifndef CEF_LIBCEF_BROWSER_AUDIO_LOOPBACK_STREAM_CREATOR_H_
|
||||
#define CEF_LIBCEF_BROWSER_AUDIO_LOOPBACK_STREAM_CREATOR_H_
|
||||
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/callback.h"
|
||||
#include "content/browser/media/forwarding_audio_stream_factory.h"
|
||||
#include "content/common/content_export.h"
|
||||
#include "media/mojo/mojom/audio_data_pipe.mojom.h"
|
||||
|
@@ -218,6 +218,12 @@ bool CefBrowserContentsDelegate::DidAddMessageToConsole(
|
||||
return false;
|
||||
}
|
||||
|
||||
void CefBrowserContentsDelegate::DidNavigatePrimaryMainFramePostCommit(
|
||||
content::WebContents* web_contents) {
|
||||
has_document_ = false;
|
||||
OnStateChanged(State::kDocument);
|
||||
}
|
||||
|
||||
void CefBrowserContentsDelegate::EnterFullscreenModeForTab(
|
||||
content::RenderFrameHost* requesting_frame,
|
||||
const blink::mojom::FullscreenOptions& options) {
|
||||
@@ -313,11 +319,8 @@ void CefBrowserContentsDelegate::RenderFrameCreated(
|
||||
web_contents()->SetPageBaseBackgroundColor(SkColor());
|
||||
web_contents()->SetPageBaseBackgroundColor(base_background_color);
|
||||
}
|
||||
if (render_view_host->GetWidget() &&
|
||||
render_view_host->GetWidget()->GetView()) {
|
||||
render_view_host->GetWidget()->GetView()->SetBackgroundColor(
|
||||
base_background_color);
|
||||
}
|
||||
render_view_host->GetWidget()->GetView()->SetBackgroundColor(
|
||||
base_background_color);
|
||||
|
||||
platform_delegate()->RenderViewCreated(render_view_host);
|
||||
}
|
||||
@@ -455,13 +458,6 @@ void CefBrowserContentsDelegate::DidFinishNavigation(
|
||||
return;
|
||||
}
|
||||
|
||||
if (navigation_handle->IsInPrimaryMainFrame() &&
|
||||
navigation_handle->HasCommitted()) {
|
||||
// A primary main frame navigation has occured.
|
||||
has_document_ = false;
|
||||
OnStateChanged(State::kDocument);
|
||||
}
|
||||
|
||||
const bool is_main_frame = navigation_handle->IsInMainFrame();
|
||||
const auto global_id = frame_util::GetGlobalId(navigation_handle);
|
||||
const GURL& url =
|
||||
|
@@ -95,6 +95,8 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate,
|
||||
const std::u16string& message,
|
||||
int32_t line_no,
|
||||
const std::u16string& source_id) override;
|
||||
void DidNavigatePrimaryMainFramePostCommit(
|
||||
content::WebContents* web_contents) override;
|
||||
void EnterFullscreenModeForTab(
|
||||
content::RenderFrameHost* requesting_frame,
|
||||
const blink::mojom::FullscreenOptions& options) override;
|
||||
|
@@ -13,8 +13,8 @@
|
||||
#include "libcef/browser/iothread_state.h"
|
||||
#include "libcef/browser/request_context_handler_map.h"
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/task/sequenced_task_runner_helpers.h"
|
||||
#include "chrome/common/plugin.mojom.h"
|
||||
|
@@ -34,7 +34,7 @@ void CefBrowserFrame::RegisterBrowserInterfaceBindersForFrame(
|
||||
}
|
||||
|
||||
void CefBrowserFrame::SendMessage(const std::string& name,
|
||||
base::Value::List arguments) {
|
||||
base::Value arguments) {
|
||||
// Always send to the newly created RFH, which may be speculative when
|
||||
// navigating cross-origin.
|
||||
if (auto host = GetFrameHost(/*prefer_speculative=*/true)) {
|
||||
@@ -77,6 +77,6 @@ CefRefPtr<CefFrameHostImpl> CefBrowserFrame::GetFrameHost(
|
||||
return browser->browser_info()->GetFrameForHost(rfh, nullptr,
|
||||
prefer_speculative);
|
||||
}
|
||||
DCHECK(false);
|
||||
NOTREACHED();
|
||||
return nullptr;
|
||||
}
|
||||
|
@@ -35,8 +35,7 @@ class CefBrowserFrame
|
||||
|
||||
private:
|
||||
// cef::mojom::BrowserFrame methods:
|
||||
void SendMessage(const std::string& name,
|
||||
base::Value::List arguments) override;
|
||||
void SendMessage(const std::string& name, base::Value arguments) override;
|
||||
void SendSharedMemoryRegion(const std::string& name,
|
||||
base::ReadOnlySharedMemoryRegion region) override;
|
||||
void FrameAttached(mojo::PendingRemote<cef::mojom::RenderFrame> render_frame,
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -13,8 +13,8 @@
|
||||
#include "include/internal/cef_ptr.h"
|
||||
#include "libcef/common/values_impl.h"
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/containers/unique_ptr_adapters.h"
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
|
@@ -18,11 +18,11 @@
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/task/sequenced_task_runner.h"
|
||||
#include "content/public/browser/child_process_host.h"
|
||||
#include "base/threading/sequenced_task_runner_handle.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/common/child_process_host.h"
|
||||
#include "content/public/common/url_constants.h"
|
||||
|
||||
namespace {
|
||||
@@ -125,7 +125,6 @@ bool CefBrowserInfoManager::CanCreateWindow(
|
||||
|
||||
CefRefPtr<CefClient> client = browser->GetClient();
|
||||
bool allow = true;
|
||||
bool handled = false;
|
||||
|
||||
CefWindowInfo window_info;
|
||||
|
||||
@@ -134,7 +133,7 @@ bool CefBrowserInfoManager::CanCreateWindow(
|
||||
#endif
|
||||
|
||||
auto pending_popup = std::make_unique<CefBrowserInfoManager::PendingPopup>();
|
||||
pending_popup->step = PendingPopup::CAN_CREATE_WINDOW;
|
||||
pending_popup->step = CefBrowserInfoManager::PendingPopup::CAN_CREATE_WINDOW;
|
||||
pending_popup->opener_global_id = opener->GetGlobalId();
|
||||
pending_popup->target_url = target_url;
|
||||
pending_popup->target_frame_name = frame_name;
|
||||
@@ -143,11 +142,6 @@ bool CefBrowserInfoManager::CanCreateWindow(
|
||||
pending_popup->client = client;
|
||||
pending_popup->settings = browser->settings();
|
||||
|
||||
// With the Chrome runtime, we want to use default popup Browser creation
|
||||
// for document picture-in-picture.
|
||||
pending_popup->use_default_browser_creation =
|
||||
disposition == WindowOpenDisposition::NEW_PICTURE_IN_PICTURE;
|
||||
|
||||
if (client.get()) {
|
||||
CefRefPtr<CefLifeSpanHandler> handler = client->GetLifeSpanHandler();
|
||||
if (handler.get()) {
|
||||
@@ -178,7 +172,6 @@ bool CefBrowserInfoManager::CanCreateWindow(
|
||||
cef_features, window_info, pending_popup->client,
|
||||
pending_popup->settings, pending_popup->extra_info,
|
||||
no_javascript_access);
|
||||
handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,21 +179,14 @@ bool CefBrowserInfoManager::CanCreateWindow(
|
||||
CefBrowserCreateParams create_params;
|
||||
create_params.MaybeSetWindowInfo(window_info);
|
||||
|
||||
if (!handled) {
|
||||
// Use default Browser creation if OnBeforePopup was unhandled.
|
||||
// TODO(chrome): Expose a mechanism for the client to choose default
|
||||
// creation.
|
||||
pending_popup->use_default_browser_creation = true;
|
||||
}
|
||||
|
||||
// In most cases, Views-hosted browsers should create Views-hosted popups
|
||||
// and native browsers should use default popup handling. With the Chrome
|
||||
// runtime, we should additionally use default handling (a) when using an
|
||||
// external parent and (b) when using default Browser creation.
|
||||
// and native browsers should use default popup handling. The one exception
|
||||
// is with the Chrome runtime where a Views-hosted browser may have an
|
||||
// external parent. In that case we want to use default popup handling even
|
||||
// though the parent is (technically) Views-hosted.
|
||||
create_params.popup_with_views_hosted_opener =
|
||||
browser->HasView() &&
|
||||
!browser->platform_delegate()->HasExternalParent() &&
|
||||
!pending_popup->use_default_browser_creation;
|
||||
!browser->platform_delegate()->HasExternalParent();
|
||||
|
||||
create_params.settings = pending_popup->settings;
|
||||
create_params.client = pending_popup->client;
|
||||
@@ -231,8 +217,9 @@ void CefBrowserInfoManager::GetCustomWebContentsView(
|
||||
CEF_REQUIRE_UIT();
|
||||
REQUIRE_ALLOY_RUNTIME();
|
||||
|
||||
auto pending_popup = PopPendingPopup(PendingPopup::CAN_CREATE_WINDOW,
|
||||
opener_global_id, target_url);
|
||||
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup =
|
||||
PopPendingPopup(CefBrowserInfoManager::PendingPopup::CAN_CREATE_WINDOW,
|
||||
opener_global_id, target_url);
|
||||
DCHECK(pending_popup.get());
|
||||
DCHECK(pending_popup->platform_delegate.get());
|
||||
|
||||
@@ -241,7 +228,8 @@ void CefBrowserInfoManager::GetCustomWebContentsView(
|
||||
delegate_view);
|
||||
}
|
||||
|
||||
pending_popup->step = PendingPopup::GET_CUSTOM_WEB_CONTENTS_VIEW;
|
||||
pending_popup->step =
|
||||
CefBrowserInfoManager::PendingPopup::GET_CUSTOM_WEB_CONTENTS_VIEW;
|
||||
PushPendingPopup(std::move(pending_popup));
|
||||
}
|
||||
|
||||
@@ -251,16 +239,16 @@ void CefBrowserInfoManager::WebContentsCreated(
|
||||
CefBrowserSettings& settings,
|
||||
CefRefPtr<CefClient>& client,
|
||||
std::unique_ptr<CefBrowserPlatformDelegate>& platform_delegate,
|
||||
CefRefPtr<CefDictionaryValue>& extra_info,
|
||||
content::WebContents* new_contents) {
|
||||
CefRefPtr<CefDictionaryValue>& extra_info) {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
// GET_CUSTOM_WEB_CONTENTS_VIEW is only used with the alloy runtime.
|
||||
const auto previous_step = cef::IsAlloyRuntimeEnabled()
|
||||
? PendingPopup::GET_CUSTOM_WEB_CONTENTS_VIEW
|
||||
: PendingPopup::CAN_CREATE_WINDOW;
|
||||
const auto previous_step =
|
||||
cef::IsAlloyRuntimeEnabled()
|
||||
? CefBrowserInfoManager::PendingPopup::GET_CUSTOM_WEB_CONTENTS_VIEW
|
||||
: CefBrowserInfoManager::PendingPopup::CAN_CREATE_WINDOW;
|
||||
|
||||
auto pending_popup =
|
||||
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup =
|
||||
PopPendingPopup(previous_step, opener_global_id, target_url);
|
||||
DCHECK(pending_popup.get());
|
||||
DCHECK(pending_popup->platform_delegate.get());
|
||||
@@ -269,30 +257,6 @@ void CefBrowserInfoManager::WebContentsCreated(
|
||||
client = pending_popup->client;
|
||||
platform_delegate = std::move(pending_popup->platform_delegate);
|
||||
extra_info = pending_popup->extra_info;
|
||||
|
||||
// AddWebContents (the next step) is only used with the Chrome runtime.
|
||||
if (cef::IsChromeRuntimeEnabled()) {
|
||||
pending_popup->step = PendingPopup::WEB_CONTENTS_CREATED;
|
||||
pending_popup->new_contents = new_contents;
|
||||
PushPendingPopup(std::move(pending_popup));
|
||||
}
|
||||
}
|
||||
|
||||
bool CefBrowserInfoManager::AddWebContents(content::WebContents* new_contents) {
|
||||
CEF_REQUIRE_UIT();
|
||||
DCHECK(cef::IsChromeRuntimeEnabled());
|
||||
|
||||
// Pending popup information may be missing in cases where
|
||||
// chrome::AddWebContents is called directly from the Chrome UI (profile
|
||||
// settings, etc).
|
||||
auto pending_popup =
|
||||
PopPendingPopup(PendingPopup::WEB_CONTENTS_CREATED, new_contents);
|
||||
if (pending_popup) {
|
||||
return !pending_popup->use_default_browser_creation;
|
||||
}
|
||||
|
||||
// Proceed with default handling.
|
||||
return false;
|
||||
}
|
||||
|
||||
void CefBrowserInfoManager::OnGetNewBrowserInfo(
|
||||
@@ -301,7 +265,7 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo(
|
||||
DCHECK(frame_util::IsValidGlobalId(global_id));
|
||||
DCHECK(callback);
|
||||
|
||||
auto callback_runner = base::SequencedTaskRunner::GetCurrentDefault();
|
||||
auto callback_runner = base::SequencedTaskRunnerHandle::Get();
|
||||
|
||||
base::AutoLock lock_scope(browser_info_lock_);
|
||||
|
||||
@@ -333,9 +297,7 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo(
|
||||
std::make_pair(global_id, std::move(pending)));
|
||||
|
||||
// Register a timeout for the pending response so that the renderer process
|
||||
// doesn't hang forever. With the Chrome runtime, timeouts may occur in cases
|
||||
// where chrome::AddWebContents or WebContents::Create are called directly
|
||||
// from the Chrome UI (profile settings, etc).
|
||||
// doesn't hang forever.
|
||||
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kDisableNewBrowserInfoTimeout)) {
|
||||
CEF_POST_DELAYED_TASK(
|
||||
@@ -358,7 +320,7 @@ void CefBrowserInfoManager::RemoveBrowserInfo(
|
||||
}
|
||||
}
|
||||
|
||||
DCHECK(false);
|
||||
NOTREACHED();
|
||||
}
|
||||
|
||||
void CefBrowserInfoManager::DestroyAllBrowsers() {
|
||||
@@ -476,18 +438,16 @@ void CefBrowserInfoManager::PushPendingPopup(
|
||||
|
||||
std::unique_ptr<CefBrowserInfoManager::PendingPopup>
|
||||
CefBrowserInfoManager::PopPendingPopup(
|
||||
PendingPopup::Step previous_step,
|
||||
PendingPopup::Step step,
|
||||
const content::GlobalRenderFrameHostId& opener_global_id,
|
||||
const GURL& target_url) {
|
||||
CEF_REQUIRE_UIT();
|
||||
DCHECK(frame_util::IsValidGlobalId(opener_global_id));
|
||||
DCHECK_LE(previous_step, PendingPopup::GET_CUSTOM_WEB_CONTENTS_VIEW);
|
||||
|
||||
PendingPopupList::iterator it = pending_popup_list_.begin();
|
||||
for (; it != pending_popup_list_.end(); ++it) {
|
||||
PendingPopup* popup = it->get();
|
||||
if (popup->step == previous_step &&
|
||||
popup->opener_global_id == opener_global_id &&
|
||||
if (popup->step == step && popup->opener_global_id == opener_global_id &&
|
||||
popup->target_url == target_url) {
|
||||
// Transfer ownership of the pointer.
|
||||
it->release();
|
||||
@@ -499,26 +459,6 @@ CefBrowserInfoManager::PopPendingPopup(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<CefBrowserInfoManager::PendingPopup>
|
||||
CefBrowserInfoManager::PopPendingPopup(PendingPopup::Step previous_step,
|
||||
content::WebContents* new_contents) {
|
||||
CEF_REQUIRE_UIT();
|
||||
DCHECK_GE(previous_step, PendingPopup::WEB_CONTENTS_CREATED);
|
||||
|
||||
PendingPopupList::iterator it = pending_popup_list_.begin();
|
||||
for (; it != pending_popup_list_.end(); ++it) {
|
||||
PendingPopup* popup = it->get();
|
||||
if (popup->step == previous_step && popup->new_contents == new_contents) {
|
||||
// Transfer ownership of the pointer.
|
||||
it->release();
|
||||
pending_popup_list_.erase(it);
|
||||
return base::WrapUnique(popup);
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::GetBrowserInfoInternal(
|
||||
const content::GlobalRenderFrameHostId& global_id,
|
||||
bool* is_guest_view) {
|
||||
@@ -574,8 +514,8 @@ void CefBrowserInfoManager::SendNewBrowserInfoResponse(
|
||||
if (extra_info) {
|
||||
auto extra_info_impl =
|
||||
static_cast<CefDictionaryValueImpl*>(extra_info.get());
|
||||
auto extra_info_value = extra_info_impl->CopyValue();
|
||||
params->extra_info = std::move(extra_info_value.GetDict());
|
||||
auto extra_info_value = base::WrapUnique(extra_info_impl->CopyValue());
|
||||
params->extra_info = std::move(*extra_info_value);
|
||||
}
|
||||
} else {
|
||||
// The new browser info response has timed out.
|
||||
|
@@ -97,12 +97,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
CefBrowserSettings& settings,
|
||||
CefRefPtr<CefClient>& client,
|
||||
std::unique_ptr<CefBrowserPlatformDelegate>& platform_delegate,
|
||||
CefRefPtr<CefDictionaryValue>& extra_info,
|
||||
content::WebContents* new_contents);
|
||||
|
||||
// Called from ChromeBrowserDelegate::AddWebContents. See comments on
|
||||
// PendingPopup for more information. Returns true for custom handling.
|
||||
bool AddWebContents(content::WebContents* source_contents);
|
||||
CefRefPtr<CefDictionaryValue>& extra_info);
|
||||
|
||||
// Called from CefBrowserManager::GetNewBrowserInfo for delivering
|
||||
// browser info to the renderer process. If the browser info already exists
|
||||
@@ -159,8 +154,6 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
// Creates the OSR views for windowless popups.
|
||||
// - WebContentsCreated (UIT):
|
||||
// Creates the CefBrowserHost representation for the popup.
|
||||
// - AddWebContents (UIT) (chrome runtime only):
|
||||
// Creates the Browser or tab representation for the popup.
|
||||
// - CefBrowserManager::GetNewBrowserInfo (IOT)
|
||||
// Passes information about the popup to the renderer process.
|
||||
struct PendingPopup {
|
||||
@@ -170,7 +163,6 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
enum Step {
|
||||
CAN_CREATE_WINDOW,
|
||||
GET_CUSTOM_WEB_CONTENTS_VIEW,
|
||||
WEB_CONTENTS_CREATED,
|
||||
} step;
|
||||
|
||||
// Initial state from ViewHostMsg_CreateWindow.
|
||||
@@ -187,29 +179,15 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
|
||||
// Platform delegate specific to the new popup.
|
||||
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate;
|
||||
|
||||
// True if default Browser or tab creation should proceed from
|
||||
// AddWebContents (chrome runtime only).
|
||||
bool use_default_browser_creation = false;
|
||||
|
||||
// The newly created WebContents (set in WebContentsCreated).
|
||||
content::WebContents* new_contents = nullptr;
|
||||
};
|
||||
|
||||
// Manage pending popups. Only called on the UI thread.
|
||||
void PushPendingPopup(std::unique_ptr<PendingPopup> popup);
|
||||
|
||||
// Used after CanCreateWindow is called.
|
||||
std::unique_ptr<PendingPopup> PopPendingPopup(
|
||||
PendingPopup::Step previous_step,
|
||||
PendingPopup::Step step,
|
||||
const content::GlobalRenderFrameHostId& opener_global_id,
|
||||
const GURL& target_url);
|
||||
|
||||
// Used after WebContentsCreated is called.
|
||||
std::unique_ptr<PendingPopup> PopPendingPopup(
|
||||
PendingPopup::Step previous_step,
|
||||
content::WebContents* new_contents);
|
||||
|
||||
// Retrieves the BrowserInfo matching the specified ID.
|
||||
scoped_refptr<CefBrowserInfo> GetBrowserInfoInternal(
|
||||
const content::GlobalRenderFrameHostId& global_id,
|
||||
|
@@ -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(
|
||||
|
@@ -14,7 +14,7 @@
|
||||
#include "include/internal/cef_types.h"
|
||||
#include "include/views/cef_browser_view.h"
|
||||
|
||||
#include "base/functional/callback_forward.h"
|
||||
#include "base/callback_forward.h"
|
||||
#include "extensions/common/mojom/view_type.mojom-forward.h"
|
||||
#include "third_party/blink/public/common/page/drag_operation.h"
|
||||
#include "third_party/blink/public/mojom/drag/drag.mojom-forward.h"
|
||||
|
@@ -138,6 +138,6 @@ std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
|
||||
return std::move(native_delegate);
|
||||
}
|
||||
|
||||
DCHECK(false);
|
||||
NOTREACHED();
|
||||
return nullptr;
|
||||
}
|
||||
|
@@ -9,8 +9,8 @@
|
||||
#include "libcef/browser/ssl_info_impl.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/functional/callback_helpers.h"
|
||||
#include "base/callback.h"
|
||||
#include "base/callback_helpers.h"
|
||||
#include "base/logging.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "net/ssl/ssl_info.h"
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#define CEF_LIBCEF_BROWSER_CERTIFICATE_QUERY_H_
|
||||
#pragma once
|
||||
|
||||
#include "base/functional/callback_forward.h"
|
||||
#include "base/callback_forward.h"
|
||||
#include "content/public/browser/certificate_request_result_type.h"
|
||||
|
||||
namespace content {
|
||||
|
@@ -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"
|
||||
|
||||
@@ -37,16 +36,7 @@ class BrowserDelegate : public content::WebContentsDelegate {
|
||||
|
||||
~BrowserDelegate() override {}
|
||||
|
||||
// Optionally override chrome::AddWebContents behavior. This is most often
|
||||
// called via Browser::AddNewContents for new popup browsers and provides an
|
||||
// opportunity for CEF to create a new Browser instead of proceeding with
|
||||
// default Browser or tab creation.
|
||||
virtual std::unique_ptr<content::WebContents> AddWebContents(
|
||||
std::unique_ptr<content::WebContents> new_contents) = 0;
|
||||
|
||||
// Called immediately after |new_contents| is created via chrome::Navigate.
|
||||
// This is most often called for navigations targeting a new tab without a
|
||||
// pre-existing WebContents.
|
||||
// Called immediately after |new_contents| is created.
|
||||
virtual void OnWebContentsCreated(content::WebContents* new_contents) = 0;
|
||||
|
||||
// Add or remove ownership of the WebContents.
|
||||
@@ -66,32 +56,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
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -34,25 +34,6 @@ ChromeBrowserDelegate::ChromeBrowserDelegate(
|
||||
|
||||
ChromeBrowserDelegate::~ChromeBrowserDelegate() = default;
|
||||
|
||||
std::unique_ptr<content::WebContents> ChromeBrowserDelegate::AddWebContents(
|
||||
std::unique_ptr<content::WebContents> new_contents) {
|
||||
if (CefBrowserInfoManager::GetInstance()->AddWebContents(
|
||||
new_contents.get())) {
|
||||
// The browser host should have been created in WebContentsCreated().
|
||||
auto new_browser =
|
||||
ChromeBrowserHostImpl::GetBrowserForContents(new_contents.get());
|
||||
if (new_browser) {
|
||||
// Create a new Browser and give it ownership of the new WebContents.
|
||||
new_browser->AddNewContents(std::move(new_contents));
|
||||
} else {
|
||||
LOG(ERROR) << "No host found for chrome popup browser";
|
||||
}
|
||||
}
|
||||
|
||||
// Proceed with default chrome::AddWebContents behavior.
|
||||
return new_contents;
|
||||
}
|
||||
|
||||
void ChromeBrowserDelegate::OnWebContentsCreated(
|
||||
content::WebContents* new_contents) {
|
||||
// Necessary to receive LoadingStateChanged calls during initial navigation.
|
||||
@@ -122,60 +103,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,
|
||||
@@ -205,7 +132,7 @@ void ChromeBrowserDelegate::WebContentsCreated(
|
||||
target_url,
|
||||
frame_util::MakeGlobalId(opener_render_process_id,
|
||||
opener_render_frame_id),
|
||||
settings, client, platform_delegate, extra_info, new_contents);
|
||||
settings, client, platform_delegate, extra_info);
|
||||
|
||||
auto opener = ChromeBrowserHostImpl::GetBrowserForContents(source_contents);
|
||||
if (!opener) {
|
||||
@@ -228,6 +155,27 @@ void ChromeBrowserDelegate::WebContentsCreated(
|
||||
browser_info, opener, request_context_impl);
|
||||
}
|
||||
|
||||
void ChromeBrowserDelegate::AddNewContents(
|
||||
content::WebContents* source_contents,
|
||||
std::unique_ptr<content::WebContents> new_contents,
|
||||
const GURL& target_url,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& window_features,
|
||||
bool user_gesture,
|
||||
bool* was_blocked) {
|
||||
auto new_browser =
|
||||
ChromeBrowserHostImpl::GetBrowserForContents(new_contents.get());
|
||||
if (new_browser) {
|
||||
// Create a new Browser and give it ownership of the WebContents.
|
||||
new_browser->AddNewContents(std::move(new_contents));
|
||||
return;
|
||||
}
|
||||
|
||||
// Fall back to default behavior from Browser::AddNewContents.
|
||||
chrome::AddWebContents(browser_, source_contents, std::move(new_contents),
|
||||
target_url, disposition, window_features);
|
||||
}
|
||||
|
||||
content::WebContents* ChromeBrowserDelegate::OpenURLFromTab(
|
||||
content::WebContents* source,
|
||||
const content::OpenURLParams& params) {
|
||||
@@ -274,6 +222,13 @@ bool ChromeBrowserDelegate::DidAddMessageToConsole(
|
||||
return false;
|
||||
}
|
||||
|
||||
void ChromeBrowserDelegate::DidNavigatePrimaryMainFramePostCommit(
|
||||
content::WebContents* web_contents) {
|
||||
if (auto delegate = GetDelegateForWebContents(web_contents)) {
|
||||
delegate->DidNavigatePrimaryMainFramePostCommit(web_contents);
|
||||
}
|
||||
}
|
||||
|
||||
void ChromeBrowserDelegate::EnterFullscreenModeForTab(
|
||||
content::RenderFrameHost* requesting_frame,
|
||||
const blink::mojom::FullscreenOptions& options) {
|
||||
|
@@ -48,18 +48,12 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
|
||||
~ChromeBrowserDelegate() override;
|
||||
|
||||
// cef::BrowserDelegate methods:
|
||||
std::unique_ptr<content::WebContents> AddWebContents(
|
||||
std::unique_ptr<content::WebContents> new_contents) override;
|
||||
void OnWebContentsCreated(content::WebContents* new_contents) override;
|
||||
void SetAsDelegate(content::WebContents* web_contents,
|
||||
bool set_delegate) override;
|
||||
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,
|
||||
@@ -72,6 +66,13 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
|
||||
const std::string& frame_name,
|
||||
const GURL& target_url,
|
||||
content::WebContents* new_contents) override;
|
||||
void AddNewContents(content::WebContents* source_contents,
|
||||
std::unique_ptr<content::WebContents> new_contents,
|
||||
const GURL& target_url,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& window_features,
|
||||
bool user_gesture,
|
||||
bool* was_blocked) override;
|
||||
content::WebContents* OpenURLFromTab(
|
||||
content::WebContents* source,
|
||||
const content::OpenURLParams& params) override;
|
||||
@@ -83,6 +84,8 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
|
||||
const std::u16string& message,
|
||||
int32_t line_no,
|
||||
const std::u16string& source_id) override;
|
||||
void DidNavigatePrimaryMainFramePostCommit(
|
||||
content::WebContents* web_contents) override;
|
||||
void EnterFullscreenModeForTab(
|
||||
content::RenderFrameHost* requesting_frame,
|
||||
const blink::mojom::FullscreenOptions& options) override;
|
||||
|
@@ -20,7 +20,6 @@
|
||||
#include "chrome/browser/ui/browser_tabstrip.h"
|
||||
#include "chrome/browser/ui/browser_window.h"
|
||||
#include "chrome/browser/ui/tabs/tab_strip_model.h"
|
||||
#include "chrome/browser/ui/views/frame/contents_web_view.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "libcef/browser/chrome/views/chrome_browser_frame.h"
|
||||
#include "libcef/browser/chrome/views/chrome_browser_view.h"
|
||||
@@ -436,9 +435,6 @@ Browser* ChromeBrowserHostImpl::CreateBrowser(
|
||||
chrome_browser_view->InitBrowser(base::WrapUnique(browser),
|
||||
params.browser_view);
|
||||
|
||||
// Don't set theme colors in ContentsWebView::UpdateBackgroundColor.
|
||||
chrome_browser_view->contents_web_view()->SetBackgroundVisible(false);
|
||||
|
||||
// Don't show the browser by default.
|
||||
show_browser = false;
|
||||
}
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#include "libcef/browser/permission_prompt.h"
|
||||
|
||||
#include "base/task/thread_pool.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
|
||||
ChromeBrowserMainExtraPartsCef::ChromeBrowserMainExtraPartsCef() = default;
|
||||
|
||||
@@ -26,9 +25,6 @@ void ChromeBrowserMainExtraPartsCef::PostProfileInit(Profile* profile,
|
||||
CefRequestContextSettings settings;
|
||||
CefContext::Get()->PopulateGlobalRequestContextSettings(&settings);
|
||||
|
||||
// Use the existing path for the initial profile.
|
||||
CefString(&settings.cache_path) = profile->GetPath().value();
|
||||
|
||||
// Create the global RequestContext.
|
||||
global_request_context_ =
|
||||
CefRequestContextImpl::CreateGlobalRequestContext(settings);
|
||||
|
@@ -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"
|
||||
@@ -242,65 +241,21 @@ bool ChromeContentBrowserClientCef::WillCreateURLLoaderFactory(
|
||||
bool* bypass_redirect_checks,
|
||||
bool* disable_secure_dns,
|
||||
network::mojom::URLLoaderFactoryOverridePtr* factory_override) {
|
||||
bool use_proxy = ChromeContentBrowserClient::WillCreateURLLoaderFactory(
|
||||
browser_context, frame, render_process_id, type, request_initiator,
|
||||
navigation_id, ukm_source_id, factory_receiver, header_client,
|
||||
bypass_redirect_checks, disable_secure_dns, factory_override);
|
||||
if (use_proxy) {
|
||||
// The chrome layer will handle the request.
|
||||
return use_proxy;
|
||||
}
|
||||
|
||||
// Don't intercept requests for Profiles that were not created by CEF.
|
||||
// For example, the User Manager profile created via
|
||||
// profiles::CreateSystemProfileForUserManager.
|
||||
auto profile = Profile::FromBrowserContext(browser_context);
|
||||
if (!CefBrowserContext::FromProfile(profile)) {
|
||||
return ChromeContentBrowserClient::WillCreateURLLoaderFactory(
|
||||
browser_context, frame, render_process_id, type, request_initiator,
|
||||
navigation_id, ukm_source_id, factory_receiver, header_client,
|
||||
bypass_redirect_checks, disable_secure_dns, factory_override);
|
||||
}
|
||||
|
||||
// Based on content/browser/devtools/devtools_instrumentation.cc
|
||||
// WillCreateURLLoaderFactoryInternal.
|
||||
network::mojom::URLLoaderFactoryOverridePtr cef_override(
|
||||
network::mojom::URLLoaderFactoryOverride::New());
|
||||
// If caller passed some existing overrides, use those.
|
||||
// Otherwise, use our local var, then if handlers actually
|
||||
// decide to intercept, move it to |factory_override|.
|
||||
network::mojom::URLLoaderFactoryOverridePtr* handler_override =
|
||||
factory_override && *factory_override ? factory_override : &cef_override;
|
||||
network::mojom::URLLoaderFactoryOverride* intercepting_factory =
|
||||
handler_override->get();
|
||||
|
||||
// If we're the first interceptor to install an override, make a
|
||||
// remote/receiver pair, then handle this similarly to appending
|
||||
// a proxy to existing override.
|
||||
if (!intercepting_factory->overriding_factory) {
|
||||
DCHECK(!intercepting_factory->overridden_factory_receiver);
|
||||
intercepting_factory->overridden_factory_receiver =
|
||||
intercepting_factory->overriding_factory
|
||||
.InitWithNewPipeAndPassReceiver();
|
||||
}
|
||||
|
||||
// TODO(chrome): Is it necessary to proxy |header_client| callbacks?
|
||||
bool use_proxy = ChromeContentBrowserClient::WillCreateURLLoaderFactory(
|
||||
browser_context, frame, render_process_id, type, request_initiator,
|
||||
navigation_id, ukm_source_id,
|
||||
&(intercepting_factory->overridden_factory_receiver),
|
||||
/*header_client=*/nullptr, bypass_redirect_checks, disable_secure_dns,
|
||||
handler_override);
|
||||
|
||||
if (use_proxy) {
|
||||
DCHECK(intercepting_factory->overriding_factory);
|
||||
DCHECK(intercepting_factory->overridden_factory_receiver);
|
||||
if (!factory_override) {
|
||||
// Not a subresource navigation, so just override the target receiver.
|
||||
mojo::FusePipes(std::move(*factory_receiver),
|
||||
std::move(cef_override->overriding_factory));
|
||||
*factory_receiver = std::move(cef_override->overridden_factory_receiver);
|
||||
} else if (!*factory_override) {
|
||||
// No other overrides, so just returns ours as is.
|
||||
*factory_override = network::mojom::URLLoaderFactoryOverride::New(
|
||||
std::move(cef_override->overriding_factory),
|
||||
std::move(cef_override->overridden_factory_receiver), false);
|
||||
}
|
||||
// ... else things are already taken care of, as handler_override was
|
||||
// pointing to factory override and we've done all magic in-place.
|
||||
DCHECK(!cef_override->overriding_factory);
|
||||
DCHECK(!cef_override->overridden_factory_receiver);
|
||||
return false;
|
||||
}
|
||||
|
||||
auto request_handler = net_service::CreateInterceptedRequestHandler(
|
||||
@@ -311,7 +266,6 @@ bool ChromeContentBrowserClientCef::WillCreateURLLoaderFactory(
|
||||
net_service::ProxyURLLoaderFactory::CreateProxy(
|
||||
browser_context, factory_receiver, header_client,
|
||||
std::move(request_handler));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -10,8 +10,8 @@
|
||||
#include "libcef/browser/trace_subscriber.h"
|
||||
#include "libcef/common/cef_switches.h"
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/task/current_thread.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -43,7 +43,7 @@ bool CefDevToolsController::SendDevToolsMessage(
|
||||
int CefDevToolsController::ExecuteDevToolsMethod(
|
||||
int suggested_message_id,
|
||||
const std::string& method,
|
||||
const base::Value::Dict* params) {
|
||||
const base::DictionaryValue* params) {
|
||||
CEF_REQUIRE_UIT();
|
||||
if (!EnsureAgentHost()) {
|
||||
return 0;
|
||||
@@ -57,11 +57,11 @@ int CefDevToolsController::ExecuteDevToolsMethod(
|
||||
next_message_id_ = message_id + 1;
|
||||
}
|
||||
|
||||
base::Value::Dict message;
|
||||
message.Set("id", message_id);
|
||||
message.Set("method", method);
|
||||
base::DictionaryValue message;
|
||||
message.SetIntKey("id", message_id);
|
||||
message.SetStringKey("method", method);
|
||||
if (params) {
|
||||
message.Set("params", params->Clone());
|
||||
message.SetKey("params", params->Clone());
|
||||
}
|
||||
|
||||
std::string protocol_message;
|
||||
|
@@ -51,7 +51,7 @@ class CefDevToolsController : public content::DevToolsAgentHostClient {
|
||||
bool SendDevToolsMessage(const base::StringPiece& message);
|
||||
int ExecuteDevToolsMethod(int message_id,
|
||||
const std::string& method,
|
||||
const base::Value::Dict* params);
|
||||
const base::DictionaryValue* params);
|
||||
|
||||
// |observer| must outlive this object or be removed.
|
||||
void AddObserver(Observer* observer);
|
||||
|
@@ -6,17 +6,17 @@
|
||||
|
||||
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/callback.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/json/json_writer.h"
|
||||
#include "base/json/values_util.h"
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/task/sequenced_task_runner.h"
|
||||
#include "base/task/thread_pool.h"
|
||||
#include "base/threading/sequenced_task_runner_handle.h"
|
||||
#include "base/values.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/prefs/scoped_user_pref_update.h"
|
||||
@@ -142,8 +142,9 @@ void CefDevToolsFileManager::SaveAsFileSelected(const std::string& url,
|
||||
*g_last_save_path.Pointer() = path;
|
||||
saved_files_[url] = path;
|
||||
|
||||
ScopedDictPrefUpdate update(prefs_, prefs::kDevToolsEditedFiles);
|
||||
update->Set(base::MD5String(url), base::FilePathToValue(path));
|
||||
DictionaryPrefUpdate update(prefs_, prefs::kDevToolsEditedFiles);
|
||||
base::Value* files_map = update.Get();
|
||||
files_map->SetKey(base::MD5String(url), base::FilePathToValue(path));
|
||||
std::string file_system_path = path.AsUTF8Unsafe();
|
||||
std::move(callback).Run(file_system_path);
|
||||
file_task_runner_->PostTask(FROM_HERE,
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#ifndef CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FILE_MANAGER_H_
|
||||
#define CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FILE_MANAGER_H_
|
||||
|
||||
#include "base/functional/callback_forward.h"
|
||||
#include "base/callback_forward.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
|
||||
#include <map>
|
||||
|
@@ -77,10 +77,10 @@ static std::string GetFrontendURL() {
|
||||
scheme::kChromeDevToolsHost);
|
||||
}
|
||||
|
||||
base::Value::Dict BuildObjectForResponse(const net::HttpResponseHeaders* rh,
|
||||
bool success,
|
||||
int net_error) {
|
||||
base::Value::Dict response;
|
||||
base::DictionaryValue BuildObjectForResponse(const net::HttpResponseHeaders* rh,
|
||||
bool success,
|
||||
int net_error) {
|
||||
base::DictionaryValue response;
|
||||
int responseCode = 200;
|
||||
if (rh) {
|
||||
responseCode = rh->response_code();
|
||||
@@ -88,18 +88,18 @@ base::Value::Dict BuildObjectForResponse(const net::HttpResponseHeaders* rh,
|
||||
// In case of no headers, assume file:// URL and failed to load
|
||||
responseCode = 404;
|
||||
}
|
||||
response.Set("statusCode", responseCode);
|
||||
response.Set("netError", net_error);
|
||||
response.Set("netErrorName", net::ErrorToString(net_error));
|
||||
response.SetInteger("statusCode", responseCode);
|
||||
response.SetInteger("netError", net_error);
|
||||
response.SetString("netErrorName", net::ErrorToString(net_error));
|
||||
|
||||
base::Value::Dict headers;
|
||||
auto headers = std::make_unique<base::DictionaryValue>();
|
||||
size_t iterator = 0;
|
||||
std::string name;
|
||||
std::string value;
|
||||
// TODO(caseq): this probably needs to handle duplicate header names
|
||||
// correctly by folding them.
|
||||
while (rh && rh->EnumerateHeaderLines(&iterator, &name, &value)) {
|
||||
headers.Set(name, value);
|
||||
headers->SetString(name, value);
|
||||
}
|
||||
|
||||
response.Set("headers", std::move(headers));
|
||||
@@ -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_;
|
||||
@@ -424,7 +424,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
|
||||
base::Value::Dict response;
|
||||
response.Set("statusCode", 404);
|
||||
response.Set("urlValid", false);
|
||||
SendMessageAck(request_id, std::move(response));
|
||||
SendMessageAck(request_id, base::Value(std::move(response)));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -473,8 +473,8 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
|
||||
std::make_unique<network::WrapperPendingSharedURLLoaderFactory>(
|
||||
std::move(pending_remote)));
|
||||
} else if (content::HasWebUIScheme(gurl)) {
|
||||
base::Value::Dict response;
|
||||
response.Set("statusCode", 403);
|
||||
base::DictionaryValue response;
|
||||
response.SetInteger("statusCode", 403);
|
||||
SendMessageAck(request_id, std::move(response));
|
||||
return;
|
||||
} else {
|
||||
@@ -491,8 +491,9 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
|
||||
loaders_.insert(std::move(resource_loader));
|
||||
return;
|
||||
} else if (*method == "getPreferences") {
|
||||
SendMessageAck(request_id,
|
||||
GetPrefs()->GetDict(prefs::kDevToolsPreferences).Clone());
|
||||
SendMessageAck(
|
||||
request_id,
|
||||
base::Value(GetPrefs()->GetDict(prefs::kDevToolsPreferences).Clone()));
|
||||
return;
|
||||
} else if (*method == "setPreference") {
|
||||
if (params.size() < 2) {
|
||||
@@ -506,15 +507,15 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
|
||||
return;
|
||||
}
|
||||
|
||||
ScopedDictPrefUpdate update(GetPrefs(), prefs::kDevToolsPreferences);
|
||||
update->Set(*name, std::move(params[1]));
|
||||
DictionaryPrefUpdate update(GetPrefs(), prefs::kDevToolsPreferences);
|
||||
update.Get()->SetKey(*name, std::move(params[1]));
|
||||
} else if (*method == "removePreference") {
|
||||
const std::string* name = params[0].GetIfString();
|
||||
if (!name) {
|
||||
return;
|
||||
}
|
||||
ScopedDictPrefUpdate update(GetPrefs(), prefs::kDevToolsPreferences);
|
||||
update->Remove(*name);
|
||||
DictionaryPrefUpdate update(GetPrefs(), prefs::kDevToolsPreferences);
|
||||
update.Get()->RemoveKey(*name);
|
||||
} else if (*method == "requestFileSystems") {
|
||||
web_contents()->GetPrimaryMainFrame()->ExecuteJavaScriptForTests(
|
||||
u"DevToolsAPI.fileSystemsLoaded([]);", base::NullCallback());
|
||||
@@ -560,7 +561,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
|
||||
}
|
||||
|
||||
if (request_id) {
|
||||
SendMessageAck(request_id, base::Value::Dict());
|
||||
SendMessageAck(request_id, base::Value());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -627,10 +628,9 @@ void CefDevToolsFrontend::CallClientFunction(
|
||||
std::move(arguments), std::move(cb));
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::SendMessageAck(int request_id,
|
||||
base::Value::Dict arg) {
|
||||
void CefDevToolsFrontend::SendMessageAck(int request_id, base::Value arg) {
|
||||
CallClientFunction("DevToolsAPI", "embedderMessageAck",
|
||||
base::Value(request_id), base::Value(std::move(arg)));
|
||||
base::Value(request_id), std::move(arg));
|
||||
}
|
||||
|
||||
bool CefDevToolsFrontend::ProtocolLoggingEnabled() const {
|
||||
|
@@ -83,7 +83,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
|
||||
void PrimaryMainDocumentElementAvailable() override;
|
||||
void WebContentsDestroyed() override;
|
||||
|
||||
void SendMessageAck(int request_id, base::Value::Dict arg);
|
||||
void SendMessageAck(int request_id, base::Value arg);
|
||||
|
||||
bool ProtocolLoggingEnabled() const;
|
||||
void LogProtocolMessage(ProtocolMessageType type,
|
||||
|
@@ -176,8 +176,8 @@ int CefDevToolsManager::ExecuteDevToolsMethod(
|
||||
CefDictionaryValueImpl* impl =
|
||||
static_cast<CefDictionaryValueImpl*>(params.get());
|
||||
CefValueController::AutoLock lock_scope(impl->controller());
|
||||
return devtools_controller_->ExecuteDevToolsMethod(
|
||||
message_id, method, impl->GetValueUnsafe()->GetIfDict());
|
||||
return devtools_controller_->ExecuteDevToolsMethod(message_id, method,
|
||||
impl->GetValueUnsafe());
|
||||
} else {
|
||||
return devtools_controller_->ExecuteDevToolsMethod(message_id, method,
|
||||
nullptr);
|
||||
|
@@ -9,9 +9,9 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/atomicops.h"
|
||||
#include "base/bind.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
@@ -128,7 +128,7 @@ CefDevToolsManagerDelegate::CefDevToolsManagerDelegate() {}
|
||||
CefDevToolsManagerDelegate::~CefDevToolsManagerDelegate() {}
|
||||
|
||||
scoped_refptr<content::DevToolsAgentHost>
|
||||
CefDevToolsManagerDelegate::CreateNewTarget(const GURL& url, bool for_tab) {
|
||||
CefDevToolsManagerDelegate::CreateNewTarget(const GURL& url) {
|
||||
// This is reached when the user selects "Open link in new tab" from the
|
||||
// DevTools interface.
|
||||
// TODO(cef): Consider exposing new API to support this.
|
||||
|
@@ -26,8 +26,7 @@ class CefDevToolsManagerDelegate : public content::DevToolsManagerDelegate {
|
||||
|
||||
// DevToolsManagerDelegate implementation.
|
||||
scoped_refptr<content::DevToolsAgentHost> CreateNewTarget(
|
||||
const GURL& url,
|
||||
bool for_tab) override;
|
||||
const GURL& url) override;
|
||||
std::string GetDiscoveryPageHTML() override;
|
||||
bool HasBundledFrontendResources() override;
|
||||
};
|
||||
|
@@ -12,8 +12,8 @@
|
||||
#include "libcef/browser/download_item_impl.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/string_util.h"
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
@@ -15,9 +15,11 @@ CefExtensionImpl::CefExtensionImpl(const extensions::Extension* extension,
|
||||
CefRefPtr<CefExtensionHandler> handler)
|
||||
: id_(extension->id()),
|
||||
path_(extension->path().value()),
|
||||
manifest_(
|
||||
new CefDictionaryValueImpl(extension->manifest()->value()->Clone(),
|
||||
/*read_only=*/true)),
|
||||
manifest_(new CefDictionaryValueImpl(
|
||||
static_cast<base::DictionaryValue*>(
|
||||
new base::Value(extension->manifest()->value()->Clone())),
|
||||
true,
|
||||
true)),
|
||||
loader_context_(loader_context),
|
||||
handler_(handler) {}
|
||||
|
||||
@@ -54,7 +56,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 +65,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;
|
||||
}
|
||||
|
||||
|
@@ -5,8 +5,8 @@
|
||||
#include "libcef/browser/extensions/api/file_system/cef_file_system_delegate.h"
|
||||
|
||||
#include "apps/saved_files_service.h"
|
||||
#include "base/callback.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/functional/callback.h"
|
||||
#include "chrome/browser/extensions/api/file_system/file_entry_picker.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
|
@@ -7,8 +7,8 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "extensions/browser/api/execute_code_function.h"
|
||||
#include "extensions/browser/api/file_system/file_system_delegate.h"
|
||||
|
@@ -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;
|
||||
|
@@ -12,7 +12,6 @@
|
||||
#include "libcef/browser/extensions/api/tabs/tabs_api.h"
|
||||
|
||||
#include "chrome/browser/extensions/api/content_settings/content_settings_api.h"
|
||||
#include "chrome/browser/extensions/api/pdf_viewer_private/pdf_viewer_private_api.h"
|
||||
#include "chrome/browser/extensions/api/resources_private/resources_private_api.h"
|
||||
#include "extensions/browser/api/alarms/alarms_api.h"
|
||||
#include "extensions/browser/api/storage/storage_api.h"
|
||||
@@ -29,6 +28,8 @@ namespace cefimpl = extensions::cef;
|
||||
// Maintain the same order as https://developer.chrome.com/extensions/api_index
|
||||
// so chrome://extensions-support looks nice.
|
||||
const char* const kSupportedAPIs[] = {
|
||||
"resourcesPrivate",
|
||||
EXTENSION_FUNCTION_NAME(ResourcesPrivateGetStringsFunction),
|
||||
"alarms",
|
||||
EXTENSION_FUNCTION_NAME(AlarmsCreateFunction),
|
||||
EXTENSION_FUNCTION_NAME(AlarmsGetFunction),
|
||||
@@ -41,11 +42,6 @@ const char* const kSupportedAPIs[] = {
|
||||
EXTENSION_FUNCTION_NAME(ContentSettingsContentSettingSetFunction),
|
||||
EXTENSION_FUNCTION_NAME(
|
||||
ContentSettingsContentSettingGetResourceIdentifiersFunction),
|
||||
"pdfViewerPrivate",
|
||||
EXTENSION_FUNCTION_NAME(PdfViewerPrivateIsAllowedLocalFileAccessFunction),
|
||||
EXTENSION_FUNCTION_NAME(PdfViewerPrivateIsPdfOcrAlwaysActiveFunction),
|
||||
"resourcesPrivate",
|
||||
EXTENSION_FUNCTION_NAME(ResourcesPrivateGetStringsFunction),
|
||||
"storage",
|
||||
EXTENSION_FUNCTION_NAME(StorageStorageAreaGetFunction),
|
||||
EXTENSION_FUNCTION_NAME(StorageStorageAreaSetFunction),
|
||||
@@ -80,6 +76,7 @@ bool ChromeFunctionRegistry::IsSupported(const std::string& name) {
|
||||
// Only add APIs to this list that have been tested in CEF.
|
||||
// static
|
||||
void ChromeFunctionRegistry::RegisterAll(ExtensionFunctionRegistry* registry) {
|
||||
registry->RegisterFunction<ResourcesPrivateGetStringsFunction>();
|
||||
registry->RegisterFunction<AlarmsCreateFunction>();
|
||||
registry->RegisterFunction<AlarmsGetFunction>();
|
||||
registry->RegisterFunction<AlarmsGetAllFunction>();
|
||||
@@ -90,10 +87,6 @@ void ChromeFunctionRegistry::RegisterAll(ExtensionFunctionRegistry* registry) {
|
||||
registry->RegisterFunction<ContentSettingsContentSettingSetFunction>();
|
||||
registry->RegisterFunction<
|
||||
ContentSettingsContentSettingGetResourceIdentifiersFunction>();
|
||||
registry
|
||||
->RegisterFunction<PdfViewerPrivateIsAllowedLocalFileAccessFunction>();
|
||||
registry->RegisterFunction<PdfViewerPrivateIsPdfOcrAlwaysActiveFunction>();
|
||||
registry->RegisterFunction<ResourcesPrivateGetStringsFunction>();
|
||||
registry->RegisterFunction<StorageStorageAreaGetFunction>();
|
||||
registry->RegisterFunction<StorageStorageAreaSetFunction>();
|
||||
registry->RegisterFunction<StorageStorageAreaRemoveFunction>();
|
||||
|
@@ -24,8 +24,7 @@ CefComponentExtensionResourceManager::CefComponentExtensionResourceManager() {
|
||||
base::Value::Dict dict;
|
||||
pdf_extension_util::AddStrings(
|
||||
pdf_extension_util::PdfViewerContext::kPdfViewer, &dict);
|
||||
pdf_extension_util::AddAdditionalData(/*enable_printing=*/true,
|
||||
/*enable_annotations=*/true, &dict);
|
||||
pdf_extension_util::AddAdditionalData(/*enable_annotations=*/true, &dict);
|
||||
|
||||
ui::TemplateReplacements pdf_viewer_replacements;
|
||||
ui::TemplateReplacementsFromDictionaryValue(dict, &pdf_viewer_replacements);
|
||||
|
@@ -7,7 +7,7 @@
|
||||
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
|
||||
#include "libcef/browser/extensions/extension_host_delegate.h"
|
||||
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/callback.h"
|
||||
|
||||
namespace extensions {
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/functional/callback_forward.h"
|
||||
#include "base/callback_forward.h"
|
||||
#include "extensions/browser/extension_host.h"
|
||||
|
||||
class AlloyBrowserHostImpl;
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "include/cef_extension.h"
|
||||
|
||||
#include "base/functional/callback_forward.h"
|
||||
#include "base/callback_forward.h"
|
||||
#include "chrome/common/extensions/api/tabs.h"
|
||||
#include "ui/gfx/native_widget_types.h"
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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,
|
||||
|
@@ -12,10 +12,10 @@
|
||||
#include "libcef/browser/thread_util.h"
|
||||
#include "libcef/common/extensions/extensions_util.h"
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/json/json_string_value_serializer.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/string_tokenizer.h"
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -28,7 +28,7 @@ CefExtensionsAPIClient::CefExtensionsAPIClient() {}
|
||||
AppViewGuestDelegate* CefExtensionsAPIClient::CreateAppViewGuestDelegate()
|
||||
const {
|
||||
// TODO(extensions): Implement to support Apps.
|
||||
DCHECK(false);
|
||||
NOTREACHED();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
@@ -275,10 +275,11 @@ void CefFrameHostImpl::SendProcessMessage(
|
||||
// Invalidate the message object immediately by taking the argument list.
|
||||
auto argument_list =
|
||||
static_cast<CefProcessMessageImpl*>(message.get())->TakeArgumentList();
|
||||
|
||||
SendToRenderFrame(
|
||||
__FUNCTION__,
|
||||
base::BindOnce(
|
||||
[](const CefString& name, base::Value::List argument_list,
|
||||
[](const CefString& name, base::ListValue argument_list,
|
||||
const RenderFrameType& render_frame) {
|
||||
render_frame->SendMessage(name, std::move(argument_list));
|
||||
},
|
||||
@@ -630,12 +631,13 @@ void CefFrameHostImpl::OnRenderFrameDisconnect() {
|
||||
}
|
||||
|
||||
void CefFrameHostImpl::SendMessage(const std::string& name,
|
||||
base::Value::List arguments) {
|
||||
base::Value arguments) {
|
||||
if (auto browser = GetBrowserHostBase()) {
|
||||
if (auto client = browser->GetClient()) {
|
||||
CefRefPtr<CefProcessMessageImpl> message(
|
||||
new CefProcessMessageImpl(name, std::move(arguments),
|
||||
/*read_only=*/true));
|
||||
auto& list_value = base::Value::AsListValue(arguments);
|
||||
CefRefPtr<CefProcessMessageImpl> message(new CefProcessMessageImpl(
|
||||
name, std::move(const_cast<base::ListValue&>(list_value)),
|
||||
/*read_only=*/true));
|
||||
browser->GetClient()->OnProcessMessageReceived(
|
||||
browser.get(), this, PID_RENDERER, message.get());
|
||||
}
|
||||
|
@@ -135,8 +135,7 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
|
||||
content::RenderFrameHost* render_frame_host);
|
||||
|
||||
// cef::mojom::BrowserFrame methods forwarded from CefBrowserFrame.
|
||||
void SendMessage(const std::string& name,
|
||||
base::Value::List arguments) override;
|
||||
void SendMessage(const std::string& name, base::Value arguments) override;
|
||||
void SendSharedMemoryRegion(const std::string& name,
|
||||
base::ReadOnlySharedMemoryRegion region) override;
|
||||
void FrameAttached(mojo::PendingRemote<cef::mojom::RenderFrame> render_frame,
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/threading/thread_checker.h"
|
||||
#include "content/public/browser/navigation_handle.h"
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user