mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
47 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
6e3c9897be | ||
|
ee4b49f311 | ||
|
e6986dc677 | ||
|
ce74f0ae4d | ||
|
1349b984d6 | ||
|
7066a12d6c | ||
|
910fb6660c | ||
|
4ee985843a | ||
|
4a68f1d9a9 | ||
|
609d052db8 | ||
|
46cf800269 | ||
|
279bc57c96 | ||
|
06d2880eee | ||
|
3886f7b506 | ||
|
9f41a27e58 | ||
|
7fff3bcad5 | ||
|
cd5995a440 | ||
|
0b6ec33751 | ||
|
7d9deeb6c5 | ||
|
84a2c2fa61 | ||
|
2e04182b7a | ||
|
ce7d9bebe8 | ||
|
18b362b338 | ||
|
efe3cde8be | ||
|
24ac0330f0 | ||
|
52d535a6dc | ||
|
4a3a9c8c35 | ||
|
cb793a1d9b | ||
|
cbcbd02638 | ||
|
1501768614 | ||
|
b44050d390 | ||
|
9f2a283cc9 | ||
|
423acfd9cb | ||
|
b2db564afc | ||
|
7a532c9b6e | ||
|
c0c7488bf5 | ||
|
541f09ac97 | ||
|
190967c2df | ||
|
88e5b66c72 | ||
|
6ff4ecd838 | ||
|
73f7604770 | ||
|
53161165eb | ||
|
59d1f014f7 | ||
|
db143a5688 | ||
|
68189dc459 | ||
|
05fabff29b | ||
|
2e1b9ce37f |
60
BUILD.gn
60
BUILD.gn
@@ -168,45 +168,14 @@ if (is_mac) {
|
||||
#
|
||||
|
||||
if (is_mac) {
|
||||
cef_commit_number = exec_script(
|
||||
"//cef/tools/commit_number.py",
|
||||
[ rebase_path("//cef", root_build_dir) ],
|
||||
"trim string", [])
|
||||
|
||||
cef_version_file = "//cef/VERSION.in"
|
||||
|
||||
# The tweak_info_plist.py script requires a version number with 4 parts. CEF
|
||||
# uses a version number with 3 parts so just set the last part to 0.
|
||||
cef_plist_version = exec_script(
|
||||
"//build/util/version.py",
|
||||
[
|
||||
"-f",
|
||||
rebase_path(cef_version_file, root_build_dir),
|
||||
"-f",
|
||||
rebase_path(chrome_version_file, root_build_dir),
|
||||
"-t",
|
||||
"@CEF_MAJOR@.@BUILD@.${cef_commit_number}.0",
|
||||
],
|
||||
"trim string",
|
||||
[ cef_version_file, chrome_version_file ])
|
||||
"//cef/tools/cef_version.py", [ "plist" ], "trim string", [])
|
||||
|
||||
# Need to be creative to match dylib version formatting requirements.
|
||||
cef_dylib_version = exec_script(
|
||||
"//build/util/version.py",
|
||||
[
|
||||
"-f",
|
||||
rebase_path(cef_version_file, root_build_dir),
|
||||
"-f",
|
||||
rebase_path(chrome_version_file, root_build_dir),
|
||||
"-t",
|
||||
"@CEF_MAJOR@${cef_commit_number}.@BUILD_HI@.@BUILD_LO@",
|
||||
"-e",
|
||||
"BUILD_HI=int(BUILD)/256",
|
||||
"-e",
|
||||
"BUILD_LO=int(BUILD)%256",
|
||||
],
|
||||
"trim string",
|
||||
[ cef_version_file, chrome_version_file ])
|
||||
"//cef/tools/cef_version.py", [ "dylib" ], "trim string", [])
|
||||
}
|
||||
|
||||
# Read file lists from gypi files. The gypi_to_gn.py script does not support
|
||||
@@ -285,6 +254,10 @@ if (is_win) {
|
||||
static_library("libcef_static") {
|
||||
sources = gypi_paths2.includes_common +
|
||||
gypi_paths.autogen_cpp_includes + [
|
||||
"libcef/browser/audio_mirror_destination.cc",
|
||||
"libcef/browser/audio_mirror_destination.h",
|
||||
"libcef/browser/audio_push_sink.cc",
|
||||
"libcef/browser/audio_push_sink.h",
|
||||
"libcef/browser/browser_context.cc",
|
||||
"libcef/browser/browser_context.h",
|
||||
"libcef/browser/browser_context_impl.cc",
|
||||
@@ -327,10 +300,12 @@ static_library("libcef_static") {
|
||||
"libcef/browser/context_menu_params_impl.h",
|
||||
"libcef/browser/cookie_manager_impl.cc",
|
||||
"libcef/browser/cookie_manager_impl.h",
|
||||
"libcef/browser/devtools_frontend.cc",
|
||||
"libcef/browser/devtools_frontend.h",
|
||||
"libcef/browser/devtools_manager_delegate.cc",
|
||||
"libcef/browser/devtools_manager_delegate.h",
|
||||
"libcef/browser/devtools/devtools_file_manager.cc",
|
||||
"libcef/browser/devtools/devtools_file_manager.h",
|
||||
"libcef/browser/devtools/devtools_frontend.cc",
|
||||
"libcef/browser/devtools/devtools_frontend.h",
|
||||
"libcef/browser/devtools/devtools_manager_delegate.cc",
|
||||
"libcef/browser/devtools/devtools_manager_delegate.h",
|
||||
"libcef/browser/download_item_impl.cc",
|
||||
"libcef/browser/download_item_impl.h",
|
||||
"libcef/browser/download_manager_delegate.cc",
|
||||
@@ -443,6 +418,8 @@ static_library("libcef_static") {
|
||||
"libcef/browser/origin_whitelist_impl.h",
|
||||
"libcef/browser/osr/browser_platform_delegate_osr.cc",
|
||||
"libcef/browser/osr/browser_platform_delegate_osr.h",
|
||||
"libcef/browser/osr/motion_event_osr.cc",
|
||||
"libcef/browser/osr/motion_event_osr.h",
|
||||
"libcef/browser/osr/osr_accessibility_util.cc",
|
||||
"libcef/browser/osr/osr_accessibility_util.h",
|
||||
"libcef/browser/osr/osr_util.cc",
|
||||
@@ -1995,6 +1972,7 @@ if (is_mac) {
|
||||
"gtk+-2.0",
|
||||
"gthread-2.0",
|
||||
"gtk+-unix-print-2.0",
|
||||
"xi",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2091,7 +2069,13 @@ if (is_mac) {
|
||||
]
|
||||
}
|
||||
|
||||
if (!is_component_build) {
|
||||
if (is_component_build) {
|
||||
if (use_allocator=="tcmalloc") {
|
||||
# Link to base to initialize tcmalloc allocator shims, otherwise
|
||||
# base::allocator::IsAllocatorInitialized check fails
|
||||
deps += [ "//base" ]
|
||||
}
|
||||
} else {
|
||||
# Set rpath to find our own libfreetype even in a non-component build.
|
||||
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
|
||||
}
|
||||
|
@@ -7,5 +7,5 @@
|
||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
|
||||
{
|
||||
'chromium_checkout': 'refs/tags/73.0.3683.0'
|
||||
'chromium_checkout': 'refs/tags/73.0.3683.75'
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
# by hand. See the translator.README.txt file in the tools directory for
|
||||
# more information.
|
||||
#
|
||||
# $hash=ebb10ec8232ea37044d01a4522248b5055f5c1fc$
|
||||
# $hash=61795daa573f965b6b94dea5b8220eeca37f62a0$
|
||||
#
|
||||
|
||||
{
|
||||
@@ -16,6 +16,7 @@
|
||||
'autogen_cpp_includes': [
|
||||
'include/cef_accessibility_handler.h',
|
||||
'include/cef_app.h',
|
||||
'include/cef_audio_handler.h',
|
||||
'include/cef_auth_callback.h',
|
||||
'include/cef_browser.h',
|
||||
'include/cef_browser_process_handler.h',
|
||||
@@ -107,6 +108,7 @@
|
||||
'autogen_capi_includes': [
|
||||
'include/capi/cef_accessibility_handler_capi.h',
|
||||
'include/capi/cef_app_capi.h',
|
||||
'include/capi/cef_audio_handler_capi.h',
|
||||
'include/capi/cef_auth_callback_capi.h',
|
||||
'include/capi/cef_browser_capi.h',
|
||||
'include/capi/cef_browser_process_handler_capi.h',
|
||||
@@ -200,6 +202,8 @@
|
||||
'libcef_dll/ctocpp/accessibility_handler_ctocpp.h',
|
||||
'libcef_dll/ctocpp/app_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/app_ctocpp.h',
|
||||
'libcef_dll/ctocpp/audio_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/audio_handler_ctocpp.h',
|
||||
'libcef_dll/cpptoc/auth_callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/auth_callback_cpptoc.h',
|
||||
'libcef_dll/cpptoc/before_download_callback_cpptoc.cc',
|
||||
@@ -482,6 +486,8 @@
|
||||
'libcef_dll/cpptoc/accessibility_handler_cpptoc.h',
|
||||
'libcef_dll/cpptoc/app_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/app_cpptoc.h',
|
||||
'libcef_dll/cpptoc/audio_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/audio_handler_cpptoc.h',
|
||||
'libcef_dll/ctocpp/auth_callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/auth_callback_ctocpp.h',
|
||||
'libcef_dll/ctocpp/before_download_callback_ctocpp.cc',
|
||||
|
@@ -34,6 +34,7 @@
|
||||
'include/base/internal/cef_lock_impl.h',
|
||||
'include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h',
|
||||
'include/base/internal/cef_thread_checker_impl.h',
|
||||
'include/cef_api_hash.h',
|
||||
'include/cef_base.h',
|
||||
'include/cef_version.h',
|
||||
'include/internal/cef_export.h',
|
||||
@@ -443,6 +444,7 @@
|
||||
'tests/cefsimple/simple_handler_linux.cc',
|
||||
],
|
||||
'ceftests_sources_common': [
|
||||
'tests/ceftests/audio_output_unittest.cc',
|
||||
'tests/ceftests/browser_info_map_unittest.cc',
|
||||
'tests/ceftests/command_line_unittest.cc',
|
||||
'tests/ceftests/cookie_unittest.cc',
|
||||
|
110
include/capi/cef_audio_handler_capi.h
Normal file
110
include/capi/cef_audio_handler_capi.h
Normal file
@@ -0,0 +1,110 @@
|
||||
// Copyright (c) 2019 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=0385a38b6761c5dec07bb89a95a007ad3c11bea6$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_browser_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Implement this structure to handle audio events All functions will be called
|
||||
// on the UI thread
|
||||
///
|
||||
typedef struct _cef_audio_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called when the stream identified by |audio_stream_id| has started.
|
||||
// |audio_stream_id| will uniquely identify the stream across all future
|
||||
// cef_audio_handler_t callbacks. OnAudioSteamStopped will always be called
|
||||
// after OnAudioStreamStarted; both functions may be called multiple times for
|
||||
// the same stream. |channels| is the number of channels, |channel_layout| is
|
||||
// the layout of the channels and |sample_rate| is the stream sample rate.
|
||||
// |frames_per_buffer| is the maximum number of frames that will occur in the
|
||||
// PCM packet passed to OnAudioStreamPacket.
|
||||
///
|
||||
void(CEF_CALLBACK* on_audio_stream_started)(
|
||||
struct _cef_audio_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
int audio_stream_id,
|
||||
int channels,
|
||||
cef_channel_layout_t channel_layout,
|
||||
int sample_rate,
|
||||
int frames_per_buffer);
|
||||
|
||||
///
|
||||
// Called when a PCM packet is received for the stream identified by
|
||||
// |audio_stream_id|. |data| is an array representing the raw PCM data as a
|
||||
// floating point type, i.e. 4-byte value(s). |frames| is the number of frames
|
||||
// in the PCM packet. |pts| is the presentation timestamp (in milliseconds
|
||||
// since the Unix Epoch) and represents the time at which the decompressed
|
||||
// packet should be presented to the user. Based on |frames| and the
|
||||
// |channel_layout| value passed to OnAudioStreamStarted you can calculate the
|
||||
// size of the |data| array in bytes.
|
||||
///
|
||||
void(CEF_CALLBACK* on_audio_stream_packet)(struct _cef_audio_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
int audio_stream_id,
|
||||
const float** data,
|
||||
int frames,
|
||||
int64 pts);
|
||||
|
||||
///
|
||||
// Called when the stream identified by |audio_stream_id| has stopped.
|
||||
// OnAudioSteamStopped will always be called after OnAudioStreamStarted; both
|
||||
// functions may be called multiple times for the same stream.
|
||||
///
|
||||
void(CEF_CALLBACK* on_audio_stream_stopped)(struct _cef_audio_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
int audio_stream_id);
|
||||
} cef_audio_handler_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=faac9d17d7efae3a72c4cc44474071027596c843$
|
||||
// $hash=15f23de47af54fa690b6c5810e3049f97ae2aabd$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
|
||||
@@ -617,6 +617,12 @@ typedef struct _cef_browser_host_t {
|
||||
int deltaX,
|
||||
int deltaY);
|
||||
|
||||
///
|
||||
// Send a touch event to the browser for a windowless browser.
|
||||
///
|
||||
void(CEF_CALLBACK* send_touch_event)(struct _cef_browser_host_t* self,
|
||||
const struct _cef_touch_event_t* event);
|
||||
|
||||
///
|
||||
// Send a focus event to the browser.
|
||||
///
|
||||
@@ -844,6 +850,18 @@ typedef struct _cef_browser_host_t {
|
||||
// cef_request_tContext::LoadExtension for details.
|
||||
///
|
||||
int(CEF_CALLBACK* is_background_host)(struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
// Set whether the browser's audio is muted.
|
||||
///
|
||||
void(CEF_CALLBACK* set_audio_muted)(struct _cef_browser_host_t* self,
|
||||
int mute);
|
||||
|
||||
///
|
||||
// Returns true (1) if the browser's audio is muted. This function can only
|
||||
// be called on the UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* is_audio_muted)(struct _cef_browser_host_t* self);
|
||||
} cef_browser_host_t;
|
||||
|
||||
///
|
||||
|
@@ -33,13 +33,14 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=318ad8428256c2ef980f2f594ace2469001e59bd$
|
||||
// $hash=485de431252b72e5516f3f7f16a8d6f416801dfd$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_audio_handler_capi.h"
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_context_menu_handler_capi.h"
|
||||
#include "include/capi/cef_dialog_handler_capi.h"
|
||||
@@ -69,6 +70,12 @@ typedef struct _cef_client_t {
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Return the handler for audio rendering events.
|
||||
///
|
||||
struct _cef_audio_handler_t*(CEF_CALLBACK* get_audio_handler)(
|
||||
struct _cef_client_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for context menus. If no handler is provided the default
|
||||
// implementation will be used.
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=cf5dc6f6d2c64d5dc706edd5adc5cf6c7c752750$
|
||||
// $hash=0640490eead86e5631e8db67f3a0de8b43c10640$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
|
||||
@@ -231,6 +231,17 @@ typedef struct _cef_render_handler_t {
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_string_t* selected_text,
|
||||
const cef_range_t* selected_range);
|
||||
|
||||
///
|
||||
// Called when an on-screen keyboard should be shown or hidden for the
|
||||
// specified |browser|. |input_mode| specifies what kind of keyboard should be
|
||||
// opened. If |input_mode| is CEF_TEXT_INPUT_MODE_NONE, any existing keyboard
|
||||
// for this browser should be hidden.
|
||||
///
|
||||
void(CEF_CALLBACK* on_virtual_keyboard_requested)(
|
||||
struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_text_input_mode_t input_mode);
|
||||
} cef_render_handler_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=f83c72ec43f10f19eba82d9d3c284cc436cdbd23$
|
||||
// $hash=1d4a363735a7274fb957905f47841c63301507f0$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
|
||||
@@ -66,56 +66,7 @@ typedef struct _cef_scheme_registrar_t {
|
||||
// Register a custom scheme. This function should not be called for the built-
|
||||
// in HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes.
|
||||
//
|
||||
// If |is_standard| is true (1) the scheme will be treated as a standard
|
||||
// scheme. Standard schemes are subject to URL canonicalization and parsing
|
||||
// rules as defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1
|
||||
// available at http://www.ietf.org/rfc/rfc1738.txt
|
||||
//
|
||||
// In particular, the syntax for standard scheme URLs must be of the form:
|
||||
// <pre>
|
||||
// [scheme]://[username]:[password]@[host]:[port]/[url-path]
|
||||
// </pre> Standard scheme URLs must have a host component that is a fully
|
||||
// qualified domain name as defined in Section 3.5 of RFC 1034 [13] and
|
||||
// Section 2.1 of RFC 1123. These URLs will be canonicalized to
|
||||
// "scheme://host/path" in the simplest case and
|
||||
// "scheme://username:password@host:port/path" in the most explicit case. For
|
||||
// example, "scheme:host/path" and "scheme:///host/path" will both be
|
||||
// canonicalized to "scheme://host/path". The origin of a standard scheme URL
|
||||
// is the combination of scheme, host and port (i.e., "scheme://host:port" in
|
||||
// the most explicit case).
|
||||
//
|
||||
// For non-standard scheme URLs only the "scheme:" component is parsed and
|
||||
// canonicalized. The remainder of the URL will be passed to the handler as-
|
||||
// is. For example, "scheme:///some%20text" will remain the same. Non-standard
|
||||
// scheme URLs cannot be used as a target for form submission.
|
||||
//
|
||||
// If |is_local| is true (1) the scheme will be treated with the same security
|
||||
// rules as those applied to "file" URLs. Normal pages cannot link to or
|
||||
// access local URLs. Also, by default, local URLs can only perform
|
||||
// XMLHttpRequest calls to the same URL (origin + path) that originated the
|
||||
// request. To allow XMLHttpRequest calls from a local URL to other URLs with
|
||||
// the same origin set the CefSettings.file_access_from_file_urls_allowed
|
||||
// value to true (1). To allow XMLHttpRequest calls from a local URL to all
|
||||
// origins set the CefSettings.universal_access_from_file_urls_allowed value
|
||||
// to true (1).
|
||||
//
|
||||
// If |is_display_isolated| is true (1) the scheme can only be displayed from
|
||||
// other content hosted with the same scheme. For example, pages in other
|
||||
// origins cannot create iframes or hyperlinks to URLs with the scheme. For
|
||||
// schemes that must be accessible from other schemes set this value to false
|
||||
// (0), set |is_cors_enabled| to true (1), and use CORS "Access-Control-Allow-
|
||||
// Origin" headers to further restrict access.
|
||||
//
|
||||
// If |is_secure| is true (1) the scheme will be treated with the same
|
||||
// security rules as those applied to "https" URLs. For example, loading this
|
||||
// scheme from other secure schemes will not trigger mixed content warnings.
|
||||
//
|
||||
// If |is_cors_enabled| is true (1) the scheme can be sent CORS requests. This
|
||||
// value should be true (1) in most cases where |is_standard| is true (1).
|
||||
//
|
||||
// If |is_csp_bypassing| is true (1) the scheme can bypass Content-Security-
|
||||
// Policy (CSP) checks. This value should be false (0) in most cases where
|
||||
// |is_standard| is true (1).
|
||||
// See cef_scheme_options_t for possible values for |options|.
|
||||
//
|
||||
// This function may be called on any thread. It should only be called once
|
||||
// per unique |scheme_name| value. If |scheme_name| is already registered or
|
||||
@@ -123,12 +74,7 @@ typedef struct _cef_scheme_registrar_t {
|
||||
///
|
||||
int(CEF_CALLBACK* add_custom_scheme)(struct _cef_scheme_registrar_t* self,
|
||||
const cef_string_t* scheme_name,
|
||||
int is_standard,
|
||||
int is_local,
|
||||
int is_display_isolated,
|
||||
int is_secure,
|
||||
int is_cors_enabled,
|
||||
int is_csp_bypassing);
|
||||
int options);
|
||||
} cef_scheme_registrar_t;
|
||||
|
||||
///
|
||||
|
76
include/cef_api_hash.h
Normal file
76
include/cef_api_hash.h
Normal file
@@ -0,0 +1,76 @@
|
||||
// Copyright (c) 2019 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=e35c4017e9fd0e6371e7abbcaf1b9498a33693f9$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_API_HASH_H_
|
||||
#define CEF_INCLUDE_API_HASH_H_
|
||||
|
||||
#include "include/internal/cef_export.h"
|
||||
|
||||
// The API hash is created by analyzing CEF header files for C API type
|
||||
// definitions. The hash value will change when header files are modified in a
|
||||
// way that may cause binary incompatibility with other builds. The universal
|
||||
// hash value will change if any platform is affected whereas the platform hash
|
||||
// values will change only if that particular platform is affected.
|
||||
#define CEF_API_HASH_UNIVERSAL "21bd75ba6765d8eac60d72b761dca4deeab6c2b8"
|
||||
#if defined(OS_WIN)
|
||||
#define CEF_API_HASH_PLATFORM "b312ae5d3d4346ffaa12ab66d55fe0b31dd719fe"
|
||||
#elif defined(OS_MACOSX)
|
||||
#define CEF_API_HASH_PLATFORM "0ea51921923a950b004c34289e3deaa454eadc58"
|
||||
#elif defined(OS_LINUX)
|
||||
#define CEF_API_HASH_PLATFORM "964b1ff8bc6acdf35d275112d03faa78b1f3556b"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Returns CEF API hashes for the libcef library. The returned string is owned
|
||||
// by the library and should not be freed. The |entry| parameter describes which
|
||||
// hash value will be returned:
|
||||
// 0 - CEF_API_HASH_PLATFORM
|
||||
// 1 - CEF_API_HASH_UNIVERSAL
|
||||
// 2 - CEF_COMMIT_HASH (from cef_version.h)
|
||||
///
|
||||
CEF_EXPORT const char* cef_api_hash(int entry);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif // CEF_INCLUDE_API_HASH_H_
|
98
include/cef_audio_handler.h
Normal file
98
include/cef_audio_handler.h
Normal file
@@ -0,0 +1,98 @@
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_AUDIO_HANDLER_H_
|
||||
#define CEF_INCLUDE_CEF_AUDIO_HANDLER_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_browser.h"
|
||||
|
||||
///
|
||||
// Implement this interface to handle audio events
|
||||
// All methods will be called on the UI thread
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefAudioHandler : public virtual CefBaseRefCounted {
|
||||
public:
|
||||
typedef cef_channel_layout_t ChannelLayout;
|
||||
|
||||
///
|
||||
// Called when the stream identified by |audio_stream_id| has started.
|
||||
// |audio_stream_id| will uniquely identify the stream across all future
|
||||
// CefAudioHandler callbacks. OnAudioSteamStopped will always be called after
|
||||
// OnAudioStreamStarted; both methods may be called multiple times for the
|
||||
// same stream. |channels| is the number of channels, |channel_layout| is the
|
||||
// layout of the channels and |sample_rate| is the stream sample rate.
|
||||
// |frames_per_buffer| is the maximum number of frames that will occur in the
|
||||
// PCM packet passed to OnAudioStreamPacket.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnAudioStreamStarted(CefRefPtr<CefBrowser> browser,
|
||||
int audio_stream_id,
|
||||
int channels,
|
||||
ChannelLayout channel_layout,
|
||||
int sample_rate,
|
||||
int frames_per_buffer) = 0;
|
||||
|
||||
///
|
||||
// Called when a PCM packet is received for the stream identified by
|
||||
// |audio_stream_id|. |data| is an array representing the raw PCM data as a
|
||||
// floating point type, i.e. 4-byte value(s). |frames| is the number of frames
|
||||
// in the PCM packet. |pts| is the presentation timestamp (in milliseconds
|
||||
// since the Unix Epoch) and represents the time at which the decompressed
|
||||
// packet should be presented to the user. Based on |frames| and the
|
||||
// |channel_layout| value passed to OnAudioStreamStarted you can calculate the
|
||||
// size of the |data| array in bytes.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnAudioStreamPacket(CefRefPtr<CefBrowser> browser,
|
||||
int audio_stream_id,
|
||||
const float** data,
|
||||
int frames,
|
||||
int64 pts) = 0;
|
||||
|
||||
///
|
||||
// Called when the stream identified by |audio_stream_id| has stopped.
|
||||
// OnAudioSteamStopped will always be called after OnAudioStreamStarted; both
|
||||
// methods may be called multiple times for the same stream.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnAudioStreamStopped(CefRefPtr<CefBrowser> browser,
|
||||
int audio_stream_id) = 0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_AUDIO_HANDLER_H_
|
@@ -638,6 +638,12 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
|
||||
int deltaX,
|
||||
int deltaY) = 0;
|
||||
|
||||
///
|
||||
// Send a touch event to the browser for a windowless browser.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SendTouchEvent(const CefTouchEvent& event) = 0;
|
||||
|
||||
///
|
||||
// Send a focus event to the browser.
|
||||
///
|
||||
@@ -865,6 +871,19 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsBackgroundHost() = 0;
|
||||
|
||||
///
|
||||
// Set whether the browser's audio is muted.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetAudioMuted(bool mute) = 0;
|
||||
|
||||
///
|
||||
// Returns true if the browser's audio is muted. This method can only be
|
||||
// called on the UI thread.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsAudioMuted() = 0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_BROWSER_H_
|
||||
|
@@ -38,6 +38,7 @@
|
||||
#define CEF_INCLUDE_CEF_CLIENT_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_audio_handler.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_context_menu_handler.h"
|
||||
#include "include/cef_dialog_handler.h"
|
||||
@@ -60,6 +61,12 @@
|
||||
/*--cef(source=client,no_debugct_check)--*/
|
||||
class CefClient : public virtual CefBaseRefCounted {
|
||||
public:
|
||||
///
|
||||
// Return the handler for audio rendering events.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefAudioHandler> GetAudioHandler() { return NULL; }
|
||||
|
||||
///
|
||||
// Return the handler for context menus. If no handler is provided the default
|
||||
// implementation will be used.
|
||||
|
@@ -57,6 +57,7 @@ class CefRenderHandler : public virtual CefBaseRefCounted {
|
||||
typedef cef_drag_operations_mask_t DragOperationsMask;
|
||||
typedef cef_paint_element_type_t PaintElementType;
|
||||
typedef std::vector<CefRect> RectList;
|
||||
typedef cef_text_input_mode_t TextInputMode;
|
||||
|
||||
///
|
||||
// Return the handler for accessibility notifications. If no handler is
|
||||
@@ -231,6 +232,16 @@ class CefRenderHandler : public virtual CefBaseRefCounted {
|
||||
virtual void OnTextSelectionChanged(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& selected_text,
|
||||
const CefRange& selected_range) {}
|
||||
|
||||
///
|
||||
// Called when an on-screen keyboard should be shown or hidden for the
|
||||
// specified |browser|. |input_mode| specifies what kind of keyboard
|
||||
// should be opened. If |input_mode| is CEF_TEXT_INPUT_MODE_NONE, any
|
||||
// existing keyboard for this browser should be hidden.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnVirtualKeyboardRequested(CefRefPtr<CefBrowser> browser,
|
||||
TextInputMode input_mode) {}
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_RENDER_HANDLER_H_
|
||||
|
@@ -86,69 +86,14 @@ class CefSchemeRegistrar : public CefBaseScoped {
|
||||
// Register a custom scheme. This method should not be called for the built-in
|
||||
// HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes.
|
||||
//
|
||||
// If |is_standard| is true the scheme will be treated as a standard scheme.
|
||||
// Standard schemes are subject to URL canonicalization and parsing rules as
|
||||
// defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1 available
|
||||
// at http://www.ietf.org/rfc/rfc1738.txt
|
||||
//
|
||||
// In particular, the syntax for standard scheme URLs must be of the form:
|
||||
// <pre>
|
||||
// [scheme]://[username]:[password]@[host]:[port]/[url-path]
|
||||
// </pre>
|
||||
// Standard scheme URLs must have a host component that is a fully qualified
|
||||
// domain name as defined in Section 3.5 of RFC 1034 [13] and Section 2.1 of
|
||||
// RFC 1123. These URLs will be canonicalized to "scheme://host/path" in the
|
||||
// simplest case and "scheme://username:password@host:port/path" in the most
|
||||
// explicit case. For example, "scheme:host/path" and "scheme:///host/path"
|
||||
// will both be canonicalized to "scheme://host/path". The origin of a
|
||||
// standard scheme URL is the combination of scheme, host and port (i.e.,
|
||||
// "scheme://host:port" in the most explicit case).
|
||||
//
|
||||
// For non-standard scheme URLs only the "scheme:" component is parsed and
|
||||
// canonicalized. The remainder of the URL will be passed to the handler
|
||||
// as-is. For example, "scheme:///some%20text" will remain the same.
|
||||
// Non-standard scheme URLs cannot be used as a target for form submission.
|
||||
//
|
||||
// If |is_local| is true the scheme will be treated with the same security
|
||||
// rules as those applied to "file" URLs. Normal pages cannot link to or
|
||||
// access local URLs. Also, by default, local URLs can only perform
|
||||
// XMLHttpRequest calls to the same URL (origin + path) that originated the
|
||||
// request. To allow XMLHttpRequest calls from a local URL to other URLs with
|
||||
// the same origin set the CefSettings.file_access_from_file_urls_allowed
|
||||
// value to true. To allow XMLHttpRequest calls from a local URL to all
|
||||
// origins set the CefSettings.universal_access_from_file_urls_allowed value
|
||||
// to true.
|
||||
//
|
||||
// If |is_display_isolated| is true the scheme can only be displayed from
|
||||
// other content hosted with the same scheme. For example, pages in other
|
||||
// origins cannot create iframes or hyperlinks to URLs with the scheme. For
|
||||
// schemes that must be accessible from other schemes set this value to false,
|
||||
// set |is_cors_enabled| to true, and use CORS "Access-Control-Allow-Origin"
|
||||
// headers to further restrict access.
|
||||
//
|
||||
// If |is_secure| is true the scheme will be treated with the same security
|
||||
// rules as those applied to "https" URLs. For example, loading this scheme
|
||||
// from other secure schemes will not trigger mixed content warnings.
|
||||
//
|
||||
// If |is_cors_enabled| is true the scheme can be sent CORS requests. This
|
||||
// value should be true in most cases where |is_standard| is true.
|
||||
//
|
||||
// If |is_csp_bypassing| is true the scheme can bypass Content-Security-Policy
|
||||
// (CSP) checks. This value should be false in most cases where |is_standard|
|
||||
// is true.
|
||||
// See cef_scheme_options_t for possible values for |options|.
|
||||
//
|
||||
// This function may be called on any thread. It should only be called once
|
||||
// per unique |scheme_name| value. If |scheme_name| is already registered or
|
||||
// if an error occurs this method will return false.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool AddCustomScheme(const CefString& scheme_name,
|
||||
bool is_standard,
|
||||
bool is_local,
|
||||
bool is_display_isolated,
|
||||
bool is_secure,
|
||||
bool is_cors_enabled,
|
||||
bool is_csp_bypassing) = 0;
|
||||
virtual bool AddCustomScheme(const CefString& scheme_name, int options) = 0;
|
||||
};
|
||||
|
||||
///
|
||||
|
@@ -71,11 +71,16 @@ struct CefWindowInfoTraits {
|
||||
typedef cef_window_info_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
static inline void clear(struct_type* s) {}
|
||||
|
||||
static inline void clear(struct_type* s) {
|
||||
cef_string_clear(&s->window_name);
|
||||
}
|
||||
|
||||
static inline void set(const struct_type* src,
|
||||
struct_type* target,
|
||||
bool copy) {
|
||||
cef_string_set(src->window_name.str, src->window_name.length,
|
||||
&target->window_name, copy);
|
||||
target->x = src->x;
|
||||
target->y = src->y;
|
||||
target->width = src->width;
|
||||
|
@@ -994,6 +994,25 @@ typedef enum {
|
||||
DRAG_OPERATION_EVERY = UINT_MAX
|
||||
} cef_drag_operations_mask_t;
|
||||
|
||||
///
|
||||
// Input mode of a virtual keyboard. These constants match their equivalents
|
||||
// in Chromium's text_input_mode.h and should not be renumbered.
|
||||
// See https://html.spec.whatwg.org/#input-modalities:-the-inputmode-attribute
|
||||
///
|
||||
typedef enum {
|
||||
CEF_TEXT_INPUT_MODE_DEFAULT,
|
||||
CEF_TEXT_INPUT_MODE_NONE,
|
||||
CEF_TEXT_INPUT_MODE_TEXT,
|
||||
CEF_TEXT_INPUT_MODE_TEL,
|
||||
CEF_TEXT_INPUT_MODE_URL,
|
||||
CEF_TEXT_INPUT_MODE_EMAIL,
|
||||
CEF_TEXT_INPUT_MODE_NUMERIC,
|
||||
CEF_TEXT_INPUT_MODE_DECIMAL,
|
||||
CEF_TEXT_INPUT_MODE_SEARCH,
|
||||
|
||||
CEF_TEXT_INPUT_MODE_MAX = CEF_TEXT_INPUT_MODE_SEARCH,
|
||||
} cef_text_input_mode_t;
|
||||
|
||||
///
|
||||
// V8 access control values.
|
||||
///
|
||||
@@ -1242,38 +1261,47 @@ typedef enum {
|
||||
// If set the request will fail if it cannot be served from the cache (or some
|
||||
// equivalent local store). Setting this value is equivalent to specifying the
|
||||
// "Cache-Control: only-if-cached" request header. Setting this value in
|
||||
// combination with UR_FLAG_SKIP_CACHE will cause the request to fail.
|
||||
// combination with UR_FLAG_SKIP_CACHE or UR_FLAG_DISABLE_CACHE will cause the
|
||||
// request to fail.
|
||||
///
|
||||
UR_FLAG_ONLY_FROM_CACHE = 1 << 1,
|
||||
|
||||
///
|
||||
// If set the cache will not be used at all. Setting this value is equivalent
|
||||
// to specifying the "Cache-Control: no-store" request header. Setting this
|
||||
// value in combination with UR_FLAG_ONLY_FROM_CACHE will cause the request to
|
||||
// fail.
|
||||
///
|
||||
UR_FLAG_DISABLE_CACHE = 1 << 2,
|
||||
|
||||
///
|
||||
// If set user name, password, and cookies may be sent with the request, and
|
||||
// cookies may be saved from the response.
|
||||
///
|
||||
UR_FLAG_ALLOW_STORED_CREDENTIALS = 1 << 2,
|
||||
UR_FLAG_ALLOW_STORED_CREDENTIALS = 1 << 3,
|
||||
|
||||
///
|
||||
// If set upload progress events will be generated when a request has a body.
|
||||
///
|
||||
UR_FLAG_REPORT_UPLOAD_PROGRESS = 1 << 3,
|
||||
UR_FLAG_REPORT_UPLOAD_PROGRESS = 1 << 4,
|
||||
|
||||
///
|
||||
// If set the CefURLRequestClient::OnDownloadData method will not be called.
|
||||
///
|
||||
UR_FLAG_NO_DOWNLOAD_DATA = 1 << 4,
|
||||
UR_FLAG_NO_DOWNLOAD_DATA = 1 << 5,
|
||||
|
||||
///
|
||||
// If set 5XX redirect errors will be propagated to the observer instead of
|
||||
// automatically re-tried. This currently only applies for requests
|
||||
// originated in the browser process.
|
||||
///
|
||||
UR_FLAG_NO_RETRY_ON_5XX = 1 << 5,
|
||||
UR_FLAG_NO_RETRY_ON_5XX = 1 << 6,
|
||||
|
||||
///
|
||||
// If set 3XX responses will cause the fetch to halt immediately rather than
|
||||
// continue through the redirect.
|
||||
///
|
||||
UR_FLAG_STOP_ON_REDIRECT = 1 << 6,
|
||||
UR_FLAG_STOP_ON_REDIRECT = 1 << 7,
|
||||
} cef_urlrequest_flags_t;
|
||||
|
||||
///
|
||||
@@ -1677,6 +1705,90 @@ typedef struct _cef_mouse_event_t {
|
||||
uint32 modifiers;
|
||||
} cef_mouse_event_t;
|
||||
|
||||
///
|
||||
// Touch points states types.
|
||||
///
|
||||
typedef enum {
|
||||
CEF_TET_RELEASED = 0,
|
||||
CEF_TET_PRESSED,
|
||||
CEF_TET_MOVED,
|
||||
CEF_TET_CANCELLED
|
||||
} cef_touch_event_type_t;
|
||||
|
||||
///
|
||||
// The device type that caused the event.
|
||||
///
|
||||
typedef enum {
|
||||
CEF_POINTER_TYPE_TOUCH = 0,
|
||||
CEF_POINTER_TYPE_MOUSE,
|
||||
CEF_POINTER_TYPE_PEN,
|
||||
CEF_POINTER_TYPE_ERASER,
|
||||
CEF_POINTER_TYPE_UNKNOWN
|
||||
} cef_pointer_type_t;
|
||||
|
||||
///
|
||||
// Structure representing touch event information.
|
||||
///
|
||||
typedef struct _cef_touch_event_t {
|
||||
///
|
||||
// Id of a touch point. Must be unique per touch, can be any number except -1.
|
||||
// Note that a maximum of 16 concurrent touches will be tracked; touches
|
||||
// beyond that will be ignored.
|
||||
///
|
||||
int id;
|
||||
|
||||
///
|
||||
// X coordinate relative to the left side of the view.
|
||||
///
|
||||
float x;
|
||||
|
||||
///
|
||||
// Y coordinate relative to the top side of the view.
|
||||
///
|
||||
float y;
|
||||
|
||||
///
|
||||
// X radius in pixels. Set to 0 if not applicable.
|
||||
///
|
||||
float radius_x;
|
||||
|
||||
///
|
||||
// Y radius in pixels. Set to 0 if not applicable.
|
||||
///
|
||||
float radius_y;
|
||||
|
||||
///
|
||||
// Rotation angle in radians. Set to 0 if not applicable.
|
||||
///
|
||||
float rotation_angle;
|
||||
|
||||
///
|
||||
// The normalized pressure of the pointer input in the range of [0,1].
|
||||
// Set to 0 if not applicable.
|
||||
///
|
||||
float pressure;
|
||||
|
||||
///
|
||||
// The state of the touch point. Touches begin with one CEF_TET_PRESSED event
|
||||
// followed by zero or more CEF_TET_MOVED events and finally one
|
||||
// CEF_TET_RELEASED or CEF_TET_CANCELLED event. Events not respecting this
|
||||
// order will be ignored.
|
||||
///
|
||||
cef_touch_event_type_t type;
|
||||
|
||||
///
|
||||
// Bit flags describing any pressed modifier keys. See
|
||||
// cef_event_flags_t for values.
|
||||
///
|
||||
uint32 modifiers;
|
||||
|
||||
///
|
||||
// The device type that caused the event.
|
||||
///
|
||||
cef_pointer_type_t pointer_type;
|
||||
|
||||
} cef_touch_event_t;
|
||||
|
||||
///
|
||||
// Paint element types.
|
||||
///
|
||||
@@ -2745,6 +2857,90 @@ typedef enum {
|
||||
SSL_CONTENT_RAN_INSECURE_CONTENT = 1 << 1,
|
||||
} cef_ssl_content_status_t;
|
||||
|
||||
//
|
||||
// Configuration options for registering a custom scheme.
|
||||
// These values are used when calling AddCustomScheme.
|
||||
//
|
||||
typedef enum {
|
||||
CEF_SCHEME_OPTION_NONE = 0,
|
||||
|
||||
///
|
||||
// If CEF_SCHEME_OPTION_STANDARD is set the scheme will be treated as a
|
||||
// standard scheme. Standard schemes are subject to URL canonicalization and
|
||||
// parsing rules as defined in the Common Internet Scheme Syntax RFC 1738
|
||||
// Section 3.1 available at http://www.ietf.org/rfc/rfc1738.txt
|
||||
//
|
||||
// In particular, the syntax for standard scheme URLs must be of the form:
|
||||
// <pre>
|
||||
// [scheme]://[username]:[password]@[host]:[port]/[url-path]
|
||||
// </pre> Standard scheme URLs must have a host component that is a fully
|
||||
// qualified domain name as defined in Section 3.5 of RFC 1034 [13] and
|
||||
// Section 2.1 of RFC 1123. These URLs will be canonicalized to
|
||||
// "scheme://host/path" in the simplest case and
|
||||
// "scheme://username:password@host:port/path" in the most explicit case. For
|
||||
// example, "scheme:host/path" and "scheme:///host/path" will both be
|
||||
// canonicalized to "scheme://host/path". The origin of a standard scheme URL
|
||||
// is the combination of scheme, host and port (i.e., "scheme://host:port" in
|
||||
// the most explicit case).
|
||||
//
|
||||
// For non-standard scheme URLs only the "scheme:" component is parsed and
|
||||
// canonicalized. The remainder of the URL will be passed to the handler as-
|
||||
// is. For example, "scheme:///some%20text" will remain the same. Non-standard
|
||||
// scheme URLs cannot be used as a target for form submission.
|
||||
///
|
||||
CEF_SCHEME_OPTION_STANDARD = 1 << 0,
|
||||
|
||||
///
|
||||
// If CEF_SCHEME_OPTION_LOCAL is set the scheme will be treated with the same
|
||||
// security rules as those applied to "file" URLs. Normal pages cannot link to
|
||||
// or access local URLs. Also, by default, local URLs can only perform
|
||||
// XMLHttpRequest calls to the same URL (origin + path) that originated the
|
||||
// request. To allow XMLHttpRequest calls from a local URL to other URLs with
|
||||
// the same origin set the CefSettings.file_access_from_file_urls_allowed
|
||||
// value to true (1). To allow XMLHttpRequest calls from a local URL to all
|
||||
// origins set the CefSettings.universal_access_from_file_urls_allowed value
|
||||
// to true (1).
|
||||
///
|
||||
CEF_SCHEME_OPTION_LOCAL = 1 << 1,
|
||||
|
||||
///
|
||||
// If CEF_SCHEME_OPTION_DISPLAY_ISOLATED is set the scheme can only be
|
||||
// displayed from other content hosted with the same scheme. For example,
|
||||
// pages in other origins cannot create iframes or hyperlinks to URLs with the
|
||||
// scheme. For schemes that must be accessible from other schemes don't set
|
||||
// this, set CEF_SCHEME_OPTION_CORS_ENABLED, and use CORS
|
||||
// "Access-Control-Allow-Origin" headers to further restrict access.
|
||||
///
|
||||
CEF_SCHEME_OPTION_DISPLAY_ISOLATED = 1 << 2,
|
||||
|
||||
///
|
||||
// If CEF_SCHEME_OPTION_SECURE is set the scheme will be treated with the same
|
||||
// security rules as those applied to "https" URLs. For example, loading this
|
||||
// scheme from other secure schemes will not trigger mixed content warnings.
|
||||
///
|
||||
CEF_SCHEME_OPTION_SECURE = 1 << 3,
|
||||
|
||||
///
|
||||
// If CEF_SCHEME_OPTION_CORS_ENABLED is set the scheme can be sent CORS
|
||||
// requests. This value should be set in most cases where
|
||||
// CEF_SCHEME_OPTION_STANDARD is set.
|
||||
///
|
||||
CEF_SCHEME_OPTION_CORS_ENABLED = 1 << 4,
|
||||
|
||||
///
|
||||
// If CEF_SCHEME_OPTION_CSP_BYPASSING is set the scheme can bypass Content-
|
||||
// Security-Policy (CSP) checks. This value should not be set in most cases
|
||||
// where CEF_SCHEME_OPTION_STANDARD is set.
|
||||
///
|
||||
CEF_SCHEME_OPTION_CSP_BYPASSING = 1 << 5,
|
||||
|
||||
///
|
||||
// If CEF_SCHEME_OPTION_FETCH_ENABLED is set the scheme can perform Fetch API
|
||||
// requests.
|
||||
///
|
||||
CEF_SCHEME_OPTION_FETCH_ENABLED = 1 << 6,
|
||||
} cef_scheme_options_t;
|
||||
|
||||
///
|
||||
// Error codes for CDM registration. See cef_web_plugin.h for details.
|
||||
///
|
||||
@@ -2797,6 +2993,117 @@ typedef struct _cef_composition_underline_t {
|
||||
int thick;
|
||||
} cef_composition_underline_t;
|
||||
|
||||
///
|
||||
// Enumerates the various representations of the ordering of audio channels.
|
||||
// Logged to UMA, so never reuse a value, always add new/greater ones!
|
||||
// See media\base\channel_layout.h
|
||||
///
|
||||
typedef enum {
|
||||
CEF_CHANNEL_LAYOUT_NONE = 0,
|
||||
CEF_CHANNEL_LAYOUT_UNSUPPORTED = 1,
|
||||
|
||||
// Front C
|
||||
CEF_CHANNEL_LAYOUT_MONO = 2,
|
||||
|
||||
// Front L, Front R
|
||||
CEF_CHANNEL_LAYOUT_STEREO = 3,
|
||||
|
||||
// Front L, Front R, Back C
|
||||
CEF_CHANNEL_LAYOUT_2_1 = 4,
|
||||
|
||||
// Front L, Front R, Front C
|
||||
CEF_CHANNEL_LAYOUT_SURROUND = 5,
|
||||
|
||||
// Front L, Front R, Front C, Back C
|
||||
CEF_CHANNEL_LAYOUT_4_0 = 6,
|
||||
|
||||
// Front L, Front R, Side L, Side R
|
||||
CEF_CHANNEL_LAYOUT_2_2 = 7,
|
||||
|
||||
// Front L, Front R, Back L, Back R
|
||||
CEF_CHANNEL_LAYOUT_QUAD = 8,
|
||||
|
||||
// Front L, Front R, Front C, Side L, Side R
|
||||
CEF_CHANNEL_LAYOUT_5_0 = 9,
|
||||
|
||||
// Front L, Front R, Front C, LFE, Side L, Side R
|
||||
CEF_CHANNEL_LAYOUT_5_1 = 10,
|
||||
|
||||
// Front L, Front R, Front C, Back L, Back R
|
||||
CEF_CHANNEL_LAYOUT_5_0_BACK = 11,
|
||||
|
||||
// Front L, Front R, Front C, LFE, Back L, Back R
|
||||
CEF_CHANNEL_LAYOUT_5_1_BACK = 12,
|
||||
|
||||
// Front L, Front R, Front C, Side L, Side R, Back L, Back R
|
||||
CEF_CHANNEL_LAYOUT_7_0 = 13,
|
||||
|
||||
// Front L, Front R, Front C, LFE, Side L, Side R, Back L, Back R
|
||||
CEF_CHANNEL_LAYOUT_7_1 = 14,
|
||||
|
||||
// Front L, Front R, Front C, LFE, Side L, Side R, Front LofC, Front RofC
|
||||
CEF_CHANNEL_LAYOUT_7_1_WIDE = 15,
|
||||
|
||||
// Stereo L, Stereo R
|
||||
CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX = 16,
|
||||
|
||||
// Stereo L, Stereo R, LFE
|
||||
CEF_CHANNEL_LAYOUT_2POINT1 = 17,
|
||||
|
||||
// Stereo L, Stereo R, Front C, LFE
|
||||
CEF_CHANNEL_LAYOUT_3_1 = 18,
|
||||
|
||||
// Stereo L, Stereo R, Front C, Rear C, LFE
|
||||
CEF_CHANNEL_LAYOUT_4_1 = 19,
|
||||
|
||||
// Stereo L, Stereo R, Front C, Side L, Side R, Back C
|
||||
CEF_CHANNEL_LAYOUT_6_0 = 20,
|
||||
|
||||
// Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC
|
||||
CEF_CHANNEL_LAYOUT_6_0_FRONT = 21,
|
||||
|
||||
// Stereo L, Stereo R, Front C, Rear L, Rear R, Rear C
|
||||
CEF_CHANNEL_LAYOUT_HEXAGONAL = 22,
|
||||
|
||||
// Stereo L, Stereo R, Front C, LFE, Side L, Side R, Rear Center
|
||||
CEF_CHANNEL_LAYOUT_6_1 = 23,
|
||||
|
||||
// Stereo L, Stereo R, Front C, LFE, Back L, Back R, Rear Center
|
||||
CEF_CHANNEL_LAYOUT_6_1_BACK = 24,
|
||||
|
||||
// Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC, LFE
|
||||
CEF_CHANNEL_LAYOUT_6_1_FRONT = 25,
|
||||
|
||||
// Front L, Front R, Front C, Side L, Side R, Front LofC, Front RofC
|
||||
CEF_CHANNEL_LAYOUT_7_0_FRONT = 26,
|
||||
|
||||
// Front L, Front R, Front C, LFE, Back L, Back R, Front LofC, Front RofC
|
||||
CEF_CHANNEL_LAYOUT_7_1_WIDE_BACK = 27,
|
||||
|
||||
// Front L, Front R, Front C, Side L, Side R, Rear L, Back R, Back C.
|
||||
CEF_CHANNEL_LAYOUT_OCTAGONAL = 28,
|
||||
|
||||
// Channels are not explicitly mapped to speakers.
|
||||
CEF_CHANNEL_LAYOUT_DISCRETE = 29,
|
||||
|
||||
// Front L, Front R, Front C. Front C contains the keyboard mic audio. This
|
||||
// layout is only intended for input for WebRTC. The Front C channel
|
||||
// is stripped away in the WebRTC audio input pipeline and never seen outside
|
||||
// of that.
|
||||
CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC = 30,
|
||||
|
||||
// Front L, Front R, Side L, Side R, LFE
|
||||
CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE = 31,
|
||||
|
||||
// Actual channel layout is specified in the bitstream and the actual channel
|
||||
// count is unknown at Chromium media pipeline level (useful for audio
|
||||
// pass-through mode).
|
||||
CEF_CHANNEL_LAYOUT_BITSTREAM = 32,
|
||||
|
||||
// Max value, must always equal the largest entry ever logged.
|
||||
CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_BITSTREAM
|
||||
} cef_channel_layout_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -72,6 +72,16 @@ typedef struct _cef_main_args_t {
|
||||
// Class representing window information.
|
||||
///
|
||||
typedef struct _cef_window_info_t {
|
||||
///
|
||||
// The initial title of the window, to be set when the window is created.
|
||||
// Some layout managers (e.g., Compiz) can look at the window title
|
||||
// in order to decide where to place the window when it is
|
||||
// created. When this attribute is not empty, the window title will
|
||||
// be set before the window is mapped to the dispay. Otherwise the
|
||||
// title will be initially empty.
|
||||
///
|
||||
cef_string_t window_name;
|
||||
|
||||
unsigned int x;
|
||||
unsigned int y;
|
||||
unsigned int width;
|
||||
|
@@ -481,6 +481,25 @@ struct CefMouseEventTraits {
|
||||
///
|
||||
typedef CefStructBase<CefMouseEventTraits> CefMouseEvent;
|
||||
|
||||
struct CefTouchEventTraits {
|
||||
typedef cef_touch_event_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
|
||||
static inline void clear(struct_type* s) {}
|
||||
|
||||
static inline void set(const struct_type* src,
|
||||
struct_type* target,
|
||||
bool copy) {
|
||||
*target = *src;
|
||||
}
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing a touch event.
|
||||
///
|
||||
typedef CefStructBase<CefTouchEventTraits> CefTouchEvent;
|
||||
|
||||
struct CefPopupFeaturesTraits {
|
||||
typedef cef_popup_features_t struct_type;
|
||||
|
||||
|
107
libcef/browser/audio_mirror_destination.cc
Normal file
107
libcef/browser/audio_mirror_destination.cc
Normal file
@@ -0,0 +1,107 @@
|
||||
// Copyright (c) 2018 The Chromium Embedded Framework Authors.
|
||||
// Portions copyright (c) 2011 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/browser/audio_mirror_destination.h"
|
||||
#include "libcef/browser/audio_push_sink.h"
|
||||
|
||||
#include "base/task/post_task.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "media/base/bind_to_current_loop.h"
|
||||
|
||||
CefAudioMirrorDestination::CefAudioMirrorDestination(
|
||||
CefRefPtr<CefBrowserHostImpl> browser,
|
||||
CefRefPtr<CefAudioHandler> cef_audio_handler,
|
||||
content::AudioMirroringManager* mirroring_manager)
|
||||
: browser_(browser),
|
||||
cef_audio_handler_(cef_audio_handler),
|
||||
mirroring_manager_(mirroring_manager) {
|
||||
DCHECK(mirroring_manager_);
|
||||
|
||||
thread_checker_.DetachFromThread();
|
||||
}
|
||||
|
||||
void CefAudioMirrorDestination::Start() {
|
||||
DCHECK(thread_checker_.CalledOnValidThread());
|
||||
|
||||
base::PostTaskWithTraits(
|
||||
FROM_HERE, {content::BrowserThread::IO},
|
||||
base::BindOnce(&content::AudioMirroringManager::StartMirroring,
|
||||
base::Unretained(mirroring_manager_),
|
||||
base::Unretained(this)));
|
||||
}
|
||||
|
||||
void CefAudioMirrorDestination::Stop() {
|
||||
DCHECK(thread_checker_.CalledOnValidThread());
|
||||
|
||||
base::PostTaskWithTraits(
|
||||
FROM_HERE, {content::BrowserThread::IO},
|
||||
base::BindOnce(&content::AudioMirroringManager::StopMirroring,
|
||||
base::Unretained(mirroring_manager_),
|
||||
base::Unretained(this)));
|
||||
}
|
||||
|
||||
// Asynchronously query whether this MirroringDestination wants to consume
|
||||
// audio sourced from each of the |candidates|. |results_callback| is run
|
||||
// to indicate which of them (or none) should have audio routed to this
|
||||
// MirroringDestination. The second parameter of |results_callback|
|
||||
// indicates whether the MirroringDestination wants either: 1) exclusive
|
||||
// access to a diverted audio flow versus 2) a duplicate copy of the audio
|
||||
// flow. |results_callback| must be run on the same thread as the one that
|
||||
// called QueryForMatches().
|
||||
void CefAudioMirrorDestination::QueryForMatches(
|
||||
const std::set<content::GlobalFrameRoutingId>& candidates,
|
||||
MatchesCallback results_callback) {
|
||||
base::PostTaskWithTraits(
|
||||
FROM_HERE, {content::BrowserThread::UI},
|
||||
base::BindOnce(&CefAudioMirrorDestination::QueryForMatchesOnUIThread,
|
||||
base::Unretained(this), candidates,
|
||||
media::BindToCurrentLoop(std::move(results_callback))));
|
||||
}
|
||||
|
||||
void CefAudioMirrorDestination::QueryForMatchesOnUIThread(
|
||||
const std::set<content::GlobalFrameRoutingId>& candidates,
|
||||
MatchesCallback results_callback) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
|
||||
std::set<content::GlobalFrameRoutingId> matches;
|
||||
for (auto& candidate : candidates) {
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefBrowserHostImpl::GetBrowserForFrame(candidate.child_id,
|
||||
candidate.frame_routing_id);
|
||||
if (browser == browser_) {
|
||||
matches.insert(candidate);
|
||||
}
|
||||
}
|
||||
|
||||
std::move(results_callback).Run(matches, true);
|
||||
}
|
||||
|
||||
// Create a consumer of audio data in the format specified by |params|, and
|
||||
// connect it as an input to mirroring. This is used to provide
|
||||
// MirroringDestination with exclusive access to pull the audio flow from
|
||||
// the source. When Close() is called on the returned AudioOutputStream, the
|
||||
// input is disconnected and the object becomes invalid.
|
||||
media::AudioOutputStream* CefAudioMirrorDestination::AddInput(
|
||||
const media::AudioParameters& params) {
|
||||
// TODO Check and add usage on CEF
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Create a consumer of audio data in the format specified by |params|, and
|
||||
// connect it as an input to mirroring. This is used to provide
|
||||
// MirroringDestination with duplicate audio data, which is pushed from the
|
||||
// main audio flow. When Close() is called on the returned AudioPushSink,
|
||||
// the input is disconnected and the object becomes invalid.
|
||||
media::AudioPushSink* CefAudioMirrorDestination::AddPushInput(
|
||||
const media::AudioParameters& params) {
|
||||
return new CefAudioPushSink(
|
||||
params, browser_, cef_audio_handler_,
|
||||
base::Bind(&CefAudioMirrorDestination::ReleasePushInput,
|
||||
base::Unretained(this)));
|
||||
}
|
||||
|
||||
void CefAudioMirrorDestination::ReleasePushInput(CefAudioPushSink* sink) {
|
||||
delete sink;
|
||||
}
|
80
libcef/browser/audio_mirror_destination.h
Normal file
80
libcef/browser/audio_mirror_destination.h
Normal file
@@ -0,0 +1,80 @@
|
||||
// Copyright (c) 2018 The Chromium Embedded Framework Authors.
|
||||
// Portions copyright (c) 2011 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_BROWSER_AUDIO_MIRROR_DESTINATION_H_
|
||||
#define CEF_LIBCEF_BROWSER_AUDIO_MIRROR_DESTINATION_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_audio_handler.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/threading/thread_checker.h"
|
||||
#include "content/browser/media/capture/audio_mirroring_manager.h"
|
||||
#include "media/audio/audio_io.h"
|
||||
#include "media/base/audio_converter.h"
|
||||
#include "media/base/audio_parameters.h"
|
||||
|
||||
class CefAudioPushSink;
|
||||
class CefBrowserHostImpl;
|
||||
|
||||
class CefAudioMirrorDestination
|
||||
: public content::AudioMirroringManager::MirroringDestination {
|
||||
public:
|
||||
CefAudioMirrorDestination(CefRefPtr<CefBrowserHostImpl> browser,
|
||||
CefRefPtr<CefAudioHandler> cef_audio_handler,
|
||||
content::AudioMirroringManager* mirroring_manager);
|
||||
|
||||
virtual ~CefAudioMirrorDestination() = default;
|
||||
|
||||
// Start mirroring. This needs to be triggered on the IO thread.
|
||||
void Start();
|
||||
|
||||
// Stop mirroring. This needs to be triggered on the IO thread.
|
||||
void Stop();
|
||||
|
||||
// Asynchronously query whether this MirroringDestination wants to consume
|
||||
// audio sourced from each of the |candidates|. |results_callback| is run
|
||||
// to indicate which of them (or none) should have audio routed to this
|
||||
// MirroringDestination. The second parameter of |results_callback|
|
||||
// indicates whether the MirroringDestination wants either: 1) exclusive
|
||||
// access to a diverted audio flow versus 2) a duplicate copy of the audio
|
||||
// flow. |results_callback| must be run on the same thread as the one that
|
||||
// called QueryForMatches().
|
||||
void QueryForMatches(
|
||||
const std::set<content::GlobalFrameRoutingId>& candidates,
|
||||
MatchesCallback results_callback) override;
|
||||
|
||||
// Create a consumer of audio data in the format specified by |params|, and
|
||||
// connect it as an input to mirroring. This is used to provide
|
||||
// MirroringDestination with exclusive access to pull the audio flow from
|
||||
// the source. When Close() is called on the returned AudioOutputStream, the
|
||||
// input is disconnected and the object becomes invalid.
|
||||
media::AudioOutputStream* AddInput(
|
||||
const media::AudioParameters& params) override;
|
||||
|
||||
// Create a consumer of audio data in the format specified by |params|, and
|
||||
// connect it as an input to mirroring. This is used to provide
|
||||
// MirroringDestination with duplicate audio data, which is pushed from the
|
||||
// main audio flow. When Close() is called on the returned AudioPushSink,
|
||||
// the input is disconnected and the object becomes invalid.
|
||||
media::AudioPushSink* AddPushInput(
|
||||
const media::AudioParameters& params) override;
|
||||
|
||||
private:
|
||||
void QueryForMatchesOnUIThread(
|
||||
const std::set<content::GlobalFrameRoutingId>& candidates,
|
||||
MatchesCallback results_callback);
|
||||
void ReleasePushInput(CefAudioPushSink* sink);
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser_;
|
||||
CefRefPtr<CefAudioHandler> cef_audio_handler_;
|
||||
content::AudioMirroringManager* mirroring_manager_;
|
||||
|
||||
base::ThreadChecker thread_checker_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_AUDIO_MIRROR_DESTINATION_H_
|
172
libcef/browser/audio_push_sink.cc
Normal file
172
libcef/browser/audio_push_sink.cc
Normal file
@@ -0,0 +1,172 @@
|
||||
// Copyright (c) 2018 The Chromium Embedded Framework Authors.
|
||||
// Portions copyright (c) 2011 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/browser/audio_push_sink.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "media/base/audio_sample_types.h"
|
||||
#include "media/base/data_buffer.h"
|
||||
|
||||
using namespace media;
|
||||
|
||||
namespace {
|
||||
cef_channel_layout_t TranslateChannelLayout(ChannelLayout channel) {
|
||||
switch (channel) {
|
||||
case CHANNEL_LAYOUT_UNSUPPORTED:
|
||||
return CEF_CHANNEL_LAYOUT_UNSUPPORTED;
|
||||
case CHANNEL_LAYOUT_MONO:
|
||||
return CEF_CHANNEL_LAYOUT_MONO;
|
||||
case CHANNEL_LAYOUT_STEREO:
|
||||
return CEF_CHANNEL_LAYOUT_STEREO;
|
||||
case CHANNEL_LAYOUT_2_1:
|
||||
return CEF_CHANNEL_LAYOUT_2_1;
|
||||
case CHANNEL_LAYOUT_SURROUND:
|
||||
return CEF_CHANNEL_LAYOUT_SURROUND;
|
||||
case CHANNEL_LAYOUT_4_0:
|
||||
return CEF_CHANNEL_LAYOUT_4_0;
|
||||
case CHANNEL_LAYOUT_2_2:
|
||||
return CEF_CHANNEL_LAYOUT_2_2;
|
||||
case CHANNEL_LAYOUT_QUAD:
|
||||
return CEF_CHANNEL_LAYOUT_QUAD;
|
||||
case CHANNEL_LAYOUT_5_0:
|
||||
return CEF_CHANNEL_LAYOUT_5_0;
|
||||
case CHANNEL_LAYOUT_5_1:
|
||||
return CEF_CHANNEL_LAYOUT_5_1;
|
||||
case CHANNEL_LAYOUT_5_0_BACK:
|
||||
return CEF_CHANNEL_LAYOUT_5_0_BACK;
|
||||
case CHANNEL_LAYOUT_5_1_BACK:
|
||||
return CEF_CHANNEL_LAYOUT_5_1_BACK;
|
||||
case CHANNEL_LAYOUT_7_0:
|
||||
return CEF_CHANNEL_LAYOUT_7_0;
|
||||
case CHANNEL_LAYOUT_7_1:
|
||||
return CEF_CHANNEL_LAYOUT_7_1;
|
||||
case CHANNEL_LAYOUT_7_1_WIDE:
|
||||
return CEF_CHANNEL_LAYOUT_7_1_WIDE;
|
||||
case CHANNEL_LAYOUT_STEREO_DOWNMIX:
|
||||
return CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX;
|
||||
case CHANNEL_LAYOUT_2POINT1:
|
||||
return CEF_CHANNEL_LAYOUT_2POINT1;
|
||||
case CHANNEL_LAYOUT_3_1:
|
||||
return CEF_CHANNEL_LAYOUT_3_1;
|
||||
case CHANNEL_LAYOUT_4_1:
|
||||
return CEF_CHANNEL_LAYOUT_4_1;
|
||||
case CHANNEL_LAYOUT_6_0:
|
||||
return CEF_CHANNEL_LAYOUT_6_0;
|
||||
case CHANNEL_LAYOUT_6_0_FRONT:
|
||||
return CEF_CHANNEL_LAYOUT_6_0_FRONT;
|
||||
case CHANNEL_LAYOUT_HEXAGONAL:
|
||||
return CEF_CHANNEL_LAYOUT_HEXAGONAL;
|
||||
case CHANNEL_LAYOUT_6_1:
|
||||
return CEF_CHANNEL_LAYOUT_6_1;
|
||||
case CHANNEL_LAYOUT_6_1_BACK:
|
||||
return CEF_CHANNEL_LAYOUT_6_1_BACK;
|
||||
case CHANNEL_LAYOUT_6_1_FRONT:
|
||||
return CEF_CHANNEL_LAYOUT_6_1_FRONT;
|
||||
case CHANNEL_LAYOUT_7_0_FRONT:
|
||||
return CEF_CHANNEL_LAYOUT_7_0_FRONT;
|
||||
case CHANNEL_LAYOUT_7_1_WIDE_BACK:
|
||||
return CEF_CHANNEL_LAYOUT_7_1_WIDE_BACK;
|
||||
case CHANNEL_LAYOUT_OCTAGONAL:
|
||||
return CEF_CHANNEL_LAYOUT_OCTAGONAL;
|
||||
case CHANNEL_LAYOUT_DISCRETE:
|
||||
return CEF_CHANNEL_LAYOUT_DISCRETE;
|
||||
case CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC:
|
||||
return CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC;
|
||||
case CHANNEL_LAYOUT_4_1_QUAD_SIDE:
|
||||
return CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE;
|
||||
case CHANNEL_LAYOUT_BITSTREAM:
|
||||
return CEF_CHANNEL_LAYOUT_BITSTREAM;
|
||||
case CHANNEL_LAYOUT_NONE:
|
||||
return CEF_CHANNEL_LAYOUT_NONE;
|
||||
}
|
||||
return CEF_CHANNEL_LAYOUT_NONE;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
int CefAudioPushSink::audio_stream_id = 0;
|
||||
|
||||
CefAudioPushSink::CefAudioPushSink(const AudioParameters& params,
|
||||
CefRefPtr<CefBrowserHostImpl> browser,
|
||||
CefRefPtr<CefAudioHandler> cef_audio_handler,
|
||||
const CloseCallback& callback)
|
||||
: params_(params),
|
||||
browser_(browser),
|
||||
cef_audio_handler_(cef_audio_handler),
|
||||
close_callback_(callback),
|
||||
stop_stream_(false),
|
||||
audio_stream_id_(++audio_stream_id) {
|
||||
// Verify that our enum matches Chromium's values.
|
||||
static_assert(
|
||||
static_cast<int>(CEF_CHANNEL_LAYOUT_MAX) ==
|
||||
static_cast<int>(CHANNEL_LAYOUT_MAX),
|
||||
"cef_channel_layout_t must match the ChannelLayout enum in Chromium");
|
||||
|
||||
DCHECK(params_.IsValid());
|
||||
DCHECK(browser);
|
||||
DCHECK(cef_audio_handler);
|
||||
|
||||
// VAOS can be constructed on any thread, but will DCHECK that all
|
||||
// AudioOutputStream methods are called from the same thread.
|
||||
thread_checker_.DetachFromThread();
|
||||
|
||||
base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
|
||||
base::BindOnce(&CefAudioPushSink::InitOnUIThread,
|
||||
base::Unretained(this)));
|
||||
}
|
||||
|
||||
CefAudioPushSink::~CefAudioPushSink() = default;
|
||||
|
||||
void CefAudioPushSink::InitOnUIThread() {
|
||||
DCHECK(thread_checker_.CalledOnValidThread());
|
||||
|
||||
cef_audio_handler_->OnAudioStreamStarted(
|
||||
browser_.get(), audio_stream_id_, params_.channels(),
|
||||
TranslateChannelLayout(params_.channel_layout()), params_.sample_rate(),
|
||||
params_.frames_per_buffer());
|
||||
}
|
||||
|
||||
void CefAudioPushSink::OnData(std::unique_ptr<media::AudioBus> source,
|
||||
base::TimeTicks reference_time) {
|
||||
// early exit if stream already stopped
|
||||
if (stop_stream_)
|
||||
return;
|
||||
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
CEF_POST_TASK(CEF_UIT, base::BindOnce(&CefAudioPushSink::OnData,
|
||||
base::Unretained(this),
|
||||
std::move(source), reference_time));
|
||||
return;
|
||||
}
|
||||
|
||||
const int channels = source->channels();
|
||||
std::vector<const float*> data(channels);
|
||||
for (int c = 0; c < channels; ++c) {
|
||||
data[c] = source->channel(c);
|
||||
}
|
||||
// Add the packet to the buffer.
|
||||
base::TimeDelta pts = reference_time - base::TimeTicks::UnixEpoch();
|
||||
cef_audio_handler_->OnAudioStreamPacket(browser_.get(), audio_stream_id_,
|
||||
data.data(), source->frames(),
|
||||
pts.InMilliseconds());
|
||||
}
|
||||
|
||||
void CefAudioPushSink::Close() {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
CEF_POST_TASK(CEF_UIT, base::BindOnce(&CefAudioPushSink::Close,
|
||||
base::Unretained(this)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!stop_stream_) {
|
||||
stop_stream_ = true;
|
||||
cef_audio_handler_->OnAudioStreamStopped(browser_.get(), audio_stream_id_);
|
||||
|
||||
const CloseCallback& cb = base::ResetAndReturn(&close_callback_);
|
||||
if (!cb.is_null())
|
||||
cb.Run(this);
|
||||
}
|
||||
}
|
54
libcef/browser/audio_push_sink.h
Normal file
54
libcef/browser/audio_push_sink.h
Normal file
@@ -0,0 +1,54 @@
|
||||
// Copyright (c) 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_BROWSER_AUDIO_PUSH_SINK_H_
|
||||
#define CEF_LIBCEF_BROWSER_AUDIO_PUSH_SINK_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_audio_handler.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/threading/thread_checker.h"
|
||||
#include "media/audio/audio_io.h"
|
||||
#include "media/base/audio_converter.h"
|
||||
#include "media/base/audio_parameters.h"
|
||||
#include "media/base/channel_layout.h"
|
||||
|
||||
class CefAudioPushSink : public media::AudioPushSink {
|
||||
public:
|
||||
typedef base::Callback<void(CefAudioPushSink* sink)> CloseCallback;
|
||||
|
||||
CefAudioPushSink(const media::AudioParameters& params,
|
||||
CefRefPtr<CefBrowserHostImpl> browser,
|
||||
CefRefPtr<CefAudioHandler> cef_audio_handler,
|
||||
const CloseCallback& callback);
|
||||
virtual ~CefAudioPushSink();
|
||||
|
||||
void OnData(std::unique_ptr<media::AudioBus> source,
|
||||
base::TimeTicks reference_time) override;
|
||||
void Close() override;
|
||||
|
||||
private:
|
||||
void InitOnUIThread();
|
||||
|
||||
const media::AudioParameters params_;
|
||||
CefRefPtr<CefBrowserHostImpl> browser_;
|
||||
CefRefPtr<CefAudioHandler> cef_audio_handler_;
|
||||
CloseCallback close_callback_;
|
||||
|
||||
base::ThreadChecker thread_checker_;
|
||||
|
||||
bool stop_stream_;
|
||||
int audio_stream_id_;
|
||||
|
||||
static int audio_stream_id;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefAudioPushSink);
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_AUDIO_PUSH_SINK_H_
|
@@ -8,6 +8,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "libcef/browser/audio_mirror_destination.h"
|
||||
#include "libcef/browser/browser_context_impl.h"
|
||||
#include "libcef/browser/browser_info.h"
|
||||
#include "libcef/browser/browser_info_manager.h"
|
||||
@@ -15,8 +16,8 @@
|
||||
#include "libcef/browser/browser_util.h"
|
||||
#include "libcef/browser/content_browser_client.h"
|
||||
#include "libcef/browser/context.h"
|
||||
#include "libcef/browser/devtools_frontend.h"
|
||||
#include "libcef/browser/devtools_manager_delegate.h"
|
||||
#include "libcef/browser/devtools/devtools_frontend.h"
|
||||
#include "libcef/browser/devtools/devtools_manager_delegate.h"
|
||||
#include "libcef/browser/extensions/browser_extensions_util.h"
|
||||
#include "libcef/browser/extensions/extension_background_host.h"
|
||||
#include "libcef/browser/extensions/extension_system.h"
|
||||
@@ -49,6 +50,7 @@
|
||||
#include "chrome/browser/ui/prefs/prefs_tab_helper.h"
|
||||
#include "components/zoom/zoom_controller.h"
|
||||
#include "content/browser/gpu/compositor_util.h"
|
||||
#include "content/browser/media/capture/audio_mirroring_manager.h"
|
||||
#include "content/browser/web_contents/web_contents_impl.h"
|
||||
#include "content/common/widget_messages.h"
|
||||
#include "content/public/browser/desktop_media_id.h"
|
||||
@@ -1582,6 +1584,8 @@ void CefBrowserHostImpl::DestroyBrowser() {
|
||||
menu_manager_->Destroy();
|
||||
DestroyExtensionHost();
|
||||
|
||||
StopAudioMirroring();
|
||||
|
||||
// Notify any observers that may have state associated with this browser.
|
||||
for (auto& observer : observers_)
|
||||
observer.OnBrowserDestroyed(this);
|
||||
@@ -2204,6 +2208,27 @@ void CefBrowserHostImpl::DragSourceEndedAt(
|
||||
platform_delegate_->DragSourceEndedAt(x, y, op);
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::SetAudioMuted(bool mute) {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::Bind(&CefBrowserHostImpl::SetAudioMuted, this, mute));
|
||||
return;
|
||||
}
|
||||
if (!web_contents())
|
||||
return;
|
||||
web_contents()->SetAudioMuted(mute);
|
||||
}
|
||||
|
||||
bool CefBrowserHostImpl::IsAudioMuted() {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
NOTREACHED() << "called on invalid thread";
|
||||
return false;
|
||||
}
|
||||
if (!web_contents())
|
||||
return false;
|
||||
return web_contents()->IsAudioMuted();
|
||||
}
|
||||
|
||||
// content::WebContentsDelegate methods.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
@@ -2281,8 +2306,10 @@ void CefBrowserHostImpl::LoadingStateChanged(content::WebContents* source,
|
||||
|
||||
// This method may be called multiple times in a row with |is_loading| true
|
||||
// as a result of https://crrev.com/5e750ad0. Ignore the 2nd+ times.
|
||||
if (is_loading_ == is_loading)
|
||||
if (is_loading_ == is_loading && can_go_back_ == can_go_back &&
|
||||
can_go_forward_ == can_go_forward) {
|
||||
return;
|
||||
}
|
||||
|
||||
is_loading_ = is_loading;
|
||||
can_go_back_ = can_go_back;
|
||||
@@ -3017,6 +3044,28 @@ bool CefBrowserHostImpl::HasObserver(Observer* observer) const {
|
||||
return observers_.HasObserver(observer);
|
||||
}
|
||||
|
||||
bool CefBrowserHostImpl::StartAudioMirroring() {
|
||||
if (client_.get()) {
|
||||
CefRefPtr<CefAudioHandler> audio_handler = client_->GetAudioHandler();
|
||||
if (audio_handler.get()) {
|
||||
audio_mirror_destination_.reset(new CefAudioMirrorDestination(
|
||||
this, audio_handler, content::AudioMirroringManager::GetInstance()));
|
||||
audio_mirror_destination_->Start();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CefBrowserHostImpl::StopAudioMirroring() {
|
||||
if (audio_mirror_destination_.get()) {
|
||||
audio_mirror_destination_->Stop();
|
||||
audio_mirror_destination_.reset();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
CefBrowserHostImpl::NavigationLock::NavigationLock(
|
||||
CefRefPtr<CefBrowserHostImpl> browser)
|
||||
: browser_(browser) {
|
||||
@@ -3269,6 +3318,8 @@ CefBrowserHostImpl::CefBrowserHostImpl(
|
||||
// Make sure RenderViewCreated is called at least one time.
|
||||
RenderViewCreated(web_contents->GetRenderViewHost());
|
||||
|
||||
StartAudioMirroring();
|
||||
|
||||
// Associate the platform delegate with this browser.
|
||||
platform_delegate_->BrowserCreated(this);
|
||||
}
|
||||
@@ -3676,3 +3727,21 @@ bool CefBrowserHostImpl::Send(IPC::Message* message) {
|
||||
delete message;
|
||||
return false;
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::SendTouchEvent(const CefTouchEvent& event) {
|
||||
if (!IsWindowless()) {
|
||||
NOTREACHED() << "Window rendering is not disabled";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::Bind(&CefBrowserHostImpl::SendTouchEvent, this, event));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
platform_delegate_->SendTouchEvent(event);
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@
|
||||
#include "include/cef_client.h"
|
||||
#include "include/cef_frame.h"
|
||||
#include "include/views/cef_browser_view.h"
|
||||
#include "libcef/browser/audio_mirror_destination.h"
|
||||
#include "libcef/browser/browser_info.h"
|
||||
#include "libcef/browser/file_dialog_manager.h"
|
||||
#include "libcef/browser/frame_host_impl.h"
|
||||
@@ -56,6 +57,7 @@ class Widget;
|
||||
struct Cef_DraggableRegion_Params;
|
||||
struct Cef_Request_Params;
|
||||
struct Cef_Response_Params;
|
||||
class CefAudioMirrorDestination;
|
||||
class CefBrowserInfo;
|
||||
class CefBrowserPlatformDelegate;
|
||||
class CefDevToolsFrontend;
|
||||
@@ -222,6 +224,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
void SendMouseWheelEvent(const CefMouseEvent& event,
|
||||
int deltaX,
|
||||
int deltaY) override;
|
||||
void SendTouchEvent(const CefTouchEvent& event) override;
|
||||
void SendFocusEvent(bool setFocus) override;
|
||||
void SendCaptureLostEvent() override;
|
||||
void NotifyMoveOrResizeStarted() override;
|
||||
@@ -245,6 +248,8 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
void DragTargetDrop(const CefMouseEvent& event) override;
|
||||
void DragSourceSystemDragEnded() override;
|
||||
void DragSourceEndedAt(int x, int y, DragOperationsMask op) override;
|
||||
void SetAudioMuted(bool mute) override;
|
||||
bool IsAudioMuted() override;
|
||||
CefRefPtr<CefNavigationEntry> GetVisibleNavigationEntry() override;
|
||||
void SetAccessibilityState(cef_state_t accessibility_state) override;
|
||||
void SetAutoResizeEnabled(bool enabled,
|
||||
@@ -523,6 +528,8 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
void AddObserver(Observer* observer);
|
||||
void RemoveObserver(Observer* observer);
|
||||
bool HasObserver(Observer* observer) const;
|
||||
bool StartAudioMirroring();
|
||||
bool StopAudioMirroring();
|
||||
|
||||
class NavigationLock final {
|
||||
private:
|
||||
@@ -762,6 +769,9 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
CefRefPtr<CefExtension> extension_;
|
||||
bool is_background_host_ = false;
|
||||
|
||||
// Used to mirror audio streams
|
||||
std::unique_ptr<CefAudioMirrorDestination> audio_mirror_destination_;
|
||||
|
||||
// Used with auto-resize.
|
||||
bool auto_resize_enabled_ = false;
|
||||
gfx::Size auto_resize_min_;
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include "libcef/browser/browser_context_keyed_service_factories.h"
|
||||
#include "libcef/browser/content_browser_client.h"
|
||||
#include "libcef/browser/context.h"
|
||||
#include "libcef/browser/devtools_manager_delegate.h"
|
||||
#include "libcef/browser/devtools/devtools_manager_delegate.h"
|
||||
#include "libcef/browser/extensions/extension_system_factory.h"
|
||||
#include "libcef/browser/extensions/extensions_browser_client.h"
|
||||
#include "libcef/browser/net/chrome_scheme_handler.h"
|
||||
@@ -36,6 +36,10 @@
|
||||
#include "ui/base/material_design/material_design_controller.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
|
||||
#if defined(USE_AURA) && defined(USE_X11)
|
||||
#include "ui/events/devices/x11/touch_factory_x11.h"
|
||||
#endif
|
||||
|
||||
#if defined(USE_AURA)
|
||||
#include "ui/aura/env.h"
|
||||
#include "ui/display/screen.h"
|
||||
@@ -107,6 +111,10 @@ void CefBrowserMainParts::ToolkitInitialized() {
|
||||
}
|
||||
|
||||
void CefBrowserMainParts::PreMainMessageLoopStart() {
|
||||
#if defined(USE_AURA) && defined(USE_X11)
|
||||
ui::TouchFactory::SetTouchDeviceListFromCommandLine();
|
||||
#endif
|
||||
|
||||
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
|
||||
chrome_extra_parts_[i]->PreMainMessageLoopStart();
|
||||
}
|
||||
|
@@ -22,6 +22,7 @@ namespace blink {
|
||||
class WebMouseEvent;
|
||||
class WebMouseWheelEvent;
|
||||
class WebInputEvent;
|
||||
class WebTouchEvent;
|
||||
} // namespace blink
|
||||
|
||||
namespace content {
|
||||
@@ -150,6 +151,9 @@ class CefBrowserPlatformDelegate {
|
||||
virtual void SendMouseEvent(const blink::WebMouseEvent& event) = 0;
|
||||
virtual void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event) = 0;
|
||||
|
||||
// Send touch events.
|
||||
virtual void SendTouchEvent(const CefTouchEvent& event) = 0;
|
||||
|
||||
// Send focus event. The browser's WebContents may be NULL when this method is
|
||||
// called.
|
||||
virtual void SendFocusEvent(bool setFocus) = 0;
|
||||
|
@@ -46,7 +46,7 @@ std::unique_ptr<CefBrowserPlatformDelegateNative> CreateNativeDelegate(
|
||||
window_info, background_color);
|
||||
#elif defined(OS_LINUX)
|
||||
return std::make_unique<CefBrowserPlatformDelegateNativeLinux>(
|
||||
window_info, background_color);
|
||||
window_info, background_color, use_external_begin_frame);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#include "libcef/browser/browser_message_filter.h"
|
||||
#include "libcef/browser/browser_platform_delegate.h"
|
||||
#include "libcef/browser/context.h"
|
||||
#include "libcef/browser/devtools_manager_delegate.h"
|
||||
#include "libcef/browser/devtools/devtools_manager_delegate.h"
|
||||
#include "libcef/browser/extensions/extension_system.h"
|
||||
#include "libcef/browser/media_capture_devices_dispatcher.h"
|
||||
#include "libcef/browser/net/chrome_scheme_handler.h"
|
||||
@@ -1120,6 +1120,7 @@ bool CefContentBrowserClient::WillCreateURLLoaderFactory(
|
||||
content::RenderFrameHost* frame,
|
||||
int render_process_id,
|
||||
bool is_navigation,
|
||||
bool is_download,
|
||||
const url::Origin& request_initiator,
|
||||
network::mojom::URLLoaderFactoryRequest* factory_request,
|
||||
network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client,
|
||||
@@ -1131,8 +1132,8 @@ bool CefContentBrowserClient::WillCreateURLLoaderFactory(
|
||||
extensions::BrowserContextKeyedAPIFactory<extensions::WebRequestAPI>::Get(
|
||||
browser_context);
|
||||
bool use_proxy = web_request_api->MaybeProxyURLLoaderFactory(
|
||||
browser_context, frame, render_process_id, is_navigation, factory_request,
|
||||
header_client);
|
||||
browser_context, frame, render_process_id, is_navigation, is_download,
|
||||
factory_request, header_client);
|
||||
if (bypass_redirect_checks)
|
||||
*bypass_redirect_checks = use_proxy;
|
||||
return use_proxy;
|
||||
|
@@ -147,6 +147,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
|
||||
content::RenderFrameHost* frame,
|
||||
int render_process_id,
|
||||
bool is_navigation,
|
||||
bool is_download,
|
||||
const url::Origin& request_initiator,
|
||||
network::mojom::URLLoaderFactoryRequest* factory_request,
|
||||
network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client,
|
||||
|
203
libcef/browser/devtools/devtools_file_manager.cc
Normal file
203
libcef/browser/devtools/devtools_file_manager.cc
Normal file
@@ -0,0 +1,203 @@
|
||||
// Copyright 2019 The Chromium Embedded Framework Authors. Portions copyright
|
||||
// 2013 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/browser/devtools/devtools_file_manager.h"
|
||||
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/callback.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/json/json_writer.h"
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/task/post_task.h"
|
||||
#include "base/threading/sequenced_task_runner_handle.h"
|
||||
#include "base/value_conversions.h"
|
||||
#include "base/values.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/prefs/scoped_user_pref_update.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
|
||||
namespace {
|
||||
|
||||
base::LazyInstance<base::FilePath>::Leaky g_last_save_path =
|
||||
LAZY_INSTANCE_INITIALIZER;
|
||||
|
||||
void WriteToFile(const base::FilePath& path, const std::string& content) {
|
||||
DCHECK(!path.empty());
|
||||
base::WriteFile(path, content.c_str(), content.length());
|
||||
}
|
||||
|
||||
void AppendToFile(const base::FilePath& path, const std::string& content) {
|
||||
DCHECK(!path.empty());
|
||||
base::AppendToFile(path, content.c_str(), content.size());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
CefDevToolsFileManager::CefDevToolsFileManager(CefBrowserHostImpl* browser_impl,
|
||||
PrefService* prefs)
|
||||
: browser_impl_(browser_impl),
|
||||
prefs_(prefs),
|
||||
file_task_runner_(
|
||||
base::CreateSequencedTaskRunnerWithTraits({base::MayBlock()})),
|
||||
weak_factory_(this) {}
|
||||
|
||||
void CefDevToolsFileManager::SaveToFile(const std::string& url,
|
||||
const std::string& content,
|
||||
bool save_as) {
|
||||
Save(url, content, save_as,
|
||||
base::Bind(&CefDevToolsFileManager::FileSavedAs,
|
||||
weak_factory_.GetWeakPtr(), url),
|
||||
base::Bind(&CefDevToolsFileManager::CanceledFileSaveAs,
|
||||
weak_factory_.GetWeakPtr(), url));
|
||||
}
|
||||
|
||||
void CefDevToolsFileManager::AppendToFile(const std::string& url,
|
||||
const std::string& content) {
|
||||
Append(url, content,
|
||||
base::Bind(&CefDevToolsFileManager::AppendedTo,
|
||||
weak_factory_.GetWeakPtr(), url));
|
||||
}
|
||||
|
||||
void CefDevToolsFileManager::Save(const std::string& url,
|
||||
const std::string& content,
|
||||
bool save_as,
|
||||
const SaveCallback& saveCallback,
|
||||
const CancelCallback& cancelCallback) {
|
||||
auto it = saved_files_.find(url);
|
||||
if (it != saved_files_.end() && !save_as) {
|
||||
SaveAsFileSelected(url, content, saveCallback, it->second);
|
||||
return;
|
||||
}
|
||||
|
||||
const base::DictionaryValue* file_map =
|
||||
prefs_->GetDictionary(prefs::kDevToolsEditedFiles);
|
||||
base::FilePath initial_path;
|
||||
|
||||
const base::Value* path_value;
|
||||
if (file_map->Get(base::MD5String(url), &path_value)) {
|
||||
// Ignore base::GetValueAsFilePath() failure since we handle empty
|
||||
// |initial_path| below.
|
||||
ignore_result(base::GetValueAsFilePath(*path_value, &initial_path));
|
||||
}
|
||||
|
||||
if (initial_path.empty()) {
|
||||
GURL gurl(url);
|
||||
std::string suggested_file_name =
|
||||
gurl.is_valid() ? gurl.ExtractFileName() : url;
|
||||
|
||||
if (suggested_file_name.length() > 64)
|
||||
suggested_file_name = suggested_file_name.substr(0, 64);
|
||||
|
||||
if (!g_last_save_path.Pointer()->empty()) {
|
||||
initial_path = g_last_save_path.Pointer()->DirName().AppendASCII(
|
||||
suggested_file_name);
|
||||
} else {
|
||||
// Use the temp directory. It may be an empty value.
|
||||
base::PathService::Get(base::DIR_TEMP, &initial_path);
|
||||
initial_path = initial_path.AppendASCII(suggested_file_name);
|
||||
}
|
||||
}
|
||||
|
||||
CefFileDialogRunner::FileChooserParams params;
|
||||
params.mode = blink::mojom::FileChooserParams::Mode::kSave;
|
||||
if (!initial_path.empty()) {
|
||||
params.default_file_name = initial_path;
|
||||
if (!initial_path.Extension().empty()) {
|
||||
params.accept_types.push_back(CefString(initial_path.Extension()));
|
||||
}
|
||||
}
|
||||
|
||||
browser_impl_->RunFileChooser(
|
||||
params, base::Bind(&CefDevToolsFileManager::SaveAsDialogDismissed,
|
||||
weak_factory_.GetWeakPtr(), url, content, saveCallback,
|
||||
cancelCallback));
|
||||
}
|
||||
|
||||
void CefDevToolsFileManager::SaveAsDialogDismissed(
|
||||
const std::string& url,
|
||||
const std::string& content,
|
||||
const SaveCallback& saveCallback,
|
||||
const CancelCallback& cancelCallback,
|
||||
int selected_accept_filter,
|
||||
const std::vector<base::FilePath>& file_paths) {
|
||||
if (file_paths.size() == 1) {
|
||||
SaveAsFileSelected(url, content, saveCallback, file_paths[0]);
|
||||
} else {
|
||||
cancelCallback.Run();
|
||||
}
|
||||
}
|
||||
|
||||
void CefDevToolsFileManager::SaveAsFileSelected(const std::string& url,
|
||||
const std::string& content,
|
||||
const SaveCallback& callback,
|
||||
const base::FilePath& path) {
|
||||
*g_last_save_path.Pointer() = path;
|
||||
saved_files_[url] = path;
|
||||
|
||||
DictionaryPrefUpdate update(prefs_, prefs::kDevToolsEditedFiles);
|
||||
base::DictionaryValue* files_map = update.Get();
|
||||
files_map->SetKey(base::MD5String(url), base::CreateFilePathValue(path));
|
||||
std::string file_system_path = path.AsUTF8Unsafe();
|
||||
callback.Run(file_system_path);
|
||||
file_task_runner_->PostTask(FROM_HERE,
|
||||
base::BindOnce(&::WriteToFile, path, content));
|
||||
}
|
||||
|
||||
void CefDevToolsFileManager::FileSavedAs(const std::string& url,
|
||||
const std::string& file_system_path) {
|
||||
base::Value url_value(url);
|
||||
base::Value file_system_path_value(file_system_path);
|
||||
CallClientFunction("DevToolsAPI.savedURL", &url_value,
|
||||
&file_system_path_value, NULL);
|
||||
}
|
||||
|
||||
void CefDevToolsFileManager::CanceledFileSaveAs(const std::string& url) {
|
||||
base::Value url_value(url);
|
||||
CallClientFunction("DevToolsAPI.canceledSaveURL", &url_value, NULL, NULL);
|
||||
}
|
||||
|
||||
void CefDevToolsFileManager::Append(const std::string& url,
|
||||
const std::string& content,
|
||||
const AppendCallback& callback) {
|
||||
auto it = saved_files_.find(url);
|
||||
if (it == saved_files_.end())
|
||||
return;
|
||||
callback.Run();
|
||||
file_task_runner_->PostTask(
|
||||
FROM_HERE, base::BindOnce(&::AppendToFile, it->second, content));
|
||||
}
|
||||
|
||||
void CefDevToolsFileManager::AppendedTo(const std::string& url) {
|
||||
base::Value url_value(url);
|
||||
CallClientFunction("DevToolsAPI.appendedToURL", &url_value, NULL, NULL);
|
||||
}
|
||||
|
||||
void CefDevToolsFileManager::CallClientFunction(
|
||||
const std::string& function_name,
|
||||
const base::Value* arg1,
|
||||
const base::Value* arg2,
|
||||
const base::Value* arg3) {
|
||||
std::string javascript = function_name + "(";
|
||||
if (arg1) {
|
||||
std::string json;
|
||||
base::JSONWriter::Write(*arg1, &json);
|
||||
javascript.append(json);
|
||||
if (arg2) {
|
||||
base::JSONWriter::Write(*arg2, &json);
|
||||
javascript.append(", ").append(json);
|
||||
if (arg3) {
|
||||
base::JSONWriter::Write(*arg3, &json);
|
||||
javascript.append(", ").append(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
javascript.append(");");
|
||||
browser_impl_->web_contents()->GetMainFrame()->ExecuteJavaScript(
|
||||
base::UTF8ToUTF16(javascript));
|
||||
}
|
82
libcef/browser/devtools/devtools_file_manager.h
Normal file
82
libcef/browser/devtools/devtools_file_manager.h
Normal file
@@ -0,0 +1,82 @@
|
||||
// Copyright 2019 The Chromium Embedded Framework Authors. Portions copyright
|
||||
// 2013 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_BROWSER_DEVTOOLS_DEVTOOLS_FILE_MANAGER_H_
|
||||
#define CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FILE_MANAGER_H_
|
||||
|
||||
#include "base/callback_forward.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
namespace base {
|
||||
class FilePath;
|
||||
class SequencedTaskRunner;
|
||||
class Value;
|
||||
} // namespace base
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class PrefService;
|
||||
|
||||
// File management helper for DevTools.
|
||||
// Based on chrome/browser/devtools/devtools_ui_bindings.cc and
|
||||
// chrome/browser/devtools/devtools_file_helper.cc.
|
||||
class CefDevToolsFileManager {
|
||||
public:
|
||||
CefDevToolsFileManager(CefBrowserHostImpl* browser_impl, PrefService* prefs);
|
||||
|
||||
void SaveToFile(const std::string& url,
|
||||
const std::string& content,
|
||||
bool save_as);
|
||||
void AppendToFile(const std::string& url, const std::string& content);
|
||||
|
||||
private:
|
||||
// SaveToFile implementation:
|
||||
typedef base::Callback<void(const std::string&)> SaveCallback;
|
||||
typedef base::Callback<void()> CancelCallback;
|
||||
void Save(const std::string& url,
|
||||
const std::string& content,
|
||||
bool save_as,
|
||||
const SaveCallback& saveCallback,
|
||||
const CancelCallback& cancelCallback);
|
||||
void SaveAsDialogDismissed(const std::string& url,
|
||||
const std::string& content,
|
||||
const SaveCallback& saveCallback,
|
||||
const CancelCallback& cancelCallback,
|
||||
int selected_accept_filter,
|
||||
const std::vector<base::FilePath>& file_paths);
|
||||
void SaveAsFileSelected(const std::string& url,
|
||||
const std::string& content,
|
||||
const SaveCallback& callback,
|
||||
const base::FilePath& path);
|
||||
void FileSavedAs(const std::string& url, const std::string& file_system_path);
|
||||
void CanceledFileSaveAs(const std::string& url);
|
||||
|
||||
// AppendToFile implementation:
|
||||
typedef base::Callback<void(void)> AppendCallback;
|
||||
void Append(const std::string& url,
|
||||
const std::string& content,
|
||||
const AppendCallback& callback);
|
||||
void AppendedTo(const std::string& url);
|
||||
|
||||
void CallClientFunction(const std::string& function_name,
|
||||
const base::Value* arg1,
|
||||
const base::Value* arg2,
|
||||
const base::Value* arg3);
|
||||
|
||||
// Guaranteed to outlive this object.
|
||||
CefBrowserHostImpl* browser_impl_;
|
||||
PrefService* prefs_;
|
||||
|
||||
typedef std::map<std::string, base::FilePath> PathsMap;
|
||||
PathsMap saved_files_;
|
||||
scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
|
||||
base::WeakPtrFactory<CefDevToolsFileManager> weak_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefDevToolsFileManager);
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FILE_MANAGER_H_
|
@@ -2,14 +2,14 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "libcef/browser/devtools_frontend.h"
|
||||
#include "libcef/browser/devtools/devtools_frontend.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "libcef/browser/browser_context.h"
|
||||
#include "libcef/browser/devtools_manager_delegate.h"
|
||||
#include "libcef/browser/devtools/devtools_manager_delegate.h"
|
||||
#include "libcef/browser/net/devtools_scheme_handler.h"
|
||||
|
||||
#include "base/guid.h"
|
||||
@@ -190,6 +190,7 @@ CefDevToolsFrontend::CefDevToolsFrontend(
|
||||
frontend_browser_(frontend_browser),
|
||||
inspected_contents_(inspected_contents),
|
||||
inspect_element_at_(inspect_element_at),
|
||||
file_manager_(frontend_browser.get(), GetPrefs()),
|
||||
weak_factory_(this) {}
|
||||
|
||||
CefDevToolsFrontend::~CefDevToolsFrontend() {
|
||||
@@ -355,6 +356,22 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
|
||||
if (!params->GetString(0, &origin) || !params->GetString(1, &script))
|
||||
return;
|
||||
extensions_api_[origin + "/"] = script;
|
||||
} else if (method == "save" && params->GetSize() == 3) {
|
||||
std::string url;
|
||||
std::string content;
|
||||
bool save_as;
|
||||
if (!params->GetString(0, &url) || !params->GetString(1, &content) ||
|
||||
!params->GetBoolean(2, &save_as)) {
|
||||
return;
|
||||
}
|
||||
file_manager_.SaveToFile(url, content, save_as);
|
||||
} else if (method == "append" && params->GetSize() == 2) {
|
||||
std::string url;
|
||||
std::string content;
|
||||
if (!params->GetString(0, &url) || !params->GetString(1, &content)) {
|
||||
return;
|
||||
}
|
||||
file_manager_.AppendToFile(url, content);
|
||||
} else {
|
||||
return;
|
||||
}
|
@@ -2,12 +2,13 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef CEF_LIBCEF_BROWSER_DEVTOOLS_FRONTEND_H_
|
||||
#define CEF_LIBCEF_BROWSER_DEVTOOLS_FRONTEND_H_
|
||||
#ifndef CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FRONTEND_H_
|
||||
#define CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FRONTEND_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
#include "libcef/browser/devtools/devtools_file_manager.h"
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/macros.h"
|
||||
@@ -93,9 +94,10 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
|
||||
PendingRequestsMap pending_requests_;
|
||||
using ExtensionsAPIs = std::map<std::string, std::string>;
|
||||
ExtensionsAPIs extensions_api_;
|
||||
CefDevToolsFileManager file_manager_;
|
||||
base::WeakPtrFactory<CefDevToolsFrontend> weak_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefDevToolsFrontend);
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_FRONTEND_H_
|
||||
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FRONTEND_H_
|
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "libcef/browser/devtools_manager_delegate.h"
|
||||
#include "libcef/browser/devtools/devtools_manager_delegate.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
@@ -2,8 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef CEF_LIBCEF_BROWSER_DEVTOOLS_MANAGER_DELEGATE_H_
|
||||
#define CEF_LIBCEF_BROWSER_DEVTOOLS_MANAGER_DELEGATE_H_
|
||||
#ifndef CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_DELEGATE_H_
|
||||
#define CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_DELEGATE_H_
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/macros.h"
|
||||
@@ -31,4 +31,4 @@ class CefDevToolsManagerDelegate : public content::DevToolsManagerDelegate {
|
||||
DISALLOW_COPY_AND_ASSIGN(CefDevToolsManagerDelegate);
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_MANAGER_DELEGATE_H_
|
||||
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_DELEGATE_H_
|
@@ -66,6 +66,11 @@ void CefBrowserPlatformDelegateBackground::SendMouseWheelEvent(
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateBackground::SendTouchEvent(
|
||||
const CefTouchEvent& event) {
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateBackground::SendFocusEvent(bool setFocus) {
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
@@ -28,6 +28,7 @@ class CefBrowserPlatformDelegateBackground
|
||||
void SendKeyEvent(const content::NativeWebKeyboardEvent& event) override;
|
||||
void SendMouseEvent(const blink::WebMouseEvent& event) override;
|
||||
void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event) override;
|
||||
void SendTouchEvent(const CefTouchEvent& event) override;
|
||||
void SendFocusEvent(bool setFocus) override;
|
||||
gfx::Point GetScreenPoint(const gfx::Point& view) const override;
|
||||
void ViewText(const std::string& text) override;
|
||||
|
@@ -72,7 +72,6 @@ CefJavaScriptDialogManager::~CefJavaScriptDialogManager() {}
|
||||
|
||||
void CefJavaScriptDialogManager::Destroy() {
|
||||
if (runner_.get()) {
|
||||
DCHECK(!dialog_running_);
|
||||
runner_.reset(NULL);
|
||||
}
|
||||
}
|
||||
|
@@ -59,6 +59,9 @@ void CefBrowserPlatformDelegateNative::SendMouseWheelEvent(
|
||||
host->GetWidget()->ForwardWheelEvent(event);
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateNative::SendTouchEvent(
|
||||
const CefTouchEvent& event) {}
|
||||
|
||||
bool CefBrowserPlatformDelegateNative::IsWindowless() const {
|
||||
return false;
|
||||
}
|
||||
|
@@ -32,6 +32,7 @@ class CefBrowserPlatformDelegateNative : public CefBrowserPlatformDelegate {
|
||||
void SendKeyEvent(const content::NativeWebKeyboardEvent& event) override;
|
||||
void SendMouseEvent(const blink::WebMouseEvent& event) override;
|
||||
void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event) override;
|
||||
void SendTouchEvent(const CefTouchEvent& event) override;
|
||||
bool IsWindowless() const override;
|
||||
bool IsViewsHosted() const override;
|
||||
|
||||
|
@@ -41,11 +41,12 @@ long GetSystemUptime() {
|
||||
|
||||
CefBrowserPlatformDelegateNativeLinux::CefBrowserPlatformDelegateNativeLinux(
|
||||
const CefWindowInfo& window_info,
|
||||
SkColor background_color)
|
||||
SkColor background_color,
|
||||
bool use_external_begin_frame)
|
||||
: CefBrowserPlatformDelegateNative(window_info,
|
||||
background_color,
|
||||
false,
|
||||
false),
|
||||
use_external_begin_frame),
|
||||
host_window_created_(false),
|
||||
window_widget_(nullptr),
|
||||
window_x11_(nullptr) {}
|
||||
@@ -74,7 +75,8 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() {
|
||||
|
||||
// Create a new window object. It will delete itself when the associated X11
|
||||
// window is destroyed.
|
||||
window_x11_ = new CefWindowX11(browser_, window_info_.parent_window, rect);
|
||||
window_x11_ = new CefWindowX11(browser_, window_info_.parent_window, rect,
|
||||
CefString(&window_info_.window_name).ToString());
|
||||
window_info_.window = window_x11_->xwindow();
|
||||
|
||||
host_window_created_ = true;
|
||||
|
@@ -14,7 +14,8 @@ class CefBrowserPlatformDelegateNativeLinux
|
||||
: public CefBrowserPlatformDelegateNative {
|
||||
public:
|
||||
CefBrowserPlatformDelegateNativeLinux(const CefWindowInfo& window_info,
|
||||
SkColor background_color);
|
||||
SkColor background_color,
|
||||
bool use_external_begin_frame);
|
||||
|
||||
// CefBrowserPlatformDelegate methods:
|
||||
void BrowserDestroyed(CefBrowserHostImpl* browser) override;
|
||||
|
@@ -207,8 +207,27 @@ bool CefBrowserPlatformDelegateNativeWin::CreateHostWindow() {
|
||||
gfx::Rect(0, 0, point.x(), point.y()));
|
||||
|
||||
window_widget_ = delegate_view->GetWidget();
|
||||
|
||||
const HWND widget_hwnd = HWNDForWidget(window_widget_);
|
||||
DCHECK(widget_hwnd);
|
||||
const DWORD widget_ex_styles = GetWindowLongPtr(widget_hwnd, GWL_EXSTYLE);
|
||||
|
||||
if (window_info_.ex_style & WS_EX_NOACTIVATE) {
|
||||
// Add the WS_EX_NOACTIVATE style on the DesktopWindowTreeHostWin HWND
|
||||
// so that HWNDMessageHandler::Show() called via Widget::Show() does not
|
||||
// activate the window.
|
||||
SetWindowLongPtr(widget_hwnd, GWL_EXSTYLE,
|
||||
widget_ex_styles | WS_EX_NOACTIVATE);
|
||||
}
|
||||
|
||||
window_widget_->Show();
|
||||
|
||||
if (window_info_.ex_style & WS_EX_NOACTIVATE) {
|
||||
// Remove the WS_EX_NOACTIVATE style so that future mouse clicks inside the
|
||||
// browser correctly activate and focus the window.
|
||||
SetWindowLongPtr(widget_hwnd, GWL_EXSTYLE, widget_ex_styles);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -688,7 +707,10 @@ LRESULT CALLBACK CefBrowserPlatformDelegateNativeWin::WndProc(HWND hwnd,
|
||||
return 0;
|
||||
|
||||
case WM_SETFOCUS:
|
||||
if (browser)
|
||||
// Selecting "Close window" from the task bar menu may send a focus
|
||||
// notification even though the window is currently disabled (e.g. while
|
||||
// a modal JS dialog is displayed).
|
||||
if (browser && ::IsWindowEnabled(hwnd))
|
||||
browser->SetFocus(true);
|
||||
return 0;
|
||||
|
||||
|
@@ -39,8 +39,7 @@ INT_PTR CALLBACK CefJavaScriptDialogRunnerWin::DialogProc(HWND dialog,
|
||||
reinterpret_cast<CefJavaScriptDialogRunnerWin*>(
|
||||
GetWindowLongPtr(dialog, DWLP_USER));
|
||||
if (owner) {
|
||||
owner->Cancel();
|
||||
owner->callback_.Run(false, base::string16());
|
||||
owner->CloseDialog(false, base::string16());
|
||||
|
||||
// No need for the system to call DestroyWindow() because it will be
|
||||
// called by the Cancel() method.
|
||||
@@ -74,8 +73,7 @@ INT_PTR CALLBACK CefJavaScriptDialogRunnerWin::DialogProc(HWND dialog,
|
||||
break;
|
||||
}
|
||||
if (finish) {
|
||||
owner->Cancel();
|
||||
owner->callback_.Run(result, user_input);
|
||||
owner->CloseDialog(result, user_input);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -153,12 +151,9 @@ void CefJavaScriptDialogRunnerWin::Run(
|
||||
}
|
||||
|
||||
void CefJavaScriptDialogRunnerWin::Cancel() {
|
||||
HWND parent = NULL;
|
||||
|
||||
// Re-enable the parent before closing the popup to avoid focus/activation/
|
||||
// z-order issues.
|
||||
if (parent_win_ && IsWindow(parent_win_) && !IsWindowEnabled(parent_win_)) {
|
||||
parent = parent_win_;
|
||||
EnableWindow(parent_win_, TRUE);
|
||||
parent_win_ = NULL;
|
||||
}
|
||||
@@ -169,16 +164,24 @@ void CefJavaScriptDialogRunnerWin::Cancel() {
|
||||
dialog_win_ = NULL;
|
||||
}
|
||||
|
||||
// Return focus to the parent window.
|
||||
if (parent)
|
||||
SetFocus(parent);
|
||||
|
||||
if (hook_installed_) {
|
||||
UninstallMessageHook();
|
||||
hook_installed_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CefJavaScriptDialogRunnerWin::CloseDialog(
|
||||
bool success,
|
||||
const base::string16& user_input) {
|
||||
// Run the callback first so that RenderProcessHostImpl::IsBlocked is
|
||||
// cleared. Otherwise, RenderWidgetHostImpl::IsIgnoringInputEvents will
|
||||
// return true and RenderWidgetHostViewAura::OnWindowFocused will fail to
|
||||
// re-assign browser focus.
|
||||
callback_.Run(success, user_input);
|
||||
callback_.Reset();
|
||||
Cancel();
|
||||
}
|
||||
|
||||
// static
|
||||
LRESULT CALLBACK CefJavaScriptDialogRunnerWin::GetMsgProc(int code,
|
||||
WPARAM wparam,
|
||||
|
@@ -26,6 +26,8 @@ class CefJavaScriptDialogRunnerWin : public CefJavaScriptDialogRunner {
|
||||
void Cancel() override;
|
||||
|
||||
private:
|
||||
void CloseDialog(bool success, const base::string16& user_input);
|
||||
|
||||
HWND dialog_win_;
|
||||
HWND parent_win_;
|
||||
|
||||
|
@@ -21,10 +21,12 @@ namespace {
|
||||
const char kAtom[] = "ATOM";
|
||||
const char kWMDeleteWindow[] = "WM_DELETE_WINDOW";
|
||||
const char kWMProtocols[] = "WM_PROTOCOLS";
|
||||
const char kNetWMName[] = "_NET_WM_NAME";
|
||||
const char kNetWMPid[] = "_NET_WM_PID";
|
||||
const char kNetWMPing[] = "_NET_WM_PING";
|
||||
const char kNetWMState[] = "_NET_WM_STATE";
|
||||
const char kXdndProxy[] = "XdndProxy";
|
||||
const char kUTF8String[] = "UTF8_STRING";
|
||||
|
||||
::Window FindEventTarget(const ui::PlatformEvent& xev) {
|
||||
::Window target = xev->xany.window;
|
||||
@@ -81,7 +83,8 @@ CEF_EXPORT XDisplay* cef_get_xdisplay() {
|
||||
|
||||
CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostImpl> browser,
|
||||
::Window parent_xwindow,
|
||||
const gfx::Rect& bounds)
|
||||
const gfx::Rect& bounds,
|
||||
const std::string& title)
|
||||
: browser_(browser),
|
||||
xdisplay_(gfx::GetXDisplay()),
|
||||
parent_xwindow_(parent_xwindow),
|
||||
@@ -133,6 +136,14 @@ CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostImpl> browser,
|
||||
long pid = getpid();
|
||||
XChangeProperty(xdisplay_, xwindow_, gfx::GetAtom(kNetWMPid), XA_CARDINAL, 32,
|
||||
PropModeReplace, reinterpret_cast<unsigned char*>(&pid), 1);
|
||||
|
||||
// Set the initial window name, if provided.
|
||||
if (!title.empty()) {
|
||||
XChangeProperty(xdisplay_, xwindow_, gfx::GetAtom(kNetWMName),
|
||||
gfx::GetAtom(kUTF8String), 8, PropModeReplace,
|
||||
reinterpret_cast<const unsigned char*>(title.c_str()),
|
||||
title.size());
|
||||
}
|
||||
}
|
||||
|
||||
CefWindowX11::~CefWindowX11() {
|
||||
|
@@ -29,7 +29,8 @@ class CefWindowX11 : public ui::PlatformEventDispatcher {
|
||||
public:
|
||||
CefWindowX11(CefRefPtr<CefBrowserHostImpl> browser,
|
||||
::Window parent_xwindow,
|
||||
const gfx::Rect& bounds);
|
||||
const gfx::Rect& bounds,
|
||||
const std::string& title);
|
||||
~CefWindowX11() override;
|
||||
|
||||
void Close();
|
||||
|
@@ -30,6 +30,9 @@
|
||||
|
||||
namespace {
|
||||
|
||||
const void* kAuthCallbackHolderUserDataKey =
|
||||
static_cast<const void*>(&kAuthCallbackHolderUserDataKey);
|
||||
|
||||
class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback {
|
||||
public:
|
||||
typedef net::CompletionOnceCallback CallbackType;
|
||||
@@ -223,6 +226,19 @@ class CefAuthCallbackImpl : public CefAuthCallback {
|
||||
IMPLEMENT_REFCOUNTING(CefAuthCallbackImpl);
|
||||
};
|
||||
|
||||
// Invalidates CefAuthCallbackImpl::callback_ if the URLRequest is deleted
|
||||
// before the callback.
|
||||
class AuthCallbackHolder : public base::SupportsUserData::Data {
|
||||
public:
|
||||
explicit AuthCallbackHolder(CefRefPtr<CefAuthCallbackImpl> callback)
|
||||
: callback_(callback) {}
|
||||
|
||||
~AuthCallbackHolder() override { callback_->Disconnect().Reset(); }
|
||||
|
||||
private:
|
||||
CefRefPtr<CefAuthCallbackImpl> callback_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
CefNetworkDelegate::CefNetworkDelegate() : force_google_safesearch_(nullptr) {}
|
||||
@@ -401,6 +417,9 @@ net::NetworkDelegate::AuthRequiredResponse CefNetworkDelegate::OnAuthRequired(
|
||||
browser.get(), frame, auth_info.is_proxy,
|
||||
auth_info.challenger.host(), auth_info.challenger.port(),
|
||||
auth_info.realm, auth_info.scheme, callbackPtr.get())) {
|
||||
request->SetUserData(
|
||||
kAuthCallbackHolderUserDataKey,
|
||||
std::make_unique<AuthCallbackHolder>(callbackPtr));
|
||||
return AUTH_REQUIRED_RESPONSE_IO_PENDING;
|
||||
} else {
|
||||
callback = callbackPtr->Disconnect();
|
||||
@@ -421,6 +440,8 @@ net::NetworkDelegate::AuthRequiredResponse CefNetworkDelegate::OnAuthRequired(
|
||||
auth_info.is_proxy, auth_info.challenger.host(),
|
||||
auth_info.challenger.port(), auth_info.realm, auth_info.scheme,
|
||||
callbackPtr.get())) {
|
||||
request->SetUserData(kAuthCallbackHolderUserDataKey,
|
||||
std::make_unique<AuthCallbackHolder>(callbackPtr));
|
||||
return AUTH_REQUIRED_RESPONSE_IO_PENDING;
|
||||
} else {
|
||||
callback = callbackPtr->Disconnect();
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
|
||||
#include "content/browser/web_contents/web_contents_impl.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "ui/events/base_event_utils.h"
|
||||
|
||||
CefBrowserPlatformDelegateOsr::CefBrowserPlatformDelegateOsr(
|
||||
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate)
|
||||
@@ -109,6 +110,12 @@ void CefBrowserPlatformDelegateOsr::SendMouseWheelEvent(
|
||||
view->SendMouseWheelEvent(event);
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateOsr::SendTouchEvent(const CefTouchEvent& event) {
|
||||
CefRenderWidgetHostViewOSR* view = GetOSRHostView();
|
||||
if (view)
|
||||
view->SendTouchEvent(event);
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateOsr::SendFocusEvent(bool setFocus) {
|
||||
CefRenderWidgetHostViewOSR* view = GetOSRHostView();
|
||||
if (view)
|
||||
|
@@ -35,6 +35,7 @@ class CefBrowserPlatformDelegateOsr
|
||||
void SendKeyEvent(const content::NativeWebKeyboardEvent& event) override;
|
||||
void SendMouseEvent(const blink::WebMouseEvent& event) override;
|
||||
void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event) override;
|
||||
void SendTouchEvent(const CefTouchEvent& event) override;
|
||||
void SendFocusEvent(bool setFocus) override;
|
||||
gfx::Point GetScreenPoint(const gfx::Point& view) const override;
|
||||
void ViewText(const std::string& text) override;
|
||||
|
251
libcef/browser/osr/motion_event_osr.cc
Normal file
251
libcef/browser/osr/motion_event_osr.cc
Normal file
@@ -0,0 +1,251 @@
|
||||
// Copyright (c) 2017 The Chromium Embedded Framework Authors.
|
||||
// Portions copyright (c) 2012 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/browser/osr/motion_event_osr.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "ui/events/base_event_utils.h"
|
||||
#include "ui/events/gesture_detection/gesture_configuration.h"
|
||||
|
||||
namespace {
|
||||
|
||||
ui::MotionEvent::ToolType CefPointerTypeToMotionEventToolType(
|
||||
cef_pointer_type_t pointer_type) {
|
||||
switch (pointer_type) {
|
||||
case CEF_POINTER_TYPE_TOUCH:
|
||||
return ui::MotionEvent::ToolType::FINGER;
|
||||
case CEF_POINTER_TYPE_MOUSE:
|
||||
return ui::MotionEvent::ToolType::MOUSE;
|
||||
case CEF_POINTER_TYPE_PEN:
|
||||
return ui::MotionEvent::ToolType::STYLUS;
|
||||
case CEF_POINTER_TYPE_ERASER:
|
||||
return ui::MotionEvent::ToolType::ERASER;
|
||||
case CEF_POINTER_TYPE_UNKNOWN:
|
||||
return ui::MotionEvent::ToolType::UNKNOWN;
|
||||
}
|
||||
NOTREACHED();
|
||||
return ui::MotionEvent::ToolType::UNKNOWN;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
CefMotionEventOSR::CefMotionEventOSR() {
|
||||
std::fill(id_map_, id_map_ + blink::WebTouchEvent::kTouchesLengthCap, -1);
|
||||
}
|
||||
|
||||
CefMotionEventOSR::~CefMotionEventOSR() {}
|
||||
|
||||
int CefMotionEventOSR::GetSourceDeviceId(size_t pointer_index) const {
|
||||
if (IsValidIndex(pointer_index))
|
||||
return pointer(pointer_index).source_device_id;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Returns true if the touch was valid.
|
||||
bool CefMotionEventOSR::OnTouch(const CefTouchEvent& touch) {
|
||||
int id = LookupId(touch.id);
|
||||
bool pointer_id_is_active = id != -1;
|
||||
|
||||
if (touch.type == CEF_TET_PRESSED && pointer_id_is_active) {
|
||||
// Ignore pressed events for already active touches.
|
||||
return false;
|
||||
} else if (touch.type != CEF_TET_PRESSED && !pointer_id_is_active) {
|
||||
// When a window begins capturing touch events, we could have an active
|
||||
// touch stream transfered to us, resulting in touch move or touch up
|
||||
// events without associated touch down events. Ignore them.
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (touch.type) {
|
||||
case CEF_TET_PRESSED:
|
||||
id = AddId(touch.id);
|
||||
if (id == -1)
|
||||
return false;
|
||||
if (!AddTouch(touch, id))
|
||||
return false;
|
||||
break;
|
||||
|
||||
case CEF_TET_MOVED: {
|
||||
// Discard if touch is stationary.
|
||||
int index = FindPointerIndexOfId(id);
|
||||
if (IsValidIndex(index) &&
|
||||
(touch.x == GetX(index) && touch.y == GetY(index))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
[[fallthrough]];
|
||||
// No break.
|
||||
case CEF_TET_RELEASED:
|
||||
case CEF_TET_CANCELLED:
|
||||
// Removing these touch points needs to be postponed until after the
|
||||
// MotionEvent has been dispatched. This cleanup occurs in
|
||||
// CleanupRemovedTouchPoints.
|
||||
UpdateTouch(touch, id);
|
||||
break;
|
||||
}
|
||||
|
||||
UpdateCachedAction(touch, id);
|
||||
set_unique_event_id(ui::GetNextTouchEventId());
|
||||
set_flags(touch.modifiers);
|
||||
set_event_time(base::TimeTicks::Now());
|
||||
return true;
|
||||
}
|
||||
|
||||
// We can't cleanup removed touch points immediately upon receipt of a
|
||||
// TouchCancel or TouchRelease, as the MotionEvent needs to be able to report
|
||||
// information about those touch events. Once the MotionEvent has been
|
||||
// processed, we call CleanupRemovedTouchPoints to do the required
|
||||
// book-keeping.
|
||||
void CefMotionEventOSR::CleanupRemovedTouchPoints(const CefTouchEvent& event) {
|
||||
if (event.type != CEF_TET_RELEASED && event.type != CEF_TET_CANCELLED) {
|
||||
return;
|
||||
}
|
||||
|
||||
DCHECK(GetPointerCount());
|
||||
|
||||
int id = LookupId(event.id);
|
||||
int index_to_delete = FindPointerIndexOfId(id);
|
||||
set_action_index(-1);
|
||||
set_action(ui::MotionEvent::Action::NONE);
|
||||
if (IsValidIndex(index_to_delete)) {
|
||||
pointer(index_to_delete) = pointer(GetPointerCount() - 1);
|
||||
PopPointer();
|
||||
RemoveId(event.id);
|
||||
}
|
||||
}
|
||||
|
||||
// Reset unchanged touch point to StateStationary for touchmove and touchcancel.
|
||||
void CefMotionEventOSR::MarkUnchangedTouchPointsAsStationary(
|
||||
blink::WebTouchEvent* event,
|
||||
const CefTouchEvent& cef_event) {
|
||||
int id = LookupId(cef_event.id);
|
||||
if (event->GetType() == blink::WebInputEvent::kTouchMove ||
|
||||
event->GetType() == blink::WebInputEvent::kTouchCancel) {
|
||||
for (size_t i = 0; i < event->touches_length; ++i) {
|
||||
if (event->touches[i].id != id)
|
||||
event->touches[i].state = blink::WebTouchPoint::kStateStationary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int CefMotionEventOSR::LookupId(int id) {
|
||||
if (id == -1)
|
||||
return -1;
|
||||
|
||||
for (int i = 0; i < blink::WebTouchEvent::kTouchesLengthCap; i++) {
|
||||
if (id_map_[i] == id) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int CefMotionEventOSR::AddId(int id) {
|
||||
if (id == -1 || LookupId(id) >= 0)
|
||||
return -1;
|
||||
|
||||
for (int i = 0; i < blink::WebTouchEvent::kTouchesLengthCap; i++) {
|
||||
if (id_map_[i] == -1) {
|
||||
id_map_[i] = id;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void CefMotionEventOSR::RemoveId(int id) {
|
||||
for (int i = 0; i < blink::WebTouchEvent::kTouchesLengthCap; i++) {
|
||||
if (id_map_[i] == id) {
|
||||
id_map_[i] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CefMotionEventOSR::AddTouch(const CefTouchEvent& touch, int id) {
|
||||
if (GetPointerCount() == MotionEvent::MAX_TOUCH_POINT_COUNT)
|
||||
return false;
|
||||
|
||||
PushPointer(GetPointerPropertiesFromTouchEvent(touch, id));
|
||||
return true;
|
||||
}
|
||||
|
||||
void CefMotionEventOSR::UpdateTouch(const CefTouchEvent& touch, int id) {
|
||||
int index_to_update = FindPointerIndexOfId(id);
|
||||
if (IsValidIndex(index_to_update))
|
||||
pointer(index_to_update) = GetPointerPropertiesFromTouchEvent(touch, id);
|
||||
}
|
||||
|
||||
void CefMotionEventOSR::UpdateCachedAction(const CefTouchEvent& touch, int id) {
|
||||
DCHECK(GetPointerCount());
|
||||
switch (touch.type) {
|
||||
case CEF_TET_PRESSED:
|
||||
if (GetPointerCount() == 1) {
|
||||
set_action(ui::MotionEvent::Action::DOWN);
|
||||
} else {
|
||||
set_action(ui::MotionEvent::Action::POINTER_DOWN);
|
||||
set_action_index(FindPointerIndexOfId(id));
|
||||
}
|
||||
break;
|
||||
case CEF_TET_RELEASED:
|
||||
if (GetPointerCount() == 1) {
|
||||
set_action(ui::MotionEvent::Action::UP);
|
||||
} else {
|
||||
set_action(ui::MotionEvent::Action::POINTER_UP);
|
||||
set_action_index(FindPointerIndexOfId(id));
|
||||
}
|
||||
break;
|
||||
case CEF_TET_CANCELLED:
|
||||
set_action(ui::MotionEvent::Action::CANCEL);
|
||||
break;
|
||||
case CEF_TET_MOVED:
|
||||
set_action(ui::MotionEvent::Action::MOVE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool CefMotionEventOSR::IsValidIndex(int index) const {
|
||||
return (index >= 0) && (index < static_cast<int>(GetPointerCount()));
|
||||
}
|
||||
|
||||
ui::PointerProperties CefMotionEventOSR::GetPointerPropertiesFromTouchEvent(
|
||||
const CefTouchEvent& touch,
|
||||
int id) {
|
||||
ui::PointerProperties pointer_properties;
|
||||
pointer_properties.x = touch.x;
|
||||
pointer_properties.y = touch.y;
|
||||
pointer_properties.raw_x = touch.x;
|
||||
pointer_properties.raw_y = touch.y;
|
||||
pointer_properties.id = id;
|
||||
pointer_properties.pressure = touch.pressure;
|
||||
pointer_properties.source_device_id = 0;
|
||||
|
||||
pointer_properties.SetAxesAndOrientation(touch.radius_x, touch.radius_y,
|
||||
touch.rotation_angle);
|
||||
if (!pointer_properties.touch_major) {
|
||||
float default_size;
|
||||
switch (touch.pointer_type) {
|
||||
case CEF_POINTER_TYPE_PEN:
|
||||
case CEF_POINTER_TYPE_ERASER:
|
||||
// Default size for stylus events is 1x1.
|
||||
default_size = 1;
|
||||
break;
|
||||
default:
|
||||
default_size =
|
||||
2.f * ui::GestureConfiguration::GetInstance()->default_radius();
|
||||
break;
|
||||
}
|
||||
pointer_properties.touch_major = pointer_properties.touch_minor =
|
||||
default_size;
|
||||
pointer_properties.orientation = 0;
|
||||
}
|
||||
|
||||
pointer_properties.tool_type =
|
||||
CefPointerTypeToMotionEventToolType(touch.pointer_type);
|
||||
|
||||
return pointer_properties;
|
||||
}
|
59
libcef/browser/osr/motion_event_osr.h
Normal file
59
libcef/browser/osr/motion_event_osr.h
Normal file
@@ -0,0 +1,59 @@
|
||||
// Copyright (c) 2017 The Chromium Embedded Framework Authors.
|
||||
// Portions copyright (c) 2012 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_BROWSER_OSR_MOTION_EVENT_OSR_H_
|
||||
#define CEF_LIBCEF_BROWSER_OSR_MOTION_EVENT_OSR_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
|
||||
#include "third_party/blink/public/platform/web_touch_event.h"
|
||||
#include "ui/events/gesture_detection/motion_event_generic.h"
|
||||
|
||||
// Implementation of MotionEvent which takes a stream of CefTouchEvents.
|
||||
// This class is based on ui::MotionEventAura.
|
||||
class CefMotionEventOSR : public ui::MotionEventGeneric {
|
||||
public:
|
||||
CefMotionEventOSR();
|
||||
~CefMotionEventOSR() override;
|
||||
|
||||
int GetSourceDeviceId(size_t pointer_index) const override;
|
||||
|
||||
// Returns true if the touch was valid.
|
||||
bool OnTouch(const CefTouchEvent& touch);
|
||||
|
||||
// We can't cleanup removed touch points immediately upon receipt of a
|
||||
// TouchCancel or TouchRelease, as the MotionEvent needs to be able to report
|
||||
// information about those touch events. Once the MotionEvent has been
|
||||
// processed, we call CleanupRemovedTouchPoints to do the required
|
||||
// book-keeping.
|
||||
void CleanupRemovedTouchPoints(const CefTouchEvent& event);
|
||||
|
||||
// Reset unchanged touch point to StateStationary for touchmove and
|
||||
// touchcancel to make sure only send one ack per WebTouchEvent.
|
||||
void MarkUnchangedTouchPointsAsStationary(blink::WebTouchEvent* event,
|
||||
const CefTouchEvent& cef_event);
|
||||
|
||||
private:
|
||||
// Chromium can't cope with touch ids >31, so let's map the incoming
|
||||
// ids to a safe range.
|
||||
int id_map_[blink::WebTouchEvent::kTouchesLengthCap];
|
||||
|
||||
int LookupId(int id);
|
||||
int AddId(int id);
|
||||
void RemoveId(int id);
|
||||
|
||||
bool AddTouch(const CefTouchEvent& touch, int id);
|
||||
void UpdateTouch(const CefTouchEvent& touch, int id);
|
||||
void UpdateCachedAction(const CefTouchEvent& touch, int id);
|
||||
bool IsValidIndex(int index) const;
|
||||
ui::PointerProperties GetPointerPropertiesFromTouchEvent(
|
||||
const CefTouchEvent& touch,
|
||||
int id);
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefMotionEventOSR);
|
||||
};
|
||||
|
||||
#endif
|
@@ -31,8 +31,11 @@
|
||||
#include "content/browser/renderer_host/cursor_manager.h"
|
||||
#include "content/browser/renderer_host/delegated_frame_host.h"
|
||||
#include "content/browser/renderer_host/dip_util.h"
|
||||
#include "content/browser/renderer_host/input/motion_event_web.h"
|
||||
#include "content/browser/renderer_host/render_widget_host_delegate.h"
|
||||
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
||||
#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
|
||||
#include "content/common/content_switches_internal.h"
|
||||
#include "content/common/input_messages.h"
|
||||
#include "content/common/view_messages.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
@@ -43,6 +46,9 @@
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "media/base/video_frame.h"
|
||||
#include "ui/compositor/compositor_vsync_manager.h"
|
||||
#include "ui/events/blink/blink_event_util.h"
|
||||
#include "ui/events/gesture_detection/gesture_provider_config_helper.h"
|
||||
#include "ui/events/gesture_detection/motion_event.h"
|
||||
#include "ui/gfx/geometry/dip_util.h"
|
||||
#include "ui/gfx/geometry/size_conversions.h"
|
||||
|
||||
@@ -164,6 +170,23 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient {
|
||||
|
||||
#endif // !defined(OS_MACOSX)
|
||||
|
||||
ui::GestureProvider::Config CreateGestureProviderConfig() {
|
||||
ui::GestureProvider::Config config = ui::GetGestureProviderConfig(
|
||||
ui::GestureProviderConfigType::CURRENT_PLATFORM);
|
||||
return config;
|
||||
}
|
||||
|
||||
ui::LatencyInfo CreateLatencyInfo(const blink::WebInputEvent& event) {
|
||||
ui::LatencyInfo latency_info;
|
||||
// The latency number should only be added if the timestamp is valid.
|
||||
base::TimeTicks time = event.TimeStamp();
|
||||
if (!time.is_null()) {
|
||||
latency_info.AddLatencyNumberWithTimestamp(
|
||||
ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, time, 1);
|
||||
}
|
||||
return latency_info;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// Used for managing copy requests when GPU compositing is enabled. Based on
|
||||
@@ -319,6 +342,7 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
|
||||
software_output_device_(NULL),
|
||||
hold_resize_(false),
|
||||
pending_resize_(false),
|
||||
pending_resize_force_(false),
|
||||
render_widget_host_(content::RenderWidgetHostImpl::From(widget)),
|
||||
has_parent_(parent_host_view != NULL),
|
||||
parent_host_view_(parent_host_view),
|
||||
@@ -326,8 +350,11 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
|
||||
child_host_view_(NULL),
|
||||
is_showing_(!render_widget_host_->is_hidden()),
|
||||
is_destroyed_(false),
|
||||
pinch_zoom_enabled_(content::IsPinchToZoomEnabled()),
|
||||
is_scroll_offset_changed_pending_(false),
|
||||
mouse_wheel_phase_handler_(this),
|
||||
gesture_provider_(CreateGestureProviderConfig(), this),
|
||||
forward_touch_to_popup_(false),
|
||||
weak_ptr_factory_(this) {
|
||||
DCHECK(render_widget_host_);
|
||||
DCHECK(!render_widget_host_->GetView());
|
||||
@@ -353,7 +380,7 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
|
||||
delegated_frame_host_ = std::make_unique<content::DelegatedFrameHost>(
|
||||
AllocateFrameSinkId(is_guest_view_hack),
|
||||
delegated_frame_host_client_.get(),
|
||||
true /* should_register_frame_sink_id */);
|
||||
false /* should_register_frame_sink_id */);
|
||||
|
||||
root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
|
||||
#endif
|
||||
@@ -386,6 +413,7 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
|
||||
|
||||
compositor_->SetDelegate(this);
|
||||
compositor_->SetRootLayer(root_layer_.get());
|
||||
compositor_->AddChildFrameSink(GetFrameSinkId());
|
||||
#endif
|
||||
|
||||
if (browser_impl_.get())
|
||||
@@ -395,6 +423,15 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
|
||||
|
||||
// Do this last because it may result in a call to SetNeedsBeginFrames.
|
||||
render_widget_host_->SetView(this);
|
||||
|
||||
if (GetTextInputManager())
|
||||
GetTextInputManager()->AddObserver(this);
|
||||
|
||||
if (render_widget_host_->delegate() &&
|
||||
render_widget_host_->delegate()->GetInputEventRouter()) {
|
||||
render_widget_host_->delegate()->GetInputEventRouter()->AddFrameSinkIdOwner(
|
||||
GetFrameSinkId(), this);
|
||||
}
|
||||
}
|
||||
|
||||
CefRenderWidgetHostViewOSR::~CefRenderWidgetHostViewOSR() {
|
||||
@@ -424,6 +461,9 @@ CefRenderWidgetHostViewOSR::~CefRenderWidgetHostViewOSR() {
|
||||
DCHECK(popup_host_view_ == NULL);
|
||||
DCHECK(child_host_view_ == NULL);
|
||||
DCHECK(guest_host_views_.empty());
|
||||
|
||||
if (text_input_manager_)
|
||||
text_input_manager_->RemoveObserver(this);
|
||||
}
|
||||
|
||||
// Called for full-screen widgets.
|
||||
@@ -493,6 +533,8 @@ void CefRenderWidgetHostViewOSR::Hide() {
|
||||
if (!is_showing_)
|
||||
return;
|
||||
|
||||
is_showing_ = false;
|
||||
|
||||
if (browser_impl_.get())
|
||||
browser_impl_->CancelContextMenu();
|
||||
|
||||
@@ -505,8 +547,6 @@ void CefRenderWidgetHostViewOSR::Hide() {
|
||||
GetDelegatedFrameHost()->WasHidden();
|
||||
GetDelegatedFrameHost()->DetachFromCompositor();
|
||||
#endif
|
||||
|
||||
is_showing_ = false;
|
||||
}
|
||||
|
||||
bool CefRenderWidgetHostViewOSR::IsShowing() {
|
||||
@@ -848,7 +888,13 @@ content::CursorManager* CefRenderWidgetHostViewOSR::GetCursorManager() {
|
||||
return cursor_manager_.get();
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SetIsLoading(bool is_loading) {}
|
||||
void CefRenderWidgetHostViewOSR::SetIsLoading(bool is_loading) {
|
||||
if (!is_loading)
|
||||
return;
|
||||
// Make sure gesture detection is fresh.
|
||||
gesture_provider_.ResetDetection();
|
||||
forward_touch_to_popup_ = false;
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::RenderProcessGone(
|
||||
base::TerminationStatus status,
|
||||
@@ -1078,6 +1124,27 @@ const viz::FrameSinkId& CefRenderWidgetHostViewOSR::GetFrameSinkId() const {
|
||||
return GetDelegatedFrameHost()->frame_sink_id();
|
||||
}
|
||||
|
||||
viz::FrameSinkId CefRenderWidgetHostViewOSR::GetRootFrameSinkId() {
|
||||
#if defined(OS_MACOSX)
|
||||
return browser_compositor_->GetRootFrameSinkId();
|
||||
#else
|
||||
return compositor_->frame_sink_id();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
viz::ScopedSurfaceIdAllocator
|
||||
CefRenderWidgetHostViewOSR::DidUpdateVisualProperties(
|
||||
const cc::RenderFrameMetadata& metadata) {
|
||||
bool force =
|
||||
local_surface_id_allocation_ != metadata.local_surface_id_allocation;
|
||||
base::OnceCallback<void()> allocation_task =
|
||||
base::BindOnce(&CefRenderWidgetHostViewOSR::SynchronizeVisualProperties,
|
||||
weak_ptr_factory_.GetWeakPtr(), force);
|
||||
return viz::ScopedSurfaceIdAllocator(std::move(allocation_task));
|
||||
}
|
||||
#endif
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SetNeedsBeginFrames(bool enabled) {
|
||||
SetFrameRate();
|
||||
|
||||
@@ -1179,14 +1246,16 @@ bool CefRenderWidgetHostViewOSR::InstallTransparency() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SynchronizeVisualProperties() {
|
||||
void CefRenderWidgetHostViewOSR::SynchronizeVisualProperties(bool force) {
|
||||
if (hold_resize_) {
|
||||
if (!pending_resize_)
|
||||
pending_resize_ = true;
|
||||
if (force)
|
||||
pending_resize_force_ = true;
|
||||
return;
|
||||
}
|
||||
|
||||
ResizeRootLayer(false);
|
||||
ResizeRootLayer(force);
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() {
|
||||
@@ -1194,7 +1263,7 @@ void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() {
|
||||
if (!render_widget_host_)
|
||||
return;
|
||||
|
||||
// TODO(OSR): Update the backing store.
|
||||
SynchronizeVisualProperties();
|
||||
|
||||
if (render_widget_host_->delegate())
|
||||
render_widget_host_->delegate()->SendScreenRects();
|
||||
@@ -1248,6 +1317,9 @@ void CefRenderWidgetHostViewOSR::SendExternalBeginFrame() {
|
||||
DCHECK(begin_frame_args.IsValid());
|
||||
begin_frame_number_++;
|
||||
|
||||
if (render_widget_host_)
|
||||
render_widget_host_->ProgressFlingIfNeeded(frame_time);
|
||||
|
||||
if (renderer_compositor_frame_sink_) {
|
||||
GetCompositor()->context_factory_private()->IssueExternalBeginFrame(
|
||||
GetCompositor(), begin_frame_args);
|
||||
@@ -1397,6 +1469,78 @@ void CefRenderWidgetHostViewOSR::SendMouseWheelEvent(
|
||||
}
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SendTouchEvent(const CefTouchEvent& event) {
|
||||
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::SendTouchEvent");
|
||||
|
||||
if (!IsPopupWidget() && popup_host_view_) {
|
||||
if (!forward_touch_to_popup_ && event.type == CEF_TET_PRESSED &&
|
||||
pointer_state_.GetPointerCount() == 0) {
|
||||
forward_touch_to_popup_ =
|
||||
popup_host_view_->popup_position_.Contains(event.x, event.y);
|
||||
}
|
||||
|
||||
if (forward_touch_to_popup_) {
|
||||
CefTouchEvent popup_event(event);
|
||||
popup_event.x -= popup_host_view_->popup_position_.x();
|
||||
popup_event.y -= popup_host_view_->popup_position_.y();
|
||||
popup_host_view_->SendTouchEvent(popup_event);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Update the touch event first.
|
||||
if (!pointer_state_.OnTouch(event))
|
||||
return;
|
||||
|
||||
ui::FilteredGestureProvider::TouchHandlingResult result =
|
||||
gesture_provider_.OnTouchEvent(pointer_state_);
|
||||
|
||||
blink::WebTouchEvent touch_event = ui::CreateWebTouchEventFromMotionEvent(
|
||||
pointer_state_, result.moved_beyond_slop_region, false);
|
||||
|
||||
pointer_state_.CleanupRemovedTouchPoints(event);
|
||||
|
||||
// Set unchanged touch point to StateStationary for touchmove and
|
||||
// touchcancel to make sure only send one ack per WebTouchEvent.
|
||||
if (!result.succeeded)
|
||||
pointer_state_.MarkUnchangedTouchPointsAsStationary(&touch_event, event);
|
||||
|
||||
if (!render_widget_host_)
|
||||
return;
|
||||
|
||||
ui::LatencyInfo latency_info = CreateLatencyInfo(touch_event);
|
||||
if (ShouldRouteEvents()) {
|
||||
render_widget_host_->delegate()->GetInputEventRouter()->RouteTouchEvent(
|
||||
this, &touch_event, latency_info);
|
||||
} else {
|
||||
render_widget_host_->ForwardTouchEventWithLatencyInfo(touch_event,
|
||||
latency_info);
|
||||
}
|
||||
|
||||
bool touch_end = touch_event.GetType() == blink::WebInputEvent::kTouchEnd ||
|
||||
touch_event.GetType() == blink::WebInputEvent::kTouchCancel;
|
||||
|
||||
if (touch_end && IsPopupWidget() && parent_host_view_ &&
|
||||
parent_host_view_->popup_host_view_ == this) {
|
||||
parent_host_view_->forward_touch_to_popup_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool CefRenderWidgetHostViewOSR::ShouldRouteEvents() const {
|
||||
if (!render_widget_host_->delegate())
|
||||
return false;
|
||||
|
||||
// Do not route events that are currently targeted to page popups such as
|
||||
// <select> element drop-downs, since these cannot contain cross-process
|
||||
// frames.
|
||||
if (!render_widget_host_->delegate()->IsWidgetForMainFrame(
|
||||
render_widget_host_)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !!render_widget_host_->delegate()->GetInputEventRouter();
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SendFocusEvent(bool focus) {
|
||||
if (!render_widget_host_)
|
||||
return;
|
||||
@@ -1415,6 +1559,66 @@ void CefRenderWidgetHostViewOSR::SendFocusEvent(bool focus) {
|
||||
}
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::OnUpdateTextInputStateCalled(
|
||||
content::TextInputManager* text_input_manager,
|
||||
content::RenderWidgetHostViewBase* updated_view,
|
||||
bool did_update_state) {
|
||||
const content::TextInputState* state =
|
||||
text_input_manager->GetTextInputState();
|
||||
if (state && !state->show_ime_if_needed)
|
||||
return;
|
||||
|
||||
CefRenderHandler::TextInputMode mode = CEF_TEXT_INPUT_MODE_NONE;
|
||||
if (state && state->type != ui::TEXT_INPUT_TYPE_NONE) {
|
||||
static_assert(
|
||||
static_cast<int>(CEF_TEXT_INPUT_MODE_MAX) ==
|
||||
static_cast<int>(ui::TEXT_INPUT_MODE_MAX),
|
||||
"Enum values in cef_text_input_mode_t must match ui::TextInputMode");
|
||||
mode = static_cast<CefRenderHandler::TextInputMode>(state->mode);
|
||||
}
|
||||
|
||||
CefRefPtr<CefRenderHandler> handler =
|
||||
browser_impl_->GetClient()->GetRenderHandler();
|
||||
CHECK(handler);
|
||||
|
||||
handler->OnVirtualKeyboardRequested(browser_impl_->GetBrowser(), mode);
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::ProcessAckedTouchEvent(
|
||||
const content::TouchEventWithLatencyInfo& touch,
|
||||
content::InputEventAckState ack_result) {
|
||||
const bool event_consumed =
|
||||
ack_result == content::INPUT_EVENT_ACK_STATE_CONSUMED;
|
||||
gesture_provider_.OnTouchEventAck(touch.event.unique_touch_event_id,
|
||||
event_consumed, false);
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::OnGestureEvent(
|
||||
const ui::GestureEventData& gesture) {
|
||||
if ((gesture.type() == ui::ET_GESTURE_PINCH_BEGIN ||
|
||||
gesture.type() == ui::ET_GESTURE_PINCH_UPDATE ||
|
||||
gesture.type() == ui::ET_GESTURE_PINCH_END) &&
|
||||
!pinch_zoom_enabled_) {
|
||||
return;
|
||||
}
|
||||
|
||||
blink::WebGestureEvent web_event =
|
||||
ui::CreateWebGestureEventFromGestureEventData(gesture);
|
||||
|
||||
// without this check, forwarding gestures does not work!
|
||||
if (web_event.GetType() == blink::WebInputEvent::kUndefined)
|
||||
return;
|
||||
|
||||
ui::LatencyInfo latency_info = CreateLatencyInfo(web_event);
|
||||
if (ShouldRouteEvents()) {
|
||||
render_widget_host_->delegate()->GetInputEventRouter()->RouteGestureEvent(
|
||||
this, &web_event, latency_info);
|
||||
} else {
|
||||
render_widget_host_->ForwardGestureEventWithLatencyInfo(web_event,
|
||||
latency_info);
|
||||
}
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::UpdateFrameRate() {
|
||||
frame_rate_threshold_us_ = 0;
|
||||
SetFrameRate();
|
||||
@@ -1435,11 +1639,13 @@ void CefRenderWidgetHostViewOSR::ReleaseResize() {
|
||||
|
||||
hold_resize_ = false;
|
||||
if (pending_resize_) {
|
||||
bool force = pending_resize_force_;
|
||||
pending_resize_ = false;
|
||||
pending_resize_force_ = false;
|
||||
CEF_POST_TASK(
|
||||
CEF_UIT,
|
||||
base::Bind(&CefRenderWidgetHostViewOSR::SynchronizeVisualProperties,
|
||||
weak_ptr_factory_.GetWeakPtr()));
|
||||
weak_ptr_factory_.GetWeakPtr(), force));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1644,6 +1850,9 @@ void CefRenderWidgetHostViewOSR::SendBeginFrame(base::TimeTicks frame_time,
|
||||
DCHECK(begin_frame_args.IsValid());
|
||||
begin_frame_number_++;
|
||||
|
||||
if (render_widget_host_)
|
||||
render_widget_host_->ProgressFlingIfNeeded(frame_time);
|
||||
|
||||
if (renderer_compositor_frame_sink_) {
|
||||
renderer_compositor_frame_sink_->OnBeginFrame(begin_frame_args, {});
|
||||
}
|
||||
|
@@ -14,15 +14,22 @@
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_browser.h"
|
||||
|
||||
#include "libcef/browser/osr/motion_event_osr.h"
|
||||
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "build/build_config.h"
|
||||
#include "components/viz/common/frame_sinks/begin_frame_source.h"
|
||||
#include "components/viz/common/surfaces/parent_local_surface_id_allocator.h"
|
||||
#include "content/browser/renderer_host/input/mouse_wheel_phase_handler.h"
|
||||
#include "content/browser/renderer_host/render_widget_host_view_base.h"
|
||||
#include "content/browser/renderer_host/text_input_manager.h"
|
||||
#include "content/public/common/widget_type.h"
|
||||
#include "ui/compositor/compositor.h"
|
||||
#include "ui/compositor/external_begin_frame_client.h"
|
||||
#include "ui/events/base_event_utils.h"
|
||||
#include "ui/events/gesture_detection/filtered_gesture_provider.h"
|
||||
#include "ui/events/gesture_detection/gesture_configuration.h"
|
||||
#include "ui/events/gesture_detection/motion_event_generic.h"
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
@@ -96,7 +103,9 @@ class MacHelper;
|
||||
|
||||
class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
public ui::ExternalBeginFrameClient,
|
||||
public ui::CompositorDelegate {
|
||||
public ui::CompositorDelegate,
|
||||
public content::TextInputManager::Observer,
|
||||
public ui::GestureProviderClient {
|
||||
public:
|
||||
CefRenderWidgetHostViewOSR(SkColor background_color,
|
||||
bool use_shared_texture,
|
||||
@@ -166,10 +175,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
void GetScreenInfo(content::ScreenInfo* results) const override;
|
||||
void TransformPointToRootSurface(gfx::PointF* point) override;
|
||||
gfx::Rect GetBoundsInRootWindow() override;
|
||||
#if defined(OS_MACOSX)
|
||||
viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(
|
||||
const cc::RenderFrameMetadata& metadata) override;
|
||||
#endif
|
||||
viz::SurfaceId GetCurrentSurfaceId() const override;
|
||||
content::BrowserAccessibilityManager* CreateBrowserAccessibilityManager(
|
||||
content::BrowserAccessibilityDelegate* delegate,
|
||||
@@ -200,6 +207,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
const viz::LocalSurfaceIdAllocation& GetLocalSurfaceIdAllocation()
|
||||
const override;
|
||||
const viz::FrameSinkId& GetFrameSinkId() const override;
|
||||
viz::FrameSinkId GetRootFrameSinkId() override;
|
||||
|
||||
// ui::ExternalBeginFrameClient implementation:
|
||||
void OnDisplayDidFinishFrame(const viz::BeginFrameAck& ack) override;
|
||||
@@ -209,15 +217,28 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
std::unique_ptr<viz::SoftwareOutputDevice> CreateSoftwareOutputDevice(
|
||||
ui::Compositor* compositor) override;
|
||||
|
||||
// TextInputManager::Observer implementation.
|
||||
void OnUpdateTextInputStateCalled(
|
||||
content::TextInputManager* text_input_manager,
|
||||
RenderWidgetHostViewBase* updated_view,
|
||||
bool did_update_state) override;
|
||||
|
||||
// ui::GestureProviderClient implementation.
|
||||
void ProcessAckedTouchEvent(const content::TouchEventWithLatencyInfo& touch,
|
||||
content::InputEventAckState ack_result) override;
|
||||
void OnGestureEvent(const ui::GestureEventData& gesture) override;
|
||||
|
||||
bool InstallTransparency();
|
||||
|
||||
void SynchronizeVisualProperties();
|
||||
void SynchronizeVisualProperties(bool force = false);
|
||||
void OnScreenInfoChanged();
|
||||
void Invalidate(CefBrowserHost::PaintElementType type);
|
||||
void SendExternalBeginFrame();
|
||||
void SendKeyEvent(const content::NativeWebKeyboardEvent& event);
|
||||
void SendMouseEvent(const blink::WebMouseEvent& event);
|
||||
void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event);
|
||||
void SendTouchEvent(const CefTouchEvent& event);
|
||||
bool ShouldRouteEvents() const;
|
||||
void SendFocusEvent(bool focus);
|
||||
void UpdateFrameRate();
|
||||
|
||||
@@ -249,6 +270,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
}
|
||||
|
||||
void set_popup_host_view(CefRenderWidgetHostViewOSR* popup_view) {
|
||||
if (popup_view != popup_host_view_)
|
||||
forward_touch_to_popup_ = false;
|
||||
popup_host_view_ = popup_view;
|
||||
}
|
||||
void set_child_host_view(CefRenderWidgetHostViewOSR* popup_view) {
|
||||
@@ -350,8 +373,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
std::unique_ptr<content::BrowserCompositorMac> browser_compositor_;
|
||||
MacHelper* mac_helper_;
|
||||
#elif defined(USE_X11)
|
||||
CefWindowX11* window_;
|
||||
std::unique_ptr<ui::XScopedCursor> invisible_cursor_;
|
||||
CefWindowX11* window_;
|
||||
std::unique_ptr<ui::XScopedCursor> invisible_cursor_;
|
||||
#endif
|
||||
|
||||
std::unique_ptr<content::CursorManager> cursor_manager_;
|
||||
@@ -377,6 +400,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
|
||||
bool hold_resize_;
|
||||
bool pending_resize_;
|
||||
bool pending_resize_force_;
|
||||
|
||||
// The associated Model. While |this| is being Destroyed,
|
||||
// |render_widget_host_| is NULL and the message loop is run one last time
|
||||
@@ -397,6 +421,10 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
base::Lock damage_rect_lock_;
|
||||
std::map<uint32_t, gfx::Rect> damage_rects_;
|
||||
|
||||
// Whether pinch-to-zoom should be enabled and pinch events forwarded to the
|
||||
// renderer.
|
||||
bool pinch_zoom_enabled_;
|
||||
|
||||
// The last scroll offset of the view.
|
||||
gfx::Vector2dF last_scroll_offset_;
|
||||
bool is_scroll_offset_changed_pending_;
|
||||
@@ -411,6 +439,12 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
// EnsureSurfaceSynchronizedForLayoutTest().
|
||||
uint32_t latest_capture_sequence_number_ = 0u;
|
||||
|
||||
// ui::GestureProviderClient implementation.
|
||||
ui::FilteredGestureProvider gesture_provider_;
|
||||
|
||||
CefMotionEventOSR pointer_state_;
|
||||
bool forward_touch_to_popup_;
|
||||
|
||||
base::WeakPtrFactory<CefRenderWidgetHostViewOSR> weak_ptr_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefRenderWidgetHostViewOSR);
|
||||
|
@@ -167,7 +167,7 @@ XCursorCache* cursor_cache = nullptr;
|
||||
void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget(
|
||||
bool is_guest_view_hack) {
|
||||
// Create a hidden 1x1 window. It will delete itself on close.
|
||||
window_ = new CefWindowX11(NULL, None, gfx::Rect(0, 0, 1, 1));
|
||||
window_ = new CefWindowX11(NULL, None, gfx::Rect(0, 0, 1, 1), "");
|
||||
compositor_widget_ = window_->xwindow();
|
||||
}
|
||||
|
||||
|
@@ -192,6 +192,7 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
|
||||
// DevTools preferences.
|
||||
// Based on DevToolsWindow::RegisterProfilePrefs.
|
||||
registry->RegisterDictionaryPref(prefs::kDevToolsPreferences);
|
||||
registry->RegisterDictionaryPref(prefs::kDevToolsEditedFiles);
|
||||
|
||||
if (command_line->HasSwitch(switches::kEnablePreferenceTesting)) {
|
||||
// Preferences used with unit tests.
|
||||
|
@@ -204,6 +204,9 @@ void CefBrowserPlatformDelegateViews::SendMouseWheelEvent(
|
||||
host->GetWidget()->ForwardWheelEvent(event);
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateViews::SendTouchEvent(
|
||||
const CefTouchEvent& event) {}
|
||||
|
||||
void CefBrowserPlatformDelegateViews::SendFocusEvent(bool setFocus) {
|
||||
// Will result in a call to WebContents::Focus().
|
||||
if (setFocus && browser_view_->root_view())
|
||||
|
@@ -48,6 +48,7 @@ class CefBrowserPlatformDelegateViews
|
||||
void SendKeyEvent(const content::NativeWebKeyboardEvent& event) override;
|
||||
void SendMouseEvent(const blink::WebMouseEvent& event) override;
|
||||
void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event) override;
|
||||
void SendTouchEvent(const CefTouchEvent& event) override;
|
||||
void SendFocusEvent(bool setFocus) override;
|
||||
gfx::Point GetScreenPoint(const gfx::Point& view) const override;
|
||||
void ViewText(const std::string& text) override;
|
||||
|
@@ -81,6 +81,9 @@ class CefContentClient : public content::ContentClient,
|
||||
// A scheme that can bypass Content-Security-Policy (CSP) checks. This value
|
||||
// should be false in most cases where |is_standard| is true.
|
||||
bool is_csp_bypassing;
|
||||
|
||||
// A scheme that can perform fetch request.
|
||||
bool is_fetch_enabled;
|
||||
};
|
||||
typedef std::list<SchemeInfo> SchemeInfoList;
|
||||
|
||||
|
@@ -3,6 +3,11 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "libcef/common/main_delegate.h"
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#include "libcef/browser/browser_message_loop.h"
|
||||
#include "libcef/browser/content_browser_client.h"
|
||||
#include "libcef/browser/context.h"
|
||||
@@ -132,7 +137,7 @@ void OverrideChildProcessPath() {
|
||||
|
||||
base::FilePath GetResourcesFilePath() {
|
||||
base::FilePath pak_dir;
|
||||
base::PathService::Get(base::DIR_MODULE, &pak_dir);
|
||||
base::PathService::Get(base::DIR_ASSETS, &pak_dir);
|
||||
return pak_dir;
|
||||
}
|
||||
|
||||
@@ -257,6 +262,19 @@ bool IsScaleFactorSupported(ui::ScaleFactor scale_factor) {
|
||||
scale_factor) != supported_scale_factors.end();
|
||||
}
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
// Look for binary files (*.bin, *.dat, *.pak, chrome-sandbox, libGLESv2.so,
|
||||
// libEGL.so, locales/*.pak, swiftshader/*.so) next to libcef instead of the exe
|
||||
// on Linux. This is already the default on Windows.
|
||||
void OverrideAssetPath() {
|
||||
Dl_info dl_info;
|
||||
if (dladdr(reinterpret_cast<const void*>(&OverrideAssetPath), &dl_info)) {
|
||||
base::FilePath path = base::FilePath(dl_info.dli_fname).DirName();
|
||||
base::PathService::Override(base::DIR_ASSETS, path);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Used to run the UI on a separate thread.
|
||||
class CefUIThread : public base::Thread {
|
||||
public:
|
||||
@@ -313,6 +331,10 @@ CefMainDelegate::CefMainDelegate(CefRefPtr<CefApp> application)
|
||||
// in the binary.
|
||||
extern void base_impl_stub();
|
||||
base_impl_stub();
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
OverrideAssetPath();
|
||||
#endif
|
||||
}
|
||||
|
||||
CefMainDelegate::~CefMainDelegate() {}
|
||||
|
@@ -48,11 +48,13 @@ const char kReferrerLowerCase[] = "referer";
|
||||
const char kContentTypeLowerCase[] = "content-type";
|
||||
const char kCacheControlLowerCase[] = "cache-control";
|
||||
const char kCacheControlDirectiveNoCacheLowerCase[] = "no-cache";
|
||||
const char kCacheControlDirectiveNoStoreLowerCase[] = "no-store";
|
||||
const char kCacheControlDirectiveOnlyIfCachedLowerCase[] = "only-if-cached";
|
||||
const char kApplicationFormURLEncoded[] = "application/x-www-form-urlencoded";
|
||||
|
||||
// Mask of values that configure the cache policy.
|
||||
const int kURCachePolicyMask = (UR_FLAG_SKIP_CACHE | UR_FLAG_ONLY_FROM_CACHE);
|
||||
const int kURCachePolicyMask =
|
||||
(UR_FLAG_SKIP_CACHE | UR_FLAG_ONLY_FROM_CACHE | UR_FLAG_DISABLE_CACHE);
|
||||
|
||||
// A subclass of net::UploadBytesElementReader that keeps the associated
|
||||
// UploadElement alive until the request completes.
|
||||
@@ -142,6 +144,9 @@ int GetCacheControlHeaderPolicy(CefRequest::HeaderMap headerMap) {
|
||||
} else if (base::LowerCaseEqualsASCII(
|
||||
piece, kCacheControlDirectiveOnlyIfCachedLowerCase)) {
|
||||
flags |= UR_FLAG_ONLY_FROM_CACHE;
|
||||
} else if (base::LowerCaseEqualsASCII(
|
||||
piece, kCacheControlDirectiveNoStoreLowerCase)) {
|
||||
flags |= UR_FLAG_DISABLE_CACHE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,12 +156,17 @@ int GetCacheControlHeaderPolicy(CefRequest::HeaderMap headerMap) {
|
||||
|
||||
// Convert cef_urlrequest_flags_t to blink::WebCachePolicy.
|
||||
blink::mojom::FetchCacheMode GetFetchCacheMode(int ur_flags) {
|
||||
if ((ur_flags & kURCachePolicyMask) == kURCachePolicyMask) {
|
||||
const bool skip_cache{ur_flags & UR_FLAG_SKIP_CACHE};
|
||||
const bool only_from_cache{ur_flags & UR_FLAG_ONLY_FROM_CACHE};
|
||||
const bool disable_cache{ur_flags & UR_FLAG_DISABLE_CACHE};
|
||||
if (only_from_cache && (skip_cache || disable_cache)) {
|
||||
return blink::mojom::FetchCacheMode::kUnspecifiedForceCacheMiss;
|
||||
} else if (ur_flags & UR_FLAG_SKIP_CACHE) {
|
||||
} else if (skip_cache) {
|
||||
return blink::mojom::FetchCacheMode::kBypassCache;
|
||||
} else if (ur_flags & UR_FLAG_ONLY_FROM_CACHE) {
|
||||
} else if (only_from_cache) {
|
||||
return blink::mojom::FetchCacheMode::kOnlyIfCached;
|
||||
} else if (disable_cache) {
|
||||
return blink::mojom::FetchCacheMode::kNoStore;
|
||||
}
|
||||
return blink::mojom::FetchCacheMode::kDefault;
|
||||
}
|
||||
@@ -756,6 +766,9 @@ void CefRequestImpl::Get(net::URLFetcher& fetcher,
|
||||
if (flags & UR_FLAG_ONLY_FROM_CACHE) {
|
||||
net_flags |= net::LOAD_ONLY_FROM_CACHE | net::LOAD_SKIP_CACHE_VALIDATION;
|
||||
}
|
||||
if (flags & UR_FLAG_DISABLE_CACHE) {
|
||||
net_flags |= net::LOAD_DISABLE_CACHE;
|
||||
}
|
||||
|
||||
if (!(flags & UR_FLAG_ALLOW_STORED_CREDENTIALS)) {
|
||||
net_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA |
|
||||
|
@@ -21,17 +21,12 @@ void AppendArray(const std::vector<std::string>& source,
|
||||
return;
|
||||
target->insert(target->end(), source.begin(), source.end());
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
CefSchemeRegistrarImpl::CefSchemeRegistrarImpl() {}
|
||||
|
||||
bool CefSchemeRegistrarImpl::AddCustomScheme(const CefString& scheme_name,
|
||||
bool is_standard,
|
||||
bool is_local,
|
||||
bool is_display_isolated,
|
||||
bool is_secure,
|
||||
bool is_cors_enabled,
|
||||
bool is_csp_bypassing) {
|
||||
int options) {
|
||||
const std::string& scheme = base::ToLowerASCII(scheme_name.ToString());
|
||||
if (scheme::IsInternalHandledScheme(scheme) ||
|
||||
registered_schemes_.find(scheme) != registered_schemes_.end()) {
|
||||
@@ -40,6 +35,14 @@ bool CefSchemeRegistrarImpl::AddCustomScheme(const CefString& scheme_name,
|
||||
|
||||
registered_schemes_.insert(scheme);
|
||||
|
||||
const bool is_standard = options & CEF_SCHEME_OPTION_STANDARD;
|
||||
const bool is_local = options & CEF_SCHEME_OPTION_LOCAL;
|
||||
const bool is_display_isolated = options & CEF_SCHEME_OPTION_DISPLAY_ISOLATED;
|
||||
const bool is_secure = options & CEF_SCHEME_OPTION_SECURE;
|
||||
const bool is_cors_enabled = options & CEF_SCHEME_OPTION_CORS_ENABLED;
|
||||
const bool is_csp_bypassing = options & CEF_SCHEME_OPTION_CSP_BYPASSING;
|
||||
const bool is_fetch_enabled = options & CEF_SCHEME_OPTION_FETCH_ENABLED;
|
||||
|
||||
// The |is_display_isolated| value is excluded here because it's registered
|
||||
// with Blink only.
|
||||
if (is_standard)
|
||||
@@ -54,8 +57,8 @@ bool CefSchemeRegistrarImpl::AddCustomScheme(const CefString& scheme_name,
|
||||
schemes_.csp_bypassing_schemes.push_back(scheme);
|
||||
|
||||
CefContentClient::SchemeInfo scheme_info = {
|
||||
scheme, is_standard, is_local, is_display_isolated,
|
||||
is_secure, is_cors_enabled, is_csp_bypassing};
|
||||
scheme, is_standard, is_local, is_display_isolated,
|
||||
is_secure, is_cors_enabled, is_csp_bypassing, is_fetch_enabled};
|
||||
CefContentClient::Get()->AddCustomScheme(scheme_info);
|
||||
|
||||
return true;
|
||||
|
@@ -18,13 +18,7 @@ class CefSchemeRegistrarImpl : public CefSchemeRegistrar {
|
||||
CefSchemeRegistrarImpl();
|
||||
|
||||
// CefSchemeRegistrar methods.
|
||||
bool AddCustomScheme(const CefString& scheme_name,
|
||||
bool is_standard,
|
||||
bool is_local,
|
||||
bool is_display_isolated,
|
||||
bool is_secure,
|
||||
bool is_cors_enabled,
|
||||
bool is_csp_bypassing) override;
|
||||
bool AddCustomScheme(const CefString& scheme_name, int options) override;
|
||||
|
||||
void GetSchemes(content::ContentClient::Schemes* schemes);
|
||||
|
||||
|
@@ -216,6 +216,10 @@ void RegisterURLSchemeAsSecure(const blink::WebString& scheme) {
|
||||
blink::SchemeRegistry::RegisterURLSchemeAsSecure(scheme);
|
||||
}
|
||||
|
||||
void RegisterURLSchemeAsSupportingFetchAPI(const blink::WebString& scheme) {
|
||||
blink::SchemeRegistry::RegisterURLSchemeAsSupportingFetchAPI(scheme);
|
||||
}
|
||||
|
||||
struct CefScriptForbiddenScope::Impl {
|
||||
blink::ScriptForbiddenScope scope_;
|
||||
};
|
||||
|
@@ -69,6 +69,9 @@ BLINK_EXPORT bool IsScriptForbidden();
|
||||
BLINK_EXPORT void RegisterURLSchemeAsLocal(const blink::WebString& scheme);
|
||||
BLINK_EXPORT void RegisterURLSchemeAsSecure(const blink::WebString& scheme);
|
||||
|
||||
BLINK_EXPORT void RegisterURLSchemeAsSupportingFetchAPI(
|
||||
const blink::WebString& scheme);
|
||||
|
||||
// Wrapper for blink::ScriptForbiddenScope.
|
||||
class BLINK_EXPORT CefScriptForbiddenScope final {
|
||||
public:
|
||||
|
@@ -269,6 +269,8 @@ void CefContentRendererClient::WebKitInitialized() {
|
||||
blink::WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(scheme);
|
||||
if (info.is_secure)
|
||||
blink_glue::RegisterURLSchemeAsSecure(scheme);
|
||||
if (info.is_fetch_enabled)
|
||||
blink_glue::RegisterURLSchemeAsSupportingFetchAPI(scheme);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -182,7 +182,6 @@ LogMessage::LogMessage(const char* file,
|
||||
}
|
||||
|
||||
LogMessage::~LogMessage() {
|
||||
stream_ << std::endl;
|
||||
std::string str_newline(stream_.str());
|
||||
cef_log(file_, line_, severity_, str_newline.c_str());
|
||||
}
|
||||
@@ -253,6 +252,9 @@ ErrnoLogMessage::~ErrnoLogMessage() {
|
||||
}
|
||||
#endif // OS_WIN
|
||||
|
||||
} // namespace logging
|
||||
} // namespace cef
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) {
|
||||
cef_string_utf8_t str = {0};
|
||||
std::wstring tmp_str(wstr);
|
||||
@@ -261,6 +263,3 @@ std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) {
|
||||
cef_string_utf8_clear(&str);
|
||||
return out;
|
||||
}
|
||||
|
||||
} // namespace logging
|
||||
} // namespace cef
|
||||
|
123
libcef_dll/cpptoc/audio_handler_cpptoc.cc
Normal file
123
libcef_dll/cpptoc/audio_handler_cpptoc.cc
Normal file
@@ -0,0 +1,123 @@
|
||||
// Copyright (c) 2019 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=adcf6805d35059945c09825ebb73b55434727d97$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/audio_handler_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/browser_ctocpp.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
void CEF_CALLBACK
|
||||
audio_handler_on_audio_stream_started(struct _cef_audio_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
int audio_stream_id,
|
||||
int channels,
|
||||
cef_channel_layout_t channel_layout,
|
||||
int sample_rate,
|
||||
int frames_per_buffer) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefAudioHandlerCppToC::Get(self)->OnAudioStreamStarted(
|
||||
CefBrowserCToCpp::Wrap(browser), audio_stream_id, channels,
|
||||
channel_layout, sample_rate, frames_per_buffer);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK
|
||||
audio_handler_on_audio_stream_packet(struct _cef_audio_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
int audio_stream_id,
|
||||
const float** data,
|
||||
int frames,
|
||||
int64 pts) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser)
|
||||
return;
|
||||
// Verify param: data; type: simple_byaddr
|
||||
DCHECK(data);
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefAudioHandlerCppToC::Get(self)->OnAudioStreamPacket(
|
||||
CefBrowserCToCpp::Wrap(browser), audio_stream_id, data, frames, pts);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK
|
||||
audio_handler_on_audio_stream_stopped(struct _cef_audio_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
int audio_stream_id) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefAudioHandlerCppToC::Get(self)->OnAudioStreamStopped(
|
||||
CefBrowserCToCpp::Wrap(browser), audio_stream_id);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefAudioHandlerCppToC::CefAudioHandlerCppToC() {
|
||||
GetStruct()->on_audio_stream_started = audio_handler_on_audio_stream_started;
|
||||
GetStruct()->on_audio_stream_packet = audio_handler_on_audio_stream_packet;
|
||||
GetStruct()->on_audio_stream_stopped = audio_handler_on_audio_stream_stopped;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefRefPtr<CefAudioHandler> CefCppToCRefCounted<
|
||||
CefAudioHandlerCppToC,
|
||||
CefAudioHandler,
|
||||
cef_audio_handler_t>::UnwrapDerived(CefWrapperType type,
|
||||
cef_audio_handler_t* s) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
template <>
|
||||
base::AtomicRefCount CefCppToCRefCounted<CefAudioHandlerCppToC,
|
||||
CefAudioHandler,
|
||||
cef_audio_handler_t>::DebugObjCt
|
||||
ATOMIC_DECLARATION;
|
||||
#endif
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCppToCRefCounted<CefAudioHandlerCppToC,
|
||||
CefAudioHandler,
|
||||
cef_audio_handler_t>::kWrapperType =
|
||||
WT_AUDIO_HANDLER;
|
36
libcef_dll/cpptoc/audio_handler_cpptoc.h
Normal file
36
libcef_dll/cpptoc/audio_handler_cpptoc.h
Normal file
@@ -0,0 +1,36 @@
|
||||
// Copyright (c) 2019 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=7b72089e8ee155c1b2dee881fb63ab65f6c0fc71$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_AUDIO_HANDLER_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_AUDIO_HANDLER_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(WRAPPING_CEF_SHARED)
|
||||
#error This file can be included wrapper-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_audio_handler_capi.h"
|
||||
#include "include/cef_audio_handler.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefAudioHandlerCppToC : public CefCppToCRefCounted<CefAudioHandlerCppToC,
|
||||
CefAudioHandler,
|
||||
cef_audio_handler_t> {
|
||||
public:
|
||||
CefAudioHandlerCppToC();
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_AUDIO_HANDLER_CPPTOC_H_
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=24122606bad0381fccb91003b12c14fc24f355de$
|
||||
// $hash=41e334182e76a4bfc65eca7cbf10e402a115ef64$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/browser_host_cpptoc.h"
|
||||
@@ -724,6 +724,28 @@ browser_host_send_mouse_wheel_event(struct _cef_browser_host_t* self,
|
||||
deltaY);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK
|
||||
browser_host_send_touch_event(struct _cef_browser_host_t* self,
|
||||
const struct _cef_touch_event_t* event) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: event; type: struct_byref_const
|
||||
DCHECK(event);
|
||||
if (!event)
|
||||
return;
|
||||
|
||||
// Translate param: event; type: struct_byref_const
|
||||
CefTouchEvent eventObj;
|
||||
if (event)
|
||||
eventObj.Set(*event, false);
|
||||
|
||||
// Execute
|
||||
CefBrowserHostCppToC::Get(self)->SendTouchEvent(eventObj);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK
|
||||
browser_host_send_focus_event(struct _cef_browser_host_t* self, int setFocus) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@@ -1083,6 +1105,32 @@ browser_host_is_background_host(struct _cef_browser_host_t* self) {
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK browser_host_set_audio_muted(struct _cef_browser_host_t* self,
|
||||
int mute) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefBrowserHostCppToC::Get(self)->SetAudioMuted(mute ? true : false);
|
||||
}
|
||||
|
||||
int CEF_CALLBACK browser_host_is_audio_muted(struct _cef_browser_host_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefBrowserHostCppToC::Get(self)->IsAudioMuted();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
@@ -1129,6 +1177,7 @@ CefBrowserHostCppToC::CefBrowserHostCppToC() {
|
||||
GetStruct()->send_mouse_click_event = browser_host_send_mouse_click_event;
|
||||
GetStruct()->send_mouse_move_event = browser_host_send_mouse_move_event;
|
||||
GetStruct()->send_mouse_wheel_event = browser_host_send_mouse_wheel_event;
|
||||
GetStruct()->send_touch_event = browser_host_send_touch_event;
|
||||
GetStruct()->send_focus_event = browser_host_send_focus_event;
|
||||
GetStruct()->send_capture_lost_event = browser_host_send_capture_lost_event;
|
||||
GetStruct()->notify_move_or_resize_started =
|
||||
@@ -1155,6 +1204,8 @@ CefBrowserHostCppToC::CefBrowserHostCppToC() {
|
||||
GetStruct()->set_auto_resize_enabled = browser_host_set_auto_resize_enabled;
|
||||
GetStruct()->get_extension = browser_host_get_extension;
|
||||
GetStruct()->is_background_host = browser_host_is_background_host;
|
||||
GetStruct()->set_audio_muted = browser_host_set_audio_muted;
|
||||
GetStruct()->is_audio_muted = browser_host_is_audio_muted;
|
||||
}
|
||||
|
||||
template <>
|
||||
|
@@ -9,10 +9,11 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=9a46adab7d328c9d33c759cc02f28d15fb23e2c2$
|
||||
// $hash=8c46367b04ebcf4fd178da887dd9cb691d3d0e27$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/client_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/audio_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/context_menu_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/dialog_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/display_handler_cpptoc.h"
|
||||
@@ -33,6 +34,22 @@ namespace {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
cef_audio_handler_t* CEF_CALLBACK
|
||||
client_get_audio_handler(struct _cef_client_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefAudioHandler> _retval =
|
||||
CefClientCppToC::Get(self)->GetAudioHandler();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefAudioHandlerCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
struct _cef_context_menu_handler_t* CEF_CALLBACK
|
||||
client_get_context_menu_handler(struct _cef_client_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@@ -274,6 +291,7 @@ client_on_process_message_received(struct _cef_client_t* self,
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefClientCppToC::CefClientCppToC() {
|
||||
GetStruct()->get_audio_handler = client_get_audio_handler;
|
||||
GetStruct()->get_context_menu_handler = client_get_context_menu_handler;
|
||||
GetStruct()->get_dialog_handler = client_get_dialog_handler;
|
||||
GetStruct()->get_display_handler = client_get_display_handler;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=adb6d28a466b3de0fc13958c55ef0045eeeb9b89$
|
||||
// $hash=fed594fa4215590d42b52c5d4e9eb33c50a535ea$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/render_handler_cpptoc.h"
|
||||
@@ -469,6 +469,25 @@ render_handler_on_text_selection_changed(struct _cef_render_handler_t* self,
|
||||
selected_rangeVal);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK
|
||||
render_handler_on_virtual_keyboard_requested(struct _cef_render_handler_t* self,
|
||||
cef_browser_t* browser,
|
||||
cef_text_input_mode_t input_mode) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefRenderHandlerCppToC::Get(self)->OnVirtualKeyboardRequested(
|
||||
CefBrowserCToCpp::Wrap(browser), input_mode);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
@@ -493,6 +512,8 @@ CefRenderHandlerCppToC::CefRenderHandlerCppToC() {
|
||||
render_handler_on_ime_composition_range_changed;
|
||||
GetStruct()->on_text_selection_changed =
|
||||
render_handler_on_text_selection_changed;
|
||||
GetStruct()->on_virtual_keyboard_requested =
|
||||
render_handler_on_virtual_keyboard_requested;
|
||||
}
|
||||
|
||||
template <>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=9371355cdf8f8baca16fdb8558074b4198561b0c$
|
||||
// $hash=66aacd7ba2ae54b43ed5e6f55b8dbcd9608e8543$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/scheme_registrar_cpptoc.h"
|
||||
@@ -21,12 +21,7 @@ namespace {
|
||||
int CEF_CALLBACK
|
||||
scheme_registrar_add_custom_scheme(struct _cef_scheme_registrar_t* self,
|
||||
const cef_string_t* scheme_name,
|
||||
int is_standard,
|
||||
int is_local,
|
||||
int is_display_isolated,
|
||||
int is_secure,
|
||||
int is_cors_enabled,
|
||||
int is_csp_bypassing) {
|
||||
int options) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
@@ -39,10 +34,7 @@ scheme_registrar_add_custom_scheme(struct _cef_scheme_registrar_t* self,
|
||||
|
||||
// Execute
|
||||
bool _retval = CefSchemeRegistrarCppToC::Get(self)->AddCustomScheme(
|
||||
CefString(scheme_name), is_standard ? true : false,
|
||||
is_local ? true : false, is_display_isolated ? true : false,
|
||||
is_secure ? true : false, is_cors_enabled ? true : false,
|
||||
is_csp_bypassing ? true : false);
|
||||
CefString(scheme_name), options);
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
|
115
libcef_dll/ctocpp/audio_handler_ctocpp.cc
Normal file
115
libcef_dll/ctocpp/audio_handler_ctocpp.cc
Normal file
@@ -0,0 +1,115 @@
|
||||
// Copyright (c) 2019 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=280f9ca344ead60b5e6bde70bdd9b155f0a8060a$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/audio_handler_ctocpp.h"
|
||||
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefAudioHandlerCToCpp::OnAudioStreamStarted(CefRefPtr<CefBrowser> browser,
|
||||
int audio_stream_id,
|
||||
int channels,
|
||||
ChannelLayout channel_layout,
|
||||
int sample_rate,
|
||||
int frames_per_buffer) {
|
||||
cef_audio_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_audio_stream_started))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser.get());
|
||||
if (!browser.get())
|
||||
return;
|
||||
|
||||
// Execute
|
||||
_struct->on_audio_stream_started(_struct, CefBrowserCppToC::Wrap(browser),
|
||||
audio_stream_id, channels, channel_layout,
|
||||
sample_rate, frames_per_buffer);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefAudioHandlerCToCpp::OnAudioStreamPacket(CefRefPtr<CefBrowser> browser,
|
||||
int audio_stream_id,
|
||||
const float** data,
|
||||
int frames,
|
||||
int64 pts) {
|
||||
cef_audio_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_audio_stream_packet))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser.get());
|
||||
if (!browser.get())
|
||||
return;
|
||||
// Verify param: data; type: simple_byaddr
|
||||
DCHECK(data);
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
_struct->on_audio_stream_packet(_struct, CefBrowserCppToC::Wrap(browser),
|
||||
audio_stream_id, data, frames, pts);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefAudioHandlerCToCpp::OnAudioStreamStopped(CefRefPtr<CefBrowser> browser,
|
||||
int audio_stream_id) {
|
||||
cef_audio_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_audio_stream_stopped))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser.get());
|
||||
if (!browser.get())
|
||||
return;
|
||||
|
||||
// Execute
|
||||
_struct->on_audio_stream_stopped(_struct, CefBrowserCppToC::Wrap(browser),
|
||||
audio_stream_id);
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefAudioHandlerCToCpp::CefAudioHandlerCToCpp() {}
|
||||
|
||||
template <>
|
||||
cef_audio_handler_t*
|
||||
CefCToCppRefCounted<CefAudioHandlerCToCpp,
|
||||
CefAudioHandler,
|
||||
cef_audio_handler_t>::UnwrapDerived(CefWrapperType type,
|
||||
CefAudioHandler* c) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
template <>
|
||||
base::AtomicRefCount CefCToCppRefCounted<CefAudioHandlerCToCpp,
|
||||
CefAudioHandler,
|
||||
cef_audio_handler_t>::DebugObjCt
|
||||
ATOMIC_DECLARATION;
|
||||
#endif
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCToCppRefCounted<CefAudioHandlerCToCpp,
|
||||
CefAudioHandler,
|
||||
cef_audio_handler_t>::kWrapperType =
|
||||
WT_AUDIO_HANDLER;
|
51
libcef_dll/ctocpp/audio_handler_ctocpp.h
Normal file
51
libcef_dll/ctocpp/audio_handler_ctocpp.h
Normal file
@@ -0,0 +1,51 @@
|
||||
// Copyright (c) 2019 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=59b7d7d50125a15f90e67e28a6e004da957cc0f9$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_AUDIO_HANDLER_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_AUDIO_HANDLER_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(BUILDING_CEF_SHARED)
|
||||
#error This file can be included DLL-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_audio_handler_capi.h"
|
||||
#include "include/cef_audio_handler.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefAudioHandlerCToCpp : public CefCToCppRefCounted<CefAudioHandlerCToCpp,
|
||||
CefAudioHandler,
|
||||
cef_audio_handler_t> {
|
||||
public:
|
||||
CefAudioHandlerCToCpp();
|
||||
|
||||
// CefAudioHandler methods.
|
||||
void OnAudioStreamStarted(CefRefPtr<CefBrowser> browser,
|
||||
int audio_stream_id,
|
||||
int channels,
|
||||
ChannelLayout channel_layout,
|
||||
int sample_rate,
|
||||
int frames_per_buffer) override;
|
||||
void OnAudioStreamPacket(CefRefPtr<CefBrowser> browser,
|
||||
int audio_stream_id,
|
||||
const float** data,
|
||||
int frames,
|
||||
int64 pts) override;
|
||||
void OnAudioStreamStopped(CefRefPtr<CefBrowser> browser,
|
||||
int audio_stream_id) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_AUDIO_HANDLER_CTOCPP_H_
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=f60a48364a8a829b25ac48261e8147f5974175a3$
|
||||
// $hash=5b3acb2cb74ef6b6b42bade4e0515d39e4609319$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/browser_host_ctocpp.h"
|
||||
@@ -622,6 +622,18 @@ void CefBrowserHostCToCpp::SendMouseWheelEvent(const CefMouseEvent& event,
|
||||
_struct->send_mouse_wheel_event(_struct, &event, deltaX, deltaY);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefBrowserHostCToCpp::SendTouchEvent(const CefTouchEvent& event) {
|
||||
cef_browser_host_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, send_touch_event))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
_struct->send_touch_event(_struct, &event);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefBrowserHostCToCpp::SendFocusEvent(bool setFocus) {
|
||||
cef_browser_host_t* _struct = GetStruct();
|
||||
@@ -915,6 +927,31 @@ NO_SANITIZE("cfi-icall") bool CefBrowserHostCToCpp::IsBackgroundHost() {
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") void CefBrowserHostCToCpp::SetAudioMuted(bool mute) {
|
||||
cef_browser_host_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, set_audio_muted))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
_struct->set_audio_muted(_struct, mute);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") bool CefBrowserHostCToCpp::IsAudioMuted() {
|
||||
cef_browser_host_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, is_audio_muted))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->is_audio_muted(_struct);
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefBrowserHostCToCpp::CefBrowserHostCToCpp() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=b12307f9b88f1fe1fd7ec6ba2c17d1599b679618$
|
||||
// $hash=a7acce93e2b4109ddf76e4a82e0ff6d85be1451a$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_
|
||||
@@ -96,6 +96,7 @@ class CefBrowserHostCToCpp : public CefCToCppRefCounted<CefBrowserHostCToCpp,
|
||||
void SendMouseWheelEvent(const CefMouseEvent& event,
|
||||
int deltaX,
|
||||
int deltaY) OVERRIDE;
|
||||
void SendTouchEvent(const CefTouchEvent& event) OVERRIDE;
|
||||
void SendFocusEvent(bool setFocus) OVERRIDE;
|
||||
void SendCaptureLostEvent() OVERRIDE;
|
||||
void NotifyMoveOrResizeStarted() OVERRIDE;
|
||||
@@ -126,6 +127,8 @@ class CefBrowserHostCToCpp : public CefCToCppRefCounted<CefBrowserHostCToCpp,
|
||||
const CefSize& max_size) OVERRIDE;
|
||||
CefRefPtr<CefExtension> GetExtension() OVERRIDE;
|
||||
bool IsBackgroundHost() OVERRIDE;
|
||||
void SetAudioMuted(bool mute) OVERRIDE;
|
||||
bool IsAudioMuted() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_
|
||||
|
@@ -9,12 +9,13 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=206c9d8f26cdcf1d7a879aab7c92712c3c10781c$
|
||||
// $hash=f86cfe6f6a72ed0b619bc2bd0980e74c38210737$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/client_ctocpp.h"
|
||||
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/process_message_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/audio_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/context_menu_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/dialog_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/display_handler_ctocpp.h"
|
||||
@@ -31,6 +32,21 @@
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefAudioHandler> CefClientCToCpp::GetAudioHandler() {
|
||||
cef_client_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_audio_handler))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_audio_handler_t* _retval = _struct->get_audio_handler(_struct);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefAudioHandlerCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefContextMenuHandler> CefClientCToCpp::GetContextMenuHandler() {
|
||||
cef_client_t* _struct = GetStruct();
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=bf7c09d3ce6778f188b0ded7c16bde93b3875a8b$
|
||||
// $hash=cef382050baf759eb067510de43a2772739a68e1$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_CLIENT_CTOCPP_H_
|
||||
@@ -32,6 +32,7 @@ class CefClientCToCpp
|
||||
CefClientCToCpp();
|
||||
|
||||
// CefClient methods.
|
||||
CefRefPtr<CefAudioHandler> GetAudioHandler() override;
|
||||
CefRefPtr<CefContextMenuHandler> GetContextMenuHandler() override;
|
||||
CefRefPtr<CefDialogHandler> GetDialogHandler() override;
|
||||
CefRefPtr<CefDisplayHandler> GetDisplayHandler() override;
|
||||
|
@@ -9,11 +9,11 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=1c498e2873d5fc44f66de6a1faa1cb786465c293$
|
||||
// $hash=0623242c16db04c2964cca648a6fd0b9f35662b5$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/command_line_ctocpp.h"
|
||||
#include "include/cef_version.h"
|
||||
#include "include/cef_api_hash.h"
|
||||
#include "libcef_dll/transfer_util.h"
|
||||
|
||||
// STATIC METHODS - Body may be edited by hand.
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=9948a3a215228eb5cb39757742f0af6c3eeb8d7a$
|
||||
// $hash=eba8f81a9792ad15071aa13eec3d9b2694f0a5fe$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/render_handler_ctocpp.h"
|
||||
@@ -400,6 +400,26 @@ void CefRenderHandlerCToCpp::OnTextSelectionChanged(
|
||||
&selected_range);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefRenderHandlerCToCpp::OnVirtualKeyboardRequested(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
TextInputMode input_mode) {
|
||||
cef_render_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_virtual_keyboard_requested))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser.get());
|
||||
if (!browser.get())
|
||||
return;
|
||||
|
||||
// Execute
|
||||
_struct->on_virtual_keyboard_requested(
|
||||
_struct, CefBrowserCppToC::Wrap(browser), input_mode);
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefRenderHandlerCToCpp::CefRenderHandlerCToCpp() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=45737a7e991711566b6f46499ccdc6fe9b1e0317$
|
||||
// $hash=40d1efb94fb2ba7dc519f0fc31226aa603d0c22f$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_RENDER_HANDLER_CTOCPP_H_
|
||||
@@ -76,6 +76,8 @@ class CefRenderHandlerCToCpp
|
||||
void OnTextSelectionChanged(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& selected_text,
|
||||
const CefRange& selected_range) override;
|
||||
void OnVirtualKeyboardRequested(CefRefPtr<CefBrowser> browser,
|
||||
TextInputMode input_mode) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_RENDER_HANDLER_CTOCPP_H_
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=e7d830a10e5beeb36640297489468dae63df32e3$
|
||||
// $hash=caa6e377d0a5fb63cb6663daf5e0651d7cc7db00$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/scheme_registrar_ctocpp.h"
|
||||
@@ -18,12 +18,7 @@
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefSchemeRegistrarCToCpp::AddCustomScheme(const CefString& scheme_name,
|
||||
bool is_standard,
|
||||
bool is_local,
|
||||
bool is_display_isolated,
|
||||
bool is_secure,
|
||||
bool is_cors_enabled,
|
||||
bool is_csp_bypassing) {
|
||||
int options) {
|
||||
cef_scheme_registrar_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, add_custom_scheme))
|
||||
return false;
|
||||
@@ -36,9 +31,8 @@ bool CefSchemeRegistrarCToCpp::AddCustomScheme(const CefString& scheme_name,
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->add_custom_scheme(
|
||||
_struct, scheme_name.GetStruct(), is_standard, is_local,
|
||||
is_display_isolated, is_secure, is_cors_enabled, is_csp_bypassing);
|
||||
int _retval =
|
||||
_struct->add_custom_scheme(_struct, scheme_name.GetStruct(), options);
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=5ce8d9f062d527c665f33c4508da01da9dbf277d$
|
||||
// $hash=a22c0321046042438e4751343efd6893a3c49aca$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_SCHEME_REGISTRAR_CTOCPP_H_
|
||||
@@ -34,13 +34,7 @@ class CefSchemeRegistrarCToCpp
|
||||
CefSchemeRegistrarCToCpp();
|
||||
|
||||
// CefSchemeRegistrar methods.
|
||||
bool AddCustomScheme(const CefString& scheme_name,
|
||||
bool is_standard,
|
||||
bool is_local,
|
||||
bool is_display_isolated,
|
||||
bool is_secure,
|
||||
bool is_cors_enabled,
|
||||
bool is_csp_bypassing) OVERRIDE;
|
||||
bool AddCustomScheme(const CefString& scheme_name, int options) OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_SCHEME_REGISTRAR_CTOCPP_H_
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=824a78e502417eccd79d65691b35b9a965d72778$
|
||||
// $hash=36b0b2964486a8b1412209b1146f1b4338255a80$
|
||||
//
|
||||
|
||||
#include "include/capi/cef_app_capi.h"
|
||||
@@ -114,6 +114,7 @@
|
||||
#include "libcef_dll/cpptoc/zip_reader_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/accessibility_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/app_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/audio_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/browser_process_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/completion_callback_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/context_menu_handler_ctocpp.h"
|
||||
@@ -243,6 +244,7 @@ CEF_EXPORT void cef_shutdown() {
|
||||
// Check that all wrapper objects have been destroyed
|
||||
DCHECK(
|
||||
base::AtomicRefCountIsZero(&CefAccessibilityHandlerCToCpp::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefAudioHandlerCToCpp::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefAuthCallbackCppToC::DebugObjCt));
|
||||
DCHECK(
|
||||
base::AtomicRefCountIsZero(&CefBeforeDownloadCallbackCppToC::DebugObjCt));
|
||||
|
@@ -95,8 +95,8 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION CEF_VERSION_MAJOR,CHROME_VERSION_BUILD,CEF_COMMIT_NUMBER,0
|
||||
PRODUCTVERSION CEF_VERSION_MAJOR,CHROME_VERSION_BUILD,CEF_COMMIT_NUMBER,0
|
||||
FILEVERSION CEF_VERSION_MAJOR,CEF_VERSION_MINOR,CEF_VERSION_PATCH,0
|
||||
PRODUCTVERSION CEF_VERSION_MAJOR,CEF_VERSION_MINOR,CEF_VERSION_PATCH,0
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@@ -4,6 +4,7 @@
|
||||
//
|
||||
|
||||
#include <cstddef>
|
||||
#include "include/cef_api_hash.h"
|
||||
#include "include/cef_version.h"
|
||||
|
||||
CEF_EXPORT int cef_version_info(int entry) {
|
||||
@@ -11,14 +12,18 @@ CEF_EXPORT int cef_version_info(int entry) {
|
||||
case 0:
|
||||
return CEF_VERSION_MAJOR;
|
||||
case 1:
|
||||
return CEF_COMMIT_NUMBER;
|
||||
return CEF_VERSION_MINOR;
|
||||
case 2:
|
||||
return CHROME_VERSION_MAJOR;
|
||||
return CEF_VERSION_PATCH;
|
||||
case 3:
|
||||
return CHROME_VERSION_MINOR;
|
||||
return CEF_COMMIT_NUMBER;
|
||||
case 4:
|
||||
return CHROME_VERSION_BUILD;
|
||||
return CHROME_VERSION_MAJOR;
|
||||
case 5:
|
||||
return CHROME_VERSION_MINOR;
|
||||
case 6:
|
||||
return CHROME_VERSION_BUILD;
|
||||
case 7:
|
||||
return CHROME_VERSION_PATCH;
|
||||
default:
|
||||
return 0;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=ef8269462464beba6718a2e0d03e0f1cb41901bf$
|
||||
// $hash=55141875850aab1e8d72877838b06bd2f503a8f0$
|
||||
//
|
||||
|
||||
#include <dlfcn.h>
|
||||
@@ -58,6 +58,7 @@
|
||||
#include "include/capi/views/cef_scroll_view_capi.h"
|
||||
#include "include/capi/views/cef_textfield_capi.h"
|
||||
#include "include/capi/views/cef_window_capi.h"
|
||||
#include "include/cef_api_hash.h"
|
||||
#include "include/cef_version.h"
|
||||
#include "include/internal/cef_logging_internal.h"
|
||||
#include "include/internal/cef_string_list.h"
|
||||
@@ -333,8 +334,8 @@ typedef struct _cef_textfield_t* (*cef_textfield_create_ptr)(
|
||||
struct _cef_textfield_delegate_t*);
|
||||
typedef struct _cef_window_t* (*cef_window_create_top_level_ptr)(
|
||||
struct _cef_window_delegate_t*);
|
||||
typedef int (*cef_version_info_ptr)(int);
|
||||
typedef const char* (*cef_api_hash_ptr)(int);
|
||||
typedef int (*cef_version_info_ptr)(int);
|
||||
typedef int (*cef_get_min_log_level_ptr)();
|
||||
typedef int (*cef_get_vlog_level_ptr)(const char*, size_t);
|
||||
typedef void (*cef_log_ptr)(const char*, int, int, const char*);
|
||||
@@ -656,8 +657,8 @@ struct libcef_pointers {
|
||||
cef_scroll_view_create_ptr cef_scroll_view_create;
|
||||
cef_textfield_create_ptr cef_textfield_create;
|
||||
cef_window_create_top_level_ptr cef_window_create_top_level;
|
||||
cef_version_info_ptr cef_version_info;
|
||||
cef_api_hash_ptr cef_api_hash;
|
||||
cef_version_info_ptr cef_version_info;
|
||||
cef_get_min_log_level_ptr cef_get_min_log_level;
|
||||
cef_get_vlog_level_ptr cef_get_vlog_level;
|
||||
cef_log_ptr cef_log;
|
||||
@@ -864,8 +865,8 @@ int libcef_init_pointers(const char* path) {
|
||||
INIT_ENTRY(cef_scroll_view_create);
|
||||
INIT_ENTRY(cef_textfield_create);
|
||||
INIT_ENTRY(cef_window_create_top_level);
|
||||
INIT_ENTRY(cef_version_info);
|
||||
INIT_ENTRY(cef_api_hash);
|
||||
INIT_ENTRY(cef_version_info);
|
||||
INIT_ENTRY(cef_get_min_log_level);
|
||||
INIT_ENTRY(cef_get_vlog_level);
|
||||
INIT_ENTRY(cef_log);
|
||||
@@ -1727,14 +1728,14 @@ struct _cef_window_t* cef_window_create_top_level(
|
||||
return g_libcef_pointers.cef_window_create_top_level(delegate);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") int cef_version_info(int entry) {
|
||||
return g_libcef_pointers.cef_version_info(entry);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") const char* cef_api_hash(int entry) {
|
||||
return g_libcef_pointers.cef_api_hash(entry);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") int cef_version_info(int entry) {
|
||||
return g_libcef_pointers.cef_version_info(entry);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") int cef_get_min_log_level() {
|
||||
return g_libcef_pointers.cef_get_min_log_level();
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=dfa41e1f1e43a693fb48a8de17a8a7cddba8c60a$
|
||||
// $hash=eda2091dfc48ca1cb29bddd362ae597b80263a22$
|
||||
//
|
||||
|
||||
#include "include/capi/cef_app_capi.h"
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "include/capi/cef_v8_capi.h"
|
||||
#include "include/capi/cef_web_plugin_capi.h"
|
||||
#include "include/capi/test/cef_test_helpers_capi.h"
|
||||
#include "include/cef_api_hash.h"
|
||||
#include "include/cef_app.h"
|
||||
#include "include/cef_crash_util.h"
|
||||
#include "include/cef_file_util.h"
|
||||
@@ -38,11 +39,11 @@
|
||||
#include "include/cef_task.h"
|
||||
#include "include/cef_trace.h"
|
||||
#include "include/cef_v8.h"
|
||||
#include "include/cef_version.h"
|
||||
#include "include/cef_web_plugin.h"
|
||||
#include "include/test/cef_test_helpers.h"
|
||||
#include "libcef_dll/cpptoc/accessibility_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/app_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/audio_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/completion_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/context_menu_handler_cpptoc.h"
|
||||
@@ -236,6 +237,7 @@ NO_SANITIZE("cfi-icall") CEF_GLOBAL void CefShutdown() {
|
||||
// Check that all wrapper objects have been destroyed
|
||||
DCHECK(
|
||||
base::AtomicRefCountIsZero(&CefAccessibilityHandlerCppToC::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefAudioHandlerCppToC::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefAuthCallbackCToCpp::DebugObjCt));
|
||||
DCHECK(
|
||||
base::AtomicRefCountIsZero(&CefBeforeDownloadCallbackCToCpp::DebugObjCt));
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=2465514c5a784838334475fd06fb3c1bf1755fd6$
|
||||
// $hash=babd63d2abc0812c13f7228094f601851ea0679f$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_WRAPPER_TYPES_H_
|
||||
@@ -21,6 +21,7 @@ enum CefWrapperType {
|
||||
WT_BASE_SCOPED,
|
||||
WT_ACCESSIBILITY_HANDLER,
|
||||
WT_APP,
|
||||
WT_AUDIO_HANDLER,
|
||||
WT_AUTH_CALLBACK,
|
||||
WT_BEFORE_DOWNLOAD_CALLBACK,
|
||||
WT_BINARY_VALUE,
|
||||
|
@@ -39,7 +39,11 @@ patches = [
|
||||
{
|
||||
# Support component builds (GN is_component_build=true).
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1617
|
||||
'name': 'component_build_1617',
|
||||
#
|
||||
# Export GetUnicodeCharacterFromXKeySym and XKeySymToDomKey
|
||||
# to fix component builds.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2587
|
||||
'name': 'component_build',
|
||||
},
|
||||
{
|
||||
# Revert change on Windows that removes MessageLoop::os_modal_loop().
|
||||
@@ -241,6 +245,9 @@ patches = [
|
||||
# of adding a dependency on SystemNetworkContextManager (see
|
||||
# https://crrev.com/6ed14d99e9).
|
||||
# TODO(cef): Consider removing this once we support NetworkService.
|
||||
#
|
||||
# Show the CEF Save As dialog.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2613
|
||||
'name': 'chrome_browser_net_export',
|
||||
},
|
||||
{
|
||||
@@ -254,7 +261,8 @@ patches = [
|
||||
# (c) Removing static_cast<> of StoragePartition to StoragePartitionImpl.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1973
|
||||
#
|
||||
# Don't create a "databases" directory when cache_path is empty.
|
||||
# Don't create databases, blob_storage or VideoDecodeStats directories when
|
||||
# cache_path is empty.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2289
|
||||
'name': 'storage_partition_1973',
|
||||
},
|
||||
@@ -411,9 +419,8 @@ patches = [
|
||||
'name': 'message_pump_mac_2495',
|
||||
},
|
||||
{
|
||||
# Windows: Fix "error: unknown escape sequence" with jumbo builds.
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=924454
|
||||
'name': 'v8_embed_924454',
|
||||
'path': 'v8',
|
||||
# Linux: Load binaries from DIR_ASSETS.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1936
|
||||
'name': 'linux_assets_path_1936',
|
||||
}
|
||||
]
|
||||
|
@@ -37,7 +37,7 @@ index fa03ea14330e..c1bd1b67ce21 100644
|
||||
|
||||
attached_ = true;
|
||||
diff --git content/browser/frame_host/interstitial_page_impl.cc content/browser/frame_host/interstitial_page_impl.cc
|
||||
index a97648ef717b..b82895c89f77 100644
|
||||
index de100cad56f2..32fc6c09ca14 100644
|
||||
--- content/browser/frame_host/interstitial_page_impl.cc
|
||||
+++ content/browser/frame_host/interstitial_page_impl.cc
|
||||
@@ -632,7 +632,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
|
||||
@@ -221,10 +221,10 @@ index c0c553023138..39b8fe0bd57c 100644
|
||||
RenderWidgetHost* render_widget_host) override;
|
||||
void SetPageTitle(const base::string16& title) override;
|
||||
diff --git content/browser/web_contents/web_contents_view_mac.mm content/browser/web_contents/web_contents_view_mac.mm
|
||||
index d4f6a36dce63..ba6382ee43ea 100644
|
||||
index 2ff03cf86f72..c7fed51cee68 100644
|
||||
--- content/browser/web_contents/web_contents_view_mac.mm
|
||||
+++ content/browser/web_contents/web_contents_view_mac.mm
|
||||
@@ -313,7 +313,8 @@ void WebContentsViewMac::CreateView(
|
||||
@@ -312,7 +312,8 @@ void WebContentsViewMac::CreateView(
|
||||
}
|
||||
|
||||
RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
|
||||
@@ -234,7 +234,7 @@ index d4f6a36dce63..ba6382ee43ea 100644
|
||||
if (render_widget_host->GetView()) {
|
||||
// During testing, the view will already be set up in most cases to the
|
||||
// test view, so we don't want to clobber it with a real one. To verify that
|
||||
@@ -325,6 +326,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
|
||||
@@ -324,6 +325,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
|
||||
render_widget_host->GetView());
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
|
||||
index 6ebafc0acd44..96644b7b809c 100644
|
||||
index 5f188cf2d300..97a9a83a96ef 100644
|
||||
--- chrome/browser/BUILD.gn
|
||||
+++ chrome/browser/BUILD.gn
|
||||
@@ -8,6 +8,7 @@ import("//build/config/features.gni")
|
||||
@@ -10,7 +10,7 @@ index 6ebafc0acd44..96644b7b809c 100644
|
||||
import("//chrome/common/features.gni")
|
||||
import("//components/feature_engagement/features.gni")
|
||||
import("//components/feed/features.gni")
|
||||
@@ -1732,6 +1733,7 @@ jumbo_split_static_library("browser") {
|
||||
@@ -1734,6 +1735,7 @@ jumbo_split_static_library("browser") {
|
||||
"//base:i18n",
|
||||
"//base/allocator:buildflags",
|
||||
"//cc",
|
||||
@@ -18,7 +18,7 @@ index 6ebafc0acd44..96644b7b809c 100644
|
||||
"//chrome:extra_resources",
|
||||
"//chrome:resources",
|
||||
"//chrome:strings",
|
||||
@@ -2020,6 +2022,10 @@ jumbo_split_static_library("browser") {
|
||||
@@ -2022,6 +2024,10 @@ jumbo_split_static_library("browser") {
|
||||
]
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ index 6ebafc0acd44..96644b7b809c 100644
|
||||
if (is_android) {
|
||||
sources += [
|
||||
"after_startup_task_utils_android.cc",
|
||||
@@ -3713,7 +3719,7 @@ jumbo_split_static_library("browser") {
|
||||
@@ -3720,7 +3726,7 @@ jumbo_split_static_library("browser") {
|
||||
]
|
||||
}
|
||||
|
||||
|
@@ -50,11 +50,149 @@ index d70dd33f4f41..3d4db9e49933 100644
|
||||
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory()
|
||||
override;
|
||||
network::NetworkQualityTracker* network_quality_tracker() override;
|
||||
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
|
||||
index 46bee4c2a411..dd0d0451eec9 100644
|
||||
--- chrome/browser/ui/BUILD.gn
|
||||
+++ chrome/browser/ui/BUILD.gn
|
||||
@@ -9,6 +9,7 @@ import("//build/config/features.gni")
|
||||
import("//build/config/jumbo.gni")
|
||||
import("//build/config/ui.gni")
|
||||
import("//build/split_static_library.gni")
|
||||
+import("//cef/libcef/features/features.gni")
|
||||
import("//chrome/common/features.gni")
|
||||
import("//chromeos/assistant/assistant.gni")
|
||||
import("//components/feature_engagement/features.gni")
|
||||
@@ -346,6 +347,10 @@ jumbo_split_static_library("ui") {
|
||||
"//build/config/compiler:wexit_time_destructors",
|
||||
]
|
||||
|
||||
+ if (enable_cef) {
|
||||
+ configs += [ "//cef/libcef/features:config" ]
|
||||
+ }
|
||||
+
|
||||
# Since browser and browser_ui actually depend on each other,
|
||||
# we must omit the dependency from browser_ui to browser.
|
||||
# However, this means browser_ui and browser should more or less
|
||||
@@ -362,6 +367,7 @@ jumbo_split_static_library("ui") {
|
||||
"//base:i18n",
|
||||
"//base/allocator:buildflags",
|
||||
"//cc/paint",
|
||||
+ "//cef/libcef/features",
|
||||
"//chrome:extra_resources",
|
||||
"//chrome:resources",
|
||||
"//chrome:strings",
|
||||
@@ -2311,7 +2317,7 @@ jumbo_split_static_library("ui") {
|
||||
"views/frame/native_browser_frame_factory_ozone.cc",
|
||||
]
|
||||
} else {
|
||||
- if (use_aura) {
|
||||
+ if (use_aura && use_gtk) {
|
||||
# This is the only component that can interact with gtk.
|
||||
deps += [ "//chrome/browser/ui/libgtkui" ]
|
||||
}
|
||||
diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc
|
||||
index 62796358a2a7..9249ae2d07fa 100644
|
||||
index 62796358a2a7..8ba23a87b982 100644
|
||||
--- chrome/browser/ui/webui/net_export_ui.cc
|
||||
+++ chrome/browser/ui/webui/net_export_ui.cc
|
||||
@@ -159,8 +159,7 @@ class NetExportMessageHandler
|
||||
@@ -20,14 +20,13 @@
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
+#include "cef/libcef/features/features.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
-#include "chrome/browser/download/download_prefs.h"
|
||||
#include "chrome/browser/io_thread.h"
|
||||
#include "chrome/browser/net/net_export_helper.h"
|
||||
#include "chrome/browser/net/system_network_context_manager.h"
|
||||
#include "chrome/browser/platform_util.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
-#include "chrome/browser/ui/chrome_select_file_policy.h"
|
||||
#include "chrome/common/channel_info.h"
|
||||
#include "chrome/common/url_constants.h"
|
||||
#include "components/grit/components_resources.h"
|
||||
@@ -42,7 +41,14 @@
|
||||
#include "content/public/browser/web_ui_message_handler.h"
|
||||
#include "extensions/buildflags/buildflags.h"
|
||||
#include "net/log/net_log_capture_mode.h"
|
||||
+
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
+#include "chrome/browser/download/download_prefs.h"
|
||||
+#include "chrome/browser/ui/chrome_select_file_policy.h"
|
||||
#include "ui/shell_dialogs/select_file_dialog.h"
|
||||
+#else
|
||||
+#include "cef/libcef/browser/browser_host_impl.h"
|
||||
+#endif
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
#include "chrome/browser/android/intent_helper.h"
|
||||
@@ -69,6 +75,7 @@ content::WebUIDataSource* CreateNetExportHTMLSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
void SetIfNotNull(base::DictionaryValue* dict,
|
||||
const base::StringPiece& path,
|
||||
std::unique_ptr<base::Value> in_value) {
|
||||
@@ -76,6 +83,7 @@ void SetIfNotNull(base::DictionaryValue* dict,
|
||||
dict->Set(path, std::move(in_value));
|
||||
}
|
||||
}
|
||||
+#endif // !BUILDFLAG(ENABLE_CEF)
|
||||
|
||||
// This class receives javascript messages from the renderer.
|
||||
// Note that the WebUI infrastructure runs on the UI thread, therefore all of
|
||||
@@ -83,7 +91,9 @@ void SetIfNotNull(base::DictionaryValue* dict,
|
||||
class NetExportMessageHandler
|
||||
: public WebUIMessageHandler,
|
||||
public base::SupportsWeakPtr<NetExportMessageHandler>,
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
public ui::SelectFileDialog::Listener,
|
||||
+#endif
|
||||
public net_log::NetExportFileWriter::StateObserver {
|
||||
public:
|
||||
NetExportMessageHandler();
|
||||
@@ -99,11 +109,13 @@ class NetExportMessageHandler
|
||||
void OnSendNetLog(const base::ListValue* list);
|
||||
void OnShowFile(const base::ListValue* list);
|
||||
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
// ui::SelectFileDialog::Listener implementation.
|
||||
void FileSelected(const base::FilePath& path,
|
||||
int index,
|
||||
void* params) override;
|
||||
void FileSelectionCanceled(void* params) override;
|
||||
+#endif // !BUILDFLAG(ENABLE_CEF)
|
||||
|
||||
// net_log::NetExportFileWriter::StateObserver implementation.
|
||||
void OnNewState(const base::DictionaryValue& state) override;
|
||||
@@ -133,9 +145,16 @@ class NetExportMessageHandler
|
||||
// renderer.
|
||||
void NotifyUIWithState(std::unique_ptr<base::DictionaryValue> state);
|
||||
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
// Opens the SelectFileDialog UI with the default path to save a
|
||||
// NetLog file.
|
||||
void ShowSelectFileDialog(const base::FilePath& default_path);
|
||||
+#else
|
||||
+ void ShowCefSaveAsDialog(content::WebContents* web_contents);
|
||||
+ void SaveAsDialogDismissed(
|
||||
+ int selected_accept_filter,
|
||||
+ const std::vector<base::FilePath>& file_paths);
|
||||
+#endif
|
||||
|
||||
// Cached pointer to SystemNetworkContextManager's NetExportFileWriter.
|
||||
net_log::NetExportFileWriter* file_writer_;
|
||||
@@ -151,7 +170,9 @@ class NetExportMessageHandler
|
||||
net::NetLogCaptureMode capture_mode_;
|
||||
uint64_t max_log_file_size_;
|
||||
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
|
||||
+#endif
|
||||
|
||||
base::WeakPtrFactory<NetExportMessageHandler> weak_ptr_factory_;
|
||||
|
||||
@@ -159,8 +180,7 @@ class NetExportMessageHandler
|
||||
};
|
||||
|
||||
NetExportMessageHandler::NetExportMessageHandler()
|
||||
@@ -64,3 +202,116 @@ index 62796358a2a7..9249ae2d07fa 100644
|
||||
state_observer_manager_(this),
|
||||
weak_ptr_factory_(this) {
|
||||
file_writer_->Initialize();
|
||||
@@ -169,8 +189,10 @@ NetExportMessageHandler::NetExportMessageHandler()
|
||||
NetExportMessageHandler::~NetExportMessageHandler() {
|
||||
// There may be a pending file dialog, it needs to be told that the user
|
||||
// has gone away so that it doesn't try to call back.
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
if (select_file_dialog_)
|
||||
select_file_dialog_->ListenerDestroyed();
|
||||
+#endif
|
||||
|
||||
file_writer_->StopNetLog(nullptr);
|
||||
}
|
||||
@@ -233,6 +255,7 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) {
|
||||
if (UsingMobileUI()) {
|
||||
StartNetLog(base::FilePath());
|
||||
} else {
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
base::FilePath initial_dir = last_save_dir.Pointer()->empty() ?
|
||||
DownloadPrefs::FromBrowserContext(
|
||||
web_ui()->GetWebContents()->GetBrowserContext())->DownloadPath() :
|
||||
@@ -240,6 +263,9 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) {
|
||||
base::FilePath initial_path =
|
||||
initial_dir.Append(FILE_PATH_LITERAL("chrome-net-export-log.json"));
|
||||
ShowSelectFileDialog(initial_path);
|
||||
+#else // BUILDFLAG(ENABLE_CEF)
|
||||
+ ShowCefSaveAsDialog(web_ui()->GetWebContents());
|
||||
+#endif // BUILDFLAG(ENABLE_CEF)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,6 +275,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) {
|
||||
std::unique_ptr<base::DictionaryValue> ui_thread_polled_data(
|
||||
new base::DictionaryValue());
|
||||
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
Profile* profile = Profile::FromWebUI(web_ui());
|
||||
SetIfNotNull(ui_thread_polled_data.get(), "prerenderInfo",
|
||||
chrome_browser_net::GetPrerenderInfo(profile));
|
||||
@@ -258,6 +285,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) {
|
||||
SetIfNotNull(ui_thread_polled_data.get(), "serviceProviders",
|
||||
chrome_browser_net::GetWindowsServiceProviders());
|
||||
#endif
|
||||
+#endif // !BUILDFLAG(ENABLE_CEF)
|
||||
|
||||
file_writer_->StopNetLog(std::move(ui_thread_polled_data));
|
||||
}
|
||||
@@ -274,6 +302,7 @@ void NetExportMessageHandler::OnShowFile(const base::ListValue* list) {
|
||||
base::Bind(&NetExportMessageHandler::ShowFileInShell, AsWeakPtr()));
|
||||
}
|
||||
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
void NetExportMessageHandler::FileSelected(const base::FilePath& path,
|
||||
int index,
|
||||
void* params) {
|
||||
@@ -292,6 +321,7 @@ void NetExportMessageHandler::FileSelectionCanceled(void* params) {
|
||||
DCHECK(select_file_dialog_);
|
||||
select_file_dialog_ = nullptr;
|
||||
}
|
||||
+#endif // !BUILDFLAG(ENABLE_CEF)
|
||||
|
||||
void NetExportMessageHandler::OnNewState(const base::DictionaryValue& state) {
|
||||
NotifyUIWithState(state.CreateDeepCopy());
|
||||
@@ -356,6 +386,7 @@ void NetExportMessageHandler::NotifyUIWithState(
|
||||
*state);
|
||||
}
|
||||
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
void NetExportMessageHandler::ShowSelectFileDialog(
|
||||
const base::FilePath& default_path) {
|
||||
// User may have clicked more than once before the save dialog appears.
|
||||
@@ -374,6 +405,43 @@ void NetExportMessageHandler::ShowSelectFileDialog(
|
||||
ui::SelectFileDialog::SELECT_SAVEAS_FILE, base::string16(), default_path,
|
||||
&file_type_info, 0, base::FilePath::StringType(), owning_window, nullptr);
|
||||
}
|
||||
+#endif // !BUILDFLAG(ENABLE_CEF)
|
||||
+
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+
|
||||
+void NetExportMessageHandler::ShowCefSaveAsDialog(
|
||||
+ content::WebContents* web_contents) {
|
||||
+ CefRefPtr<CefBrowserHostImpl> cef_browser =
|
||||
+ CefBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
+ if (!cef_browser)
|
||||
+ return;
|
||||
+
|
||||
+ base::FilePath initial_dir;
|
||||
+ if (!last_save_dir.Pointer()->empty())
|
||||
+ initial_dir = *last_save_dir.Pointer();
|
||||
+ base::FilePath initial_path =
|
||||
+ initial_dir.Append(FILE_PATH_LITERAL("chrome-net-export-log.json"));
|
||||
+
|
||||
+ CefFileDialogRunner::FileChooserParams params;
|
||||
+ params.mode = blink::mojom::FileChooserParams::Mode::kSave;
|
||||
+ params.default_file_name = initial_path;
|
||||
+ params.accept_types.push_back(CefString(initial_path.Extension()));
|
||||
+
|
||||
+ cef_browser->RunFileChooser(
|
||||
+ params, base::Bind(&NetExportMessageHandler::SaveAsDialogDismissed,
|
||||
+ weak_ptr_factory_.GetWeakPtr()));
|
||||
+}
|
||||
+
|
||||
+void NetExportMessageHandler::SaveAsDialogDismissed(
|
||||
+ int selected_accept_filter,
|
||||
+ const std::vector<base::FilePath>& file_paths) {
|
||||
+ if (file_paths.size() == 1) {
|
||||
+ *last_save_dir.Pointer() = file_paths[0].DirName();
|
||||
+ StartNetLog(file_paths[0]);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#endif // BUILDFLAG(ENABLE_CEF)
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@@ -71,7 +71,7 @@ index e8e76ce5b954..1dd338dd0142 100644
|
||||
content::BrowserContext* GetBrowserContextRedirectedInIncognito(
|
||||
content::BrowserContext* context);
|
||||
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
|
||||
index 16c500023e3f..e0bc6609c6ae 100644
|
||||
index 7c6dbb5e026f..24dfc5caf7c2 100644
|
||||
--- chrome/browser/profiles/profile_manager.cc
|
||||
+++ chrome/browser/profiles/profile_manager.cc
|
||||
@@ -386,7 +386,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
|
||||
|
@@ -125,7 +125,7 @@ index 989d5d02cedb..e05810db6824 100644
|
||||
// If we broke out of the loop, we have found an enabled plugin.
|
||||
bool enabled = i < matching_plugins.size();
|
||||
diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc
|
||||
index 9136ab583964..1839ce97c7e4 100644
|
||||
index 93512757d137..63105b158100 100644
|
||||
--- chrome/renderer/chrome_content_renderer_client.cc
|
||||
+++ chrome/renderer/chrome_content_renderer_client.cc
|
||||
@@ -781,6 +781,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn
|
||||
index 2e32e5797683..89892c369d0b 100644
|
||||
index 06008eab559d..73f419de5370 100644
|
||||
--- chrome/renderer/BUILD.gn
|
||||
+++ chrome/renderer/BUILD.gn
|
||||
@@ -4,6 +4,7 @@
|
||||
|
147
patch/patches/component_build.patch
Normal file
147
patch/patches/component_build.patch
Normal file
@@ -0,0 +1,147 @@
|
||||
diff --git content/app/content_service_manager_main_delegate.h content/app/content_service_manager_main_delegate.h
|
||||
index 864f2a5a315a..78b71d523e86 100644
|
||||
--- content/app/content_service_manager_main_delegate.h
|
||||
+++ content/app/content_service_manager_main_delegate.h
|
||||
@@ -18,7 +18,8 @@ namespace content {
|
||||
|
||||
class ContentMainRunnerImpl;
|
||||
|
||||
-class ContentServiceManagerMainDelegate : public service_manager::MainDelegate {
|
||||
+class CONTENT_EXPORT ContentServiceManagerMainDelegate :
|
||||
+ public service_manager::MainDelegate {
|
||||
public:
|
||||
explicit ContentServiceManagerMainDelegate(const ContentMainParams& params);
|
||||
~ContentServiceManagerMainDelegate() override;
|
||||
diff --git content/browser/renderer_host/input/mouse_wheel_phase_handler.h content/browser/renderer_host/input/mouse_wheel_phase_handler.h
|
||||
index fc252b6ceffd..b0dfd847ec03 100644
|
||||
--- content/browser/renderer_host/input/mouse_wheel_phase_handler.h
|
||||
+++ content/browser/renderer_host/input/mouse_wheel_phase_handler.h
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "base/timer/timer.h"
|
||||
#include "content/browser/renderer_host/render_widget_host_delegate.h"
|
||||
+#include "content/common/content_export.h"
|
||||
#include "content/public/common/input_event_ack_state.h"
|
||||
#include "third_party/blink/public/platform/web_mouse_wheel_event.h"
|
||||
|
||||
@@ -55,7 +56,7 @@ enum class FirstScrollUpdateAckState {
|
||||
// The MouseWheelPhaseHandler is responsible for adding the proper phase to
|
||||
// wheel events. Phase information is necessary for wheel scrolling since it
|
||||
// shows the start and end of a scrolling sequence.
|
||||
-class MouseWheelPhaseHandler {
|
||||
+class CONTENT_EXPORT MouseWheelPhaseHandler {
|
||||
public:
|
||||
MouseWheelPhaseHandler(RenderWidgetHostViewBase* const host_view);
|
||||
~MouseWheelPhaseHandler() {}
|
||||
diff --git content/browser/renderer_host/input/synthetic_gesture_target_base.h content/browser/renderer_host/input/synthetic_gesture_target_base.h
|
||||
index 53476354343e..fd1a7a24455b 100644
|
||||
--- content/browser/renderer_host/input/synthetic_gesture_target_base.h
|
||||
+++ content/browser/renderer_host/input/synthetic_gesture_target_base.h
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "base/macros.h"
|
||||
#include "base/time/time.h"
|
||||
#include "content/browser/renderer_host/input/synthetic_gesture_target.h"
|
||||
+#include "content/common/content_export.h"
|
||||
|
||||
namespace ui {
|
||||
class LatencyInfo;
|
||||
@@ -24,7 +25,8 @@ namespace content {
|
||||
|
||||
class RenderWidgetHostImpl;
|
||||
|
||||
-class SyntheticGestureTargetBase : public SyntheticGestureTarget {
|
||||
+class CONTENT_EXPORT SyntheticGestureTargetBase :
|
||||
+ public SyntheticGestureTarget {
|
||||
public:
|
||||
explicit SyntheticGestureTargetBase(RenderWidgetHostImpl* host);
|
||||
~SyntheticGestureTargetBase() override;
|
||||
diff --git content/common/content_switches_internal.h content/common/content_switches_internal.h
|
||||
index 5e67fbce7c9e..5bb9ee518dce 100644
|
||||
--- content/common/content_switches_internal.h
|
||||
+++ content/common/content_switches_internal.h
|
||||
@@ -15,7 +15,7 @@ class CommandLine;
|
||||
|
||||
namespace content {
|
||||
|
||||
-bool IsPinchToZoomEnabled();
|
||||
+CONTENT_EXPORT bool IsPinchToZoomEnabled();
|
||||
|
||||
V8CacheOptions GetV8CacheOptions();
|
||||
|
||||
diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn
|
||||
index 7668f3725200..665e8e579c54 100644
|
||||
--- third_party/blink/renderer/controller/BUILD.gn
|
||||
+++ third_party/blink/renderer/controller/BUILD.gn
|
||||
@@ -25,6 +25,7 @@ component("controller") {
|
||||
|
||||
configs += [
|
||||
"//build/config/compiler:wexit_time_destructors",
|
||||
+ "//cef/libcef/features:config",
|
||||
"//third_party/blink/renderer:config",
|
||||
"//third_party/blink/renderer:inside_blink",
|
||||
"//third_party/blink/renderer:non_test_config",
|
||||
@@ -47,6 +48,8 @@ component("controller") {
|
||||
"memory_usage_monitor.h",
|
||||
"memory_usage_monitor_android.cc",
|
||||
"memory_usage_monitor_android.h",
|
||||
+ "//cef/libcef/renderer/blink_glue.cc",
|
||||
+ "//cef/libcef/renderer/blink_glue.h",
|
||||
]
|
||||
|
||||
if (is_android) {
|
||||
diff --git ui/events/keycodes/BUILD.gn ui/events/keycodes/BUILD.gn
|
||||
index 1e6d31cc0c92..36f3283291d9 100644
|
||||
--- ui/events/keycodes/BUILD.gn
|
||||
+++ ui/events/keycodes/BUILD.gn
|
||||
@@ -14,6 +14,8 @@ jumbo_source_set("xkb") {
|
||||
"xkb_keysym.h",
|
||||
]
|
||||
|
||||
+ defines = [ "KEYCODES_X_IMPLEMENTATION" ]
|
||||
+
|
||||
deps = [
|
||||
"//base",
|
||||
"//ui/base:buildflags",
|
||||
diff --git ui/events/keycodes/keyboard_code_conversion_xkb.h ui/events/keycodes/keyboard_code_conversion_xkb.h
|
||||
index a1f9b78704fb..c7d3558251d9 100644
|
||||
--- ui/events/keycodes/keyboard_code_conversion_xkb.h
|
||||
+++ ui/events/keycodes/keyboard_code_conversion_xkb.h
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "base/strings/string16.h"
|
||||
#include "ui/events/keycodes/dom/dom_key.h"
|
||||
+#include "ui/events/keycodes/keycodes_x_export.h"
|
||||
#include "ui/events/keycodes/xkb_keysym.h"
|
||||
|
||||
namespace ui {
|
||||
@@ -24,7 +25,7 @@ DomKey NonPrintableXKeySymToDomKey(xkb_keysym_t keysym);
|
||||
// base::char16 DeadXKeySymToCombiningCharacter(xkb_keysym_t keysym);
|
||||
|
||||
// Return the DomKey determined by the XKB layout result (keysym, character).
|
||||
-DomKey XKeySymToDomKey(xkb_keysym_t keysym, base::char16 character);
|
||||
+KEYCODES_X_EXPORT DomKey XKeySymToDomKey(xkb_keysym_t keysym, base::char16 character);
|
||||
|
||||
} // namespace ui
|
||||
|
||||
diff --git ui/events/keycodes/keysym_to_unicode.h ui/events/keycodes/keysym_to_unicode.h
|
||||
index a7983d179832..2bbee48e57ac 100644
|
||||
--- ui/events/keycodes/keysym_to_unicode.h
|
||||
+++ ui/events/keycodes/keysym_to_unicode.h
|
||||
@@ -5,6 +5,8 @@
|
||||
#ifndef UI_EVENTS_KEYCODES_KEYSYM_TO_UNICODE_H_
|
||||
#define UI_EVENTS_KEYCODES_KEYSYM_TO_UNICODE_H_
|
||||
|
||||
+#include "ui/events/keycodes/keycodes_x_export.h"
|
||||
+
|
||||
#include <stdint.h>
|
||||
|
||||
namespace ui {
|
||||
@@ -13,7 +15,7 @@ namespace ui {
|
||||
// |keysym| doesn't represent a printable character, returns zero. We don't
|
||||
// support characters outside the Basic Plane, and this function returns zero
|
||||
// in that case.
|
||||
-uint16_t GetUnicodeCharacterFromXKeySym(unsigned long keysym);
|
||||
+KEYCODES_X_EXPORT uint16_t GetUnicodeCharacterFromXKeySym(unsigned long keysym);
|
||||
|
||||
} // namespace ui
|
||||
|
@@ -1,56 +0,0 @@
|
||||
diff --git content/app/content_service_manager_main_delegate.h content/app/content_service_manager_main_delegate.h
|
||||
index 864f2a5a315a..78b71d523e86 100644
|
||||
--- content/app/content_service_manager_main_delegate.h
|
||||
+++ content/app/content_service_manager_main_delegate.h
|
||||
@@ -18,7 +18,8 @@ namespace content {
|
||||
|
||||
class ContentMainRunnerImpl;
|
||||
|
||||
-class ContentServiceManagerMainDelegate : public service_manager::MainDelegate {
|
||||
+class CONTENT_EXPORT ContentServiceManagerMainDelegate :
|
||||
+ public service_manager::MainDelegate {
|
||||
public:
|
||||
explicit ContentServiceManagerMainDelegate(const ContentMainParams& params);
|
||||
~ContentServiceManagerMainDelegate() override;
|
||||
diff --git content/browser/renderer_host/input/mouse_wheel_phase_handler.h content/browser/renderer_host/input/mouse_wheel_phase_handler.h
|
||||
index fc252b6ceffd..b0dfd847ec03 100644
|
||||
--- content/browser/renderer_host/input/mouse_wheel_phase_handler.h
|
||||
+++ content/browser/renderer_host/input/mouse_wheel_phase_handler.h
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "base/timer/timer.h"
|
||||
#include "content/browser/renderer_host/render_widget_host_delegate.h"
|
||||
+#include "content/common/content_export.h"
|
||||
#include "content/public/common/input_event_ack_state.h"
|
||||
#include "third_party/blink/public/platform/web_mouse_wheel_event.h"
|
||||
|
||||
@@ -55,7 +56,7 @@ enum class FirstScrollUpdateAckState {
|
||||
// The MouseWheelPhaseHandler is responsible for adding the proper phase to
|
||||
// wheel events. Phase information is necessary for wheel scrolling since it
|
||||
// shows the start and end of a scrolling sequence.
|
||||
-class MouseWheelPhaseHandler {
|
||||
+class CONTENT_EXPORT MouseWheelPhaseHandler {
|
||||
public:
|
||||
MouseWheelPhaseHandler(RenderWidgetHostViewBase* const host_view);
|
||||
~MouseWheelPhaseHandler() {}
|
||||
diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn
|
||||
index 7668f3725200..665e8e579c54 100644
|
||||
--- third_party/blink/renderer/controller/BUILD.gn
|
||||
+++ third_party/blink/renderer/controller/BUILD.gn
|
||||
@@ -25,6 +25,7 @@ component("controller") {
|
||||
|
||||
configs += [
|
||||
"//build/config/compiler:wexit_time_destructors",
|
||||
+ "//cef/libcef/features:config",
|
||||
"//third_party/blink/renderer:config",
|
||||
"//third_party/blink/renderer:inside_blink",
|
||||
"//third_party/blink/renderer:non_test_config",
|
||||
@@ -47,6 +48,8 @@ component("controller") {
|
||||
"memory_usage_monitor.h",
|
||||
"memory_usage_monitor_android.cc",
|
||||
"memory_usage_monitor_android.h",
|
||||
+ "//cef/libcef/renderer/blink_glue.cc",
|
||||
+ "//cef/libcef/renderer/blink_glue.h",
|
||||
]
|
||||
|
||||
if (is_android) {
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user