mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-05-22 06:34:26 +02:00
Update to Chromium version 86.0.4240.0 (#800218)
- CefURLRequest::Create is no longer supported in the renderer process (see https://crbug.com/891872). Use CefFrame::CreateURLRequest instead. - Mac platform definitions have been changed from `MACOSX` to `MAC` (see https://crbug.com/1105907) and related CMake macro names have been updated. The old `OS_MACOSX` define is still set in code and CMake for backwards compatibility. - Linux ARM build is currently broken (see https://crbug.com/1123214).
This commit is contained in:
parent
6b1e5335bc
commit
24c2f2fa38
66
BUILD.gn
66
BUILD.gn
@ -122,8 +122,8 @@ if (is_linux) {
|
|||||||
import("//third_party/fontconfig/fontconfig.gni")
|
import("//third_party/fontconfig/fontconfig.gni")
|
||||||
}
|
}
|
||||||
if (is_mac) {
|
if (is_mac) {
|
||||||
|
import("//build/apple/tweak_info_plist.gni")
|
||||||
import("//build/config/mac/rules.gni")
|
import("//build/config/mac/rules.gni")
|
||||||
import("//build/mac/tweak_info_plist.gni")
|
|
||||||
import("//build/util/version.gni")
|
import("//build/util/version.gni")
|
||||||
import("//media/cdm/library_cdm/cdm_paths.gni")
|
import("//media/cdm/library_cdm/cdm_paths.gni")
|
||||||
import("//build/config/mac/base_rules.gni")
|
import("//build/config/mac/base_rules.gni")
|
||||||
@ -808,7 +808,6 @@ static_library("libcef_static") {
|
|||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
":cef_make_headers",
|
":cef_make_headers",
|
||||||
":cef_service_manifests",
|
|
||||||
|
|
||||||
":libcef_static_unittested",
|
":libcef_static_unittested",
|
||||||
|
|
||||||
@ -841,7 +840,7 @@ static_library("libcef_static") {
|
|||||||
"//components/keyed_service/content:content",
|
"//components/keyed_service/content:content",
|
||||||
"//components/keyed_service/core:core",
|
"//components/keyed_service/core:core",
|
||||||
"//components/navigation_interception",
|
"//components/navigation_interception",
|
||||||
"//components/network_session_configurator/browser",
|
"//components/network_session_configurator/common",
|
||||||
"//components/pdf/browser",
|
"//components/pdf/browser",
|
||||||
"//components/pdf/renderer",
|
"//components/pdf/renderer",
|
||||||
"//components/plugins/renderer",
|
"//components/plugins/renderer",
|
||||||
@ -1167,7 +1166,6 @@ static_library("libcef_static") {
|
|||||||
sources += [
|
sources += [
|
||||||
# Support for UI input events.
|
# Support for UI input events.
|
||||||
# Part of //ui/aura:test_support which is testingonly.
|
# Part of //ui/aura:test_support which is testingonly.
|
||||||
"//ui/aura/test/ui_controls_factory_aurax11.cc",
|
|
||||||
"//ui/aura/test/x11_event_sender.cc",
|
"//ui/aura/test/x11_event_sender.cc",
|
||||||
"//ui/aura/test/x11_event_sender.h",
|
"//ui/aura/test/x11_event_sender.h",
|
||||||
# Part of //ui/views:test_support which is testingonly.
|
# Part of //ui/views:test_support which is testingonly.
|
||||||
@ -1252,56 +1250,6 @@ if (is_mac) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Service manifests.
|
|
||||||
#
|
|
||||||
|
|
||||||
source_set("cef_content_browser_overlay_manifest") {
|
|
||||||
sources = [
|
|
||||||
"libcef/common/service_manifests/cef_content_browser_overlay_manifest.cc",
|
|
||||||
"libcef/common/service_manifests/cef_content_browser_overlay_manifest.h",
|
|
||||||
]
|
|
||||||
|
|
||||||
configs += [
|
|
||||||
"libcef/features:config"
|
|
||||||
]
|
|
||||||
|
|
||||||
deps = [
|
|
||||||
"//base",
|
|
||||||
"//extensions/buildflags",
|
|
||||||
"//extensions/common:mojom",
|
|
||||||
"//extensions/common/api:mojom",
|
|
||||||
"//services/service_manager/public/cpp",
|
|
||||||
"//third_party/blink/public/common",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
source_set("cef_content_renderer_overlay_manifest") {
|
|
||||||
sources = [
|
|
||||||
"libcef/common/service_manifests/cef_content_renderer_overlay_manifest.h",
|
|
||||||
]
|
|
||||||
|
|
||||||
configs += [
|
|
||||||
"libcef/features:config"
|
|
||||||
]
|
|
||||||
|
|
||||||
deps = [
|
|
||||||
"//base",
|
|
||||||
"//components/subresource_filter/content/mojom",
|
|
||||||
"//extensions/buildflags",
|
|
||||||
"//extensions/common:mojom",
|
|
||||||
"//services/service_manager/public/cpp",
|
|
||||||
"//third_party/blink/public/common",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
source_set("cef_service_manifests") {
|
|
||||||
public_deps = [
|
|
||||||
":cef_content_browser_overlay_manifest",
|
|
||||||
":cef_content_renderer_overlay_manifest",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Resource grit/pack targets.
|
# Resource grit/pack targets.
|
||||||
#
|
#
|
||||||
@ -1935,8 +1883,8 @@ if (is_mac) {
|
|||||||
deps += invoker.deps
|
deps += invoker.deps
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined(invoker.libs)) {
|
if (defined(invoker.frameworks)) {
|
||||||
libs = invoker.libs
|
frameworks = invoker.frameworks
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined(invoker.defines)) {
|
if (defined(invoker.defines)) {
|
||||||
@ -2020,7 +1968,7 @@ if (is_mac) {
|
|||||||
":cefclient_resources_bundle_data_english",
|
":cefclient_resources_bundle_data_english",
|
||||||
":cefclient_xibs",
|
":cefclient_xibs",
|
||||||
]
|
]
|
||||||
libs = [
|
frameworks = [
|
||||||
"AppKit.framework",
|
"AppKit.framework",
|
||||||
"OpenGL.framework",
|
"OpenGL.framework",
|
||||||
]
|
]
|
||||||
@ -2084,7 +2032,7 @@ if (is_mac) {
|
|||||||
":cefsimple_resources_bundle_data_english",
|
":cefsimple_resources_bundle_data_english",
|
||||||
":cefsimple_xibs",
|
":cefsimple_xibs",
|
||||||
]
|
]
|
||||||
libs = [
|
frameworks = [
|
||||||
"AppKit.framework",
|
"AppKit.framework",
|
||||||
]
|
]
|
||||||
defines = [
|
defines = [
|
||||||
@ -2155,7 +2103,7 @@ if (is_mac) {
|
|||||||
":ceftests_xibs",
|
":ceftests_xibs",
|
||||||
"//testing/gtest",
|
"//testing/gtest",
|
||||||
]
|
]
|
||||||
libs = [
|
frameworks = [
|
||||||
"AppKit.framework",
|
"AppKit.framework",
|
||||||
]
|
]
|
||||||
defines = [
|
defines = [
|
||||||
|
@ -7,5 +7,5 @@
|
|||||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||||
|
|
||||||
{
|
{
|
||||||
'chromium_checkout': 'refs/tags/85.0.4183.0'
|
'chromium_checkout': 'refs/tags/86.0.4240.0'
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,6 @@
|
|||||||
# Files in the chromium/src directory that should be evaluated for changes.
|
# Files in the chromium/src directory that should be evaluated for changes.
|
||||||
# Similar changes may need to be applied to the CEF source code.
|
# Similar changes may need to be applied to the CEF source code.
|
||||||
'files': [
|
'files': [
|
||||||
'chrome/app/chrome_*_manifest.*',
|
|
||||||
'chrome/app/chrome_*_manifests.*',
|
|
||||||
'chrome/browser/browser_process.h',
|
'chrome/browser/browser_process.h',
|
||||||
'chrome/browser/extensions/api/tabs/tabs_api.*',
|
'chrome/browser/extensions/api/tabs/tabs_api.*',
|
||||||
'chrome/browser/extensions/chrome_component_extension_resource_manager.*',
|
'chrome/browser/extensions/chrome_component_extension_resource_manager.*',
|
||||||
|
@ -25,7 +25,7 @@ macro(PRINT_CEF_CONFIG)
|
|||||||
|
|
||||||
message(STATUS "Binary distribution root: ${_CEF_ROOT}")
|
message(STATUS "Binary distribution root: ${_CEF_ROOT}")
|
||||||
|
|
||||||
if(OS_MACOSX)
|
if(OS_MAC)
|
||||||
message(STATUS "Base SDK: ${CMAKE_OSX_SYSROOT}")
|
message(STATUS "Base SDK: ${CMAKE_OSX_SYSROOT}")
|
||||||
message(STATUS "Target SDK: ${CEF_TARGET_SDK}")
|
message(STATUS "Target SDK: ${CEF_TARGET_SDK}")
|
||||||
endif()
|
endif()
|
||||||
@ -75,8 +75,8 @@ macro(APPEND_PLATFORM_SOURCES name_of_list)
|
|||||||
if(OS_WINDOWS AND ${name_of_list}_WINDOWS)
|
if(OS_WINDOWS AND ${name_of_list}_WINDOWS)
|
||||||
list(APPEND ${name_of_list} ${${name_of_list}_WINDOWS})
|
list(APPEND ${name_of_list} ${${name_of_list}_WINDOWS})
|
||||||
endif()
|
endif()
|
||||||
if(OS_MACOSX AND ${name_of_list}_MACOSX)
|
if(OS_MAC AND ${name_of_list}_MAC)
|
||||||
list(APPEND ${name_of_list} ${${name_of_list}_MACOSX})
|
list(APPEND ${name_of_list} ${${name_of_list}_MAC})
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
@ -184,10 +184,10 @@ endif(OS_LINUX)
|
|||||||
# Mac OS X macros.
|
# Mac OS X macros.
|
||||||
#
|
#
|
||||||
|
|
||||||
if(OS_MACOSX)
|
if(OS_MAC)
|
||||||
|
|
||||||
# Manually process and copy over resource files.
|
# Manually process and copy over resource files.
|
||||||
macro(COPY_MACOSX_RESOURCES resource_list prefix_list target source_dir app_path)
|
macro(COPY_MAC_RESOURCES resource_list prefix_list target source_dir app_path)
|
||||||
foreach(FILENAME ${resource_list})
|
foreach(FILENAME ${resource_list})
|
||||||
# Remove one or more prefixes from the source paths.
|
# Remove one or more prefixes from the source paths.
|
||||||
set(TARGET_FILENAME "${FILENAME}")
|
set(TARGET_FILENAME "${FILENAME}")
|
||||||
@ -229,7 +229,7 @@ macro(COPY_MACOSX_RESOURCES resource_list prefix_list target source_dir app_path
|
|||||||
endforeach()
|
endforeach()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
endif(OS_MACOSX)
|
endif(OS_MAC)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -298,7 +298,7 @@ macro(SET_COMMON_TARGET_PROPERTIES target)
|
|||||||
set_property(TARGET ${target} PROPERTY LINK_FLAGS_RELEASE ${_flags_str})
|
set_property(TARGET ${target} PROPERTY LINK_FLAGS_RELEASE ${_flags_str})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(OS_MACOSX)
|
if(OS_MAC)
|
||||||
# Set Xcode target properties.
|
# Set Xcode target properties.
|
||||||
set_target_properties(${target} PROPERTIES
|
set_target_properties(${target} PROPERTIES
|
||||||
XCODE_ATTRIBUTE_ALWAYS_SEARCH_USER_PATHS NO
|
XCODE_ATTRIBUTE_ALWAYS_SEARCH_USER_PATHS NO
|
||||||
|
@ -14,7 +14,8 @@ endif()
|
|||||||
|
|
||||||
# Determine the platform.
|
# Determine the platform.
|
||||||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
||||||
set(OS_MACOSX 1)
|
set(OS_MAC 1)
|
||||||
|
set(OS_MACOSX 1) # For backwards compatibility.
|
||||||
set(OS_POSIX 1)
|
set(OS_POSIX 1)
|
||||||
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||||
set(OS_LINUX 1)
|
set(OS_LINUX 1)
|
||||||
@ -31,7 +32,7 @@ if(NOT DEFINED PROJECT_ARCH)
|
|||||||
set(PROJECT_ARCH "x86")
|
set(PROJECT_ARCH "x86")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(OS_MACOSX)
|
if(OS_MAC)
|
||||||
# PROJECT_ARCH should be specified on Mac OS X.
|
# PROJECT_ARCH should be specified on Mac OS X.
|
||||||
message(WARNING "No PROJECT_ARCH value specified, using ${PROJECT_ARCH}")
|
message(WARNING "No PROJECT_ARCH value specified, using ${PROJECT_ARCH}")
|
||||||
endif()
|
endif()
|
||||||
@ -246,7 +247,7 @@ endif()
|
|||||||
# Mac OS X configuration.
|
# Mac OS X configuration.
|
||||||
#
|
#
|
||||||
|
|
||||||
if(OS_MACOSX)
|
if(OS_MAC)
|
||||||
# Platform-specific compiler/linker flags.
|
# Platform-specific compiler/linker flags.
|
||||||
# See also Xcode target properties in cef_macros.cmake.
|
# See also Xcode target properties in cef_macros.cmake.
|
||||||
set(CEF_LIBTYPE SHARED)
|
set(CEF_LIBTYPE SHARED)
|
||||||
|
@ -180,7 +180,7 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
|
|||||||
#include "include/base/internal/cef_atomicops_x86_msvc.h"
|
#include "include/base/internal/cef_atomicops_x86_msvc.h"
|
||||||
#elif defined(OS_WIN) && (defined(__ARM_ARCH_ISA_A64) || defined(_M_ARM64))
|
#elif defined(OS_WIN) && (defined(__ARM_ARCH_ISA_A64) || defined(_M_ARM64))
|
||||||
#include "include/base/internal/cef_atomicops_arm64_msvc.h"
|
#include "include/base/internal/cef_atomicops_arm64_msvc.h"
|
||||||
#elif defined(OS_MACOSX)
|
#elif defined(OS_MAC)
|
||||||
#include "include/base/internal/cef_atomicops_mac.h"
|
#include "include/base/internal/cef_atomicops_mac.h"
|
||||||
#elif defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY)
|
#elif defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY)
|
||||||
#include "include/base/internal/cef_atomicops_x86_gcc.h"
|
#include "include/base/internal/cef_atomicops_x86_gcc.h"
|
||||||
@ -194,7 +194,7 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
|
|||||||
|
|
||||||
// On some platforms we need additional declarations to make
|
// On some platforms we need additional declarations to make
|
||||||
// AtomicWord compatible with our other Atomic* types.
|
// AtomicWord compatible with our other Atomic* types.
|
||||||
#if defined(OS_MACOSX) || defined(OS_OPENBSD)
|
#if defined(OS_MAC) || defined(OS_OPENBSD)
|
||||||
#include "include/base/internal/cef_atomicops_atomicword_compat.h"
|
#include "include/base/internal/cef_atomicops_atomicword_compat.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
//
|
//
|
||||||
// On Mac OS X, |long long| is used for 64-bit types for compatibility with
|
// On Mac OS X, |long long| is used for 64-bit types for compatibility with
|
||||||
// <inttypes.h> format macros even in the LP64 model.
|
// <inttypes.h> format macros even in the LP64 model.
|
||||||
#if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD)
|
#if defined(__LP64__) && !defined(OS_MAC) && !defined(OS_OPENBSD)
|
||||||
typedef long int64;
|
typedef long int64;
|
||||||
typedef unsigned long uint64;
|
typedef unsigned long uint64;
|
||||||
#else
|
#else
|
||||||
|
@ -44,6 +44,14 @@
|
|||||||
#define OS_WIN 1
|
#define OS_WIN 1
|
||||||
#endif
|
#endif
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
|
// New platform defines after https://crbug.com/1105907.
|
||||||
|
#ifndef OS_MAC
|
||||||
|
#define OS_MAC 1
|
||||||
|
#endif
|
||||||
|
#ifndef OS_APPLE
|
||||||
|
#define OS_APPLE 1
|
||||||
|
#endif
|
||||||
|
// Old platform defines retained for backwards compatibility.
|
||||||
#ifndef OS_MACOSX
|
#ifndef OS_MACOSX
|
||||||
#define OS_MACOSX 1
|
#define OS_MACOSX 1
|
||||||
#endif
|
#endif
|
||||||
@ -57,7 +65,7 @@
|
|||||||
|
|
||||||
// For access to standard POSIXish features, use OS_POSIX instead of a
|
// For access to standard POSIXish features, use OS_POSIX instead of a
|
||||||
// more specific macro.
|
// more specific macro.
|
||||||
#if defined(OS_MACOSX) || defined(OS_LINUX)
|
#if defined(OS_MAC) || defined(OS_LINUX)
|
||||||
#ifndef OS_POSIX
|
#ifndef OS_POSIX
|
||||||
#define OS_POSIX 1
|
#define OS_POSIX 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=63d875f5a922dd2c2e1efaaf0ddaa20475f79ef8$
|
// $hash=75f4f7a9ff628a6ae699a697722caa5d49546784$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_
|
||||||
@ -115,20 +115,13 @@ typedef struct _cef_urlrequest_t {
|
|||||||
// Create a new URL request that is not associated with a specific browser or
|
// Create a new URL request that is not associated with a specific browser or
|
||||||
// frame. Use cef_frame_t::CreateURLRequest instead if you want the request to
|
// frame. Use cef_frame_t::CreateURLRequest instead if you want the request to
|
||||||
// have this association, in which case it may be handled differently (see
|
// have this association, in which case it may be handled differently (see
|
||||||
// documentation on that function). Requests may originate from the both browser
|
// documentation on that function). A request created with this function may
|
||||||
// process and the render process.
|
// only originate from the browser process, and will behave as follows:
|
||||||
//
|
|
||||||
// For requests originating from the browser process:
|
|
||||||
// - It may be intercepted by the client via CefResourceRequestHandler or
|
// - It may be intercepted by the client via CefResourceRequestHandler or
|
||||||
// CefSchemeHandlerFactory.
|
// CefSchemeHandlerFactory.
|
||||||
// - POST data may only contain only a single element of type PDE_TYPE_FILE
|
// - POST data may only contain only a single element of type PDE_TYPE_FILE
|
||||||
// or PDE_TYPE_BYTES.
|
// or PDE_TYPE_BYTES.
|
||||||
// - If |request_context| is empty the global request context will be used.
|
// - If |request_context| is empty the global request context will be used.
|
||||||
// For requests originating from the render process:
|
|
||||||
// - It cannot be intercepted by the client so only http(s) and blob schemes
|
|
||||||
// are supported.
|
|
||||||
// - POST data may only contain a single element of type PDE_TYPE_BYTES.
|
|
||||||
// - The |request_context| parameter must be NULL.
|
|
||||||
//
|
//
|
||||||
// The |request| object will be marked as read-only after calling this function.
|
// The |request| object will be marked as read-only after calling this function.
|
||||||
///
|
///
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
#define CEF_API_HASH_UNIVERSAL "09dba98bcfcdf8a84e6e1bddf9cfbfd02cdb9c41"
|
#define CEF_API_HASH_UNIVERSAL "09dba98bcfcdf8a84e6e1bddf9cfbfd02cdb9c41"
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
#define CEF_API_HASH_PLATFORM "52cba70fb6dd7cfa07a64033875f2b9951ab194b"
|
#define CEF_API_HASH_PLATFORM "52cba70fb6dd7cfa07a64033875f2b9951ab194b"
|
||||||
#elif defined(OS_MACOSX)
|
#elif defined(OS_MAC)
|
||||||
#define CEF_API_HASH_PLATFORM "40ddb93c4e9b9d0f81b62a61a595307c6ed204e5"
|
#define CEF_API_HASH_PLATFORM "40ddb93c4e9b9d0f81b62a61a595307c6ed204e5"
|
||||||
#elif defined(OS_LINUX)
|
#elif defined(OS_LINUX)
|
||||||
#define CEF_API_HASH_PLATFORM "e48b0f06a363df82624951e4b85fb638bf0987c0"
|
#define CEF_API_HASH_PLATFORM "e48b0f06a363df82624951e4b85fb638bf0987c0"
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include "include/cef_base.h"
|
#include "include/cef_base.h"
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
#if defined(OS_MACOSX) && defined(__OBJC__)
|
#if defined(OS_MAC) && defined(__OBJC__)
|
||||||
|
|
||||||
#ifdef USING_CHROMIUM_INCLUDES
|
#ifdef USING_CHROMIUM_INCLUDES
|
||||||
|
|
||||||
@ -105,6 +105,6 @@ class CefScopedSendingEvent {
|
|||||||
|
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
#endif // defined(OS_MACOSX) && defined(__OBJC__)
|
#endif // defined(OS_MAC) && defined(__OBJC__)
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_CEF_APPLICATION_MAC_H_
|
#endif // CEF_INCLUDE_CEF_APPLICATION_MAC_H_
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
#include "include/internal/cef_types_wrappers.h"
|
#include "include/internal/cef_types_wrappers.h"
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
#include "include/internal/cef_win.h"
|
#include "include/internal/cef_win.h"
|
||||||
#elif defined(OS_MACOSX)
|
#elif defined(OS_MAC)
|
||||||
#include "include/internal/cef_mac.h"
|
#include "include/internal/cef_mac.h"
|
||||||
#elif defined(OS_LINUX)
|
#elif defined(OS_LINUX)
|
||||||
#include "include/internal/cef_linux.h"
|
#include "include/internal/cef_linux.h"
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#include "include/base/cef_build.h"
|
#include "include/base/cef_build.h"
|
||||||
#include "include/internal/cef_export.h"
|
#include "include/internal/cef_export.h"
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -83,6 +83,6 @@ class CEF_EXPORT CefScopedSandboxContext {
|
|||||||
};
|
};
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
#endif // defined(OS_MACOSX)
|
#endif // defined(OS_MAC)
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_CEF_SANDBOX_MAC_H_
|
#endif // CEF_INCLUDE_CEF_SANDBOX_MAC_H_
|
||||||
|
@ -63,20 +63,13 @@ class CefURLRequest : public virtual CefBaseRefCounted {
|
|||||||
// Create a new URL request that is not associated with a specific browser or
|
// Create a new URL request that is not associated with a specific browser or
|
||||||
// frame. Use CefFrame::CreateURLRequest instead if you want the request to
|
// frame. Use CefFrame::CreateURLRequest instead if you want the request to
|
||||||
// have this association, in which case it may be handled differently (see
|
// have this association, in which case it may be handled differently (see
|
||||||
// documentation on that method). Requests may originate from the both browser
|
// documentation on that method). A request created with this method may only
|
||||||
// process and the render process.
|
// originate from the browser process, and will behave as follows:
|
||||||
//
|
|
||||||
// For requests originating from the browser process:
|
|
||||||
// - It may be intercepted by the client via CefResourceRequestHandler or
|
// - It may be intercepted by the client via CefResourceRequestHandler or
|
||||||
// CefSchemeHandlerFactory.
|
// CefSchemeHandlerFactory.
|
||||||
// - POST data may only contain only a single element of type PDE_TYPE_FILE
|
// - POST data may only contain only a single element of type PDE_TYPE_FILE
|
||||||
// or PDE_TYPE_BYTES.
|
// or PDE_TYPE_BYTES.
|
||||||
// - If |request_context| is empty the global request context will be used.
|
// - If |request_context| is empty the global request context will be used.
|
||||||
// For requests originating from the render process:
|
|
||||||
// - It cannot be intercepted by the client so only http(s) and blob schemes
|
|
||||||
// are supported.
|
|
||||||
// - POST data may only contain a single element of type PDE_TYPE_BYTES.
|
|
||||||
// - The |request_context| parameter must be NULL.
|
|
||||||
//
|
//
|
||||||
// The |request| object will be marked as read-only after calling this method.
|
// The |request| object will be marked as read-only after calling this method.
|
||||||
///
|
///
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
// Bring in platform-specific definitions.
|
// Bring in platform-specific definitions.
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
#include "include/internal/cef_types_win.h"
|
#include "include/internal/cef_types_win.h"
|
||||||
#elif defined(OS_MACOSX)
|
#elif defined(OS_MAC)
|
||||||
#include "include/internal/cef_types_mac.h"
|
#include "include/internal/cef_types_mac.h"
|
||||||
#elif defined(OS_LINUX)
|
#elif defined(OS_LINUX)
|
||||||
#include "include/internal/cef_types_linux.h"
|
#include "include/internal/cef_types_linux.h"
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include "include/base/cef_build.h"
|
#include "include/base/cef_build.h"
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
#include "include/internal/cef_string.h"
|
#include "include/internal/cef_string.h"
|
||||||
|
|
||||||
// Handle types.
|
// Handle types.
|
||||||
@ -137,6 +137,6 @@ typedef struct _cef_window_info_t {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // OS_MACOSX
|
#endif // OS_MAC
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_MAC_H_
|
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_MAC_H_
|
||||||
|
@ -56,7 +56,7 @@ int cef_unload_library();
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
|
|
||||||
///
|
///
|
||||||
// Scoped helper for loading and unloading the CEF framework library at
|
// Scoped helper for loading and unloading the CEF framework library at
|
||||||
@ -122,7 +122,7 @@ class CefScopedLibraryLoader {
|
|||||||
DISALLOW_COPY_AND_ASSIGN(CefScopedLibraryLoader);
|
DISALLOW_COPY_AND_ASSIGN(CefScopedLibraryLoader);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // defined(OS_MACOSX)
|
#endif // defined(OS_MAC)
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_WRAPPER_CEF_LIBRARY_LOADER_H_
|
#endif // CEF_INCLUDE_WRAPPER_CEF_LIBRARY_LOADER_H_
|
||||||
|
@ -96,10 +96,10 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
|
|||||||
|
|
||||||
// Values checked in ProfileNetworkContextService::CreateNetworkContextParams
|
// Values checked in ProfileNetworkContextService::CreateNetworkContextParams
|
||||||
// when creating the NetworkContext.
|
// when creating the NetworkContext.
|
||||||
bool ShouldRestoreOldSessionCookies() override {
|
bool ShouldRestoreOldSessionCookies() const override {
|
||||||
return ShouldPersistSessionCookies();
|
return ShouldPersistSessionCookies();
|
||||||
}
|
}
|
||||||
bool ShouldPersistSessionCookies() override {
|
bool ShouldPersistSessionCookies() const override {
|
||||||
return !!settings_.persist_session_cookies;
|
return !!settings_.persist_session_cookies;
|
||||||
}
|
}
|
||||||
base::Optional<std::vector<std::string>> GetCookieableSchemes() override {
|
base::Optional<std::vector<std::string>> GetCookieableSchemes() override {
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
#endif // defined(USE_AURA)
|
#endif // defined(USE_AURA)
|
||||||
|
|
||||||
#if defined(TOOLKIT_VIEWS)
|
#if defined(TOOLKIT_VIEWS)
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
#include "chrome/browser/ui/views/chrome_layout_provider.h"
|
#include "chrome/browser/ui/views/chrome_layout_provider.h"
|
||||||
#include "chrome/browser/ui/views/chrome_views_delegate.h"
|
#include "chrome/browser/ui/views/chrome_views_delegate.h"
|
||||||
#else
|
#else
|
||||||
@ -105,7 +105,7 @@ void AlloyBrowserMainParts::ToolkitInitialized() {
|
|||||||
#endif // defined(USE_AURA)
|
#endif // defined(USE_AURA)
|
||||||
|
|
||||||
#if defined(TOOLKIT_VIEWS)
|
#if defined(TOOLKIT_VIEWS)
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
views_delegate_ = std::make_unique<ChromeViewsDelegate>();
|
views_delegate_ = std::make_unique<ChromeViewsDelegate>();
|
||||||
layout_provider_ = ChromeLayoutProvider::CreateLayoutProvider();
|
layout_provider_ = ChromeLayoutProvider::CreateLayoutProvider();
|
||||||
#else
|
#else
|
||||||
@ -230,7 +230,7 @@ void AlloyBrowserMainParts::PostDestroyThreads() {
|
|||||||
|
|
||||||
#if defined(TOOLKIT_VIEWS)
|
#if defined(TOOLKIT_VIEWS)
|
||||||
views_delegate_.reset();
|
views_delegate_.reset();
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
layout_provider_.reset();
|
layout_provider_.reset();
|
||||||
#endif
|
#endif
|
||||||
#endif // defined(TOOLKIT_VIEWS)
|
#endif // defined(TOOLKIT_VIEWS)
|
||||||
|
@ -32,7 +32,7 @@ class WMState;
|
|||||||
#if defined(TOOLKIT_VIEWS)
|
#if defined(TOOLKIT_VIEWS)
|
||||||
namespace views {
|
namespace views {
|
||||||
class ViewsDelegate;
|
class ViewsDelegate;
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
class LayoutProvider;
|
class LayoutProvider;
|
||||||
#endif
|
#endif
|
||||||
} // namespace views
|
} // namespace views
|
||||||
@ -96,7 +96,7 @@ class AlloyBrowserMainParts : public content::BrowserMainParts {
|
|||||||
|
|
||||||
#if defined(TOOLKIT_VIEWS)
|
#if defined(TOOLKIT_VIEWS)
|
||||||
std::unique_ptr<views::ViewsDelegate> views_delegate_;
|
std::unique_ptr<views::ViewsDelegate> views_delegate_;
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
std::unique_ptr<views::LayoutProvider> layout_provider_;
|
std::unique_ptr<views::LayoutProvider> layout_provider_;
|
||||||
#endif
|
#endif
|
||||||
#endif // defined(TOOLKIT_VIEWS)
|
#endif // defined(TOOLKIT_VIEWS)
|
||||||
|
@ -40,7 +40,6 @@
|
|||||||
#include "libcef/common/extensions/extensions_util.h"
|
#include "libcef/common/extensions/extensions_util.h"
|
||||||
#include "libcef/common/net/scheme_registration.h"
|
#include "libcef/common/net/scheme_registration.h"
|
||||||
#include "libcef/common/request_impl.h"
|
#include "libcef/common/request_impl.h"
|
||||||
#include "libcef/common/service_manifests/cef_content_browser_overlay_manifest.h"
|
|
||||||
|
|
||||||
#include "base/base_switches.h"
|
#include "base/base_switches.h"
|
||||||
#include "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
@ -73,7 +72,6 @@
|
|||||||
#include "components/navigation_interception/intercept_navigation_throttle.h"
|
#include "components/navigation_interception/intercept_navigation_throttle.h"
|
||||||
#include "components/navigation_interception/navigation_params.h"
|
#include "components/navigation_interception/navigation_params.h"
|
||||||
#include "components/spellcheck/common/spellcheck.mojom.h"
|
#include "components/spellcheck/common/spellcheck.mojom.h"
|
||||||
#include "components/variations/variations_http_header_provider.h"
|
|
||||||
#include "components/version_info/version_info.h"
|
#include "components/version_info/version_info.h"
|
||||||
#include "content/browser/frame_host/render_frame_host_impl.h"
|
#include "content/browser/frame_host/render_frame_host_impl.h"
|
||||||
#include "content/browser/plugin_service_impl.h"
|
#include "content/browser/plugin_service_impl.h"
|
||||||
@ -104,6 +102,8 @@
|
|||||||
#include "extensions/browser/extensions_browser_client.h"
|
#include "extensions/browser/extensions_browser_client.h"
|
||||||
#include "extensions/browser/guest_view/extensions_guest_view_message_filter.h"
|
#include "extensions/browser/guest_view/extensions_guest_view_message_filter.h"
|
||||||
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
|
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
|
||||||
|
#include "extensions/browser/info_map.h"
|
||||||
|
#include "extensions/browser/process_map.h"
|
||||||
#include "extensions/browser/url_loader_factory_manager.h"
|
#include "extensions/browser/url_loader_factory_manager.h"
|
||||||
#include "extensions/common/constants.h"
|
#include "extensions/common/constants.h"
|
||||||
#include "extensions/common/switches.h"
|
#include "extensions/common/switches.h"
|
||||||
@ -112,11 +112,11 @@
|
|||||||
#include "net/base/auth.h"
|
#include "net/base/auth.h"
|
||||||
#include "net/ssl/ssl_cert_request_info.h"
|
#include "net/ssl/ssl_cert_request_info.h"
|
||||||
#include "ppapi/host/ppapi_host.h"
|
#include "ppapi/host/ppapi_host.h"
|
||||||
|
#include "sandbox/policy/switches.h"
|
||||||
#include "services/network/public/cpp/network_switches.h"
|
#include "services/network/public/cpp/network_switches.h"
|
||||||
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
|
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
|
||||||
#include "services/service_manager/embedder/switches.h"
|
#include "services/service_manager/embedder/switches.h"
|
||||||
#include "services/service_manager/public/mojom/connector.mojom.h"
|
#include "services/service_manager/public/mojom/connector.mojom.h"
|
||||||
#include "services/service_manager/sandbox/switches.h"
|
|
||||||
#include "storage/browser/quota/quota_settings.h"
|
#include "storage/browser/quota/quota_settings.h"
|
||||||
#include "third_party/blink/public/mojom/insecure_input/insecure_input_service.mojom.h"
|
#include "third_party/blink/public/mojom/insecure_input/insecure_input_service.mojom.h"
|
||||||
#include "third_party/blink/public/mojom/prerender/prerender.mojom.h"
|
#include "third_party/blink/public/mojom/prerender/prerender.mojom.h"
|
||||||
@ -131,7 +131,7 @@
|
|||||||
#include "libcef/common/widevine_loader.h"
|
#include "libcef/common/widevine_loader.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
#if defined(OS_POSIX) && !defined(OS_MAC)
|
||||||
#include "base/debug/leak_annotations.h"
|
#include "base/debug/leak_annotations.h"
|
||||||
#include "chrome/common/chrome_paths.h"
|
#include "chrome/common/chrome_paths.h"
|
||||||
#include "components/crash/content/browser/crash_handler_host_linux.h"
|
#include "components/crash/content/browser/crash_handler_host_linux.h"
|
||||||
@ -139,7 +139,7 @@
|
|||||||
#include "content/public/common/content_descriptors.h"
|
#include "content/public/common/content_descriptors.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
#include "net/ssl/client_cert_store_mac.h"
|
#include "net/ssl/client_cert_store_mac.h"
|
||||||
#include "services/video_capture/public/mojom/constants.mojom.h"
|
#include "services/video_capture/public/mojom/constants.mojom.h"
|
||||||
#endif
|
#endif
|
||||||
@ -381,7 +381,7 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext {
|
|||||||
DISALLOW_COPY_AND_ASSIGN(CefQuotaPermissionContext);
|
DISALLOW_COPY_AND_ASSIGN(CefQuotaPermissionContext);
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
#if defined(OS_POSIX) && !defined(OS_MAC)
|
||||||
breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost(
|
breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost(
|
||||||
const std::string& process_type) {
|
const std::string& process_type) {
|
||||||
base::FilePath dumps_path;
|
base::FilePath dumps_path;
|
||||||
@ -436,7 +436,7 @@ int GetCrashSignalFD(const base::CommandLine& command_line) {
|
|||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif // defined(OS_POSIX) && !defined(OS_MACOSX)
|
#endif // defined(OS_POSIX) && !defined(OS_MAC)
|
||||||
|
|
||||||
// TODO(cef): We can't currently trust NavigationParams::is_main_frame() because
|
// TODO(cef): We can't currently trust NavigationParams::is_main_frame() because
|
||||||
// it's always set to true in
|
// it's always set to true in
|
||||||
@ -697,12 +697,6 @@ void AlloyContentBrowserClient::SiteInstanceGotProcess(
|
|||||||
extensions::ProcessMap::Get(browser_context)
|
extensions::ProcessMap::Get(browser_context)
|
||||||
->Insert(extension->id(), site_instance->GetProcess()->GetID(),
|
->Insert(extension->id(), site_instance->GetProcess()->GetID(),
|
||||||
site_instance->GetId());
|
site_instance->GetId());
|
||||||
|
|
||||||
CEF_POST_TASK(
|
|
||||||
CEF_IOT, base::Bind(&extensions::InfoMap::RegisterExtensionProcess,
|
|
||||||
browser_context->extension_system()->info_map(),
|
|
||||||
extension->id(), site_instance->GetProcess()->GetID(),
|
|
||||||
site_instance->GetId()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AlloyContentBrowserClient::SiteInstanceDeleting(
|
void AlloyContentBrowserClient::SiteInstanceDeleting(
|
||||||
@ -729,12 +723,6 @@ void AlloyContentBrowserClient::SiteInstanceDeleting(
|
|||||||
extensions::ProcessMap::Get(browser_context)
|
extensions::ProcessMap::Get(browser_context)
|
||||||
->Remove(extension->id(), site_instance->GetProcess()->GetID(),
|
->Remove(extension->id(), site_instance->GetProcess()->GetID(),
|
||||||
site_instance->GetId());
|
site_instance->GetId());
|
||||||
|
|
||||||
CEF_POST_TASK(
|
|
||||||
CEF_IOT, base::Bind(&extensions::InfoMap::UnregisterExtensionProcess,
|
|
||||||
browser_context->extension_system()->info_map(),
|
|
||||||
extension->id(), site_instance->GetProcess()->GetID(),
|
|
||||||
site_instance->GetId()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AlloyContentBrowserClient::BindHostReceiverForRenderer(
|
void AlloyContentBrowserClient::BindHostReceiverForRenderer(
|
||||||
@ -756,15 +744,6 @@ void AlloyContentBrowserClient::BindHostReceiverForRenderer(
|
|||||||
#endif // BUILDFLAG(HAS_SPELLCHECK_PANEL)
|
#endif // BUILDFLAG(HAS_SPELLCHECK_PANEL)
|
||||||
}
|
}
|
||||||
|
|
||||||
base::Optional<service_manager::Manifest>
|
|
||||||
AlloyContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) {
|
|
||||||
if (name == content::mojom::kBrowserServiceName) {
|
|
||||||
return GetCefContentBrowserOverlayManifest();
|
|
||||||
}
|
|
||||||
|
|
||||||
return base::nullopt;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
|
void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
|
||||||
base::CommandLine* command_line,
|
base::CommandLine* command_line,
|
||||||
int child_process_id) {
|
int child_process_id) {
|
||||||
@ -775,7 +754,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
|
|||||||
// associated values) if present in the browser command line.
|
// associated values) if present in the browser command line.
|
||||||
static const char* const kSwitchNames[] = {
|
static const char* const kSwitchNames[] = {
|
||||||
switches::kDisablePackLoading,
|
switches::kDisablePackLoading,
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
switches::kFrameworkDirPath,
|
switches::kFrameworkDirPath,
|
||||||
switches::kMainBundlePath,
|
switches::kMainBundlePath,
|
||||||
#endif
|
#endif
|
||||||
@ -855,7 +834,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
|
|||||||
base::size(kSwitchNames));
|
base::size(kSwitchNames));
|
||||||
|
|
||||||
#if BUILDFLAG(ENABLE_WIDEVINE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
#if BUILDFLAG(ENABLE_WIDEVINE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
if (!browser_cmd->HasSwitch(service_manager::switches::kNoSandbox)) {
|
if (!browser_cmd->HasSwitch(sandbox::policy::switches::kNoSandbox)) {
|
||||||
// Pass the Widevine CDM path to the Zygote process. See comments in
|
// Pass the Widevine CDM path to the Zygote process. See comments in
|
||||||
// CefWidevineLoader::AddContentDecryptionModules.
|
// CefWidevineLoader::AddContentDecryptionModules.
|
||||||
const base::FilePath& cdm_path = CefWidevineLoader::GetInstance()->path();
|
const base::FilePath& cdm_path = CefWidevineLoader::GetInstance()->path();
|
||||||
@ -1179,7 +1158,7 @@ AlloyContentBrowserClient::CreateClientCertStore(
|
|||||||
net::ClientCertStoreNSS::PasswordDelegateFactory()));
|
net::ClientCertStoreNSS::PasswordDelegateFactory()));
|
||||||
#elif defined(OS_WIN)
|
#elif defined(OS_WIN)
|
||||||
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreWin());
|
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreWin());
|
||||||
#elif defined(OS_MACOSX)
|
#elif defined(OS_MAC)
|
||||||
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreMac());
|
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreMac());
|
||||||
#else
|
#else
|
||||||
#error Unknown platform.
|
#error Unknown platform.
|
||||||
@ -1203,6 +1182,7 @@ AlloyContentBrowserClient::CreateLoginDelegate(
|
|||||||
|
|
||||||
void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
|
void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
|
||||||
int frame_tree_node_id,
|
int frame_tree_node_id,
|
||||||
|
base::UkmSourceId ukm_source_id,
|
||||||
NonNetworkURLLoaderFactoryMap* factories) {
|
NonNetworkURLLoaderFactoryMap* factories) {
|
||||||
if (!extensions::ExtensionsEnabled())
|
if (!extensions::ExtensionsEnabled())
|
||||||
return;
|
return;
|
||||||
@ -1212,7 +1192,7 @@ void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
|
|||||||
factories->emplace(
|
factories->emplace(
|
||||||
extensions::kExtensionScheme,
|
extensions::kExtensionScheme,
|
||||||
extensions::CreateExtensionNavigationURLLoaderFactory(
|
extensions::CreateExtensionNavigationURLLoaderFactory(
|
||||||
web_contents->GetBrowserContext(),
|
web_contents->GetBrowserContext(), ukm_source_id,
|
||||||
!!extensions::WebViewGuest::FromWebContents(web_contents)));
|
!!extensions::WebViewGuest::FromWebContents(web_contents)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,8 +61,6 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
|
|||||||
void BindHostReceiverForRenderer(
|
void BindHostReceiverForRenderer(
|
||||||
content::RenderProcessHost* render_process_host,
|
content::RenderProcessHost* render_process_host,
|
||||||
mojo::GenericPendingReceiver receiver) override;
|
mojo::GenericPendingReceiver receiver) override;
|
||||||
base::Optional<service_manager::Manifest> GetServiceManifestOverlay(
|
|
||||||
base::StringPiece name) override;
|
|
||||||
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
|
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
|
||||||
int child_process_id) override;
|
int child_process_id) override;
|
||||||
std::string GetApplicationLocale() override;
|
std::string GetApplicationLocale() override;
|
||||||
@ -149,6 +147,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
|
|||||||
LoginAuthRequiredCallback auth_required_callback) override;
|
LoginAuthRequiredCallback auth_required_callback) override;
|
||||||
void RegisterNonNetworkNavigationURLLoaderFactories(
|
void RegisterNonNetworkNavigationURLLoaderFactories(
|
||||||
int frame_tree_node_id,
|
int frame_tree_node_id,
|
||||||
|
base::UkmSourceId ukm_source_id,
|
||||||
NonNetworkURLLoaderFactoryMap* factories) override;
|
NonNetworkURLLoaderFactoryMap* factories) override;
|
||||||
void RegisterNonNetworkSubresourceURLLoaderFactories(
|
void RegisterNonNetworkSubresourceURLLoaderFactories(
|
||||||
int render_process_id,
|
int render_process_id,
|
||||||
|
@ -222,7 +222,7 @@ void CefBrowserPlatformDelegateAlloy::SendCaptureLostEvent() {
|
|||||||
widget->LostCapture();
|
widget->LostCapture();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX))
|
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
|
||||||
void CefBrowserPlatformDelegateAlloy::NotifyMoveOrResizeStarted() {
|
void CefBrowserPlatformDelegateAlloy::NotifyMoveOrResizeStarted() {
|
||||||
if (!web_contents_)
|
if (!web_contents_)
|
||||||
return;
|
return;
|
||||||
|
@ -36,7 +36,7 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
|
|||||||
extensions::ExtensionHost* GetExtensionHost() const override;
|
extensions::ExtensionHost* GetExtensionHost() const override;
|
||||||
void BrowserDestroyed(CefBrowserHostImpl* browser) override;
|
void BrowserDestroyed(CefBrowserHostImpl* browser) override;
|
||||||
void SendCaptureLostEvent() override;
|
void SendCaptureLostEvent() override;
|
||||||
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX))
|
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
|
||||||
void NotifyMoveOrResizeStarted() override;
|
void NotifyMoveOrResizeStarted() override;
|
||||||
#endif
|
#endif
|
||||||
bool PreHandleGestureEvent(content::WebContents* source,
|
bool PreHandleGestureEvent(content::WebContents* source,
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
|
|
||||||
#include "libcef/browser/alloy/chrome_profile_alloy.h"
|
#include "libcef/browser/alloy/chrome_profile_alloy.h"
|
||||||
|
|
||||||
|
#include "base/no_destructor.h"
|
||||||
#include "components/variations/variations_client.h"
|
#include "components/variations/variations_client.h"
|
||||||
#include "components/variations/variations_http_header_provider.h"
|
#include "components/variations/variations_ids_provider.h"
|
||||||
#include "net/url_request/url_request_context.h"
|
#include "net/url_request/url_request_context.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -23,7 +24,7 @@ class CefVariationsClient : public variations::VariationsClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string GetVariationsHeader() const override {
|
std::string GetVariationsHeader() const override {
|
||||||
return variations::VariationsHttpHeaderProvider::GetInstance()
|
return variations::VariationsIdsProvider::GetInstance()
|
||||||
->GetClientDataHeader(false /* is_signed_in */);
|
->GetClientDataHeader(false /* is_signed_in */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,7 +158,7 @@ void ChromeProfileAlloy::SetExitType(ExitType exit_type) {
|
|||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile::ExitType ChromeProfileAlloy::GetLastSessionExitType() {
|
Profile::ExitType ChromeProfileAlloy::GetLastSessionExitType() const {
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
return EXIT_NORMAL;
|
return EXIT_NORMAL;
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ class ChromeProfileAlloy : public Profile {
|
|||||||
GURL GetHomePage() override;
|
GURL GetHomePage() override;
|
||||||
bool WasCreatedByVersionOrLater(const std::string& version) override;
|
bool WasCreatedByVersionOrLater(const std::string& version) override;
|
||||||
void SetExitType(ExitType exit_type) override;
|
void SetExitType(ExitType exit_type) override;
|
||||||
ExitType GetLastSessionExitType() override;
|
ExitType GetLastSessionExitType() const override;
|
||||||
base::Time GetCreationTime() const override;
|
base::Time GetCreationTime() const override;
|
||||||
void SetCreationTimeForTesting(base::Time creation_time) override;
|
void SetCreationTimeForTesting(base::Time creation_time) override;
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
#include "ui/events/base_event_utils.h"
|
#include "ui/events/base_event_utils.h"
|
||||||
#include "ui/gfx/image/image_skia.h"
|
#include "ui/gfx/image/image_skia.h"
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
#include "components/spellcheck/browser/spellcheck_platform.h"
|
#include "components/spellcheck/browser/spellcheck_platform.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -565,7 +565,7 @@ void CefBrowserHostImpl::CloseBrowser(bool force_close) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
content::WebContents* contents = web_contents();
|
content::WebContents* contents = web_contents();
|
||||||
if (contents && contents->NeedToFireBeforeUnloadOrUnload()) {
|
if (contents && contents->NeedToFireBeforeUnloadOrUnloadEvents()) {
|
||||||
// Will result in a call to BeforeUnloadFired() and, if the close isn't
|
// Will result in a call to BeforeUnloadFired() and, if the close isn't
|
||||||
// canceled, CloseContents().
|
// canceled, CloseContents().
|
||||||
contents->DispatchBeforeUnload(false /* auto_cancel */);
|
contents->DispatchBeforeUnload(false /* auto_cancel */);
|
||||||
@ -1048,7 +1048,7 @@ void CefBrowserHostImpl::AddWordToDictionary(const CefString& word) {
|
|||||||
if (spellcheck)
|
if (spellcheck)
|
||||||
spellcheck->GetCustomDictionary()->AddWord(word);
|
spellcheck->GetCustomDictionary()->AddWord(word);
|
||||||
}
|
}
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
if (spellcheck && spellcheck::UseBrowserSpellChecker()) {
|
if (spellcheck && spellcheck::UseBrowserSpellChecker()) {
|
||||||
spellcheck_platform::AddWord(spellcheck->platform_spell_checker(), word);
|
spellcheck_platform::AddWord(spellcheck->platform_spell_checker(), word);
|
||||||
}
|
}
|
||||||
@ -1225,7 +1225,7 @@ void CefBrowserHostImpl::SendCaptureLostEvent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CefBrowserHostImpl::NotifyMoveOrResizeStarted() {
|
void CefBrowserHostImpl::NotifyMoveOrResizeStarted() {
|
||||||
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX))
|
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
|
||||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||||
CEF_POST_TASK(
|
CEF_POST_TASK(
|
||||||
CEF_UIT,
|
CEF_UIT,
|
||||||
@ -2301,10 +2301,10 @@ CefBrowserHostImpl::GetJavaScriptDialogManager(content::WebContents* source) {
|
|||||||
|
|
||||||
void CefBrowserHostImpl::RunFileChooser(
|
void CefBrowserHostImpl::RunFileChooser(
|
||||||
content::RenderFrameHost* render_frame_host,
|
content::RenderFrameHost* render_frame_host,
|
||||||
std::unique_ptr<content::FileSelectListener> listener,
|
scoped_refptr<content::FileSelectListener> listener,
|
||||||
const blink::mojom::FileChooserParams& params) {
|
const blink::mojom::FileChooserParams& params) {
|
||||||
EnsureFileDialogManager();
|
EnsureFileDialogManager();
|
||||||
file_dialog_manager_->RunFileChooser(std::move(listener), params);
|
file_dialog_manager_->RunFileChooser(listener, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefBrowserHostImpl::HandleContextMenu(
|
bool CefBrowserHostImpl::HandleContextMenu(
|
||||||
@ -2320,7 +2320,7 @@ bool CefBrowserHostImpl::HandleContextMenu(
|
|||||||
|
|
||||||
void CefBrowserHostImpl::UpdatePreferredSize(content::WebContents* source,
|
void CefBrowserHostImpl::UpdatePreferredSize(content::WebContents* source,
|
||||||
const gfx::Size& pref_size) {
|
const gfx::Size& pref_size) {
|
||||||
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX))
|
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
|
||||||
CEF_REQUIRE_UIT();
|
CEF_REQUIRE_UIT();
|
||||||
if (platform_delegate_)
|
if (platform_delegate_)
|
||||||
platform_delegate_->SizeTo(pref_size.width(), pref_size.height());
|
platform_delegate_->SizeTo(pref_size.width(), pref_size.height());
|
||||||
|
@ -430,7 +430,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
|||||||
content::JavaScriptDialogManager* GetJavaScriptDialogManager(
|
content::JavaScriptDialogManager* GetJavaScriptDialogManager(
|
||||||
content::WebContents* source) override;
|
content::WebContents* source) override;
|
||||||
void RunFileChooser(content::RenderFrameHost* render_frame_host,
|
void RunFileChooser(content::RenderFrameHost* render_frame_host,
|
||||||
std::unique_ptr<content::FileSelectListener> listener,
|
scoped_refptr<content::FileSelectListener> listener,
|
||||||
const blink::mojom::FileChooserParams& params) override;
|
const blink::mojom::FileChooserParams& params) override;
|
||||||
bool EmbedsFullscreenWidget() override;
|
bool EmbedsFullscreenWidget() override;
|
||||||
void EnterFullscreenModeForTab(
|
void EnterFullscreenModeForTab(
|
||||||
|
@ -157,7 +157,7 @@ bool CefBrowserInfoManager::CanCreateWindow(
|
|||||||
CefPopupFeatures cef_features;
|
CefPopupFeatures cef_features;
|
||||||
TranslatePopupFeatures(features, cef_features);
|
TranslatePopupFeatures(features, cef_features);
|
||||||
|
|
||||||
#if (defined(OS_WIN) || defined(OS_MACOSX))
|
#if (defined(OS_WIN) || defined(OS_MAC))
|
||||||
// Default to the size from the popup features.
|
// Default to the size from the popup features.
|
||||||
if (cef_features.xSet)
|
if (cef_features.xSet)
|
||||||
window_info->x = cef_features.x;
|
window_info->x = cef_features.x;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "base/message_loop/message_pump.h"
|
#include "base/message_loop/message_pump.h"
|
||||||
#include "base/message_loop/message_pump_for_ui.h"
|
#include "base/message_loop/message_pump_for_ui.h"
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
#include "base/mac/scoped_nsautorelease_pool.h"
|
#include "base/mac/scoped_nsautorelease_pool.h"
|
||||||
#include "base/message_loop/message_pump_mac.h"
|
#include "base/message_loop/message_pump_mac.h"
|
||||||
#endif
|
#endif
|
||||||
@ -29,7 +29,7 @@ class MessagePumpExternal : public base::MessagePumpForUI {
|
|||||||
void Run(Delegate* delegate) override {
|
void Run(Delegate* delegate) override {
|
||||||
base::TimeTicks start = base::TimeTicks::Now();
|
base::TimeTicks start = base::TimeTicks::Now();
|
||||||
while (true) {
|
while (true) {
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
base::mac::ScopedNSAutoreleasePool autorelease_pool;
|
base::mac::ScopedNSAutoreleasePool autorelease_pool;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ std::unique_ptr<base::MessagePump> MessagePumpFactoryForUI() {
|
|||||||
return std::make_unique<MessagePumpExternal>(0.01f, handler);
|
return std::make_unique<MessagePumpExternal>(0.01f, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
return base::MessagePumpMac::Create();
|
return base::MessagePumpMac::Create();
|
||||||
#else
|
#else
|
||||||
return std::make_unique<base::MessagePumpForUI>();
|
return std::make_unique<base::MessagePumpForUI>();
|
||||||
|
@ -127,7 +127,7 @@ void CefBrowserPlatformDelegate::SendCaptureLostEvent() {
|
|||||||
NOTIMPLEMENTED();
|
NOTIMPLEMENTED();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX))
|
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
|
||||||
void CefBrowserPlatformDelegate::NotifyMoveOrResizeStarted() {}
|
void CefBrowserPlatformDelegate::NotifyMoveOrResizeStarted() {}
|
||||||
|
|
||||||
void CefBrowserPlatformDelegate::SizeTo(int width, int height) {}
|
void CefBrowserPlatformDelegate::SizeTo(int width, int height) {}
|
||||||
|
@ -207,7 +207,7 @@ class CefBrowserPlatformDelegate {
|
|||||||
// Send capture lost event.
|
// Send capture lost event.
|
||||||
virtual void SendCaptureLostEvent();
|
virtual void SendCaptureLostEvent();
|
||||||
|
|
||||||
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX))
|
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
|
||||||
// The window hosting the browser is about to be moved or resized. Only used
|
// The window hosting the browser is about to be moved or resized. Only used
|
||||||
// on Windows and Linux.
|
// on Windows and Linux.
|
||||||
virtual void NotifyMoveOrResizeStarted();
|
virtual void NotifyMoveOrResizeStarted();
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
#include "libcef/browser/native/browser_platform_delegate_native_win.h"
|
#include "libcef/browser/native/browser_platform_delegate_native_win.h"
|
||||||
#include "libcef/browser/osr/browser_platform_delegate_osr_win.h"
|
#include "libcef/browser/osr/browser_platform_delegate_osr_win.h"
|
||||||
#elif defined(OS_MACOSX)
|
#elif defined(OS_MAC)
|
||||||
#include "libcef/browser/native/browser_platform_delegate_native_mac.h"
|
#include "libcef/browser/native/browser_platform_delegate_native_mac.h"
|
||||||
#include "libcef/browser/osr/browser_platform_delegate_osr_mac.h"
|
#include "libcef/browser/osr/browser_platform_delegate_osr_mac.h"
|
||||||
#elif defined(OS_LINUX)
|
#elif defined(OS_LINUX)
|
||||||
@ -40,7 +40,7 @@ std::unique_ptr<CefBrowserPlatformDelegateNative> CreateNativeDelegate(
|
|||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
return std::make_unique<CefBrowserPlatformDelegateNativeWin>(
|
return std::make_unique<CefBrowserPlatformDelegateNativeWin>(
|
||||||
window_info, background_color);
|
window_info, background_color);
|
||||||
#elif defined(OS_MACOSX)
|
#elif defined(OS_MAC)
|
||||||
return std::make_unique<CefBrowserPlatformDelegateNativeMac>(
|
return std::make_unique<CefBrowserPlatformDelegateNativeMac>(
|
||||||
window_info, background_color);
|
window_info, background_color);
|
||||||
#elif defined(OS_LINUX)
|
#elif defined(OS_LINUX)
|
||||||
@ -56,7 +56,7 @@ std::unique_ptr<CefBrowserPlatformDelegateOsr> CreateOSRDelegate(
|
|||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
return std::make_unique<CefBrowserPlatformDelegateOsrWin>(
|
return std::make_unique<CefBrowserPlatformDelegateOsrWin>(
|
||||||
std::move(native_delegate), use_shared_texture, use_external_begin_frame);
|
std::move(native_delegate), use_shared_texture, use_external_begin_frame);
|
||||||
#elif defined(OS_MACOSX)
|
#elif defined(OS_MAC)
|
||||||
return std::make_unique<CefBrowserPlatformDelegateOsrMac>(
|
return std::make_unique<CefBrowserPlatformDelegateOsrMac>(
|
||||||
std::move(native_delegate));
|
std::move(native_delegate));
|
||||||
#elif defined(OS_LINUX)
|
#elif defined(OS_LINUX)
|
||||||
|
@ -26,7 +26,8 @@ ChromeContentBrowserClientCef::CreateBrowserMainParts(
|
|||||||
ChromeContentBrowserClient::CreateBrowserMainParts(parameters);
|
ChromeContentBrowserClient::CreateBrowserMainParts(parameters);
|
||||||
browser_main_parts_ = new ChromeBrowserMainExtraPartsCef;
|
browser_main_parts_ = new ChromeBrowserMainExtraPartsCef;
|
||||||
static_cast<ChromeBrowserMainParts*>(main_parts.get())
|
static_cast<ChromeBrowserMainParts*>(main_parts.get())
|
||||||
->AddParts(browser_main_parts_);
|
->AddParts(
|
||||||
|
base::WrapUnique<ChromeBrowserMainExtraParts>(browser_main_parts_));
|
||||||
return main_parts;
|
return main_parts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,11 +5,11 @@
|
|||||||
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
|
|
||||||
#include "chrome/app/chrome_crash_reporter_client.h"
|
#include "chrome/app/chrome_crash_reporter_client.h"
|
||||||
|
|
||||||
// Required due to https://crrev.com/1c9f89a06f
|
// Required due to https://crrev.com/1c9f89a06f
|
||||||
void ChromeCrashReporterClient::Create() {}
|
void ChromeCrashReporterClient::Create() {}
|
||||||
|
|
||||||
#endif // defined(OS_MACOSX)
|
#endif // defined(OS_MAC)
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
|
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "base/files/file_util.h"
|
#include "base/files/file_util.h"
|
||||||
#include "base/message_loop/message_loop_current.h"
|
|
||||||
#include "base/run_loop.h"
|
#include "base/run_loop.h"
|
||||||
|
#include "base/task/current_thread.h"
|
||||||
#include "base/threading/thread_restrictions.h"
|
#include "base/threading/thread_restrictions.h"
|
||||||
#include "components/network_session_configurator/common/network_switches.h"
|
#include "components/network_session_configurator/common/network_switches.h"
|
||||||
#include "content/public/browser/notification_service.h"
|
#include "content/public/browser/notification_service.h"
|
||||||
@ -294,7 +294,7 @@ void CefSetOSModalLoop(bool osModalLoop) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CEF_CURRENTLY_ON_UIT())
|
if (CEF_CURRENTLY_ON_UIT())
|
||||||
base::MessageLoopCurrent::Get()->set_os_modal_loop(osModalLoop);
|
base::CurrentThread::Get()->set_os_modal_loop(osModalLoop);
|
||||||
else
|
else
|
||||||
CEF_POST_TASK(CEF_UIT, base::Bind(CefSetOSModalLoop, osModalLoop));
|
CEF_POST_TASK(CEF_UIT, base::Bind(CefSetOSModalLoop, osModalLoop));
|
||||||
#endif // defined(OS_WIN)
|
#endif // defined(OS_WIN)
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "base/memory/ptr_util.h"
|
#include "base/memory/ptr_util.h"
|
||||||
#include "base/strings/string_number_conversions.h"
|
#include "base/strings/string_number_conversions.h"
|
||||||
|
#include "base/strings/string_util.h"
|
||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "base/task/post_task.h"
|
#include "base/task/post_task.h"
|
||||||
@ -538,7 +539,7 @@ void CefDevToolsFrontend::DispatchProtocolMessage(
|
|||||||
if (ProtocolLoggingEnabled()) {
|
if (ProtocolLoggingEnabled()) {
|
||||||
// Quick check to avoid parsing the JSON object. Events begin with a
|
// Quick check to avoid parsing the JSON object. Events begin with a
|
||||||
// "method" value whereas method results begin with an "id" value.
|
// "method" value whereas method results begin with an "id" value.
|
||||||
LogProtocolMessage(str_message.starts_with("{\"method\":")
|
LogProtocolMessage(base::StartsWith(str_message, "{\"method\":")
|
||||||
? ProtocolMessageType::EVENT
|
? ProtocolMessageType::EVENT
|
||||||
: ProtocolMessageType::RESULT,
|
: ProtocolMessageType::RESULT,
|
||||||
str_message);
|
str_message);
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include "libcef/browser/devtools/devtools_util.h"
|
#include "libcef/browser/devtools/devtools_util.h"
|
||||||
|
|
||||||
#include "base/strings/string_number_conversions.h"
|
#include "base/strings/string_number_conversions.h"
|
||||||
|
#include "base/strings/string_util.h"
|
||||||
|
|
||||||
namespace devtools_util {
|
namespace devtools_util {
|
||||||
|
|
||||||
@ -24,7 +25,7 @@ bool ParseEvent(const base::StringPiece& message,
|
|||||||
static const char kMethodEnd[] = "\"";
|
static const char kMethodEnd[] = "\"";
|
||||||
static const char kParamsStart[] = ",\"params\":";
|
static const char kParamsStart[] = ",\"params\":";
|
||||||
|
|
||||||
if (!message.starts_with(kMethodStart))
|
if (!base::StartsWith(message, kMethodStart))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const size_t method_start = sizeof(kMethodStart) - 1;
|
const size_t method_start = sizeof(kMethodStart) - 1;
|
||||||
@ -41,7 +42,7 @@ bool ParseEvent(const base::StringPiece& message,
|
|||||||
params = base::StringPiece();
|
params = base::StringPiece();
|
||||||
} else {
|
} else {
|
||||||
const base::StringPiece& remainder = message.substr(remainder_start);
|
const base::StringPiece& remainder = message.substr(remainder_start);
|
||||||
if (remainder.starts_with(kParamsStart)) {
|
if (base::StartsWith(remainder, kParamsStart)) {
|
||||||
// Stop immediately before the message closing bracket.
|
// Stop immediately before the message closing bracket.
|
||||||
remainder_start += sizeof(kParamsStart) - 1;
|
remainder_start += sizeof(kParamsStart) - 1;
|
||||||
params =
|
params =
|
||||||
@ -71,7 +72,7 @@ bool ParseResult(const base::StringPiece& message,
|
|||||||
static const char kResultStart[] = "\"result\":";
|
static const char kResultStart[] = "\"result\":";
|
||||||
static const char kErrorStart[] = "\"error\":";
|
static const char kErrorStart[] = "\"error\":";
|
||||||
|
|
||||||
if (!message.starts_with(kIdStart))
|
if (!base::StartsWith(message, kIdStart))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const size_t id_start = sizeof(kIdStart) - 1;
|
const size_t id_start = sizeof(kIdStart) - 1;
|
||||||
@ -84,13 +85,13 @@ bool ParseResult(const base::StringPiece& message,
|
|||||||
|
|
||||||
size_t remainder_start = id_end + sizeof(kIdEnd) - 1;
|
size_t remainder_start = id_end + sizeof(kIdEnd) - 1;
|
||||||
const base::StringPiece& remainder = message.substr(remainder_start);
|
const base::StringPiece& remainder = message.substr(remainder_start);
|
||||||
if (remainder.starts_with(kResultStart)) {
|
if (base::StartsWith(remainder, kResultStart)) {
|
||||||
// Stop immediately before the message closing bracket.
|
// Stop immediately before the message closing bracket.
|
||||||
remainder_start += sizeof(kResultStart) - 1;
|
remainder_start += sizeof(kResultStart) - 1;
|
||||||
result =
|
result =
|
||||||
message.substr(remainder_start, message.size() - 1 - remainder_start);
|
message.substr(remainder_start, message.size() - 1 - remainder_start);
|
||||||
success = true;
|
success = true;
|
||||||
} else if (remainder.starts_with(kErrorStart)) {
|
} else if (base::StartsWith(remainder, kErrorStart)) {
|
||||||
// Stop immediately before the message closing bracket.
|
// Stop immediately before the message closing bracket.
|
||||||
remainder_start += sizeof(kErrorStart) - 1;
|
remainder_start += sizeof(kErrorStart) - 1;
|
||||||
result =
|
result =
|
||||||
|
@ -487,7 +487,7 @@ void CefExtensionSystem::InstallUpdate(
|
|||||||
bool install_immediately,
|
bool install_immediately,
|
||||||
InstallUpdateCallback install_update_callback) {
|
InstallUpdateCallback install_update_callback) {
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
base::DeleteFile(temp_dir, true /* recursive */);
|
base::DeletePathRecursively(temp_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefExtensionSystem::PerformActionBasedOnOmahaAttributes(
|
void CefExtensionSystem::PerformActionBasedOnOmahaAttributes(
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
#include "content/public/browser/file_select_listener.h"
|
#include "content/public/browser/file_select_listener.h"
|
||||||
#include "content/public/browser/render_frame_host.h"
|
#include "content/public/browser/render_frame_host.h"
|
||||||
#include "content/public/common/file_chooser_file_info.h"
|
|
||||||
#include "net/base/directory_lister.h"
|
#include "net/base/directory_lister.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -202,7 +201,7 @@ void CefFileDialogManager::RunFileDialog(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CefFileDialogManager::RunFileChooser(
|
void CefFileDialogManager::RunFileChooser(
|
||||||
std::unique_ptr<content::FileSelectListener> listener,
|
scoped_refptr<content::FileSelectListener> listener,
|
||||||
const blink::mojom::FileChooserParams& params) {
|
const blink::mojom::FileChooserParams& params) {
|
||||||
CEF_REQUIRE_UIT();
|
CEF_REQUIRE_UIT();
|
||||||
|
|
||||||
@ -213,11 +212,11 @@ void CefFileDialogManager::RunFileChooser(
|
|||||||
if (params.mode == blink::mojom::FileChooserParams::Mode::kUploadFolder) {
|
if (params.mode == blink::mojom::FileChooserParams::Mode::kUploadFolder) {
|
||||||
callback = base::BindOnce(
|
callback = base::BindOnce(
|
||||||
&CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback,
|
&CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback,
|
||||||
weak_ptr_factory_.GetWeakPtr(), params.mode, std::move(listener));
|
weak_ptr_factory_.GetWeakPtr(), params.mode, listener);
|
||||||
} else {
|
} else {
|
||||||
callback = base::BindOnce(
|
callback =
|
||||||
&CefFileDialogManager::OnRunFileChooserDelegateCallback,
|
base::BindOnce(&CefFileDialogManager::OnRunFileChooserDelegateCallback,
|
||||||
weak_ptr_factory_.GetWeakPtr(), params.mode, std::move(listener));
|
weak_ptr_factory_.GetWeakPtr(), params.mode, listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
RunFileChooserInternal(cef_params, std::move(callback));
|
RunFileChooserInternal(cef_params, std::move(callback));
|
||||||
@ -320,7 +319,7 @@ void CefFileDialogManager::OnRunFileChooserCallback(
|
|||||||
|
|
||||||
void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback(
|
void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback(
|
||||||
const blink::mojom::FileChooserParams::Mode mode,
|
const blink::mojom::FileChooserParams::Mode mode,
|
||||||
std::unique_ptr<content::FileSelectListener> listener,
|
scoped_refptr<content::FileSelectListener> listener,
|
||||||
int selected_accept_filter,
|
int selected_accept_filter,
|
||||||
const std::vector<base::FilePath>& file_paths) {
|
const std::vector<base::FilePath>& file_paths) {
|
||||||
CEF_REQUIRE_UIT();
|
CEF_REQUIRE_UIT();
|
||||||
@ -328,21 +327,21 @@ void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback(
|
|||||||
|
|
||||||
if (file_paths.size() == 0) {
|
if (file_paths.size() == 0) {
|
||||||
// Client canceled the file chooser.
|
// Client canceled the file chooser.
|
||||||
OnRunFileChooserDelegateCallback(mode, std::move(listener),
|
OnRunFileChooserDelegateCallback(mode, listener, selected_accept_filter,
|
||||||
selected_accept_filter, file_paths);
|
file_paths);
|
||||||
} else {
|
} else {
|
||||||
lister_.reset(new net::DirectoryLister(
|
lister_.reset(new net::DirectoryLister(
|
||||||
file_paths[0], net::DirectoryLister::NO_SORT_RECURSIVE,
|
file_paths[0], net::DirectoryLister::NO_SORT_RECURSIVE,
|
||||||
new UploadFolderHelper(base::BindOnce(
|
new UploadFolderHelper(base::BindOnce(
|
||||||
&CefFileDialogManager::OnRunFileChooserDelegateCallback,
|
&CefFileDialogManager::OnRunFileChooserDelegateCallback,
|
||||||
weak_ptr_factory_.GetWeakPtr(), mode, std::move(listener)))));
|
weak_ptr_factory_.GetWeakPtr(), mode, listener))));
|
||||||
lister_->Start();
|
lister_->Start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefFileDialogManager::OnRunFileChooserDelegateCallback(
|
void CefFileDialogManager::OnRunFileChooserDelegateCallback(
|
||||||
blink::mojom::FileChooserParams::Mode mode,
|
blink::mojom::FileChooserParams::Mode mode,
|
||||||
std::unique_ptr<content::FileSelectListener> listener,
|
scoped_refptr<content::FileSelectListener> listener,
|
||||||
int selected_accept_filter,
|
int selected_accept_filter,
|
||||||
const std::vector<base::FilePath>& file_paths) {
|
const std::vector<base::FilePath>& file_paths) {
|
||||||
CEF_REQUIRE_UIT();
|
CEF_REQUIRE_UIT();
|
||||||
|
@ -46,7 +46,7 @@ class CefFileDialogManager {
|
|||||||
|
|
||||||
// Called from CefBrowserHostImpl::RunFileChooser.
|
// Called from CefBrowserHostImpl::RunFileChooser.
|
||||||
// See WebContentsDelegate::RunFileChooser documentation.
|
// See WebContentsDelegate::RunFileChooser documentation.
|
||||||
void RunFileChooser(std::unique_ptr<content::FileSelectListener> listener,
|
void RunFileChooser(scoped_refptr<content::FileSelectListener> listener,
|
||||||
const blink::mojom::FileChooserParams& params);
|
const blink::mojom::FileChooserParams& params);
|
||||||
|
|
||||||
// Run the file chooser dialog specified by |params|. Only a single dialog may
|
// Run the file chooser dialog specified by |params|. Only a single dialog may
|
||||||
@ -71,7 +71,7 @@ class CefFileDialogManager {
|
|||||||
// blink::mojom::FileChooserParams::Mode::kUploadFolder.
|
// blink::mojom::FileChooserParams::Mode::kUploadFolder.
|
||||||
void OnRunFileChooserUploadFolderDelegateCallback(
|
void OnRunFileChooserUploadFolderDelegateCallback(
|
||||||
const blink::mojom::FileChooserParams::Mode mode,
|
const blink::mojom::FileChooserParams::Mode mode,
|
||||||
std::unique_ptr<content::FileSelectListener> listener,
|
scoped_refptr<content::FileSelectListener> listener,
|
||||||
int selected_accept_filter,
|
int selected_accept_filter,
|
||||||
const std::vector<base::FilePath>& file_paths);
|
const std::vector<base::FilePath>& file_paths);
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ class CefFileDialogManager {
|
|||||||
// RenderFrameHost.
|
// RenderFrameHost.
|
||||||
void OnRunFileChooserDelegateCallback(
|
void OnRunFileChooserDelegateCallback(
|
||||||
blink::mojom::FileChooserParams::Mode mode,
|
blink::mojom::FileChooserParams::Mode mode,
|
||||||
std::unique_ptr<content::FileSelectListener> listener,
|
scoped_refptr<content::FileSelectListener> listener,
|
||||||
int selected_accept_filter,
|
int selected_accept_filter,
|
||||||
const std::vector<base::FilePath>& file_paths);
|
const std::vector<base::FilePath>& file_paths);
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#include "sandbox/win/src/sandbox_types.h"
|
#include "sandbox/win/src/sandbox_types.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
#if defined(OS_MAC) || defined(OS_WIN)
|
||||||
#include "components/crash/core/app/crash_switches.h"
|
#include "components/crash/core/app/crash_switches.h"
|
||||||
#include "third_party/crashpad/crashpad/handler/handler_main.h"
|
#include "third_party/crashpad/crashpad/handler/handler_main.h"
|
||||||
#endif
|
#endif
|
||||||
@ -64,7 +64,7 @@ std::unique_ptr<CefMainRunnerDelegate> MakeDelegate(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
#if defined(OS_MAC) || defined(OS_WIN)
|
||||||
|
|
||||||
// Based on components/crash/core/app/run_as_crashpad_handler_win.cc
|
// Based on components/crash/core/app/run_as_crashpad_handler_win.cc
|
||||||
// Remove the "--type=crashpad-handler" command-line flag that will otherwise
|
// Remove the "--type=crashpad-handler" command-line flag that will otherwise
|
||||||
@ -87,7 +87,7 @@ int RunAsCrashpadHandler(const base::CommandLine& command_line) {
|
|||||||
}),
|
}),
|
||||||
argv.end());
|
argv.end());
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
// HandlerMain on macOS uses the system version of getopt_long which expects
|
// HandlerMain on macOS uses the system version of getopt_long which expects
|
||||||
// the first argument to be the program name.
|
// the first argument to be the program name.
|
||||||
argv.insert(argv.begin(), command_line.GetProgram().value());
|
argv.insert(argv.begin(), command_line.GetProgram().value());
|
||||||
@ -110,7 +110,7 @@ int RunAsCrashpadHandler(const base::CommandLine& command_line) {
|
|||||||
argv_as_utf8.get(), nullptr);
|
argv_as_utf8.get(), nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // defined(OS_MACOSX) || defined(OS_WIN)
|
#endif // defined(OS_MAC) || defined(OS_WIN)
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
@ -325,7 +325,7 @@ int CefMainRunner::RunAsHelperProcess(const CefMainArgs& args,
|
|||||||
|
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
#if defined(OS_MAC) || defined(OS_WIN)
|
||||||
if (process_type == crash_reporter::switches::kCrashpadHandler) {
|
if (process_type == crash_reporter::switches::kCrashpadHandler) {
|
||||||
result = RunAsCrashpadHandler(command_line);
|
result = RunAsCrashpadHandler(command_line);
|
||||||
main_delegate->AfterExecuteProcess();
|
main_delegate->AfterExecuteProcess();
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#if defined(USE_X11)
|
#if defined(USE_X11)
|
||||||
#include "libcef/browser/native/window_x11.h"
|
#include "libcef/browser/native/window_x11.h"
|
||||||
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
|
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -40,11 +40,6 @@ long GetSystemUptime() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// See https://crbug.com/1066670#c57 for background.
|
|
||||||
inline x11::Window ToX11Window(::Window window) {
|
|
||||||
return static_cast<x11::Window>(window);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
CefBrowserPlatformDelegateNativeLinux::CefBrowserPlatformDelegateNativeLinux(
|
CefBrowserPlatformDelegateNativeLinux::CefBrowserPlatformDelegateNativeLinux(
|
||||||
@ -92,8 +87,8 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() {
|
|||||||
CefWindowDelegateView* delegate_view = new CefWindowDelegateView(
|
CefWindowDelegateView* delegate_view = new CefWindowDelegateView(
|
||||||
GetBackgroundColor(), window_x11_->TopLevelAlwaysOnTop(),
|
GetBackgroundColor(), window_x11_->TopLevelAlwaysOnTop(),
|
||||||
GetBoundsChangedCallback());
|
GetBoundsChangedCallback());
|
||||||
delegate_view->Init(ToX11Window(window_info_.window), web_contents_,
|
delegate_view->Init(static_cast<gfx::AcceleratedWidget>(window_info_.window),
|
||||||
gfx::Rect(gfx::Point(), rect.size()));
|
web_contents_, gfx::Rect(gfx::Point(), rect.size()));
|
||||||
|
|
||||||
window_widget_ = delegate_view->GetWidget();
|
window_widget_ = delegate_view->GetWidget();
|
||||||
window_widget_->Show();
|
window_widget_->Show();
|
||||||
@ -176,7 +171,7 @@ void CefBrowserPlatformDelegateNativeLinux::NotifyMoveOrResizeStarted() {
|
|||||||
if (!window_x11_)
|
if (!window_x11_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
views::DesktopWindowTreeHostX11* tree_host = window_x11_->GetHost();
|
views::DesktopWindowTreeHostLinux* tree_host = window_x11_->GetHost();
|
||||||
if (!tree_host)
|
if (!tree_host)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -212,7 +207,7 @@ gfx::Point CefBrowserPlatformDelegateNativeLinux::GetScreenPoint(
|
|||||||
return view;
|
return view;
|
||||||
|
|
||||||
// We can't use aura::Window::GetBoundsInScreen on Linux because it will
|
// We can't use aura::Window::GetBoundsInScreen on Linux because it will
|
||||||
// return bounds from DesktopWindowTreeHostX11 which in our case is relative
|
// return bounds from DesktopWindowTreeHostLinux which in our case is relative
|
||||||
// to the parent window instead of the root window (screen).
|
// to the parent window instead of the root window (screen).
|
||||||
const gfx::Rect& bounds_in_screen = window_x11_->GetBoundsInScreen();
|
const gfx::Rect& bounds_in_screen = window_x11_->GetBoundsInScreen();
|
||||||
return gfx::Point(bounds_in_screen.x() + view.x(),
|
return gfx::Point(bounds_in_screen.x() + view.x(),
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#import "base/mac/scoped_sending_event.h"
|
#import "base/mac/scoped_sending_event.h"
|
||||||
#include "base/message_loop/message_loop_current.h"
|
#include "base/task/current_thread.h"
|
||||||
#import "ui/base/cocoa/menu_controller.h"
|
#import "ui/base/cocoa/menu_controller.h"
|
||||||
#include "ui/gfx/geometry/point.h"
|
#include "ui/gfx/geometry/point.h"
|
||||||
|
|
||||||
@ -23,6 +23,7 @@ bool CefMenuRunnerMac::RunContextMenu(
|
|||||||
// Create a menu controller based on the model.
|
// Create a menu controller based on the model.
|
||||||
menu_controller_.reset([[MenuControllerCocoa alloc]
|
menu_controller_.reset([[MenuControllerCocoa alloc]
|
||||||
initWithModel:model->model()
|
initWithModel:model->model()
|
||||||
|
delegate:nil
|
||||||
useWithPopUpButtonCell:NO]);
|
useWithPopUpButtonCell:NO]);
|
||||||
|
|
||||||
// Keep the menu controller alive (by adding an additional retain) until after
|
// Keep the menu controller alive (by adding an additional retain) until after
|
||||||
@ -33,7 +34,7 @@ bool CefMenuRunnerMac::RunContextMenu(
|
|||||||
menu_controller_);
|
menu_controller_);
|
||||||
|
|
||||||
// Make sure events can be pumped while the menu is up.
|
// Make sure events can be pumped while the menu is up.
|
||||||
base::MessageLoopCurrent::ScopedNestableTaskAllower allow;
|
base::CurrentThread::ScopedNestableTaskAllower allow;
|
||||||
|
|
||||||
// One of the events that could be pumped is |window.close()|.
|
// One of the events that could be pumped is |window.close()|.
|
||||||
// User-initiated event-tracking loops protect against this by
|
// User-initiated event-tracking loops protect against this by
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "libcef/browser/browser_host_impl.h"
|
#include "libcef/browser/browser_host_impl.h"
|
||||||
#include "libcef/browser/native/menu_2.h"
|
#include "libcef/browser/native/menu_2.h"
|
||||||
|
|
||||||
#include "base/message_loop/message_loop_current.h"
|
#include "base/task/current_thread.h"
|
||||||
#include "ui/gfx/geometry/point.h"
|
#include "ui/gfx/geometry/point.h"
|
||||||
|
|
||||||
CefMenuRunnerWin::CefMenuRunnerWin() {}
|
CefMenuRunnerWin::CefMenuRunnerWin() {}
|
||||||
@ -21,7 +21,7 @@ bool CefMenuRunnerWin::RunContextMenu(
|
|||||||
menu_->Rebuild(nullptr);
|
menu_->Rebuild(nullptr);
|
||||||
|
|
||||||
// Make sure events can be pumped while the menu is up.
|
// Make sure events can be pumped while the menu is up.
|
||||||
base::MessageLoopCurrent::ScopedNestableTaskAllower allow;
|
base::CurrentThread::ScopedNestableTaskAllower allow;
|
||||||
|
|
||||||
const gfx::Point& screen_point =
|
const gfx::Point& screen_point =
|
||||||
browser->GetScreenPoint(gfx::Point(params.x, params.y));
|
browser->GetScreenPoint(gfx::Point(params.x, params.y));
|
||||||
|
@ -4,18 +4,18 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "libcef/browser/native/window_x11.h"
|
#include "libcef/browser/native/window_x11.h"
|
||||||
|
#include <X11/Xatom.h>
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#include <X11/Xutil.h>
|
||||||
|
#include <X11/extensions/XInput2.h>
|
||||||
|
|
||||||
#include "libcef/browser/thread_util.h"
|
#include "libcef/browser/thread_util.h"
|
||||||
|
|
||||||
#include "ui/base/x/x11_util.h"
|
#include "ui/base/x/x11_util.h"
|
||||||
#include "ui/events/platform/platform_event_source.h"
|
#include "ui/events/platform/platform_event_source.h"
|
||||||
#include "ui/events/x/x11_event_translation.h"
|
#include "ui/events/x/x11_event_translation.h"
|
||||||
#include "ui/platform_window/x11/x11_topmost_window_finder.h"
|
#include "ui/platform_window/x11/x11_topmost_window_finder.h"
|
||||||
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
|
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"
|
||||||
|
|
||||||
#include <X11/Xatom.h>
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <X11/Xutil.h>
|
|
||||||
#include <X11/extensions/XInput2.h>
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ void CefWindowX11::Show() {
|
|||||||
if (child && toplevel_window) {
|
if (child && toplevel_window) {
|
||||||
// Configure the drag&drop proxy property for the top-most window so
|
// Configure the drag&drop proxy property for the top-most window so
|
||||||
// that all drag&drop-related messages will be sent to the child
|
// that all drag&drop-related messages will be sent to the child
|
||||||
// DesktopWindowTreeHostX11. The proxy property is referenced by
|
// DesktopWindowTreeHostLinux. The proxy property is referenced by
|
||||||
// DesktopDragDropClientAuraX11::FindWindowFor.
|
// DesktopDragDropClientAuraX11::FindWindowFor.
|
||||||
x11::Window window = x11::Window::None;
|
x11::Window window = x11::Window::None;
|
||||||
ui::GetProperty(ToX11Window(toplevel_window), gfx::GetAtom(kXdndProxy),
|
ui::GetProperty(ToX11Window(toplevel_window), gfx::GetAtom(kXdndProxy),
|
||||||
@ -246,7 +246,7 @@ void CefWindowX11::Focus() {
|
|||||||
if (browser_.get()) {
|
if (browser_.get()) {
|
||||||
::Window child = FindChild(xdisplay_, xwindow_);
|
::Window child = FindChild(xdisplay_, xwindow_);
|
||||||
if (child && ui::IsWindowVisible(ToX11Window(child))) {
|
if (child && ui::IsWindowVisible(ToX11Window(child))) {
|
||||||
// Give focus to the child DesktopWindowTreeHostX11.
|
// Give focus to the child DesktopWindowTreeHostLinux.
|
||||||
XSetInputFocus(xdisplay_, child, RevertToParent, x11::CurrentTime);
|
XSetInputFocus(xdisplay_, child, RevertToParent, x11::CurrentTime);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -289,13 +289,13 @@ gfx::Rect CefWindowX11::GetBoundsInScreen() {
|
|||||||
return gfx::Rect();
|
return gfx::Rect();
|
||||||
}
|
}
|
||||||
|
|
||||||
views::DesktopWindowTreeHostX11* CefWindowX11::GetHost() {
|
views::DesktopWindowTreeHostLinux* CefWindowX11::GetHost() {
|
||||||
if (browser_.get()) {
|
if (browser_.get()) {
|
||||||
::Window child = FindChild(xdisplay_, xwindow_);
|
::Window child = FindChild(xdisplay_, xwindow_);
|
||||||
if (child) {
|
if (child) {
|
||||||
return static_cast<views::DesktopWindowTreeHostX11*>(
|
return static_cast<views::DesktopWindowTreeHostLinux*>(
|
||||||
views::DesktopWindowTreeHostLinux::GetHostForWidget(
|
views::DesktopWindowTreeHostLinux::GetHostForWidget(
|
||||||
ToX11Window(child)));
|
static_cast<gfx::AcceleratedWidget>(child)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -318,8 +318,7 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) {
|
|||||||
// Called by X11EventSourceLibevent to determine whether this XEventDispatcher
|
// Called by X11EventSourceLibevent to determine whether this XEventDispatcher
|
||||||
// implementation is able to process the next translated event sent by it.
|
// implementation is able to process the next translated event sent by it.
|
||||||
void CefWindowX11::CheckCanDispatchNextPlatformEvent(x11::Event* x11_event) {
|
void CefWindowX11::CheckCanDispatchNextPlatformEvent(x11::Event* x11_event) {
|
||||||
XEvent* xev = &x11_event->xlib_event();
|
current_xevent_ = IsTargetedBy(*x11_event) ? x11_event : nullptr;
|
||||||
current_xevent_ = IsTargetedBy(*x11_event) ? xev : nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefWindowX11::PlatformEventDispatchFinished() {
|
void CefWindowX11::PlatformEventDispatchFinished() {
|
||||||
@ -333,8 +332,7 @@ ui::PlatformEventDispatcher* CefWindowX11::GetPlatformEventDispatcher() {
|
|||||||
bool CefWindowX11::DispatchXEvent(x11::Event* x11_event) {
|
bool CefWindowX11::DispatchXEvent(x11::Event* x11_event) {
|
||||||
if (!IsTargetedBy(*x11_event))
|
if (!IsTargetedBy(*x11_event))
|
||||||
return false;
|
return false;
|
||||||
XEvent* xev = &x11_event->xlib_event();
|
ProcessXEvent(x11_event);
|
||||||
ProcessXEvent(xev);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,77 +376,64 @@ bool CefWindowX11::TopLevelAlwaysOnTop() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool CefWindowX11::IsTargetedBy(const x11::Event& x11_event) const {
|
bool CefWindowX11::IsTargetedBy(const x11::Event& x11_event) const {
|
||||||
const XEvent& xev = x11_event.xlib_event();
|
return ToWindow(x11_event.window()) == xwindow_;
|
||||||
::Window target_window =
|
|
||||||
xev.type == x11::GeGenericEvent::opcode
|
|
||||||
? static_cast<XIDeviceEvent*>(xev.xcookie.data)->event
|
|
||||||
: xev.xany.window;
|
|
||||||
return target_window == xwindow_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefWindowX11::ProcessXEvent(XEvent* xev) {
|
void CefWindowX11::ProcessXEvent(x11::Event* event) {
|
||||||
switch (xev->type) {
|
if (auto* configure = event->As<x11::ConfigureNotifyEvent>()) {
|
||||||
case ConfigureNotify: {
|
DCHECK_EQ(xwindow_, ToWindow(configure->event));
|
||||||
DCHECK_EQ(xwindow_, xev->xconfigure.event);
|
DCHECK_EQ(xwindow_, ToWindow(configure->window));
|
||||||
DCHECK_EQ(xwindow_, xev->xconfigure.window);
|
// It's possible that the X window may be resized by some other means
|
||||||
// It's possible that the X window may be resized by some other means
|
// than from within Aura (e.g. the X window manager can change the
|
||||||
// than from within Aura (e.g. the X window manager can change the
|
// size). Make sure the root window size is maintained properly.
|
||||||
// size). Make sure the root window size is maintained properly.
|
bounds_ = gfx::Rect(configure->x, configure->y, configure->width,
|
||||||
gfx::Rect bounds(xev->xconfigure.x, xev->xconfigure.y,
|
configure->height);
|
||||||
xev->xconfigure.width, xev->xconfigure.height);
|
|
||||||
bounds_ = bounds;
|
|
||||||
|
|
||||||
if (browser_.get()) {
|
if (browser_.get()) {
|
||||||
::Window child = FindChild(xdisplay_, xwindow_);
|
::Window child = FindChild(xdisplay_, xwindow_);
|
||||||
if (child) {
|
if (child) {
|
||||||
// Resize the child DesktopWindowTreeHostX11 to match this window.
|
// Resize the child DesktopWindowTreeHostLinux to match this window.
|
||||||
XWindowChanges changes = {0};
|
XWindowChanges changes = {0};
|
||||||
changes.width = bounds.width();
|
changes.width = bounds_.width();
|
||||||
changes.height = bounds.height();
|
changes.height = bounds_.height();
|
||||||
XConfigureWindow(xdisplay_, child, CWHeight | CWWidth, &changes);
|
XConfigureWindow(xdisplay_, child, CWHeight | CWWidth, &changes);
|
||||||
|
|
||||||
browser_->NotifyMoveOrResizeStarted();
|
browser_->NotifyMoveOrResizeStarted();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case ClientMessage: {
|
} else if (auto* client = event->As<x11::ClientMessageEvent>()) {
|
||||||
Atom message_type = xev->xclient.message_type;
|
if (client->type == gfx::GetAtom(kWMProtocols)) {
|
||||||
if (message_type == GetAtom(kWMProtocols)) {
|
x11::Atom protocol = static_cast<x11::Atom>(client->data.data32[0]);
|
||||||
Atom protocol = static_cast<Atom>(xev->xclient.data.l[0]);
|
if (protocol == gfx::GetAtom(kWMDeleteWindow)) {
|
||||||
if (protocol == GetAtom(kWMDeleteWindow)) {
|
// We have received a close message from the window manager.
|
||||||
// We have received a close message from the window manager.
|
if (!browser_ || browser_->TryCloseBrowser()) {
|
||||||
if (!browser_ || browser_->TryCloseBrowser()) {
|
// Allow the close.
|
||||||
// Allow the close.
|
XDestroyWindow(xdisplay_, xwindow_);
|
||||||
XDestroyWindow(xdisplay_, xwindow_);
|
|
||||||
|
|
||||||
xwindow_ = x11::None;
|
xwindow_ = x11::None;
|
||||||
|
|
||||||
if (browser_.get()) {
|
if (browser_.get()) {
|
||||||
// Force the browser to be destroyed and release the reference
|
// Force the browser to be destroyed and release the reference
|
||||||
// added in PlatformCreateWindow().
|
// added in PlatformCreateWindow().
|
||||||
browser_->WindowDestroyed();
|
browser_->WindowDestroyed();
|
||||||
}
|
|
||||||
|
|
||||||
delete this;
|
|
||||||
}
|
}
|
||||||
} else if (protocol == GetAtom(kNetWMPing)) {
|
|
||||||
XEvent reply_event = *xev;
|
|
||||||
reply_event.xclient.window = parent_xwindow_;
|
|
||||||
|
|
||||||
XSendEvent(xdisplay_, reply_event.xclient.window, false,
|
delete this;
|
||||||
SubstructureRedirectMask | SubstructureNotifyMask,
|
|
||||||
&reply_event);
|
|
||||||
XFlush(xdisplay_);
|
|
||||||
}
|
}
|
||||||
|
} else if (protocol == gfx::GetAtom(kNetWMPing)) {
|
||||||
|
x11::ClientMessageEvent reply_event = *client;
|
||||||
|
reply_event.window = ToX11Window(parent_xwindow_);
|
||||||
|
ui::SendEvent(reply_event, reply_event.window,
|
||||||
|
x11::EventMask::SubstructureNotify |
|
||||||
|
x11::EventMask::SubstructureRedirect);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case x11::FocusIn:
|
} else if (auto* focus = event->As<x11::FocusEvent>()) {
|
||||||
|
if (focus->opcode == x11::FocusEvent::In) {
|
||||||
// This message is received first followed by a "_NET_ACTIVE_WINDOW"
|
// This message is received first followed by a "_NET_ACTIVE_WINDOW"
|
||||||
// message sent to the root window. When X11DesktopHandler handles the
|
// message sent to the root window. When X11DesktopHandler handles the
|
||||||
// "_NET_ACTIVE_WINDOW" message it will erroneously mark the WebView
|
// "_NET_ACTIVE_WINDOW" message it will erroneously mark the WebView
|
||||||
// (hosted in a DesktopWindowTreeHostX11) as unfocused. Use a delayed
|
// (hosted in a DesktopWindowTreeHostLinux) as unfocused. Use a delayed
|
||||||
// task here to restore the WebView's focus state.
|
// task here to restore the WebView's focus state.
|
||||||
if (!focus_pending_) {
|
if (!focus_pending_) {
|
||||||
focus_pending_ = true;
|
focus_pending_ = true;
|
||||||
@ -457,44 +442,40 @@ void CefWindowX11::ProcessXEvent(XEvent* xev) {
|
|||||||
weak_ptr_factory_.GetWeakPtr()),
|
weak_ptr_factory_.GetWeakPtr()),
|
||||||
100);
|
100);
|
||||||
}
|
}
|
||||||
break;
|
} else {
|
||||||
case x11::FocusOut:
|
|
||||||
// Cancel the pending focus change if some other window has gained focus
|
// Cancel the pending focus change if some other window has gained focus
|
||||||
// while waiting for the async task to run. Otherwise we can get stuck in
|
// while waiting for the async task to run. Otherwise we can get stuck in
|
||||||
// a focus change loop.
|
// a focus change loop.
|
||||||
if (focus_pending_)
|
if (focus_pending_)
|
||||||
focus_pending_ = false;
|
focus_pending_ = false;
|
||||||
break;
|
}
|
||||||
case PropertyNotify: {
|
} else if (auto* property = event->As<x11::PropertyNotifyEvent>()) {
|
||||||
::Atom changed_atom = xev->xproperty.atom;
|
if (property->atom == gfx::GetAtom(kNetWMState)) {
|
||||||
if (changed_atom == GetAtom(kNetWMState)) {
|
// State change event like minimize/maximize.
|
||||||
// State change event like minimize/maximize.
|
if (browser_.get()) {
|
||||||
if (browser_.get()) {
|
::Window child = FindChild(xdisplay_, xwindow_);
|
||||||
::Window child = FindChild(xdisplay_, xwindow_);
|
if (child) {
|
||||||
if (child) {
|
// Forward the state change to the child DesktopWindowTreeHostLinux
|
||||||
// Forward the state change to the child DesktopWindowTreeHostX11
|
// window so that resource usage will be reduced while the window is
|
||||||
// window so that resource usage will be reduced while the window is
|
// minimized.
|
||||||
// minimized.
|
std::vector<x11::Atom> atom_list;
|
||||||
std::vector<x11::Atom> atom_list;
|
if (ui::GetAtomArrayProperty(ToX11Window(xwindow_), kNetWMState,
|
||||||
if (ui::GetAtomArrayProperty(ToX11Window(xwindow_), kNetWMState,
|
&atom_list) &&
|
||||||
&atom_list) &&
|
!atom_list.empty()) {
|
||||||
!atom_list.empty()) {
|
ui::SetAtomArrayProperty(ToX11Window(child), kNetWMState, "ATOM",
|
||||||
ui::SetAtomArrayProperty(ToX11Window(child), kNetWMState, "ATOM",
|
atom_list);
|
||||||
atom_list);
|
} else {
|
||||||
} else {
|
// Set an empty list of property values to pass the check in
|
||||||
// Set an empty list of property values to pass the check in
|
// DesktopWindowTreeHostLinux::OnWMStateUpdated().
|
||||||
// DesktopWindowTreeHostX11::OnWMStateUpdated().
|
XChangeProperty(xdisplay_, child,
|
||||||
XChangeProperty(xdisplay_, child,
|
GetAtom(kNetWMState), // name
|
||||||
GetAtom(kNetWMState), // name
|
GetAtom(kAtom), // type
|
||||||
GetAtom(kAtom), // type
|
32, // size in bits of items in 'value'
|
||||||
32, // size in bits of items in 'value'
|
PropModeReplace, NULL,
|
||||||
PropModeReplace, NULL,
|
0); // num items
|
||||||
0); // num items
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ typedef struct _XDisplay Display;
|
|||||||
#include "ui/gfx/x/x11_atom_cache.h"
|
#include "ui/gfx/x/x11_atom_cache.h"
|
||||||
|
|
||||||
namespace views {
|
namespace views {
|
||||||
class DesktopWindowTreeHostX11;
|
class DesktopWindowTreeHostLinux;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Object wrapper for an X11 Window.
|
// Object wrapper for an X11 Window.
|
||||||
@ -46,7 +46,7 @@ class CefWindowX11 : public ui::PlatformEventDispatcher,
|
|||||||
|
|
||||||
gfx::Rect GetBoundsInScreen();
|
gfx::Rect GetBoundsInScreen();
|
||||||
|
|
||||||
views::DesktopWindowTreeHostX11* GetHost();
|
views::DesktopWindowTreeHostLinux* GetHost();
|
||||||
|
|
||||||
// ui::PlatformEventDispatcher methods:
|
// ui::PlatformEventDispatcher methods:
|
||||||
bool CanDispatchEvent(const ui::PlatformEvent& event) override;
|
bool CanDispatchEvent(const ui::PlatformEvent& event) override;
|
||||||
@ -67,7 +67,7 @@ class CefWindowX11 : public ui::PlatformEventDispatcher,
|
|||||||
void ContinueFocus();
|
void ContinueFocus();
|
||||||
|
|
||||||
bool IsTargetedBy(const x11::Event& x11_event) const;
|
bool IsTargetedBy(const x11::Event& x11_event) const;
|
||||||
void ProcessXEvent(XEvent* xev);
|
void ProcessXEvent(x11::Event* xev);
|
||||||
|
|
||||||
CefRefPtr<CefBrowserHostImpl> browser_;
|
CefRefPtr<CefBrowserHostImpl> browser_;
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ class CefWindowX11 : public ui::PlatformEventDispatcher,
|
|||||||
// Tells if this dispatcher can process next translated event based on a
|
// Tells if this dispatcher can process next translated event based on a
|
||||||
// previous check in ::CheckCanDispatchNextPlatformEvent based on a XID
|
// previous check in ::CheckCanDispatchNextPlatformEvent based on a XID
|
||||||
// target.
|
// target.
|
||||||
XEvent* current_xevent_ = nullptr;
|
x11::Event* current_xevent_ = nullptr;
|
||||||
|
|
||||||
// Must always be the last member.
|
// Must always be the last member.
|
||||||
base::WeakPtrFactory<CefWindowX11> weak_ptr_factory_;
|
base::WeakPtrFactory<CefWindowX11> weak_ptr_factory_;
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "content/public/browser/global_request_id.h"
|
#include "content/public/browser/global_request_id.h"
|
||||||
#include "content/public/common/referrer.h"
|
#include "content/public/common/referrer.h"
|
||||||
|
#include "net/cookies/site_for_cookies.h"
|
||||||
#include "ui/base/page_transition_types.h"
|
#include "ui/base/page_transition_types.h"
|
||||||
#include "ui/base/window_open_disposition.h"
|
#include "ui/base/window_open_disposition.h"
|
||||||
#include "url/gurl.h"
|
#include "url/gurl.h"
|
||||||
|
@ -191,7 +191,7 @@ void GetDebugURLs(std::vector<std::string>* urls) {
|
|||||||
std::string GetOSType() {
|
std::string GetOSType() {
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
return "Windows";
|
return "Windows";
|
||||||
#elif defined(OS_MACOSX)
|
#elif defined(OS_MAC)
|
||||||
return "Mac OS X";
|
return "Mac OS X";
|
||||||
#elif defined(OS_CHROMEOS)
|
#elif defined(OS_CHROMEOS)
|
||||||
return "Chromium OS";
|
return "Chromium OS";
|
||||||
|
@ -82,10 +82,10 @@ struct SaveCookiesProgress {
|
|||||||
|
|
||||||
void SetCanonicalCookieCallback(SaveCookiesProgress* progress,
|
void SetCanonicalCookieCallback(SaveCookiesProgress* progress,
|
||||||
const net::CanonicalCookie& cookie,
|
const net::CanonicalCookie& cookie,
|
||||||
net::CookieInclusionStatus status) {
|
net::CookieAccessResult access_result) {
|
||||||
CEF_REQUIRE_UIT();
|
CEF_REQUIRE_UIT();
|
||||||
progress->num_cookie_lines_left_--;
|
progress->num_cookie_lines_left_--;
|
||||||
if (status.IsInclude()) {
|
if (access_result.status.IsInclude()) {
|
||||||
progress->allowed_cookies_.push_back(cookie);
|
progress->allowed_cookies_.push_back(cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,8 +131,8 @@ void SaveCookiesOnUIThread(content::BrowserContext* browser_context,
|
|||||||
|
|
||||||
SetCanonicalCookieCallback(
|
SetCanonicalCookieCallback(
|
||||||
progress, net::CanonicalCookie(),
|
progress, net::CanonicalCookie(),
|
||||||
net::CookieInclusionStatus(
|
net::CookieAccessResult(net::CookieInclusionStatus(
|
||||||
net::CookieInclusionStatus::EXCLUDE_UNKNOWN_ERROR));
|
net::CookieInclusionStatus::EXCLUDE_UNKNOWN_ERROR)));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -45,14 +45,16 @@ void RunAsyncCompletionOnUIThread(CefRefPtr<CefCompletionCallback> callback) {
|
|||||||
|
|
||||||
// Always execute the callback asynchronously.
|
// Always execute the callback asynchronously.
|
||||||
void SetCookieCallbackImpl(CefRefPtr<CefSetCookieCallback> callback,
|
void SetCookieCallbackImpl(CefRefPtr<CefSetCookieCallback> callback,
|
||||||
net::CookieInclusionStatus status) {
|
net::CookieAccessResult access_result) {
|
||||||
if (!callback.get())
|
if (!callback.get())
|
||||||
return;
|
return;
|
||||||
if (!status.IsInclude()) {
|
const bool is_include = access_result.status.IsInclude();
|
||||||
LOG(WARNING) << "SetCookie failed with reason: " << status.GetDebugString();
|
if (!is_include) {
|
||||||
|
LOG(WARNING) << "SetCookie failed with reason: "
|
||||||
|
<< access_result.status.GetDebugString();
|
||||||
}
|
}
|
||||||
CEF_POST_TASK(CEF_UIT, base::Bind(&CefSetCookieCallback::OnComplete,
|
CEF_POST_TASK(CEF_UIT, base::Bind(&CefSetCookieCallback::OnComplete,
|
||||||
callback.get(), status.IsInclude()));
|
callback.get(), is_include));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always execute the callback asynchronously.
|
// Always execute the callback asynchronously.
|
||||||
@ -260,8 +262,8 @@ bool CefCookieManagerImpl::SetCookie(const CefString& url,
|
|||||||
|
|
||||||
if (!canonical_cookie) {
|
if (!canonical_cookie) {
|
||||||
SetCookieCallbackImpl(
|
SetCookieCallbackImpl(
|
||||||
callback, net::CookieInclusionStatus(
|
callback, net::CookieAccessResult(net::CookieInclusionStatus(
|
||||||
net::CookieInclusionStatus::EXCLUDE_UNKNOWN_ERROR));
|
net::CookieInclusionStatus::EXCLUDE_UNKNOWN_ERROR)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "content/public/browser/web_contents.h"
|
#include "content/public/browser/web_contents.h"
|
||||||
#include "mojo/public/cpp/base/big_buffer.h"
|
#include "mojo/public/cpp/base/big_buffer.h"
|
||||||
#include "net/http/http_status_code.h"
|
#include "net/http/http_status_code.h"
|
||||||
|
#include "net/url_request/url_request.h"
|
||||||
#include "services/network/public/cpp/cors/cors.h"
|
#include "services/network/public/cpp/cors/cors.h"
|
||||||
#include "services/network/public/cpp/features.h"
|
#include "services/network/public/cpp/features.h"
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include "libcef/browser/osr/web_contents_view_osr.h"
|
#include "libcef/browser/osr/web_contents_view_osr.h"
|
||||||
#include "libcef/common/drag_data_impl.h"
|
#include "libcef/common/drag_data_impl.h"
|
||||||
|
|
||||||
#include "base/message_loop/message_loop_current.h"
|
#include "base/task/current_thread.h"
|
||||||
#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
|
#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
|
||||||
#include "content/browser/web_contents/web_contents_impl.h"
|
#include "content/browser/web_contents/web_contents_impl.h"
|
||||||
#include "content/public/browser/render_view_host.h"
|
#include "content/public/browser/render_view_host.h"
|
||||||
@ -482,7 +482,7 @@ void CefBrowserPlatformDelegateOsr::StartDragging(
|
|||||||
CefRefPtr<CefDragDataImpl> drag_data(
|
CefRefPtr<CefDragDataImpl> drag_data(
|
||||||
new CefDragDataImpl(drop_data, cef_image, cef_image_pos));
|
new CefDragDataImpl(drop_data, cef_image, cef_image_pos));
|
||||||
drag_data->SetReadOnly(true);
|
drag_data->SetReadOnly(true);
|
||||||
base::MessageLoopCurrent::ScopedNestableTaskAllower allow;
|
base::CurrentThread::ScopedNestableTaskAllower allow;
|
||||||
handled = handler->StartDragging(
|
handled = handler->StartDragging(
|
||||||
browser_, drag_data.get(),
|
browser_, drag_data.get(),
|
||||||
static_cast<CefRenderHandler::DragOperationsMask>(allowed_ops),
|
static_cast<CefRenderHandler::DragOperationsMask>(allowed_ops),
|
||||||
|
@ -150,6 +150,12 @@ struct PopulateAxNodeAttributes {
|
|||||||
attributes->SetString(ToString(attr.first), ToString(state));
|
attributes->SetString(ToString(attr.first), ToString(state));
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
case ax::mojom::IntAttribute::kTextAlign: {
|
||||||
|
auto state = static_cast<ax::mojom::TextAlign>(attr.second);
|
||||||
|
if (ax::mojom::TextAlign::kNone != state) {
|
||||||
|
attributes->SetString(ToString(attr.first), ToString(state));
|
||||||
|
}
|
||||||
|
} break;
|
||||||
case ax::mojom::IntAttribute::kNameFrom:
|
case ax::mojom::IntAttribute::kNameFrom:
|
||||||
attributes->SetString(
|
attributes->SetString(
|
||||||
ToString(attr.first),
|
ToString(attr.first),
|
||||||
@ -173,8 +179,8 @@ struct PopulateAxNodeAttributes {
|
|||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case ax::mojom::IntAttribute::kTextDirection: {
|
case ax::mojom::IntAttribute::kTextDirection: {
|
||||||
auto state = static_cast<ax::mojom::TextDirection>(attr.second);
|
auto state = static_cast<ax::mojom::WritingDirection>(attr.second);
|
||||||
if (ax::mojom::TextDirection::kNone != state) {
|
if (ax::mojom::WritingDirection::kNone != state) {
|
||||||
attributes->SetString(ToString(attr.first), ToString(state));
|
attributes->SetString(ToString(attr.first), ToString(state));
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
#include "ui/gfx/geometry/size_conversions.h"
|
#include "ui/gfx/geometry/size_conversions.h"
|
||||||
|
|
||||||
#if defined(USE_X11)
|
#if defined(USE_X11)
|
||||||
#include "ui/base/x/x11_cursor.h"
|
#include "ui/base/x/x11_cursor_loader.h"
|
||||||
#include "ui/base/x/x11_util.h"
|
#include "ui/base/x/x11_util.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -67,8 +67,8 @@ const size_t kMaxDamageRects = 10;
|
|||||||
|
|
||||||
const float kDefaultScaleFactor = 1.0;
|
const float kDefaultScaleFactor = 1.0;
|
||||||
|
|
||||||
content::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) {
|
blink::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) {
|
||||||
content::ScreenInfo screenInfo;
|
blink::ScreenInfo screenInfo;
|
||||||
screenInfo.device_scale_factor = src.device_scale_factor;
|
screenInfo.device_scale_factor = src.device_scale_factor;
|
||||||
screenInfo.depth = src.depth;
|
screenInfo.depth = src.depth;
|
||||||
screenInfo.depth_per_component = src.depth_per_component;
|
screenInfo.depth_per_component = src.depth_per_component;
|
||||||
@ -101,7 +101,7 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient {
|
|||||||
// may not match the page's, so use black as the gutter color to avoid
|
// may not match the page's, so use black as the gutter color to avoid
|
||||||
// flashes of brighter colors during the transition.
|
// flashes of brighter colors during the transition.
|
||||||
if (view_->render_widget_host()->delegate() &&
|
if (view_->render_widget_host()->delegate() &&
|
||||||
view_->render_widget_host()->delegate()->IsFullscreenForCurrentTab()) {
|
view_->render_widget_host()->delegate()->IsFullscreen()) {
|
||||||
return SK_ColorBLACK;
|
return SK_ColorBLACK;
|
||||||
}
|
}
|
||||||
return *view_->GetBackgroundColor();
|
return *view_->GetBackgroundColor();
|
||||||
@ -197,7 +197,8 @@ ui::ImeTextSpan::UnderlineStyle GetImeUnderlineStyle(
|
|||||||
CefCursorHandle ToCursorHandle(ui::PlatformCursor cursor) {
|
CefCursorHandle ToCursorHandle(ui::PlatformCursor cursor) {
|
||||||
#if defined(USE_X11)
|
#if defined(USE_X11)
|
||||||
// See https://crbug.com/1029142 for background.
|
// See https://crbug.com/1029142 for background.
|
||||||
return static_cast<ui::X11Cursor*>(cursor)->xcursor();
|
return static_cast<CefCursorHandle>(
|
||||||
|
static_cast<ui::X11Cursor*>(cursor)->xcursor());
|
||||||
#else
|
#else
|
||||||
return cursor;
|
return cursor;
|
||||||
#endif
|
#endif
|
||||||
@ -654,7 +655,7 @@ void CefRenderWidgetHostViewOSR::UpdateCursor(
|
|||||||
|
|
||||||
handler->OnCursorChange(browser_impl_.get(), platform_cursor, cursor_type,
|
handler->OnCursorChange(browser_impl_.get(), platform_cursor, cursor_type,
|
||||||
custom_cursor_info);
|
custom_cursor_info);
|
||||||
#elif defined(OS_MACOSX)
|
#elif defined(OS_MAC)
|
||||||
// |web_cursor| owns the resulting |native_cursor|.
|
// |web_cursor| owns the resulting |native_cursor|.
|
||||||
content::WebCursor web_cursor(cursor);
|
content::WebCursor web_cursor(cursor);
|
||||||
CefCursorHandle native_cursor = web_cursor.GetNativeCursor();
|
CefCursorHandle native_cursor = web_cursor.GetNativeCursor();
|
||||||
@ -741,7 +742,7 @@ void CefRenderWidgetHostViewOSR::CopyFromSurface(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefRenderWidgetHostViewOSR::GetScreenInfo(content::ScreenInfo* results) {
|
void CefRenderWidgetHostViewOSR::GetScreenInfo(blink::ScreenInfo* results) {
|
||||||
if (!browser_impl_.get())
|
if (!browser_impl_.get())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -792,7 +793,7 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetBoundsInRootWindow() {
|
|||||||
return GetViewBounds();
|
return GetViewBounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(OS_MACOSX)
|
#if !defined(OS_MAC)
|
||||||
viz::ScopedSurfaceIdAllocator
|
viz::ScopedSurfaceIdAllocator
|
||||||
CefRenderWidgetHostViewOSR::DidUpdateVisualProperties(
|
CefRenderWidgetHostViewOSR::DidUpdateVisualProperties(
|
||||||
const cc::RenderFrameMetadata& metadata) {
|
const cc::RenderFrameMetadata& metadata) {
|
||||||
@ -1443,13 +1444,16 @@ gfx::Size CefRenderWidgetHostViewOSR::SizeInPixels() {
|
|||||||
current_device_scale_factor_);
|
current_device_scale_factor_);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
void CefRenderWidgetHostViewOSR::SetActive(bool active) {}
|
void CefRenderWidgetHostViewOSR::SetActive(bool active) {}
|
||||||
|
|
||||||
void CefRenderWidgetHostViewOSR::ShowDefinitionForSelection() {}
|
void CefRenderWidgetHostViewOSR::ShowDefinitionForSelection() {}
|
||||||
|
|
||||||
void CefRenderWidgetHostViewOSR::SpeakSelection() {}
|
void CefRenderWidgetHostViewOSR::SpeakSelection() {}
|
||||||
#endif
|
|
||||||
|
void CefRenderWidgetHostViewOSR::SetWindowFrameInScreen(const gfx::Rect& rect) {
|
||||||
|
}
|
||||||
|
#endif // defined(OS_MAC)
|
||||||
|
|
||||||
void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect,
|
void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect,
|
||||||
const gfx::Size& pixel_size,
|
const gfx::Size& pixel_size,
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
#include "ui/events/gesture_detection/motion_event_generic.h"
|
#include "ui/events/gesture_detection/motion_event_generic.h"
|
||||||
#include "ui/gfx/geometry/rect.h"
|
#include "ui/gfx/geometry/rect.h"
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
#include "content/browser/renderer_host/browser_compositor_view_mac.h"
|
#include "content/browser/renderer_host/browser_compositor_view_mac.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -65,8 +65,9 @@ class CefWebContentsViewOSR;
|
|||||||
|
|
||||||
#if defined(USE_X11)
|
#if defined(USE_X11)
|
||||||
namespace ui {
|
namespace ui {
|
||||||
class XScopedCursor;
|
class X11Cursor;
|
||||||
}
|
class XCursorLoader;
|
||||||
|
} // namespace ui
|
||||||
class CefWindowX11;
|
class CefWindowX11;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -88,7 +89,7 @@ class CefWindowX11;
|
|||||||
// RenderWidgetHostView class hierarchy described in render_widget_host_view.h.
|
// RenderWidgetHostView class hierarchy described in render_widget_host_view.h.
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
class MacHelper;
|
class MacHelper;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -129,11 +130,12 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
|||||||
void UnlockMouse() override;
|
void UnlockMouse() override;
|
||||||
void TakeFallbackContentFrom(content::RenderWidgetHostView* view) override;
|
void TakeFallbackContentFrom(content::RenderWidgetHostView* view) override;
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
void SetActive(bool active) override;
|
void SetActive(bool active) override;
|
||||||
void ShowDefinitionForSelection() override;
|
void ShowDefinitionForSelection() override;
|
||||||
void SpeakSelection() override;
|
void SpeakSelection() override;
|
||||||
#endif // defined(OS_MACOSX)
|
void SetWindowFrameInScreen(const gfx::Rect& rect) override;
|
||||||
|
#endif // defined(OS_MAC)
|
||||||
|
|
||||||
// RenderWidgetHostViewBase implementation.
|
// RenderWidgetHostViewBase implementation.
|
||||||
void ResetFallbackToFirstNavigationSurface() override;
|
void ResetFallbackToFirstNavigationSurface() override;
|
||||||
@ -152,11 +154,11 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
|||||||
const gfx::Rect& src_rect,
|
const gfx::Rect& src_rect,
|
||||||
const gfx::Size& output_size,
|
const gfx::Size& output_size,
|
||||||
base::OnceCallback<void(const SkBitmap&)> callback) override;
|
base::OnceCallback<void(const SkBitmap&)> callback) override;
|
||||||
void GetScreenInfo(content::ScreenInfo* results) override;
|
void GetScreenInfo(blink::ScreenInfo* results) override;
|
||||||
void TransformPointToRootSurface(gfx::PointF* point) override;
|
void TransformPointToRootSurface(gfx::PointF* point) override;
|
||||||
gfx::Rect GetBoundsInRootWindow() override;
|
gfx::Rect GetBoundsInRootWindow() override;
|
||||||
|
|
||||||
#if !defined(OS_MACOSX)
|
#if !defined(OS_MAC)
|
||||||
viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(
|
viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(
|
||||||
const cc::RenderFrameMetadata& metadata) override;
|
const cc::RenderFrameMetadata& metadata) override;
|
||||||
#endif
|
#endif
|
||||||
@ -345,7 +347,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
|||||||
viz::ParentLocalSurfaceIdAllocator compositor_local_surface_id_allocator_;
|
viz::ParentLocalSurfaceIdAllocator compositor_local_surface_id_allocator_;
|
||||||
|
|
||||||
#if defined(USE_X11)
|
#if defined(USE_X11)
|
||||||
std::unique_ptr<ui::XScopedCursor> invisible_cursor_;
|
std::unique_ptr<ui::XCursorLoader> cursor_loader_;
|
||||||
|
scoped_refptr<ui::X11Cursor> invisible_cursor_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::unique_ptr<content::CursorManager> cursor_manager_;
|
std::unique_ptr<content::CursorManager> cursor_manager_;
|
||||||
|
@ -8,10 +8,11 @@
|
|||||||
#if defined(USE_X11)
|
#if defined(USE_X11)
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/cursorfont.h>
|
#include <X11/cursorfont.h>
|
||||||
#undef Status // Avoid conflicts with url_request_status.h
|
|
||||||
|
|
||||||
#include "libcef/browser/native/window_x11.h"
|
#include "libcef/browser/native/window_x11.h"
|
||||||
|
|
||||||
|
#include "third_party/skia/include/core/SkBitmap.h"
|
||||||
|
#include "ui/base/x/x11_cursor_loader.h"
|
||||||
#include "ui/base/x/x11_util.h"
|
#include "ui/base/x/x11_util.h"
|
||||||
#include "ui/gfx/x/x11_types.h"
|
#include "ui/gfx/x/x11_types.h"
|
||||||
#endif // defined(USE_X11)
|
#endif // defined(USE_X11)
|
||||||
@ -176,6 +177,14 @@ XCursorCache* cursor_cache = nullptr;
|
|||||||
return cursor_cache->GetCursor(cursor_shape);
|
return cursor_cache->GetCursor(cursor_shape);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Based on ui/base/x/x11_cursor_factory.cc.
|
||||||
|
scoped_refptr<ui::X11Cursor> CreateInvisibleCursor(
|
||||||
|
ui::XCursorLoader* cursor_loader) {
|
||||||
|
SkBitmap bitmap;
|
||||||
|
bitmap.allocN32Pixels(1, 1);
|
||||||
|
return cursor_loader->CreateCursor(bitmap, gfx::Point(0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
#endif // defined(USE_X11)
|
#endif // defined(USE_X11)
|
||||||
|
|
||||||
@ -184,10 +193,11 @@ CefCursorHandle CefRenderWidgetHostViewOSR::GetPlatformCursor(
|
|||||||
#if defined(USE_X11)
|
#if defined(USE_X11)
|
||||||
if (type == ui::mojom::CursorType::kNone) {
|
if (type == ui::mojom::CursorType::kNone) {
|
||||||
if (!invisible_cursor_) {
|
if (!invisible_cursor_) {
|
||||||
invisible_cursor_.reset(new ui::XScopedCursor(ui::CreateInvisibleCursor(),
|
cursor_loader_ =
|
||||||
gfx::GetXDisplay()));
|
std::make_unique<ui::XCursorLoader>(x11::Connection::Get());
|
||||||
|
invisible_cursor_ = CreateInvisibleCursor(cursor_loader_.get());
|
||||||
}
|
}
|
||||||
return invisible_cursor_->get();
|
return static_cast<::Cursor>(invisible_cursor_->xcursor());
|
||||||
} else {
|
} else {
|
||||||
return GetXCursor(ToCursorID(type));
|
return GetXCursor(ToCursorID(type));
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
#include "libcef/browser/osr/synthetic_gesture_target_osr.h"
|
#include "libcef/browser/osr/synthetic_gesture_target_osr.h"
|
||||||
|
|
||||||
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
||||||
#include "content/public/common/screen_info.h"
|
|
||||||
#include "ui/events/gesture_detection/gesture_configuration.h"
|
#include "ui/events/gesture_detection/gesture_configuration.h"
|
||||||
|
|
||||||
CefSyntheticGestureTargetOSR::CefSyntheticGestureTargetOSR(
|
CefSyntheticGestureTargetOSR::CefSyntheticGestureTargetOSR(
|
||||||
|
@ -138,11 +138,11 @@ void CefWebContentsViewOSR::RenderViewHostChanged(
|
|||||||
|
|
||||||
void CefWebContentsViewOSR::SetOverscrollControllerEnabled(bool enabled) {}
|
void CefWebContentsViewOSR::SetOverscrollControllerEnabled(bool enabled) {}
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
bool CefWebContentsViewOSR::CloseTabAfterEventTrackingIfNeeded() {
|
bool CefWebContentsViewOSR::CloseTabAfterEventTrackingIfNeeded() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif // defined(OS_MACOSX)
|
#endif // defined(OS_MAC)
|
||||||
|
|
||||||
void CefWebContentsViewOSR::StartDragging(
|
void CefWebContentsViewOSR::StartDragging(
|
||||||
const content::DropData& drop_data,
|
const content::DropData& drop_data,
|
||||||
|
@ -56,7 +56,7 @@ class CefWebContentsViewOSR : public content::WebContentsView,
|
|||||||
content::RenderViewHost* new_host) override;
|
content::RenderViewHost* new_host) override;
|
||||||
void SetOverscrollControllerEnabled(bool enabled) override;
|
void SetOverscrollControllerEnabled(bool enabled) override;
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
bool CloseTabAfterEventTrackingIfNeeded() override;
|
bool CloseTabAfterEventTrackingIfNeeded() override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -299,10 +299,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
|||||||
PrefsTabHelper::RegisterProfilePrefs(registry, locale);
|
PrefsTabHelper::RegisterProfilePrefs(registry, locale);
|
||||||
RegisterAnimationPolicyPrefs(registry);
|
RegisterAnimationPolicyPrefs(registry);
|
||||||
|
|
||||||
// From chrome::RegisterBrowserUserPrefs.
|
// From chrome/browser/ui/browser_ui_prefs.cc RegisterBrowserUserPrefs.
|
||||||
registry->RegisterBooleanPref(
|
registry->RegisterBooleanPref(
|
||||||
prefs::kEnableDoNotTrack, false,
|
prefs::kEnableDoNotTrack, false,
|
||||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||||
|
registry->RegisterBooleanPref(prefs::kCaretBrowsingEnabled, false);
|
||||||
|
|
||||||
// TODO(guoweis): Remove next 2 options at M50.
|
// TODO(guoweis): Remove next 2 options at M50.
|
||||||
registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, true);
|
registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, true);
|
||||||
@ -311,7 +312,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
|||||||
blink::kWebRTCIPHandlingDefault);
|
blink::kWebRTCIPHandlingDefault);
|
||||||
registry->RegisterStringPref(prefs::kWebRTCUDPPortRange, std::string());
|
registry->RegisterStringPref(prefs::kWebRTCUDPPortRange, std::string());
|
||||||
|
|
||||||
#if !defined(OS_MACOSX)
|
#if !defined(OS_MAC)
|
||||||
registry->RegisterBooleanPref(prefs::kFullscreenAllowed, true);
|
registry->RegisterBooleanPref(prefs::kFullscreenAllowed, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ bool CefPrintSettingsImpl::WillCollate() {
|
|||||||
|
|
||||||
void CefPrintSettingsImpl::SetColorModel(ColorModel model) {
|
void CefPrintSettingsImpl::SetColorModel(ColorModel model) {
|
||||||
CEF_VALUE_VERIFY_RETURN_VOID(true);
|
CEF_VALUE_VERIFY_RETURN_VOID(true);
|
||||||
mutable_value()->set_color(static_cast<printing::ColorModel>(model));
|
mutable_value()->set_color(static_cast<printing::mojom::ColorModel>(model));
|
||||||
}
|
}
|
||||||
|
|
||||||
CefPrintSettings::ColorModel CefPrintSettingsImpl::GetColorModel() {
|
CefPrintSettings::ColorModel CefPrintSettingsImpl::GetColorModel() {
|
||||||
|
@ -224,7 +224,7 @@ void CefPrintDialogLinux::PrintDocument(
|
|||||||
success = metafile.SaveTo(&file);
|
success = metafile.SaveTo(&file);
|
||||||
file.Close();
|
file.Close();
|
||||||
if (!success)
|
if (!success)
|
||||||
base::DeleteFile(path_to_pdf_, false);
|
base::DeleteFile(path_to_pdf_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
|
@ -60,7 +60,8 @@ void FillInDictionaryFromPdfPrintSettings(
|
|||||||
// Fixed settings.
|
// Fixed settings.
|
||||||
print_settings.SetIntKey(kSettingPrinterType,
|
print_settings.SetIntKey(kSettingPrinterType,
|
||||||
static_cast<int>(PrinterType::kPdf));
|
static_cast<int>(PrinterType::kPdf));
|
||||||
print_settings.SetInteger(kSettingColor, GRAY);
|
print_settings.SetInteger(kSettingColor,
|
||||||
|
static_cast<int>(mojom::ColorModel::kGray));
|
||||||
print_settings.SetInteger(kSettingDuplexMode,
|
print_settings.SetInteger(kSettingDuplexMode,
|
||||||
static_cast<int>(mojom::DuplexMode::kSimplex));
|
static_cast<int>(mojom::DuplexMode::kSimplex));
|
||||||
print_settings.SetInteger(kSettingCopies, 1);
|
print_settings.SetInteger(kSettingCopies, 1);
|
||||||
@ -100,23 +101,23 @@ void FillInDictionaryFromPdfPrintSettings(
|
|||||||
print_settings.Set(kSettingMediaSize, std::move(dict));
|
print_settings.Set(kSettingMediaSize, std::move(dict));
|
||||||
}
|
}
|
||||||
|
|
||||||
int margin_type = DEFAULT_MARGINS;
|
auto margin_type = printing::mojom::MarginType::kDefaultMargins;
|
||||||
switch (pdf_settings.margin_type) {
|
switch (pdf_settings.margin_type) {
|
||||||
case PDF_PRINT_MARGIN_NONE:
|
case PDF_PRINT_MARGIN_NONE:
|
||||||
margin_type = NO_MARGINS;
|
margin_type = printing::mojom::MarginType::kNoMargins;
|
||||||
break;
|
break;
|
||||||
case PDF_PRINT_MARGIN_MINIMUM:
|
case PDF_PRINT_MARGIN_MINIMUM:
|
||||||
margin_type = PRINTABLE_AREA_MARGINS;
|
margin_type = printing::mojom::MarginType::kPrintableAreaMargins;
|
||||||
break;
|
break;
|
||||||
case PDF_PRINT_MARGIN_CUSTOM:
|
case PDF_PRINT_MARGIN_CUSTOM:
|
||||||
margin_type = CUSTOM_MARGINS;
|
margin_type = printing::mojom::MarginType::kCustomMargins;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
print_settings.SetInteger(kSettingMarginsType, margin_type);
|
print_settings.SetInteger(kSettingMarginsType, static_cast<int>(margin_type));
|
||||||
if (margin_type == CUSTOM_MARGINS) {
|
if (margin_type == printing::mojom::MarginType::kCustomMargins) {
|
||||||
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
|
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
|
||||||
dict->SetInteger(kSettingMarginTop, pdf_settings.margin_top);
|
dict->SetInteger(kSettingMarginTop, pdf_settings.margin_top);
|
||||||
dict->SetInteger(kSettingMarginRight, pdf_settings.margin_right);
|
dict->SetInteger(kSettingMarginRight, pdf_settings.margin_right);
|
||||||
@ -301,7 +302,7 @@ void CefPrintViewManager::OnRequestPrintPreview_PrintToPdf(
|
|||||||
|
|
||||||
void CefPrintViewManager::OnMetafileReadyForPrinting_PrintToPdf(
|
void CefPrintViewManager::OnMetafileReadyForPrinting_PrintToPdf(
|
||||||
content::RenderFrameHost* rfh,
|
content::RenderFrameHost* rfh,
|
||||||
const PrintHostMsg_DidPreviewDocument_Params& params,
|
const mojom::DidPreviewDocumentParams& params,
|
||||||
const PrintHostMsg_PreviewIds& ids) {
|
const PrintHostMsg_PreviewIds& ids) {
|
||||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||||
StopWorker(params.document_cookie);
|
StopWorker(params.document_cookie);
|
||||||
@ -318,7 +319,7 @@ void CefPrintViewManager::OnMetafileReadyForPrinting_PrintToPdf(
|
|||||||
print_render_frame_remote->OnPrintPreviewDialogClosed();
|
print_render_frame_remote->OnPrintPreviewDialogClosed();
|
||||||
|
|
||||||
auto shared_buf = base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(
|
auto shared_buf = base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(
|
||||||
params.content.metafile_data_region);
|
params.content->metafile_data_region);
|
||||||
if (!shared_buf) {
|
if (!shared_buf) {
|
||||||
TerminatePdfPrintJob();
|
TerminatePdfPrintJob();
|
||||||
return;
|
return;
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "include/internal/cef_types_wrappers.h"
|
#include "include/internal/cef_types_wrappers.h"
|
||||||
|
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
|
#include "components/printing/common/print.mojom-forward.h"
|
||||||
#include "content/public/browser/web_contents_observer.h"
|
#include "content/public/browser/web_contents_observer.h"
|
||||||
#include "content/public/browser/web_contents_user_data.h"
|
#include "content/public/browser/web_contents_user_data.h"
|
||||||
|
|
||||||
@ -19,7 +20,6 @@ class WebContentsObserver;
|
|||||||
|
|
||||||
class CefBrowserInfo;
|
class CefBrowserInfo;
|
||||||
|
|
||||||
struct PrintHostMsg_DidPreviewDocument_Params;
|
|
||||||
struct PrintHostMsg_PreviewIds;
|
struct PrintHostMsg_PreviewIds;
|
||||||
struct PrintHostMsg_RequestPrintPreview_Params;
|
struct PrintHostMsg_RequestPrintPreview_Params;
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ class CefPrintViewManager
|
|||||||
void OnDidShowPrintDialog_PrintToPdf(content::RenderFrameHost* rfh);
|
void OnDidShowPrintDialog_PrintToPdf(content::RenderFrameHost* rfh);
|
||||||
void OnMetafileReadyForPrinting_PrintToPdf(
|
void OnMetafileReadyForPrinting_PrintToPdf(
|
||||||
content::RenderFrameHost* rfh,
|
content::RenderFrameHost* rfh,
|
||||||
const PrintHostMsg_DidPreviewDocument_Params& params,
|
const mojom::DidPreviewDocumentParams& params,
|
||||||
const PrintHostMsg_PreviewIds& ids);
|
const PrintHostMsg_PreviewIds& ids);
|
||||||
void InitializePrintPreview(int frame_tree_node_id);
|
void InitializePrintPreview(int frame_tree_node_id);
|
||||||
void TerminatePdfPrintJob();
|
void TerminatePdfPrintJob();
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "content/public/browser/render_frame_host.h"
|
#include "content/public/browser/render_frame_host.h"
|
||||||
#include "content/public/browser/web_contents.h"
|
#include "content/public/browser/web_contents.h"
|
||||||
#include "content/public/common/child_process_host.h"
|
#include "content/public/common/child_process_host.h"
|
||||||
|
#include "printing/mojom/print.mojom.h"
|
||||||
|
|
||||||
#if defined(OS_LINUX)
|
#if defined(OS_LINUX)
|
||||||
#include "libcef/browser/printing/print_dialog_linux.h"
|
#include "libcef/browser/printing/print_dialog_linux.h"
|
||||||
@ -139,8 +140,8 @@ void CefPrintingMessageFilter::OnGetDefaultPrintSettings(
|
|||||||
// will hang until the settings are retrieved.
|
// will hang until the settings are retrieved.
|
||||||
auto* printer_query_ptr = printer_query.get();
|
auto* printer_query_ptr = printer_query.get();
|
||||||
printer_query_ptr->GetSettings(
|
printer_query_ptr->GetSettings(
|
||||||
PrinterQuery::GetSettingsAskParam::DEFAULTS, 0, false, DEFAULT_MARGINS,
|
PrinterQuery::GetSettingsAskParam::DEFAULTS, 0, false,
|
||||||
false, false,
|
printing::mojom::MarginType::kDefaultMargins, false, false,
|
||||||
base::BindOnce(&CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply,
|
base::BindOnce(&CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply,
|
||||||
this, std::move(printer_query), reply_msg));
|
this, std::move(printer_query), reply_msg));
|
||||||
}
|
}
|
||||||
@ -148,11 +149,8 @@ void CefPrintingMessageFilter::OnGetDefaultPrintSettings(
|
|||||||
void CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply(
|
void CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply(
|
||||||
std::unique_ptr<PrinterQuery> printer_query,
|
std::unique_ptr<PrinterQuery> printer_query,
|
||||||
IPC::Message* reply_msg) {
|
IPC::Message* reply_msg) {
|
||||||
PrintMsg_Print_Params params;
|
mojom::PrintParams params;
|
||||||
if (!printer_query.get() ||
|
if (printer_query && printer_query->last_status() == PrintingContext::OK) {
|
||||||
printer_query->last_status() != PrintingContext::OK) {
|
|
||||||
params.Reset();
|
|
||||||
} else {
|
|
||||||
RenderParamsFromPrintSettings(printer_query->settings(), ¶ms);
|
RenderParamsFromPrintSettings(printer_query->settings(), ¶ms);
|
||||||
params.document_cookie = printer_query->cookie();
|
params.document_cookie = printer_query->cookie();
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ CEF_BUTTON_IMPL_T class CefButtonImpl : public CEF_VIEW_IMPL_D {
|
|||||||
|
|
||||||
CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetState(cef_button_state_t state) {
|
CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetState(cef_button_state_t state) {
|
||||||
CEF_REQUIRE_VALID_RETURN_VOID();
|
CEF_REQUIRE_VALID_RETURN_VOID();
|
||||||
views::Button::ButtonState old_state = ParentClass::root_view()->state();
|
views::Button::ButtonState old_state = ParentClass::root_view()->GetState();
|
||||||
views::Button::ButtonState new_state =
|
views::Button::ButtonState new_state =
|
||||||
static_cast<views::Button::ButtonState>(state);
|
static_cast<views::Button::ButtonState>(state);
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetState(cef_button_state_t state) {
|
|||||||
|
|
||||||
CEF_BUTTON_IMPL_T cef_button_state_t CEF_BUTTON_IMPL_D::GetState() {
|
CEF_BUTTON_IMPL_T cef_button_state_t CEF_BUTTON_IMPL_D::GetState() {
|
||||||
CEF_REQUIRE_VALID_RETURN(CEF_BUTTON_STATE_NORMAL);
|
CEF_REQUIRE_VALID_RETURN(CEF_BUTTON_STATE_NORMAL);
|
||||||
return static_cast<cef_button_state_t>(ParentClass::root_view()->state());
|
return static_cast<cef_button_state_t>(ParentClass::root_view()->GetState());
|
||||||
}
|
}
|
||||||
|
|
||||||
CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetInkDropEnabled(bool enabled) {
|
CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetInkDropEnabled(bool enabled) {
|
||||||
|
@ -61,7 +61,7 @@ CEF_BUTTON_VIEW_T void CEF_BUTTON_VIEW_D::ButtonPressed(
|
|||||||
ParentClass::cef_delegate()->OnButtonPressed(GetCefButton());
|
ParentClass::cef_delegate()->OnButtonPressed(GetCefButton());
|
||||||
if (ParentClass::ink_drop_mode() != views::Button::InkDropMode::OFF &&
|
if (ParentClass::ink_drop_mode() != views::Button::InkDropMode::OFF &&
|
||||||
!ParentClass::IsFocusable() &&
|
!ParentClass::IsFocusable() &&
|
||||||
ParentClass::state() != views::Button::STATE_PRESSED) {
|
ParentClass::GetState() != views::Button::STATE_PRESSED) {
|
||||||
// Ink drop state does not get reset properly on click when the button is
|
// Ink drop state does not get reset properly on click when the button is
|
||||||
// non-focusable. Reset the ink drop state here if the state has not been
|
// non-focusable. Reset the ink drop state here if the state has not been
|
||||||
// explicitly set to pressed by the OnButtonPressed callback calling
|
// explicitly set to pressed by the OnButtonPressed callback calling
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
// CefButtonView template.
|
// CefButtonView template.
|
||||||
class MenuButtonEx : public views::MenuButton, public views::ButtonListener {
|
class MenuButtonEx : public views::MenuButton, public views::ButtonListener {
|
||||||
public:
|
public:
|
||||||
MenuButtonEx() : views::MenuButton(base::string16(), this) {
|
MenuButtonEx() : views::MenuButton(this, base::string16()) {
|
||||||
// TODO(cef): MenuButton should not use ButtonListener. See
|
// TODO(cef): MenuButton should not use ButtonListener. See
|
||||||
// http://crbug.com/585252 for details.
|
// http://crbug.com/585252 for details.
|
||||||
Button::listener_ = this;
|
Button::listener_ = this;
|
||||||
|
@ -36,7 +36,11 @@ class ClientViewEx : public views::ClientView {
|
|||||||
DCHECK(window_delegate_);
|
DCHECK(window_delegate_);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CanClose() override { return window_delegate_->CanWidgetClose(); }
|
views::CloseRequestResult OnWindowCloseRequested() override {
|
||||||
|
return window_delegate_->CanWidgetClose()
|
||||||
|
? views::CloseRequestResult::kCanClose
|
||||||
|
: views::CloseRequestResult::kCannotClose;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CefWindowView::Delegate* window_delegate_; // Not owned by this object.
|
CefWindowView::Delegate* window_delegate_; // Not owned by this object.
|
||||||
@ -404,15 +408,15 @@ views::ClientView* CefWindowView::CreateClientView(views::Widget* widget) {
|
|||||||
return new ClientViewEx(widget, GetContentsView(), window_delegate_);
|
return new ClientViewEx(widget, GetContentsView(), window_delegate_);
|
||||||
}
|
}
|
||||||
|
|
||||||
views::NonClientFrameView* CefWindowView::CreateNonClientFrameView(
|
std::unique_ptr<views::NonClientFrameView>
|
||||||
views::Widget* widget) {
|
CefWindowView::CreateNonClientFrameView(views::Widget* widget) {
|
||||||
if (is_frameless_) {
|
if (is_frameless_) {
|
||||||
// Custom frame type that doesn't render a caption.
|
// Custom frame type that doesn't render a caption.
|
||||||
return new CaptionlessFrameView(widget, this);
|
return std::make_unique<CaptionlessFrameView>(widget, this);
|
||||||
} else if (widget->ShouldUseNativeFrame()) {
|
} else if (widget->ShouldUseNativeFrame()) {
|
||||||
// DesktopNativeWidgetAura::CreateNonClientFrameView() returns
|
// DesktopNativeWidgetAura::CreateNonClientFrameView() returns
|
||||||
// NativeFrameView by default. Extend that type.
|
// NativeFrameView by default. Extend that type.
|
||||||
return new NativeFrameViewEx(widget, this);
|
return std::make_unique<NativeFrameViewEx>(widget, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use Chromium provided CustomFrameView. In case if we would like to
|
// Use Chromium provided CustomFrameView. In case if we would like to
|
||||||
|
@ -63,7 +63,7 @@ class CefWindowView
|
|||||||
void WindowClosing() override;
|
void WindowClosing() override;
|
||||||
views::View* GetContentsView() override;
|
views::View* GetContentsView() override;
|
||||||
views::ClientView* CreateClientView(views::Widget* widget) override;
|
views::ClientView* CreateClientView(views::Widget* widget) override;
|
||||||
views::NonClientFrameView* CreateNonClientFrameView(
|
std::unique_ptr<views::NonClientFrameView> CreateNonClientFrameView(
|
||||||
views::Widget* widget) override;
|
views::Widget* widget) override;
|
||||||
bool ShouldDescendIntoChildForEventHandling(
|
bool ShouldDescendIntoChildForEventHandling(
|
||||||
gfx::NativeView child,
|
gfx::NativeView child,
|
||||||
|
@ -39,14 +39,14 @@
|
|||||||
#include "ipc/ipc_buildflags.h"
|
#include "ipc/ipc_buildflags.h"
|
||||||
#include "net/base/features.h"
|
#include "net/base/features.h"
|
||||||
#include "pdf/pdf_ppapi.h"
|
#include "pdf/pdf_ppapi.h"
|
||||||
|
#include "sandbox/policy/switches.h"
|
||||||
#include "services/network/public/cpp/features.h"
|
#include "services/network/public/cpp/features.h"
|
||||||
#include "services/service_manager/sandbox/switches.h"
|
|
||||||
#include "ui/base/resource/resource_bundle.h"
|
#include "ui/base/resource/resource_bundle.h"
|
||||||
#include "ui/base/ui_base_features.h"
|
#include "ui/base/ui_base_features.h"
|
||||||
#include "ui/base/ui_base_paths.h"
|
#include "ui/base/ui_base_paths.h"
|
||||||
#include "ui/base/ui_base_switches.h"
|
#include "ui/base/ui_base_switches.h"
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
#include "libcef/common/util_mac.h"
|
#include "libcef/common/util_mac.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
if (settings_->framework_dir_path.length > 0) {
|
if (settings_->framework_dir_path.length > 0) {
|
||||||
base::FilePath file_path =
|
base::FilePath file_path =
|
||||||
base::FilePath(CefString(&settings_->framework_dir_path));
|
base::FilePath(CefString(&settings_->framework_dir_path));
|
||||||
@ -144,7 +144,7 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (no_sandbox)
|
if (no_sandbox)
|
||||||
command_line->AppendSwitch(service_manager::switches::kNoSandbox);
|
command_line->AppendSwitch(sandbox::policy::switches::kNoSandbox);
|
||||||
|
|
||||||
if (settings_->user_agent.length > 0) {
|
if (settings_->user_agent.length > 0) {
|
||||||
command_line->AppendSwitchASCII(switches::kUserAgent,
|
command_line->AppendSwitchASCII(switches::kUserAgent,
|
||||||
@ -355,7 +355,7 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) {
|
|||||||
|
|
||||||
content::SetContentClient(&content_client_);
|
content::SetContentClient(&content_client_);
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
util_mac::BasicStartupComplete();
|
util_mac::BasicStartupComplete();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -370,7 +370,7 @@ void AlloyMainDelegate::PreSandboxStartup() {
|
|||||||
|
|
||||||
if (process_type.empty()) {
|
if (process_type.empty()) {
|
||||||
// Only override these paths when executing the main process.
|
// Only override these paths when executing the main process.
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
util_mac::PreSandboxStartup();
|
util_mac::PreSandboxStartup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "content/public/browser/child_process_security_policy.h"
|
#include "content/public/browser/child_process_security_policy.h"
|
||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
#include "third_party/blink/public/platform/platform.h"
|
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@ -108,11 +107,3 @@ const wchar_t* CefAppManager::GetResourceDllName() {
|
|||||||
return file_path;
|
return file_path;
|
||||||
}
|
}
|
||||||
#endif // defined(OS_WIN)
|
#endif // defined(OS_WIN)
|
||||||
|
|
||||||
blink::WebURLLoaderFactory* CefAppManager::GetDefaultURLLoaderFactory() {
|
|
||||||
if (!default_url_loader_factory_) {
|
|
||||||
default_url_loader_factory_ =
|
|
||||||
blink::Platform::Current()->CreateDefaultURLLoaderFactory();
|
|
||||||
}
|
|
||||||
return default_url_loader_factory_.get();
|
|
||||||
}
|
|
||||||
|
@ -15,10 +15,6 @@
|
|||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "content/public/common/content_client.h"
|
#include "content/public/common/content_client.h"
|
||||||
|
|
||||||
namespace blink {
|
|
||||||
class WebURLLoaderFactory;
|
|
||||||
}
|
|
||||||
|
|
||||||
class CefBrowserContext;
|
class CefBrowserContext;
|
||||||
struct CefSchemeInfo;
|
struct CefSchemeInfo;
|
||||||
|
|
||||||
@ -58,12 +54,6 @@ class CefAppManager {
|
|||||||
const wchar_t* GetResourceDllName();
|
const wchar_t* GetResourceDllName();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// The following methods are only available in the render process.
|
|
||||||
|
|
||||||
// Returns a factory that only supports unintercepted http(s) and blob
|
|
||||||
// requests. Used by CefRenderURLRequest.
|
|
||||||
blink::WebURLLoaderFactory* GetDefaultURLLoaderFactory();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CefAppManager();
|
CefAppManager();
|
||||||
virtual ~CefAppManager();
|
virtual ~CefAppManager();
|
||||||
@ -73,8 +63,6 @@ class CefAppManager {
|
|||||||
SchemeInfoList scheme_info_list_;
|
SchemeInfoList scheme_info_list_;
|
||||||
bool scheme_info_list_locked_ = false;
|
bool scheme_info_list_locked_ = false;
|
||||||
|
|
||||||
std::unique_ptr<blink::WebURLLoaderFactory> default_url_loader_factory_;
|
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CefAppManager);
|
DISALLOW_COPY_AND_ASSIGN(CefAppManager);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ const char kDevToolsProtocolLogFile[] = "devtools-protocol-log-file";
|
|||||||
// Enable use of the Chrome runtime in CEF. See issue #2969 for details.
|
// Enable use of the Chrome runtime in CEF. See issue #2969 for details.
|
||||||
const char kEnableChromeRuntime[] = "enable-chrome-runtime";
|
const char kEnableChromeRuntime[] = "enable-chrome-runtime";
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
// Path to the framework directory.
|
// Path to the framework directory.
|
||||||
const char kFrameworkDirPath[] = "framework-dir-path";
|
const char kFrameworkDirPath[] = "framework-dir-path";
|
||||||
const char kMainBundlePath[] = "main-bundle-path";
|
const char kMainBundlePath[] = "main-bundle-path";
|
||||||
|
@ -56,7 +56,7 @@ extern const char kDisableNewBrowserInfoTimeout[];
|
|||||||
extern const char kDevToolsProtocolLogFile[];
|
extern const char kDevToolsProtocolLogFile[];
|
||||||
extern const char kEnableChromeRuntime[];
|
extern const char kEnableChromeRuntime[];
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
extern const char kFrameworkDirPath[];
|
extern const char kFrameworkDirPath[];
|
||||||
extern const char kMainBundlePath[];
|
extern const char kMainBundlePath[];
|
||||||
#endif
|
#endif
|
||||||
|
@ -10,9 +10,10 @@
|
|||||||
#include "libcef/common/crash_reporting.h"
|
#include "libcef/common/crash_reporting.h"
|
||||||
#include "libcef/common/resource_util.h"
|
#include "libcef/common/resource_util.h"
|
||||||
|
|
||||||
|
#include "base/command_line.h"
|
||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
#include "libcef/common/util_mac.h"
|
#include "libcef/common/util_mac.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -42,7 +43,7 @@ bool ChromeMainDelegateCef::BasicStartupComplete(int* exit_code) {
|
|||||||
base::CommandLine::ForCurrentProcess());
|
base::CommandLine::ForCurrentProcess());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
util_mac::BasicStartupComplete();
|
util_mac::BasicStartupComplete();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -56,11 +57,11 @@ void ChromeMainDelegateCef::PreSandboxStartup() {
|
|||||||
const std::string& process_type =
|
const std::string& process_type =
|
||||||
command_line->GetSwitchValueASCII(switches::kProcessType);
|
command_line->GetSwitchValueASCII(switches::kProcessType);
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
if (process_type.empty()) {
|
if (process_type.empty()) {
|
||||||
util_mac::PreSandboxStartup();
|
util_mac::PreSandboxStartup();
|
||||||
}
|
}
|
||||||
#endif // defined(OS_MACOSX)
|
#endif // defined(OS_MAC)
|
||||||
|
|
||||||
// Since this may be configured via CefSettings we override the value on
|
// Since this may be configured via CefSettings we override the value on
|
||||||
// all platforms. We can't use the default implementation on macOS because
|
// all platforms. We can't use the default implementation on macOS because
|
||||||
|
@ -114,7 +114,11 @@ void CefCommandLineImpl::AppendSwitch(const CefString& name) {
|
|||||||
void CefCommandLineImpl::AppendSwitchWithValue(const CefString& name,
|
void CefCommandLineImpl::AppendSwitchWithValue(const CefString& name,
|
||||||
const CefString& value) {
|
const CefString& value) {
|
||||||
CEF_VALUE_VERIFY_RETURN_VOID(true);
|
CEF_VALUE_VERIFY_RETURN_VOID(true);
|
||||||
mutable_value()->AppendSwitchNative(name, value);
|
#if defined(OS_WIN)
|
||||||
|
mutable_value()->AppendSwitchNative(name, value.ToWString());
|
||||||
|
#else
|
||||||
|
mutable_value()->AppendSwitchNative(name, value.ToString());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefCommandLineImpl::HasArguments() {
|
bool CefCommandLineImpl::HasArguments() {
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include "services/service_manager/embedder/switches.h"
|
#include "services/service_manager/embedder/switches.h"
|
||||||
#include "third_party/crashpad/crashpad/client/annotation.h"
|
#include "third_party/crashpad/crashpad/client/annotation.h"
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
#include "libcef/common/util_mac.h"
|
#include "libcef/common/util_mac.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -39,7 +39,7 @@
|
|||||||
#include "chrome/common/chrome_paths.h"
|
#include "chrome/common/chrome_paths.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
#if defined(OS_POSIX) && !defined(OS_MAC)
|
||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
#include "libcef/common/cef_crash_report_utils.h"
|
#include "libcef/common/cef_crash_report_utils.h"
|
||||||
#endif
|
#endif
|
||||||
@ -79,7 +79,7 @@ PathString GetCrashConfigPath() {
|
|||||||
#elif defined(OS_POSIX)
|
#elif defined(OS_POSIX)
|
||||||
base::FilePath config_path;
|
base::FilePath config_path;
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
// Start with the path to the main app Resources directory. May be empty if
|
// Start with the path to the main app Resources directory. May be empty if
|
||||||
// not running in an app bundle.
|
// not running in an app bundle.
|
||||||
config_path = util_mac::GetMainResourcesDirectory();
|
config_path = util_mac::GetMainResourcesDirectory();
|
||||||
@ -439,7 +439,7 @@ bool CefCrashReporterClient::ReadCrashConfigFile() {
|
|||||||
app_name_ = val_str;
|
app_name_ = val_str;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#elif defined(OS_MACOSX)
|
#elif defined(OS_MAC)
|
||||||
else if (name_str == "BrowserCrashForwardingEnabled") {
|
else if (name_str == "BrowserCrashForwardingEnabled") {
|
||||||
enable_browser_crash_forwarding_ = ParseBool(val_str);
|
enable_browser_crash_forwarding_ = ParseBool(val_str);
|
||||||
}
|
}
|
||||||
@ -617,7 +617,7 @@ void CefCrashReporterClient::GetProductNameAndVersion(std::string* product_name,
|
|||||||
*version = product_version_;
|
*version = product_version_;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(OS_MACOSX)
|
#if !defined(OS_MAC)
|
||||||
|
|
||||||
base::FilePath CefCrashReporterClient::GetReporterLogFilename() {
|
base::FilePath CefCrashReporterClient::GetReporterLogFilename() {
|
||||||
return base::FilePath(FILE_PATH_LITERAL("uploads.log"));
|
return base::FilePath(FILE_PATH_LITERAL("uploads.log"));
|
||||||
@ -631,7 +631,7 @@ bool CefCrashReporterClient::EnableBreakpadForProcess(
|
|||||||
process_type == switches::kGpuProcess;
|
process_type == switches::kGpuProcess;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !defined(OS_MACOSX)
|
#endif // !defined(OS_MAC)
|
||||||
|
|
||||||
bool CefCrashReporterClient::GetCrashDumpLocation(base::FilePath* crash_dir) {
|
bool CefCrashReporterClient::GetCrashDumpLocation(base::FilePath* crash_dir) {
|
||||||
// By setting the BREAKPAD_DUMP_LOCATION environment variable, an alternate
|
// By setting the BREAKPAD_DUMP_LOCATION environment variable, an alternate
|
||||||
@ -656,7 +656,7 @@ bool CefCrashReporterClient::GetCollectStatsInSample() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_WIN) || defined(OS_MACOSX)
|
#if defined(OS_WIN) || defined(OS_MAC)
|
||||||
bool CefCrashReporterClient::ReportingIsEnforcedByPolicy(
|
bool CefCrashReporterClient::ReportingIsEnforcedByPolicy(
|
||||||
bool* crashpad_enabled) {
|
bool* crashpad_enabled) {
|
||||||
*crashpad_enabled = true;
|
*crashpad_enabled = true;
|
||||||
@ -664,7 +664,7 @@ bool CefCrashReporterClient::ReportingIsEnforcedByPolicy(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
#if defined(OS_POSIX) && !defined(OS_MAC)
|
||||||
bool CefCrashReporterClient::IsRunningUnattended() {
|
bool CefCrashReporterClient::IsRunningUnattended() {
|
||||||
// Crash upload will only be enabled with Breakpad on Linux if this method
|
// Crash upload will only be enabled with Breakpad on Linux if this method
|
||||||
// returns false.
|
// returns false.
|
||||||
@ -717,13 +717,13 @@ bool CefCrashReporterClient::HasCrashExternalHandler() const {
|
|||||||
|
|
||||||
#endif // defined(OS_WIN)
|
#endif // defined(OS_WIN)
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
bool CefCrashReporterClient::EnableBrowserCrashForwarding() {
|
bool CefCrashReporterClient::EnableBrowserCrashForwarding() {
|
||||||
return enable_browser_crash_forwarding_;
|
return enable_browser_crash_forwarding_;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
#if defined(OS_POSIX) && !defined(OS_MAC)
|
||||||
CefCrashReporterClient::ParameterMap CefCrashReporterClient::FilterParameters(
|
CefCrashReporterClient::ParameterMap CefCrashReporterClient::FilterParameters(
|
||||||
const ParameterMap& parameters) {
|
const ParameterMap& parameters) {
|
||||||
return crash_report_utils::FilterParameters(parameters);
|
return crash_report_utils::FilterParameters(parameters);
|
||||||
|
@ -57,7 +57,7 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient {
|
|||||||
void GetProductNameAndVersion(std::string* product_name,
|
void GetProductNameAndVersion(std::string* product_name,
|
||||||
std::string* version,
|
std::string* version,
|
||||||
std::string* channel) override;
|
std::string* channel) override;
|
||||||
#if !defined(OS_MACOSX)
|
#if !defined(OS_MAC)
|
||||||
base::FilePath GetReporterLogFilename() override;
|
base::FilePath GetReporterLogFilename() override;
|
||||||
bool EnableBreakpadForProcess(const std::string& process_type) override;
|
bool EnableBreakpadForProcess(const std::string& process_type) override;
|
||||||
#endif
|
#endif
|
||||||
@ -67,11 +67,11 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient {
|
|||||||
// All of these methods must return true to enable crash report upload.
|
// All of these methods must return true to enable crash report upload.
|
||||||
bool GetCollectStatsConsent() override;
|
bool GetCollectStatsConsent() override;
|
||||||
bool GetCollectStatsInSample() override;
|
bool GetCollectStatsInSample() override;
|
||||||
#if defined(OS_WIN) || defined(OS_MACOSX)
|
#if defined(OS_WIN) || defined(OS_MAC)
|
||||||
bool ReportingIsEnforcedByPolicy(bool* crashpad_enabled) override;
|
bool ReportingIsEnforcedByPolicy(bool* crashpad_enabled) override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
#if defined(OS_POSIX) && !defined(OS_MAC)
|
||||||
bool IsRunningUnattended() override;
|
bool IsRunningUnattended() override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -84,11 +84,11 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient {
|
|||||||
bool HasCrashExternalHandler() const;
|
bool HasCrashExternalHandler() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
bool EnableBrowserCrashForwarding() override;
|
bool EnableBrowserCrashForwarding() override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
#if defined(OS_POSIX) && !defined(OS_MAC)
|
||||||
ParameterMap FilterParameters(const ParameterMap& parameters) override;
|
ParameterMap FilterParameters(const ParameterMap& parameters) override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient {
|
|||||||
std::string external_handler_;
|
std::string external_handler_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
bool enable_browser_crash_forwarding_ = false;
|
bool enable_browser_crash_forwarding_ = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
#include "services/service_manager/embedder/switches.h"
|
#include "services/service_manager/embedder/switches.h"
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
#include "base/mac/foundation_util.h"
|
#include "base/mac/foundation_util.h"
|
||||||
#include "components/crash/core/app/crashpad.h"
|
#include "components/crash/core/app/crashpad.h"
|
||||||
#include "components/crash/core/common/crash_keys.h"
|
#include "components/crash/core/common/crash_keys.h"
|
||||||
@ -33,7 +33,7 @@
|
|||||||
#include "libcef/common/crash_reporter_client.h"
|
#include "libcef/common/crash_reporter_client.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
#if defined(OS_POSIX) && !defined(OS_MAC)
|
||||||
#include "components/crash/core/app/breakpad_linux.h"
|
#include "components/crash/core/app/breakpad_linux.h"
|
||||||
#include "v8/include/v8-wasm-trap-handler-posix.h"
|
#include "v8/include/v8-wasm-trap-handler-posix.h"
|
||||||
#endif
|
#endif
|
||||||
@ -101,7 +101,7 @@ void InitCrashReporter(const base::CommandLine& command_line,
|
|||||||
|
|
||||||
crash_reporter::SetCrashReporterClient(crash_client);
|
crash_reporter::SetCrashReporterClient(crash_client);
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
// TODO(mark): Right now, InitializeCrashpad() needs to be called after
|
// TODO(mark): Right now, InitializeCrashpad() needs to be called after
|
||||||
// CommandLine::Init() and configuration of chrome::DIR_CRASH_DUMPS. Ideally,
|
// CommandLine::Init() and configuration of chrome::DIR_CRASH_DUMPS. Ideally,
|
||||||
// Crashpad initialization could occur sooner, preferably even before the
|
// Crashpad initialization could occur sooner, preferably even before the
|
||||||
@ -131,7 +131,7 @@ void InitCrashReporter(const base::CommandLine& command_line,
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_crash_reporting_enabled = true;
|
g_crash_reporting_enabled = true;
|
||||||
#else // !defined(OS_MACOSX)
|
#else // !defined(OS_MAC)
|
||||||
|
|
||||||
if (process_type != service_manager::switches::kZygoteProcess) {
|
if (process_type != service_manager::switches::kZygoteProcess) {
|
||||||
// Crash reporting for subprocesses created using the zygote will be
|
// Crash reporting for subprocesses created using the zygote will be
|
||||||
@ -140,7 +140,7 @@ void InitCrashReporter(const base::CommandLine& command_line,
|
|||||||
|
|
||||||
g_crash_reporting_enabled = true;
|
g_crash_reporting_enabled = true;
|
||||||
}
|
}
|
||||||
#endif // !defined(OS_MACOSX)
|
#endif // !defined(OS_MAC)
|
||||||
}
|
}
|
||||||
#endif // defined(OS_POSIX)
|
#endif // defined(OS_POSIX)
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ bool SetCrashKeyValue(const base::StringPiece& key,
|
|||||||
void BasicStartupComplete(base::CommandLine* command_line) {
|
void BasicStartupComplete(base::CommandLine* command_line) {
|
||||||
CefCrashReporterClient* crash_client = g_crash_reporter_client.Pointer();
|
CefCrashReporterClient* crash_client = g_crash_reporter_client.Pointer();
|
||||||
if (crash_client->ReadCrashConfigFile()) {
|
if (crash_client->ReadCrashConfigFile()) {
|
||||||
#if !defined(OS_MACOSX)
|
#if !defined(OS_MAC)
|
||||||
// Breakpad requires this switch.
|
// Breakpad requires this switch.
|
||||||
command_line->AppendSwitch(switches::kEnableCrashReporter);
|
command_line->AppendSwitch(switches::kEnableCrashReporter);
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ void PreSandboxStartup(const base::CommandLine& command_line,
|
|||||||
crash_keys::SetSwitchesFromCommandLine(command_line, &IsBoringCEFSwitch);
|
crash_keys::SetSwitchesFromCommandLine(command_line, &IsBoringCEFSwitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
|
#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MAC)
|
||||||
void ZygoteForked(base::CommandLine* command_line,
|
void ZygoteForked(base::CommandLine* command_line,
|
||||||
const std::string& process_type) {
|
const std::string& process_type) {
|
||||||
CefCrashReporterClient* crash_client = g_crash_reporter_client.Pointer();
|
CefCrashReporterClient* crash_client = g_crash_reporter_client.Pointer();
|
||||||
|
@ -29,7 +29,7 @@ void BasicStartupComplete(base::CommandLine* command_line);
|
|||||||
void PreSandboxStartup(const base::CommandLine& command_line,
|
void PreSandboxStartup(const base::CommandLine& command_line,
|
||||||
const std::string& process_type);
|
const std::string& process_type);
|
||||||
|
|
||||||
#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
|
#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MAC)
|
||||||
void ZygoteForked(base::CommandLine* command_line,
|
void ZygoteForked(base::CommandLine* command_line,
|
||||||
const std::string& process_type);
|
const std::string& process_type);
|
||||||
#endif
|
#endif
|
||||||
|
@ -58,15 +58,15 @@ void CefExtensionsClient::FilterHostPermissions(
|
|||||||
NOTIMPLEMENTED();
|
NOTIMPLEMENTED();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefExtensionsClient::SetScriptingWhitelist(
|
void CefExtensionsClient::SetScriptingAllowlist(
|
||||||
const ScriptingWhitelist& whitelist) {
|
const ScriptingAllowlist& allowlist) {
|
||||||
scripting_whitelist_ = whitelist;
|
scripting_allowlist_ = allowlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ExtensionsClient::ScriptingWhitelist&
|
const ExtensionsClient::ScriptingAllowlist&
|
||||||
CefExtensionsClient::GetScriptingWhitelist() const {
|
CefExtensionsClient::GetScriptingAllowlist() const {
|
||||||
// TODO(jamescook): Real whitelist.
|
// TODO(jamescook): Real allowlist.
|
||||||
return scripting_whitelist_;
|
return scripting_allowlist_;
|
||||||
}
|
}
|
||||||
|
|
||||||
URLPatternSet CefExtensionsClient::GetPermittedChromeSchemeHosts(
|
URLPatternSet CefExtensionsClient::GetPermittedChromeSchemeHosts(
|
||||||
|
@ -29,8 +29,8 @@ class CefExtensionsClient : public ExtensionsClient {
|
|||||||
void FilterHostPermissions(const URLPatternSet& hosts,
|
void FilterHostPermissions(const URLPatternSet& hosts,
|
||||||
URLPatternSet* new_hosts,
|
URLPatternSet* new_hosts,
|
||||||
PermissionIDSet* permissions) const override;
|
PermissionIDSet* permissions) const override;
|
||||||
void SetScriptingWhitelist(const ScriptingWhitelist& whitelist) override;
|
void SetScriptingAllowlist(const ScriptingAllowlist& allowlist) override;
|
||||||
const ScriptingWhitelist& GetScriptingWhitelist() const override;
|
const ScriptingAllowlist& GetScriptingAllowlist() const override;
|
||||||
URLPatternSet GetPermittedChromeSchemeHosts(
|
URLPatternSet GetPermittedChromeSchemeHosts(
|
||||||
const Extension* extension,
|
const Extension* extension,
|
||||||
const APIPermissionSet& api_permissions) const override;
|
const APIPermissionSet& api_permissions) const override;
|
||||||
@ -42,7 +42,7 @@ class CefExtensionsClient : public ExtensionsClient {
|
|||||||
private:
|
private:
|
||||||
const ChromePermissionMessageProvider permission_message_provider_;
|
const ChromePermissionMessageProvider permission_message_provider_;
|
||||||
|
|
||||||
ScriptingWhitelist scripting_whitelist_;
|
ScriptingAllowlist scripting_allowlist_;
|
||||||
|
|
||||||
// Mutable to allow caching in a const method.
|
// Mutable to allow caching in a const method.
|
||||||
const GURL webstore_base_url_;
|
const GURL webstore_base_url_;
|
||||||
|
@ -25,7 +25,7 @@ bool PdfExtensionEnabled() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool PrintPreviewEnabled() {
|
bool PrintPreviewEnabled() {
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
// Not currently supported on macOS.
|
// Not currently supported on macOS.
|
||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
|
@ -74,7 +74,11 @@ bool CefDirectoryExists(const CefString& path) {
|
|||||||
bool CefDeleteFile(const CefString& path, bool recursive) {
|
bool CefDeleteFile(const CefString& path, bool recursive) {
|
||||||
if (!AllowFileIO())
|
if (!AllowFileIO())
|
||||||
return false;
|
return false;
|
||||||
return base::DeleteFile(path, recursive);
|
if (recursive) {
|
||||||
|
return base::DeletePathRecursively(path);
|
||||||
|
} else {
|
||||||
|
return base::DeleteFile(path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefZipDirectory(const CefString& src_dir,
|
bool CefZipDirectory(const CefString& src_dir,
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "net/http/http_status_code.h"
|
#include "net/http/http_status_code.h"
|
||||||
#include "net/url_request/redirect_info.h"
|
#include "net/url_request/redirect_info.h"
|
||||||
#include "net/url_request/redirect_util.h"
|
#include "net/url_request/redirect_util.h"
|
||||||
|
#include "net/url_request/referrer_policy.h"
|
||||||
#include "net/url_request/url_request.h"
|
#include "net/url_request/url_request.h"
|
||||||
#include "services/network/public/cpp/resource_request.h"
|
#include "services/network/public/cpp/resource_request.h"
|
||||||
|
|
||||||
@ -180,10 +181,10 @@ net::RedirectInfo MakeRedirectInfo(const network::ResourceRequest& request,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
net::URLRequest::FirstPartyURLPolicy first_party_url_policy =
|
auto first_party_url_policy =
|
||||||
request.update_first_party_url_on_redirect
|
request.update_first_party_url_on_redirect
|
||||||
? net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT
|
? net::RedirectInfo::FirstPartyURLPolicy::UPDATE_URL_ON_REDIRECT
|
||||||
: net::URLRequest::NEVER_CHANGE_FIRST_PARTY_URL;
|
: net::RedirectInfo::FirstPartyURLPolicy::NEVER_CHANGE_URL;
|
||||||
return net::RedirectInfo::ComputeRedirectInfo(
|
return net::RedirectInfo::ComputeRedirectInfo(
|
||||||
request.method, request.url, request.site_for_cookies,
|
request.method, request.url, request.site_for_cookies,
|
||||||
first_party_url_policy, request.referrer_policy, request.referrer.spec(),
|
first_party_url_policy, request.referrer_policy, request.referrer.spec(),
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include "net/http/http_request_headers.h"
|
#include "net/http/http_request_headers.h"
|
||||||
#include "net/http/http_util.h"
|
#include "net/http/http_util.h"
|
||||||
#include "net/url_request/redirect_info.h"
|
#include "net/url_request/redirect_info.h"
|
||||||
|
#include "net/url_request/referrer_policy.h"
|
||||||
#include "services/network/public/cpp/data_element.h"
|
#include "services/network/public/cpp/data_element.h"
|
||||||
#include "services/network/public/cpp/network_switches.h"
|
#include "services/network/public/cpp/network_switches.h"
|
||||||
#include "services/network/public/cpp/resource_request.h"
|
#include "services/network/public/cpp/resource_request.h"
|
||||||
@ -241,7 +242,7 @@ CefRefPtr<CefRequest> CefRequest::Create() {
|
|||||||
CefRequestImpl::CefRequestImpl() {
|
CefRequestImpl::CefRequestImpl() {
|
||||||
// Verify that our enum matches Chromium's values.
|
// Verify that our enum matches Chromium's values.
|
||||||
static_assert(static_cast<int>(REFERRER_POLICY_LAST_VALUE) ==
|
static_assert(static_cast<int>(REFERRER_POLICY_LAST_VALUE) ==
|
||||||
static_cast<int>(net::URLRequest::MAX_REFERRER_POLICY),
|
static_cast<int>(net::ReferrerPolicy::MAX),
|
||||||
"enum mismatch");
|
"enum mismatch");
|
||||||
|
|
||||||
base::AutoLock lock_scope(lock_);
|
base::AutoLock lock_scope(lock_);
|
||||||
@ -498,7 +499,7 @@ void CefRequestImpl::Get(network::ResourceRequest* request,
|
|||||||
if (ShouldSet(kChangedReferrer, changed_only)) {
|
if (ShouldSet(kChangedReferrer, changed_only)) {
|
||||||
request->referrer = referrer_url_;
|
request->referrer = referrer_url_;
|
||||||
request->referrer_policy =
|
request->referrer_policy =
|
||||||
static_cast<net::URLRequest::ReferrerPolicy>(referrer_policy_);
|
static_cast<net::ReferrerPolicy>(referrer_policy_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ShouldSet(kChangedHeaderMap, changed_only)) {
|
if (ShouldSet(kChangedHeaderMap, changed_only)) {
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "chrome/common/chrome_switches.h"
|
#include "chrome/common/chrome_switches.h"
|
||||||
#include "ui/base/layout.h"
|
#include "ui/base/layout.h"
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
#include "base/mac/foundation_util.h"
|
#include "base/mac/foundation_util.h"
|
||||||
#include "libcef/common/util_mac.h"
|
#include "libcef/common/util_mac.h"
|
||||||
#endif
|
#endif
|
||||||
@ -55,7 +55,7 @@ bool GetSystemFlashFilename(base::FilePath* out_path) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(OS_MACOSX)
|
#elif defined(OS_MAC)
|
||||||
|
|
||||||
const base::FilePath::CharType kPepperFlashSystemBaseDirectory[] =
|
const base::FilePath::CharType kPepperFlashSystemBaseDirectory[] =
|
||||||
FILE_PATH_LITERAL("Internet Plug-Ins/PepperFlashPlayer");
|
FILE_PATH_LITERAL("Internet Plug-Ins/PepperFlashPlayer");
|
||||||
@ -78,7 +78,7 @@ bool GetDefaultUserDataDirectory(base::FilePath* result) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(OS_MACOSX)
|
#elif defined(OS_MAC)
|
||||||
|
|
||||||
// Based on chrome/common/chrome_paths_mac.mm.
|
// Based on chrome/common/chrome_paths_mac.mm.
|
||||||
bool GetDefaultUserDataDirectory(base::FilePath* result) {
|
bool GetDefaultUserDataDirectory(base::FilePath* result) {
|
||||||
@ -168,7 +168,7 @@ bool GetDefaultDownloadSafeDirectory(base::FilePath* result) {
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
|
|
||||||
base::FilePath GetResourcesDir() {
|
base::FilePath GetResourcesDir() {
|
||||||
return util_mac::GetFrameworkResourcesDirectory();
|
return util_mac::GetFrameworkResourcesDirectory();
|
||||||
@ -183,7 +183,7 @@ base::FilePath GetDefaultLogFilePath() {
|
|||||||
.Append(FILE_PATH_LITERAL(exe_name + "_debug.log"));
|
.Append(FILE_PATH_LITERAL(exe_name + "_debug.log"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // !defined(OS_MACOSX)
|
#else // !defined(OS_MAC)
|
||||||
|
|
||||||
base::FilePath GetResourcesDir() {
|
base::FilePath GetResourcesDir() {
|
||||||
base::FilePath pak_dir;
|
base::FilePath pak_dir;
|
||||||
@ -198,26 +198,26 @@ base::FilePath GetDefaultLogFilePath() {
|
|||||||
return log_path.Append(FILE_PATH_LITERAL("debug.log"));
|
return log_path.Append(FILE_PATH_LITERAL("debug.log"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !defined(OS_MACOSX)
|
#endif // !defined(OS_MAC)
|
||||||
|
|
||||||
void OverridePepperFlashSystemPluginPath() {
|
void OverridePepperFlashSystemPluginPath() {
|
||||||
#if defined(OS_WIN) || defined(OS_MACOSX)
|
#if defined(OS_WIN) || defined(OS_MAC)
|
||||||
base::FilePath plugin_filename;
|
base::FilePath plugin_filename;
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
if (!GetSystemFlashFilename(&plugin_filename))
|
if (!GetSystemFlashFilename(&plugin_filename))
|
||||||
return;
|
return;
|
||||||
#elif defined(OS_MACOSX)
|
#elif defined(OS_MAC)
|
||||||
if (!util_mac::GetLocalLibraryDirectory(&plugin_filename))
|
if (!util_mac::GetLocalLibraryDirectory(&plugin_filename))
|
||||||
return;
|
return;
|
||||||
plugin_filename = plugin_filename.Append(kPepperFlashSystemBaseDirectory)
|
plugin_filename = plugin_filename.Append(kPepperFlashSystemBaseDirectory)
|
||||||
.Append(chrome::kPepperFlashPluginFilename);
|
.Append(chrome::kPepperFlashPluginFilename);
|
||||||
#endif // defined(OS_MACOSX)
|
#endif // defined(OS_MAC)
|
||||||
|
|
||||||
if (!plugin_filename.empty()) {
|
if (!plugin_filename.empty()) {
|
||||||
base::PathService::Override(chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN,
|
base::PathService::Override(chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN,
|
||||||
plugin_filename);
|
plugin_filename);
|
||||||
}
|
}
|
||||||
#else // !(defined(OS_WIN) || defined(OS_MACOSX))
|
#else // !(defined(OS_WIN) || defined(OS_MAC))
|
||||||
// A system plugin is not available on other platforms.
|
// A system plugin is not available on other platforms.
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
// Copyright 2018 The Chromium Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#include "libcef/common/service_manifests/cef_content_browser_overlay_manifest.h"
|
|
||||||
|
|
||||||
#include "base/command_line.h"
|
|
||||||
#include "base/no_destructor.h"
|
|
||||||
#include "build/build_config.h"
|
|
||||||
#include "components/metrics/public/mojom/call_stack_profile_collector.mojom.h"
|
|
||||||
#include "extensions/buildflags/buildflags.h"
|
|
||||||
#include "services/service_manager/public/cpp/manifest_builder.h"
|
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
#include "chrome/common/conflicts/module_event_sink_win.mojom.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const service_manager::Manifest& GetCefContentBrowserOverlayManifest() {
|
|
||||||
static base::NoDestructor<service_manager::Manifest> manifest {
|
|
||||||
service_manager::ManifestBuilder()
|
|
||||||
.ExposeCapability("gpu",
|
|
||||||
service_manager::Manifest::InterfaceList<
|
|
||||||
metrics::mojom::CallStackProfileCollector>())
|
|
||||||
.ExposeCapability("renderer",
|
|
||||||
service_manager::Manifest::InterfaceList<
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
mojom::ModuleEventSink,
|
|
||||||
#endif
|
|
||||||
metrics::mojom::CallStackProfileCollector>())
|
|
||||||
.RequireCapability("chrome_printing", "converter")
|
|
||||||
.Build()
|
|
||||||
};
|
|
||||||
return *manifest;
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
// Copyright 2018 The Chromium Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef CEF_LIBCEF_COMMON_SERVICE_MANIFESTS_CEF_CONTENT_BROWSER_OVERLAY_MANIFEST_H_
|
|
||||||
#define CEF_LIBCEF_COMMON_SERVICE_MANIFESTS_CEF_CONTENT_BROWSER_OVERLAY_MANIFEST_H_
|
|
||||||
|
|
||||||
#include "services/service_manager/public/cpp/manifest.h"
|
|
||||||
|
|
||||||
// Returns the Manifest CEF amends to Content's content_browser service
|
|
||||||
// manifest. This allows CEF to extend the capabilities exposed and/or
|
|
||||||
// required by content_browser service instances, as well as declaring any
|
|
||||||
// additional in- and out-of-process per-profile packaged services.
|
|
||||||
const service_manager::Manifest& GetCefContentBrowserOverlayManifest();
|
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_COMMON_SERVICE_MANIFESTS_CEF_CONTENT_BROWSER_OVERLAY_MANIFEST_H_
|
|
@ -7,7 +7,6 @@
|
|||||||
#include "libcef/common/app_manager.h"
|
#include "libcef/common/app_manager.h"
|
||||||
#include "libcef/common/task_runner_impl.h"
|
#include "libcef/common/task_runner_impl.h"
|
||||||
#include "libcef/features/runtime_checks.h"
|
#include "libcef/features/runtime_checks.h"
|
||||||
#include "libcef/renderer/render_urlrequest_impl.h"
|
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/notreached.h"
|
#include "base/notreached.h"
|
||||||
@ -39,13 +38,6 @@ CefRefPtr<CefURLRequest> CefURLRequest::Create(
|
|||||||
if (impl->Start())
|
if (impl->Start())
|
||||||
return impl.get();
|
return impl.get();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
} else if (content_client->renderer()) {
|
|
||||||
// In the render process.
|
|
||||||
CefRefPtr<CefRenderURLRequest> impl =
|
|
||||||
new CefRenderURLRequest(nullptr, request, client);
|
|
||||||
if (impl->Start())
|
|
||||||
return impl.get();
|
|
||||||
return nullptr;
|
|
||||||
} else {
|
} else {
|
||||||
NOTREACHED() << "called in unsupported process";
|
NOTREACHED() << "called in unsupported process";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
#include "media/cdm/cdm_host_file.h"
|
#include "media/cdm/cdm_host_file.h"
|
||||||
#include "media/cdm/supported_cdm_versions.h"
|
#include "media/cdm/supported_cdm_versions.h"
|
||||||
|
#include "sandbox/policy/switches.h"
|
||||||
#include "services/service_manager/embedder/switches.h"
|
#include "services/service_manager/embedder/switches.h"
|
||||||
#include "services/service_manager/sandbox/switches.h"
|
|
||||||
#include "third_party/widevine/cdm/widevine_cdm_common.h" // nogncheck
|
#include "third_party/widevine/cdm/widevine_cdm_common.h" // nogncheck
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -38,7 +38,7 @@ base::LazyInstance<CefWidevineLoader>::Leaky g_widevine_loader =
|
|||||||
|
|
||||||
// Name of the Widevine CDM OS in the component manifest.
|
// Name of the Widevine CDM OS in the component manifest.
|
||||||
const char kWidevineCdmOs[] =
|
const char kWidevineCdmOs[] =
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
"mac";
|
"mac";
|
||||||
#elif defined(OS_WIN)
|
#elif defined(OS_WIN)
|
||||||
"win";
|
"win";
|
||||||
@ -473,7 +473,7 @@ void CefWidevineLoader::AddContentDecryptionModules(
|
|||||||
// load all plugins before initializing the sandbox.
|
// load all plugins before initializing the sandbox.
|
||||||
if (command_line.GetSwitchValueASCII(switches::kProcessType) !=
|
if (command_line.GetSwitchValueASCII(switches::kProcessType) !=
|
||||||
service_manager::switches::kZygoteProcess ||
|
service_manager::switches::kZygoteProcess ||
|
||||||
command_line.HasSwitch(service_manager::switches::kNoSandbox)) {
|
command_line.HasSwitch(sandbox::policy::switches::kNoSandbox)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@
|
|||||||
#include "third_party/blink/public/web/web_view.h"
|
#include "third_party/blink/public/web/web_view.h"
|
||||||
#include "ui/base/l10n/l10n_util.h"
|
#include "ui/base/l10n/l10n_util.h"
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
#include "base/mac/mac_util.h"
|
#include "base/mac/mac_util.h"
|
||||||
#include "base/strings/sys_string_conversions.h"
|
#include "base/strings/sys_string_conversions.h"
|
||||||
#endif
|
#endif
|
||||||
@ -359,7 +359,7 @@ void AlloyContentRendererClient::RunSingleProcessCleanup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AlloyContentRendererClient::PostIOThreadCreated(
|
void AlloyContentRendererClient::PostIOThreadCreated(
|
||||||
base::SingleThreadTaskRunner*) {
|
base::SingleThreadTaskRunner*) {
|
||||||
// TODO(cef): Enable these once the implementation supports it.
|
// TODO(cef): Enable these once the implementation supports it.
|
||||||
blink::WebRuntimeFeatures::EnableNotifications(false);
|
blink::WebRuntimeFeatures::EnableNotifications(false);
|
||||||
blink::WebRuntimeFeatures::EnablePushMessaging(false);
|
blink::WebRuntimeFeatures::EnablePushMessaging(false);
|
||||||
@ -390,10 +390,10 @@ void AlloyContentRendererClient::RenderThreadStarted() {
|
|||||||
if (content::RenderProcessHost::run_renderer_in_process()) {
|
if (content::RenderProcessHost::run_renderer_in_process()) {
|
||||||
// When running in single-process mode register as a destruction observer
|
// When running in single-process mode register as a destruction observer
|
||||||
// on the render thread's MessageLoop.
|
// on the render thread's MessageLoop.
|
||||||
base::MessageLoopCurrent::Get()->AddDestructionObserver(this);
|
base::CurrentThread::Get()->AddDestructionObserver(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
{
|
{
|
||||||
base::ScopedCFTypeRef<CFStringRef> key(
|
base::ScopedCFTypeRef<CFStringRef> key(
|
||||||
base::SysUTF8ToCFStringRef("NSScrollViewRubberbanding"));
|
base::SysUTF8ToCFStringRef("NSScrollViewRubberbanding"));
|
||||||
@ -408,7 +408,7 @@ void AlloyContentRendererClient::RenderThreadStarted() {
|
|||||||
CFPreferencesSetAppValue(key, value, kCFPreferencesCurrentApplication);
|
CFPreferencesSetAppValue(key, value, kCFPreferencesCurrentApplication);
|
||||||
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
|
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
|
||||||
}
|
}
|
||||||
#endif // defined(OS_MACOSX)
|
#endif // defined(OS_MAC)
|
||||||
|
|
||||||
if (extensions::PdfExtensionEnabled()) {
|
if (extensions::PdfExtensionEnabled()) {
|
||||||
pdf_print_client_.reset(new ChromePDFPrintClient());
|
pdf_print_client_.reset(new ChromePDFPrintClient());
|
||||||
@ -749,7 +749,7 @@ CefRefPtr<CefBrowserImpl> AlloyContentRendererClient::MaybeCreateBrowser(
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MAC)
|
||||||
// FIXME: It would be better if this API would be a callback from the
|
// FIXME: It would be better if this API would be a callback from the
|
||||||
// WebKit layer, or if it would be exposed as an WebView instance method; the
|
// WebKit layer, or if it would be exposed as an WebView instance method; the
|
||||||
// current implementation uses a static variable, and WebKit needs to be
|
// current implementation uses a static variable, and WebKit needs to be
|
||||||
|
@ -16,9 +16,9 @@
|
|||||||
#include "libcef/renderer/browser_impl.h"
|
#include "libcef/renderer/browser_impl.h"
|
||||||
|
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "base/message_loop/message_loop_current.h"
|
|
||||||
#include "base/optional.h"
|
#include "base/optional.h"
|
||||||
#include "base/sequenced_task_runner.h"
|
#include "base/sequenced_task_runner.h"
|
||||||
|
#include "base/task/current_thread.h"
|
||||||
#include "chrome/common/plugin.mojom.h"
|
#include "chrome/common/plugin.mojom.h"
|
||||||
#include "content/public/renderer/content_renderer_client.h"
|
#include "content/public/renderer/content_renderer_client.h"
|
||||||
#include "content/public/renderer/render_thread.h"
|
#include "content/public/renderer/render_thread.h"
|
||||||
@ -52,7 +52,7 @@ class SpellCheck;
|
|||||||
class AlloyContentRendererClient
|
class AlloyContentRendererClient
|
||||||
: public content::ContentRendererClient,
|
: public content::ContentRendererClient,
|
||||||
public service_manager::LocalInterfaceProvider,
|
public service_manager::LocalInterfaceProvider,
|
||||||
public base::MessageLoopCurrent::DestructionObserver {
|
public base::CurrentThread::DestructionObserver {
|
||||||
public:
|
public:
|
||||||
AlloyContentRendererClient();
|
AlloyContentRendererClient();
|
||||||
~AlloyContentRendererClient() override;
|
~AlloyContentRendererClient() override;
|
||||||
|
@ -13,11 +13,8 @@
|
|||||||
#include "third_party/blink/public/web/web_node.h"
|
#include "third_party/blink/public/web/web_node.h"
|
||||||
#include "third_party/blink/public/web/web_view_client.h"
|
#include "third_party/blink/public/web/web_view_client.h"
|
||||||
|
|
||||||
#include "third_party/blink/renderer/bindings/core/v8/referrer_script_info.h"
|
|
||||||
#include "third_party/blink/renderer/bindings/core/v8/script_controller.h"
|
|
||||||
#include "third_party/blink/renderer/bindings/core/v8/script_source_code.h"
|
#include "third_party/blink/renderer/bindings/core/v8/script_source_code.h"
|
||||||
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
|
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
|
||||||
#include "third_party/blink/renderer/bindings/core/v8/v8_code_cache.h"
|
|
||||||
#include "third_party/blink/renderer/core/dom/document.h"
|
#include "third_party/blink/renderer/core/dom/document.h"
|
||||||
#include "third_party/blink/renderer/core/dom/element.h"
|
#include "third_party/blink/renderer/core/dom/element.h"
|
||||||
#include "third_party/blink/renderer/core/dom/node.h"
|
#include "third_party/blink/renderer/core/dom/node.h"
|
||||||
@ -31,6 +28,7 @@
|
|||||||
#include "third_party/blink/renderer/platform/bindings/script_forbidden_scope.h"
|
#include "third_party/blink/renderer/platform/bindings/script_forbidden_scope.h"
|
||||||
#include "third_party/blink/renderer/platform/bindings/v8_binding.h"
|
#include "third_party/blink/renderer/platform/bindings/v8_binding.h"
|
||||||
#include "third_party/blink/renderer/platform/loader/fetch/resource_response.h"
|
#include "third_party/blink/renderer/platform/loader/fetch/resource_response.h"
|
||||||
|
#include "third_party/blink/renderer/platform/loader/fetch/script_fetch_options.h"
|
||||||
#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h"
|
#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h"
|
||||||
#undef LOG
|
#undef LOG
|
||||||
|
|
||||||
@ -179,13 +177,6 @@ v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
|
|||||||
if (start_line < 1)
|
if (start_line < 1)
|
||||||
start_line = 1;
|
start_line = 1;
|
||||||
|
|
||||||
const blink::ScriptSourceCode ssc = blink::ScriptSourceCode(
|
|
||||||
source, blink::ScriptSourceLocationType::kInternal,
|
|
||||||
nullptr, /* cache_handler */
|
|
||||||
blink::KURL(source_url),
|
|
||||||
WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line),
|
|
||||||
WTF::OrdinalNumber::FromZeroBasedInt(0)));
|
|
||||||
|
|
||||||
v8::MaybeLocal<v8::Value> result;
|
v8::MaybeLocal<v8::Value> result;
|
||||||
|
|
||||||
blink::LocalFrame* frame = blink::ToLocalFrameIfNotDetached(context);
|
blink::LocalFrame* frame = blink::ToLocalFrameIfNotDetached(context);
|
||||||
@ -193,35 +184,25 @@ v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
blink::V8CacheOptions v8CacheOptions(blink::kV8CacheOptionsDefault);
|
blink::V8CacheOptions v8CacheOptions(blink::kV8CacheOptionsDefault);
|
||||||
if (frame && frame->GetSettings())
|
if (const blink::Settings* settings = frame->GetSettings())
|
||||||
v8CacheOptions = frame->GetSettings()->GetV8CacheOptions();
|
v8CacheOptions = settings->GetV8CacheOptions();
|
||||||
|
|
||||||
// Based on V8ScriptRunner::CompileAndRunInternalScript:
|
const blink::ScriptSourceCode ssc = blink::ScriptSourceCode(
|
||||||
v8::ScriptCompiler::CompileOptions compile_options;
|
source, blink::ScriptSourceLocationType::kInternal,
|
||||||
blink::V8CodeCache::ProduceCacheOptions produce_cache_options;
|
nullptr, /* cache_handler */
|
||||||
v8::ScriptCompiler::NoCacheReason no_cache_reason;
|
blink::KURL(source_url),
|
||||||
std::tie(compile_options, produce_cache_options, no_cache_reason) =
|
WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line),
|
||||||
blink::V8CodeCache::GetCompileOptions(v8CacheOptions, ssc);
|
WTF::OrdinalNumber::FromZeroBasedInt(0)));
|
||||||
|
|
||||||
// Currently internal scripts don't have cache handlers, so we should not
|
result = blink::V8ScriptRunner::CompileAndRunScript(
|
||||||
// produce cache for them.
|
isolate, blink::ScriptState::From(context), frame->DomWindow(), ssc,
|
||||||
DCHECK_EQ(produce_cache_options,
|
ssc.Url(), sanitizeScriptErrors, blink::ScriptFetchOptions(),
|
||||||
blink::V8CodeCache::ProduceCacheOptions::kNoProduceCache);
|
v8CacheOptions);
|
||||||
|
if (result.IsEmpty()) {
|
||||||
v8::Local<v8::Script> script;
|
|
||||||
// Use default ReferrerScriptInfo here:
|
|
||||||
// - nonce: empty for internal script, and
|
|
||||||
// - parser_state: always "not parser inserted" for internal scripts.
|
|
||||||
if (!blink::V8ScriptRunner::CompileScript(
|
|
||||||
blink::ScriptState::From(context), ssc, sanitizeScriptErrors,
|
|
||||||
compile_options, no_cache_reason, blink::ReferrerScriptInfo())
|
|
||||||
.ToLocal(&script)) {
|
|
||||||
DCHECK(tryCatch.HasCaught());
|
DCHECK(tryCatch.HasCaught());
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return blink::V8ScriptRunner::RunCompiledScript(
|
return result;
|
||||||
isolate, script, blink::ToExecutionContext(context));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsScriptForbidden() {
|
bool IsScriptForbidden() {
|
||||||
|
@ -76,7 +76,7 @@ void CefRenderFrameObserver::DidFinishLoad() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefRenderFrameObserver::FrameDetached() {
|
void CefRenderFrameObserver::WillDetach() {
|
||||||
if (frame_) {
|
if (frame_) {
|
||||||
frame_->OnDetached();
|
frame_->OnDetached();
|
||||||
frame_ = nullptr;
|
frame_ = nullptr;
|
||||||
|
@ -31,7 +31,7 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
|
|||||||
void DidCommitProvisionalLoad(ui::PageTransition transition) override;
|
void DidCommitProvisionalLoad(ui::PageTransition transition) override;
|
||||||
void DidFailProvisionalLoad() override;
|
void DidFailProvisionalLoad() override;
|
||||||
void DidFinishLoad() override;
|
void DidFinishLoad() override;
|
||||||
void FrameDetached() override;
|
void WillDetach() override;
|
||||||
void FocusedElementChanged(const blink::WebElement& element) override;
|
void FocusedElementChanged(const blink::WebElement& element) override;
|
||||||
void DraggableRegionsChanged() override;
|
void DraggableRegionsChanged() override;
|
||||||
void DidCreateScriptContext(v8::Handle<v8::Context> context,
|
void DidCreateScriptContext(v8::Handle<v8::Context> context,
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "libcef/common/app_manager.h"
|
|
||||||
#include "libcef/common/request_impl.h"
|
#include "libcef/common/request_impl.h"
|
||||||
#include "libcef/common/response_impl.h"
|
#include "libcef/common/response_impl.h"
|
||||||
#include "libcef/common/task_runner_impl.h"
|
#include "libcef/common/task_runner_impl.h"
|
||||||
@ -155,8 +154,8 @@ class CefRenderURLRequest::Context
|
|||||||
factory = static_cast<CefFrameImpl*>(frame_.get())->GetURLLoaderFactory();
|
factory = static_cast<CefFrameImpl*>(frame_.get())->GetURLLoaderFactory();
|
||||||
}
|
}
|
||||||
if (!factory) {
|
if (!factory) {
|
||||||
// This factory only supports unintercepted http(s) and blob requests.
|
// Global requests are not supported.
|
||||||
factory = CefAppManager::Get()->GetDefaultURLLoaderFactory();
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
loader_ = factory->CreateURLLoader(
|
loader_ = factory->CreateURLLoader(
|
||||||
@ -446,6 +445,9 @@ CefRenderURLRequest::CefRenderURLRequest(
|
|||||||
CefRefPtr<CefFrame> frame,
|
CefRefPtr<CefFrame> frame,
|
||||||
CefRefPtr<CefRequest> request,
|
CefRefPtr<CefRequest> request,
|
||||||
CefRefPtr<CefURLRequestClient> client) {
|
CefRefPtr<CefURLRequestClient> client) {
|
||||||
|
DCHECK(frame);
|
||||||
|
DCHECK(request);
|
||||||
|
DCHECK(client);
|
||||||
context_ = new Context(this, frame, request, client);
|
context_ = new Context(this, frame, request, client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
# Append platform specific sources to a list of sources.
|
# Append platform specific sources to a list of sources.
|
||||||
macro(LIBCEF_APPEND_PLATFORM_SOURCES name_of_list)
|
macro(LIBCEF_APPEND_PLATFORM_SOURCES name_of_list)
|
||||||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND ${name_of_list}_MACOSX)
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND ${name_of_list}_MAC)
|
||||||
list(APPEND ${name_of_list} ${${name_of_list}_MACOSX})
|
list(APPEND ${name_of_list} ${${name_of_list}_MAC})
|
||||||
endif()
|
endif()
|
||||||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND ${name_of_list}_LINUX)
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND ${name_of_list}_LINUX)
|
||||||
list(APPEND ${name_of_list} ${${name_of_list}_LINUX})
|
list(APPEND ${name_of_list} ${${name_of_list}_LINUX})
|
||||||
@ -28,16 +28,16 @@ set(CEF_TARGET libcef_dll_wrapper)
|
|||||||
'includes_capi',
|
'includes_capi',
|
||||||
'autogen_capi_includes',
|
'autogen_capi_includes',
|
||||||
'includes_wrapper',
|
'includes_wrapper',
|
||||||
'includes_wrapper_mac:MACOSX',
|
'includes_wrapper_mac:MAC',
|
||||||
'includes_win:WINDOWS',
|
'includes_win:WINDOWS',
|
||||||
'includes_win_capi:WINDOWS',
|
'includes_win_capi:WINDOWS',
|
||||||
'includes_mac:MACOSX',
|
'includes_mac:MAC',
|
||||||
'includes_mac_capi:MACOSX',
|
'includes_mac_capi:MAC',
|
||||||
'includes_linux:LINUX',
|
'includes_linux:LINUX',
|
||||||
'includes_linux_capi:LINUX',
|
'includes_linux_capi:LINUX',
|
||||||
'libcef_dll_wrapper_sources_base',
|
'libcef_dll_wrapper_sources_base',
|
||||||
'libcef_dll_wrapper_sources_common',
|
'libcef_dll_wrapper_sources_common',
|
||||||
'libcef_dll_wrapper_sources_mac:MACOSX',
|
'libcef_dll_wrapper_sources_mac:MAC',
|
||||||
'autogen_client_side',
|
'autogen_client_side',
|
||||||
],
|
],
|
||||||
}}
|
}}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user