cef/BUILD.gn

2327 lines
73 KiB
Plaintext
Raw Normal View History

2016-06-23 19:42:00 +02:00
# Copyright 2016 The Chromium Embedded Framework Authors. Portions copyright
# 2014 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.
#
# This file provides the GN configuration for the CEF project. This is not a
# stand-alone configuration -- it must be built from inside the Chromium source
# tree. See https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
# for complete CEF build instructions. See below for links to additional GN
# documentation.
#
# GN Setup:
#
2016-08-08 13:31:57 +02:00
# Optionally configure GN by setting the `GN_DEFINES` and/or `GN_ARGUMENTS`
2016-06-23 19:42:00 +02:00
# environment variables.
#
# Example A: Create an official build on Windows:
2016-06-23 19:42:00 +02:00
#
# > set GN_DEFINES=is_official_build=true
2016-06-23 19:42:00 +02:00
#
# Example B: Generate VS2017 project files in addition to the default Ninja
2016-06-23 19:42:00 +02:00
# build files on Windows:
#
# > set GN_ARGUMENTS=--ide=vs2017 --sln=cef --filters=//cef/*
2016-06-23 19:42:00 +02:00
#
# After completing the "GN Automated Build" or "GN Manual Build" section
# open "out\<build_dir>\cef.sln" for editing and debugging. Building must
# still be performed using the Ninja command-line.
#
# GN Automated Build:
#
# Run the `automate-git.py` script as described on the BranchesAndBuilding
# Wiki page. GN, unlike GYP, supports parallel build configurations. The
# following command-line flags have special meaning with GN builds:
#
# --x64-build Perform an x64 build if specified (requires out/*_GN_x64
# directories), otherwise perform an x86 build (requires
# out/*_GN_x86 directories).
#
# Directories are created subject to your platform and `GN_DEFINES` settings.
# See Step 1B in the "GN Manual Build" section below for details.
#
# GN Manual Build:
#
# 1. Run the `cef_create_projects.[bin|sh]` script. Upon successful completion
# proceed to Step 2.
#
# The `cef_create_projects.[bin|sh]` script will automatically do all of the
# following:
#
# A. Apply patch files to the Chromium source tree. This includes
# `patch/patches/gn_config.patch` which is required for GN integration.
#
# B. Create multiple build output directories appropriate to your platform
# and `GN_DEFINES` settings. For example:
#
# x86 debug build -> out/Debug_GN_x86
# x86 release build -> out/Release_GN_x86
# x64 debug build -> out/Debug_GN_x64
# x64 release build -> out/Release_GN_x64
#
# Build output directories will be created subject to the following rules
# (defined in `tools/gn_args.py` GetAllPlatformConfigs):
#
# - Debug and Release directories will be created on all platforms by
# default. Debug directories will not be created when `is_asan=true`.
# - x64 directories will always be created on all platforms.
# - x86 directories will always be created on Windows.
# - x86 directories will be created on Linux when `use_sysroot=true`.
#
# C. Write the `args.gn` file for each build output directory using the
# `tools/gn_args.py` script to determine the GN arguments. Some arguments
# are required and some are optional. See script output for details in
# case of conflicts or recommendations.
#
# D. Run `gn gen` for each build output directory to generate project files.
# Ninja files will be generated by default. Additional command-line
# arguments (including other project formats) can be specified via the
# `GN_ARGUMENTS` environment variable. Run `gn gen --help` for a list of
# supported arguments.
#
# 2. Run Ninja from the command-line to build. If the build configuration has
# changed it will automatically re-run `gn gen` with the same arguments.
#
# > ninja -C out/<build_dir> cefclient cefsimple ceftests
2016-06-23 19:42:00 +02:00
#
# GN Manual Packaging:
#
# Run the `make_distrib.[bat|sh]` script as described on the
# BranchesAndBuilding Wiki page.
#
# Additional GN documentation:
# http://www.chromium.org/developers/gn-build-configuration
# https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/language.md
#
import("//base/allocator/allocator.gni")
2016-06-23 19:42:00 +02:00
import("//build/config/features.gni")
import("//build/config/locales.gni")
import("//build/config/ozone.gni")
2016-06-23 19:42:00 +02:00
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni")
import("//cef/libcef/features/features.gni")
import("//chrome/common/features.gni")
import("//content/public/app/mac_helpers.gni")
import("//extensions/buildflags/buildflags.gni")
2016-06-23 19:42:00 +02:00
import("//media/media_options.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//ppapi/buildflags/buildflags.gni")
import("//printing/buildflags/buildflags.gni")
import("//rlz/buildflags/buildflags.gni")
Add support for direct DevTools protocol messaging (fixes issue #2961). This change allows the client to directly send and receive DevTools protocol messages (send method calls, and receive method results and events) without requiring a DevTools front-end or remote-debugging session. This change includes additional supporting changes: - Add a new CefRequestHandler::OnDocumentAvailableInMainFrame callback (see issue #1454). - Add a CefParseJSON variant that accepts a UTF8-encoded buffer. - Add a `--devtools-protocol-log-file=<path>` command-line flag for logging protocol messages sent to/from the DevTools front-end while it is displayed. This is useful for understanding existing DevTools protocol usage. - Add a new "libcef_static_unittests" executable target to support light-weight unit tests of libcef_static internals (e.g. without requiring exposure via the CEF API). Files to be unittested are placed in the new "libcef_static_unittested" source_set which is then included by both the existing libcef_static library and the new unittests executable target. - Linux: Remove use_bundled_fontconfig=false, which is no longer required and causes unittest build errors (see issue #2424). This change also adds a cefclient demo for configuring offline mode using the DevTools protocol (fixes issue #245). This is controlled by the "Offline mode" context menu option and the `--offline` command-line switch which will launch cefclient in offline mode. When cefclient is offline all network requests will fail with ERR_INTERNET_DISCONNECTED and navigator.onLine will return false when called from JavaScript in any frame. This mode is per-browser so newly created browser windows will have the default mode. Note that configuring offline mode in this way will not update the Network tab UI ("Throtting" option) in a displayed DevTools front-end instance.
2020-06-13 02:54:08 +02:00
import("//testing/test.gni")
import("//third_party/icu/config.gni")
import("//third_party/widevine/cdm/widevine.gni")
2016-06-23 19:42:00 +02:00
import("//tools/grit/repack.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
import("//ui/gl/features.gni")
import("//v8/gni/v8.gni")
if (is_clang) {
import("//build/config/clang/clang.gni")
}
2016-06-23 19:42:00 +02:00
if (is_linux) {
import("//build/config/linux/pkg_config.gni")
import("//third_party/fontconfig/fontconfig.gni")
2016-06-23 19:42:00 +02:00
}
if (is_mac) {
import("//build/apple/tweak_info_plist.gni")
2016-06-23 19:42:00 +02:00
import("//build/config/mac/rules.gni")
import("//chrome/version.gni")
import("//media/cdm/library_cdm/cdm_paths.gni")
# Template to compile .xib and .storyboard files.
#
# Arguments
#
# sources:
# list of string, sources to compile
#
# ibtool_flags:
# (optional) list of string, additional flags to pass to the ibtool
template("compile_ib_files") {
action_foreach(target_name) {
forward_variables_from(invoker,
[
"testonly",
"visibility",
])
assert(defined(invoker.sources),
"sources must be specified for $target_name")
assert(defined(invoker.output_extension),
"output_extension must be specified for $target_name")
ibtool_flags = []
if (defined(invoker.ibtool_flags)) {
ibtool_flags = invoker.ibtool_flags
}
_output_extension = invoker.output_extension
script = "//cef/tools/compile_ib_files.py"
sources = invoker.sources
outputs = [
"$target_gen_dir/$target_name/{{source_name_part}}.$_output_extension",
]
args = [
"--input",
"{{source}}",
"--output",
rebase_path(
"$target_gen_dir/$target_name/{{source_name_part}}.$_output_extension",
root_build_dir),
]
if (!use_system_xcode) {
args += [
"--developer_dir",
hermetic_xcode_path,
]
}
args += ibtool_flags
}
}
# Template to compile and package Mac XIB files as bundle data.
#
# Arguments
#
# sources:
# list of string, sources to comiple
#
# output_path:
# (optional) string, the path to use for the outputs list in the
# bundle_data step. If unspecified, defaults to bundle_resources_dir.
template("mac_xib_bundle_data") {
_target_name = target_name
_compile_target_name = _target_name + "_compile_ibtool"
compile_ib_files(_compile_target_name) {
forward_variables_from(invoker, [ "testonly" ])
visibility = [ ":$_target_name" ]
sources = invoker.sources
output_extension = "nib"
ibtool_flags = [
"--minimum-deployment-target",
mac_deployment_target,
# TODO(rsesek): Enable this once all the bots are on Xcode 7+.
# "--target-device",
# "mac",
]
}
bundle_data(_target_name) {
forward_variables_from(invoker,
[
"testonly",
"visibility",
])
public_deps = [
":$_compile_target_name",
]
sources = get_target_outputs(":$_compile_target_name")
_output_path = "{{bundle_resources_dir}}"
if (defined(invoker.output_path)) {
_output_path = invoker.output_path
}
outputs = [
"$_output_path/{{source_file_part}}",
]
}
}
2016-06-23 19:42:00 +02:00
}
if (is_win) {
import("//build/config/win/console_app.gni")
import("//build/config/win/manifest.gni")
}
2016-06-23 19:42:00 +02:00
if (is_linux) {
declare_args() {
# The cefclient target depends on GTK packages that are not available in the
# default sysroot environment. So we should only use them when we are not
# using the sysroot. Alternatively, the developer might not want to use the
# GTK dependencies at all, in which case they can set `cef_use_gtk=false`.
cef_use_gtk = !use_sysroot
}
}
2016-06-23 19:42:00 +02:00
#
# Verify required global arguments configured via `gn args`.
# Set by GetRequiredArgs() in //cef/tools/gn_args.py.
2016-06-23 19:42:00 +02:00
#
# Enable support for Print Preview.
assert(enable_print_preview)
2016-06-23 19:42:00 +02:00
# Enable support for Widevine CDM.
assert(enable_widevine)
if (is_mac || is_win) {
# Enable Widevine CDM host verification and storage ID.
assert(enable_cdm_host_verification)
assert(enable_cdm_storage_id)
assert(alternate_cdm_storage_id_key != "")
assert(enable_rlz)
}
# Enable Views UI framework.
assert(toolkit_views)
2016-06-23 19:42:00 +02:00
if (is_clang) {
# Don't use the chrome style plugin.
assert(!clang_use_chrome_plugins)
}
#
# Local variables.
#
if (is_mac) {
# 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(
"//cef/tools/cef_version.py", [ "plist" ], "trim string", [])
# Need to be creative to match dylib version formatting requirements.
cef_dylib_version = exec_script(
"//cef/tools/cef_version.py", [ "dylib" ], "trim string", [])
2016-06-23 19:42:00 +02:00
}
# Read file lists from gypi files. The gypi_to_gn.py script does not support
# variable references so all required variables must be explicitly specified in
# the below configurations.
gypi_paths = exec_script("//cef/tools/gypi_to_gn.py",
2016-06-23 19:42:00 +02:00
[ rebase_path("cef_paths.gypi") ],
"scope",
[ "cef_paths.gypi" ])
gypi_paths2 = exec_script("//cef/tools/gypi_to_gn.py",
2016-06-23 19:42:00 +02:00
[ rebase_path("cef_paths2.gypi") ],
"scope",
[ "cef_paths2.gypi" ])
includes_common = gypi_paths2.includes_common + gypi_paths2.includes_common_capi
includes_mac = gypi_paths2.includes_mac + gypi_paths2.includes_mac_capi
includes_linux = gypi_paths2.includes_linux + gypi_paths2.includes_linux_capi
includes_win = gypi_paths2.includes_win + gypi_paths2.includes_win_capi
2016-06-23 19:42:00 +02:00
#
# Targets that will be built when depending on "//cef".
#
group("cef") {
testonly = true
deps = [
":cefsimple",
":ceftests",
Add support for direct DevTools protocol messaging (fixes issue #2961). This change allows the client to directly send and receive DevTools protocol messages (send method calls, and receive method results and events) without requiring a DevTools front-end or remote-debugging session. This change includes additional supporting changes: - Add a new CefRequestHandler::OnDocumentAvailableInMainFrame callback (see issue #1454). - Add a CefParseJSON variant that accepts a UTF8-encoded buffer. - Add a `--devtools-protocol-log-file=<path>` command-line flag for logging protocol messages sent to/from the DevTools front-end while it is displayed. This is useful for understanding existing DevTools protocol usage. - Add a new "libcef_static_unittests" executable target to support light-weight unit tests of libcef_static internals (e.g. without requiring exposure via the CEF API). Files to be unittested are placed in the new "libcef_static_unittested" source_set which is then included by both the existing libcef_static library and the new unittests executable target. - Linux: Remove use_bundled_fontconfig=false, which is no longer required and causes unittest build errors (see issue #2424). This change also adds a cefclient demo for configuring offline mode using the DevTools protocol (fixes issue #245). This is controlled by the "Offline mode" context menu option and the `--offline` command-line switch which will launch cefclient in offline mode. When cefclient is offline all network requests will fail with ERR_INTERNET_DISCONNECTED and navigator.onLine will return false when called from JavaScript in any frame. This mode is per-browser so newly created browser windows will have the default mode. Note that configuring offline mode in this way will not update the Network tab UI ("Throtting" option) in a displayed DevTools front-end instance.
2020-06-13 02:54:08 +02:00
":libcef_static_unittests",
2016-06-23 19:42:00 +02:00
]
if (!is_linux || ozone_platform_x11) {
deps += [ ":cefclient" ]
}
2016-06-23 19:42:00 +02:00
}
if (is_win) {
# Target for building code that accesses chrome_elf internals. Included from
# the //chrome_elf:crash target. Defined as a static_library instead of a
# source_set because (a) the source files don't export any symbols and (b)
# *_switches.cc duplication otherwise causes linker errors.
static_library("chrome_elf_set") {
sources = [
"libcef/common/crash_reporter_client.cc",
"libcef/common/crash_reporter_client.h",
# Required for crash_keys::GetChromeCrashKeys.
# Otherwise we need to copy this array into CEF, which would be difficult
# to maintain.
"//chrome/common/crash_keys.cc",
"//chrome/common/chrome_switches.cc",
"//components/flags_ui/flags_ui_switches.cc",
"//content/public/common/content_switches.cc",
]
configs += [
"libcef/features:config",
"//build/config:precompiled_headers",
]
public_configs = [
"libcef/features:config",
]
if (is_component_build) {
# Avoid linker errors with content_switches.cc in component build by not
# defining CONTENT_EXPORT.
defines = ["COMPILE_CONTENT_STATICALLY"]
}
deps = [
"//components/crash/core/common", # crash_keys
# Required by chrome_switches.cc
"//chrome/common:buildflags",
"//ppapi/buildflags:buildflags",
"//printing/buildflags:buildflags",
"//ui/base:buildflags",
# Required by content_switches.cc
"//media:media_buildflags",
# Required by crash_keys.cc (from base/stl_util.h)
"//third_party/abseil-cpp:absl",
]
}
}
#
# Test support targets.
#
# Source files that are linked into libcef and cef_framework and tested by
# libcef_static_unittests. These sources provide libcef-internal functionality
# that is limited in scope (e.g. utility classes/methods).
Add support for direct DevTools protocol messaging (fixes issue #2961). This change allows the client to directly send and receive DevTools protocol messages (send method calls, and receive method results and events) without requiring a DevTools front-end or remote-debugging session. This change includes additional supporting changes: - Add a new CefRequestHandler::OnDocumentAvailableInMainFrame callback (see issue #1454). - Add a CefParseJSON variant that accepts a UTF8-encoded buffer. - Add a `--devtools-protocol-log-file=<path>` command-line flag for logging protocol messages sent to/from the DevTools front-end while it is displayed. This is useful for understanding existing DevTools protocol usage. - Add a new "libcef_static_unittests" executable target to support light-weight unit tests of libcef_static internals (e.g. without requiring exposure via the CEF API). Files to be unittested are placed in the new "libcef_static_unittested" source_set which is then included by both the existing libcef_static library and the new unittests executable target. - Linux: Remove use_bundled_fontconfig=false, which is no longer required and causes unittest build errors (see issue #2424). This change also adds a cefclient demo for configuring offline mode using the DevTools protocol (fixes issue #245). This is controlled by the "Offline mode" context menu option and the `--offline` command-line switch which will launch cefclient in offline mode. When cefclient is offline all network requests will fail with ERR_INTERNET_DISCONNECTED and navigator.onLine will return false when called from JavaScript in any frame. This mode is per-browser so newly created browser windows will have the default mode. Note that configuring offline mode in this way will not update the Network tab UI ("Throtting" option) in a displayed DevTools front-end instance.
2020-06-13 02:54:08 +02:00
source_set("libcef_static_unittested") {
sources = [
"libcef/browser/devtools/devtools_util.cc",
"libcef/browser/devtools/devtools_util.h",
"libcef/browser/geometry_util.h",
"libcef/browser/geometry_util.cc",
Add support for direct DevTools protocol messaging (fixes issue #2961). This change allows the client to directly send and receive DevTools protocol messages (send method calls, and receive method results and events) without requiring a DevTools front-end or remote-debugging session. This change includes additional supporting changes: - Add a new CefRequestHandler::OnDocumentAvailableInMainFrame callback (see issue #1454). - Add a CefParseJSON variant that accepts a UTF8-encoded buffer. - Add a `--devtools-protocol-log-file=<path>` command-line flag for logging protocol messages sent to/from the DevTools front-end while it is displayed. This is useful for understanding existing DevTools protocol usage. - Add a new "libcef_static_unittests" executable target to support light-weight unit tests of libcef_static internals (e.g. without requiring exposure via the CEF API). Files to be unittested are placed in the new "libcef_static_unittested" source_set which is then included by both the existing libcef_static library and the new unittests executable target. - Linux: Remove use_bundled_fontconfig=false, which is no longer required and causes unittest build errors (see issue #2424). This change also adds a cefclient demo for configuring offline mode using the DevTools protocol (fixes issue #245). This is controlled by the "Offline mode" context menu option and the `--offline` command-line switch which will launch cefclient in offline mode. When cefclient is offline all network requests will fail with ERR_INTERNET_DISCONNECTED and navigator.onLine will return false when called from JavaScript in any frame. This mode is per-browser so newly created browser windows will have the default mode. Note that configuring offline mode in this way will not update the Network tab UI ("Throtting" option) in a displayed DevTools front-end instance.
2020-06-13 02:54:08 +02:00
]
deps = [
"//ui/gfx/geometry",
Add support for direct DevTools protocol messaging (fixes issue #2961). This change allows the client to directly send and receive DevTools protocol messages (send method calls, and receive method results and events) without requiring a DevTools front-end or remote-debugging session. This change includes additional supporting changes: - Add a new CefRequestHandler::OnDocumentAvailableInMainFrame callback (see issue #1454). - Add a CefParseJSON variant that accepts a UTF8-encoded buffer. - Add a `--devtools-protocol-log-file=<path>` command-line flag for logging protocol messages sent to/from the DevTools front-end while it is displayed. This is useful for understanding existing DevTools protocol usage. - Add a new "libcef_static_unittests" executable target to support light-weight unit tests of libcef_static internals (e.g. without requiring exposure via the CEF API). Files to be unittested are placed in the new "libcef_static_unittested" source_set which is then included by both the existing libcef_static library and the new unittests executable target. - Linux: Remove use_bundled_fontconfig=false, which is no longer required and causes unittest build errors (see issue #2424). This change also adds a cefclient demo for configuring offline mode using the DevTools protocol (fixes issue #245). This is controlled by the "Offline mode" context menu option and the `--offline` command-line switch which will launch cefclient in offline mode. When cefclient is offline all network requests will fail with ERR_INTERNET_DISCONNECTED and navigator.onLine will return false when called from JavaScript in any frame. This mode is per-browser so newly created browser windows will have the default mode. Note that configuring offline mode in this way will not update the Network tab UI ("Throtting" option) in a displayed DevTools front-end instance.
2020-06-13 02:54:08 +02:00
]
public_deps = [
# Support relative include paths.
"//base",
]
Add support for direct DevTools protocol messaging (fixes issue #2961). This change allows the client to directly send and receive DevTools protocol messages (send method calls, and receive method results and events) without requiring a DevTools front-end or remote-debugging session. This change includes additional supporting changes: - Add a new CefRequestHandler::OnDocumentAvailableInMainFrame callback (see issue #1454). - Add a CefParseJSON variant that accepts a UTF8-encoded buffer. - Add a `--devtools-protocol-log-file=<path>` command-line flag for logging protocol messages sent to/from the DevTools front-end while it is displayed. This is useful for understanding existing DevTools protocol usage. - Add a new "libcef_static_unittests" executable target to support light-weight unit tests of libcef_static internals (e.g. without requiring exposure via the CEF API). Files to be unittested are placed in the new "libcef_static_unittested" source_set which is then included by both the existing libcef_static library and the new unittests executable target. - Linux: Remove use_bundled_fontconfig=false, which is no longer required and causes unittest build errors (see issue #2424). This change also adds a cefclient demo for configuring offline mode using the DevTools protocol (fixes issue #245). This is controlled by the "Offline mode" context menu option and the `--offline` command-line switch which will launch cefclient in offline mode. When cefclient is offline all network requests will fail with ERR_INTERNET_DISCONNECTED and navigator.onLine will return false when called from JavaScript in any frame. This mode is per-browser so newly created browser windows will have the default mode. Note that configuring offline mode in this way will not update the Network tab UI ("Throtting" option) in a displayed DevTools front-end instance.
2020-06-13 02:54:08 +02:00
configs += [
"libcef/features:config",
"//build/config:precompiled_headers",
]
}
# Executable target that provides test coverage for libcef_static_unittested
# source files.
Add support for direct DevTools protocol messaging (fixes issue #2961). This change allows the client to directly send and receive DevTools protocol messages (send method calls, and receive method results and events) without requiring a DevTools front-end or remote-debugging session. This change includes additional supporting changes: - Add a new CefRequestHandler::OnDocumentAvailableInMainFrame callback (see issue #1454). - Add a CefParseJSON variant that accepts a UTF8-encoded buffer. - Add a `--devtools-protocol-log-file=<path>` command-line flag for logging protocol messages sent to/from the DevTools front-end while it is displayed. This is useful for understanding existing DevTools protocol usage. - Add a new "libcef_static_unittests" executable target to support light-weight unit tests of libcef_static internals (e.g. without requiring exposure via the CEF API). Files to be unittested are placed in the new "libcef_static_unittested" source_set which is then included by both the existing libcef_static library and the new unittests executable target. - Linux: Remove use_bundled_fontconfig=false, which is no longer required and causes unittest build errors (see issue #2424). This change also adds a cefclient demo for configuring offline mode using the DevTools protocol (fixes issue #245). This is controlled by the "Offline mode" context menu option and the `--offline` command-line switch which will launch cefclient in offline mode. When cefclient is offline all network requests will fail with ERR_INTERNET_DISCONNECTED and navigator.onLine will return false when called from JavaScript in any frame. This mode is per-browser so newly created browser windows will have the default mode. Note that configuring offline mode in this way will not update the Network tab UI ("Throtting" option) in a displayed DevTools front-end instance.
2020-06-13 02:54:08 +02:00
test("libcef_static_unittests") {
testonly = true
Add support for direct DevTools protocol messaging (fixes issue #2961). This change allows the client to directly send and receive DevTools protocol messages (send method calls, and receive method results and events) without requiring a DevTools front-end or remote-debugging session. This change includes additional supporting changes: - Add a new CefRequestHandler::OnDocumentAvailableInMainFrame callback (see issue #1454). - Add a CefParseJSON variant that accepts a UTF8-encoded buffer. - Add a `--devtools-protocol-log-file=<path>` command-line flag for logging protocol messages sent to/from the DevTools front-end while it is displayed. This is useful for understanding existing DevTools protocol usage. - Add a new "libcef_static_unittests" executable target to support light-weight unit tests of libcef_static internals (e.g. without requiring exposure via the CEF API). Files to be unittested are placed in the new "libcef_static_unittested" source_set which is then included by both the existing libcef_static library and the new unittests executable target. - Linux: Remove use_bundled_fontconfig=false, which is no longer required and causes unittest build errors (see issue #2424). This change also adds a cefclient demo for configuring offline mode using the DevTools protocol (fixes issue #245). This is controlled by the "Offline mode" context menu option and the `--offline` command-line switch which will launch cefclient in offline mode. When cefclient is offline all network requests will fail with ERR_INTERNET_DISCONNECTED and navigator.onLine will return false when called from JavaScript in any frame. This mode is per-browser so newly created browser windows will have the default mode. Note that configuring offline mode in this way will not update the Network tab UI ("Throtting" option) in a displayed DevTools front-end instance.
2020-06-13 02:54:08 +02:00
sources = [
"libcef/browser/devtools/devtools_util_unittest.cc",
"libcef/browser/geometry_util_unittest.cc",
Add support for direct DevTools protocol messaging (fixes issue #2961). This change allows the client to directly send and receive DevTools protocol messages (send method calls, and receive method results and events) without requiring a DevTools front-end or remote-debugging session. This change includes additional supporting changes: - Add a new CefRequestHandler::OnDocumentAvailableInMainFrame callback (see issue #1454). - Add a CefParseJSON variant that accepts a UTF8-encoded buffer. - Add a `--devtools-protocol-log-file=<path>` command-line flag for logging protocol messages sent to/from the DevTools front-end while it is displayed. This is useful for understanding existing DevTools protocol usage. - Add a new "libcef_static_unittests" executable target to support light-weight unit tests of libcef_static internals (e.g. without requiring exposure via the CEF API). Files to be unittested are placed in the new "libcef_static_unittested" source_set which is then included by both the existing libcef_static library and the new unittests executable target. - Linux: Remove use_bundled_fontconfig=false, which is no longer required and causes unittest build errors (see issue #2424). This change also adds a cefclient demo for configuring offline mode using the DevTools protocol (fixes issue #245). This is controlled by the "Offline mode" context menu option and the `--offline` command-line switch which will launch cefclient in offline mode. When cefclient is offline all network requests will fail with ERR_INTERNET_DISCONNECTED and navigator.onLine will return false when called from JavaScript in any frame. This mode is per-browser so newly created browser windows will have the default mode. Note that configuring offline mode in this way will not update the Network tab UI ("Throtting" option) in a displayed DevTools front-end instance.
2020-06-13 02:54:08 +02:00
]
deps = [
":libcef_static_unittested",
"//base/test:run_all_unittests",
"//testing/gtest",
]
configs += [
"libcef/features:config",
"//build/config:precompiled_headers",
]
}
# Source files that are linked into libcef and cef_framework and implement
# interfaces exposed to ceftests via the include/test directory. These sources
# may access Chromium/CEF internals. This is defined as a separate target from
# libcef_static to avoid introducing testonly dependencies there.
source_set("libcef_test_support") {
testonly = true
sources = [
"libcef/browser/test/test_helpers_impl.cc",
"libcef/browser/test/test_server_impl.cc",
"libcef/browser/test/test_server_impl.h",
"libcef/common/test/translator_test_impl.cc",
]
deps = [
":libcef_static",
"//net:test_support",
# Support for UI input events.
"//ui/views:test_support",
]
}
#
# libcef_static target.
#
source_set("libcef_static") {
sources = includes_common +
2016-06-23 19:42:00 +02:00
gypi_paths.autogen_cpp_includes + [
"libcef/browser/alloy/alloy_browser_host_impl.cc",
"libcef/browser/alloy/alloy_browser_host_impl.h",
"libcef/browser/alloy/browser_platform_delegate_alloy.cc",
"libcef/browser/alloy/browser_platform_delegate_alloy.h",
"libcef/browser/alloy/dialogs/alloy_constrained_window_views_client.cc",
"libcef/browser/alloy/dialogs/alloy_constrained_window_views_client.h",
"libcef/browser/alloy/dialogs/alloy_web_contents_dialog_helper.cc",
"libcef/browser/alloy/dialogs/alloy_web_contents_dialog_helper.h",
"libcef/browser/audio_capturer.cc",
"libcef/browser/audio_capturer.h",
"libcef/browser/audio_loopback_stream_creator.cc",
"libcef/browser/audio_loopback_stream_creator.h",
Create a ChromeBrowserHostImpl for every Chrome tab (see issue #2969) The Browser object represents the top-level Chrome browser window. One or more tabs (WebContents) are then owned by the Browser object via TabStripModel. A new Browser object can be created programmatically using "new Browser" or Browser::Create, or as a result of user action such as dragging a tab out of an existing window. New or existing tabs can also be added to an already existing Browser object. The Browser object acts as the WebContentsDelegate for all attached tabs. CEF integration requires WebContentsDelegate callbacks and notification of tab attach/detach. To support this integration we add a cef::BrowserDelegate (ChromeBrowserDelegate) member that is created in the Browser constructor and receives delegation for the Browser callbacks. ChromeBrowserDelegate creates a new ChromeBrowserHostImpl when a tab is added to a Browser for the first time, and that ChromeBrowserHostImpl continues to exist until the tab's WebContents is destroyed. The associated WebContents object does not change, but the Browser object will change when the tab is dragged between windows. CEF callback logic is shared between the chrome and alloy runtimes where possible. This shared logic has been extracted from CefBrowserHostImpl to create new CefBrowserHostBase and CefBrowserContentsDelegate classes. The CefBrowserHostImpl class is now only used with the alloy runtime and will be renamed to AlloyBrowserHostImpl in a future commit.
2020-09-18 00:24:08 +02:00
"libcef/browser/browser_contents_delegate.cc",
"libcef/browser/browser_contents_delegate.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/browser_context.cc",
"libcef/browser/browser_context.h",
"libcef/browser/browser_event_util.cc",
"libcef/browser/browser_event_util.h",
"libcef/browser/browser_frame.cc",
"libcef/browser/browser_frame.h",
"libcef/browser/browser_guest_util.cc",
"libcef/browser/browser_guest_util.h",
Create a ChromeBrowserHostImpl for every Chrome tab (see issue #2969) The Browser object represents the top-level Chrome browser window. One or more tabs (WebContents) are then owned by the Browser object via TabStripModel. A new Browser object can be created programmatically using "new Browser" or Browser::Create, or as a result of user action such as dragging a tab out of an existing window. New or existing tabs can also be added to an already existing Browser object. The Browser object acts as the WebContentsDelegate for all attached tabs. CEF integration requires WebContentsDelegate callbacks and notification of tab attach/detach. To support this integration we add a cef::BrowserDelegate (ChromeBrowserDelegate) member that is created in the Browser constructor and receives delegation for the Browser callbacks. ChromeBrowserDelegate creates a new ChromeBrowserHostImpl when a tab is added to a Browser for the first time, and that ChromeBrowserHostImpl continues to exist until the tab's WebContents is destroyed. The associated WebContents object does not change, but the Browser object will change when the tab is dragged between windows. CEF callback logic is shared between the chrome and alloy runtimes where possible. This shared logic has been extracted from CefBrowserHostImpl to create new CefBrowserHostBase and CefBrowserContentsDelegate classes. The CefBrowserHostImpl class is now only used with the alloy runtime and will be renamed to AlloyBrowserHostImpl in a future commit.
2020-09-18 00:24:08 +02:00
"libcef/browser/browser_host_base.cc",
"libcef/browser/browser_host_base.h",
"libcef/browser/browser_host_create.cc",
2016-06-23 19:42:00 +02:00
"libcef/browser/browser_info.cc",
"libcef/browser/browser_info.h",
"libcef/browser/browser_info_manager.cc",
"libcef/browser/browser_info_manager.h",
"libcef/browser/browser_manager.cc",
"libcef/browser/browser_manager.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/browser_message_loop.cc",
"libcef/browser/browser_message_loop.h",
"libcef/browser/browser_platform_delegate.cc",
"libcef/browser/browser_platform_delegate.h",
"libcef/browser/browser_platform_delegate_create.cc",
"libcef/browser/certificate_query.cc",
"libcef/browser/certificate_query.h",
Create a ChromeBrowserHostImpl for every Chrome tab (see issue #2969) The Browser object represents the top-level Chrome browser window. One or more tabs (WebContents) are then owned by the Browser object via TabStripModel. A new Browser object can be created programmatically using "new Browser" or Browser::Create, or as a result of user action such as dragging a tab out of an existing window. New or existing tabs can also be added to an already existing Browser object. The Browser object acts as the WebContentsDelegate for all attached tabs. CEF integration requires WebContentsDelegate callbacks and notification of tab attach/detach. To support this integration we add a cef::BrowserDelegate (ChromeBrowserDelegate) member that is created in the Browser constructor and receives delegation for the Browser callbacks. ChromeBrowserDelegate creates a new ChromeBrowserHostImpl when a tab is added to a Browser for the first time, and that ChromeBrowserHostImpl continues to exist until the tab's WebContents is destroyed. The associated WebContents object does not change, but the Browser object will change when the tab is dragged between windows. CEF callback logic is shared between the chrome and alloy runtimes where possible. This shared logic has been extracted from CefBrowserHostImpl to create new CefBrowserHostBase and CefBrowserContentsDelegate classes. The CefBrowserHostImpl class is now only used with the alloy runtime and will be renamed to AlloyBrowserHostImpl in a future commit.
2020-09-18 00:24:08 +02:00
"libcef/browser/chrome/browser_delegate.h",
Add chrome runtime support for more callbacks and ceftests (see issue #2969) This change adds support for: - Protocol and request handling. - Loading and navigation events. - Display and focus events. - Mouse/keyboard events. - Popup browsers. - Callbacks in the renderer process. - Misc. functionality required for ceftests. This change also adds a new CefBrowserProcessHandler::GetCookieableSchemes callback for configuring global state that will be applied to all CefCookieManagers by default. This global callback is currently required by the chrome runtime because the primary ProfileImpl is created via ChromeBrowserMainParts::PreMainMessageLoopRun (CreatePrimaryProfile) before OnContextCreated can be called. ProfileImpl will use the "C:\Users\[user]\AppData\Local\CEF\User Data\Default" directory by default (on Windows). Cookies may persist in this directory when running ceftests and may need to be manually deleted if those tests fail. Remaining work includes: - Support for client-created request contexts. - Embedding the browser in a Views hierarchy (cefclient support). - TryCloseBrowser and DoClose support. - Most of the CefSettings configuration. - DevTools protocol and window control (ShowDevTools, ExecuteDevToolsMethod). - CEF-specific WebUI pages (about, license, webui-hosts). - Context menu customization (CefContextMenuHandler). - Auto resize (SetAutoResizeEnabled). - Zoom settings (SetZoomLevel). - File dialog runner (RunFileDialog). - File and JS dialog handlers (CefDialogHandler, CefJSDialogHandler). - Extension loading (LoadExtension, etc). - Plugin loading (OnBeforePluginLoad). - Widevine loading (CefRegisterWidevineCdm). - PDF and print preview does not display. - Crash reporting is untested. - Mac: Web content loads but does not display. The following ceftests are now passing when run with the "--enable-chrome-runtime" command-line flag: CorsTest.* DisplayTest.*:-DisplayTest.AutoResize DOMTest.* DraggableRegionsTest.* ImageTest.* MessageRouterTest.* NavigationTest.* ParserTest.* RequestContextTest.*Global* RequestTest.* ResourceManagerTest.* ResourceRequestHandlerTest.* ResponseTest.* SchemeHandlerTest.* ServerTest.* StreamResourceHandlerTest.* StreamTest.* StringTest.* TaskTest.* TestServerTest.* ThreadTest.* URLRequestTest.*Global* V8Test.*:-V8Test.OnUncaughtExceptionDevTools ValuesTest.* WaitableEventTest.* XmlReaderTest.* ZipReaderTest.*
2020-09-25 03:40:47 +02:00
"libcef/browser/chrome/browser_platform_delegate_chrome.cc",
"libcef/browser/chrome/browser_platform_delegate_chrome.h",
"libcef/browser/chrome/chrome_browser_context.cc",
"libcef/browser/chrome/chrome_browser_context.h",
Create a ChromeBrowserHostImpl for every Chrome tab (see issue #2969) The Browser object represents the top-level Chrome browser window. One or more tabs (WebContents) are then owned by the Browser object via TabStripModel. A new Browser object can be created programmatically using "new Browser" or Browser::Create, or as a result of user action such as dragging a tab out of an existing window. New or existing tabs can also be added to an already existing Browser object. The Browser object acts as the WebContentsDelegate for all attached tabs. CEF integration requires WebContentsDelegate callbacks and notification of tab attach/detach. To support this integration we add a cef::BrowserDelegate (ChromeBrowserDelegate) member that is created in the Browser constructor and receives delegation for the Browser callbacks. ChromeBrowserDelegate creates a new ChromeBrowserHostImpl when a tab is added to a Browser for the first time, and that ChromeBrowserHostImpl continues to exist until the tab's WebContents is destroyed. The associated WebContents object does not change, but the Browser object will change when the tab is dragged between windows. CEF callback logic is shared between the chrome and alloy runtimes where possible. This shared logic has been extracted from CefBrowserHostImpl to create new CefBrowserHostBase and CefBrowserContentsDelegate classes. The CefBrowserHostImpl class is now only used with the alloy runtime and will be renamed to AlloyBrowserHostImpl in a future commit.
2020-09-18 00:24:08 +02:00
"libcef/browser/chrome/chrome_browser_delegate.cc",
"libcef/browser/chrome/chrome_browser_delegate.h",
"libcef/browser/chrome/chrome_browser_host_impl.cc",
"libcef/browser/chrome/chrome_browser_host_impl.h",
"libcef/browser/chrome/chrome_browser_main_extra_parts_cef.cc",
"libcef/browser/chrome/chrome_browser_main_extra_parts_cef.h",
"libcef/browser/chrome/chrome_content_browser_client_cef.cc",
"libcef/browser/chrome/chrome_content_browser_client_cef.h",
"libcef/browser/chrome/chrome_context_menu_handler.cc",
"libcef/browser/chrome/chrome_context_menu_handler.h",
"libcef/browser/chrome/chrome_startup_browser_creator.cc",
"libcef/browser/chrome/chrome_startup_browser_creator.h",
chrome: Add support for Alloy style browsers and windows (see #3681) Split the Alloy runtime into bootstrap and style components. Support creation of Alloy style browsers and windows with the Chrome runtime. Chrome runtime (`--enable-chrome-runtime`) + Alloy style (`--use-alloy-style`) supports Views (`--use-views`), native parent (`--use-native`) and windowless rendering (`--off-screen-rendering-enabled`). Print preview is supported in all cases except with windowless rendering on all platforms and native parent on MacOS. It is disabled by default with Alloy style for legacy compatibility. Where supported it can be enabled or disabled globally using `--[enable|disable]-print-preview` or configured on a per-RequestContext basis using the `printing.print_preview_disabled` preference. It also behaves as expected when triggered via the PDF viewer print button. Chrome runtime + Alloy style behavior differs from Alloy runtime in the following significant ways: - Supports Chrome error pages by default. - DevTools popups are Chrome style only (cannot be windowless). - The Alloy extension API will not supported. Chrome runtime + Alloy style passes all expected Alloy ceftests except the following: - `DisplayTest.AutoResize` (Alloy extension API not supported) - `DownloadTest.*` (Download API not yet supported) - `ExtensionTest.*` (Alloy extension API not supported) This change also adds Chrome runtime support for CefContextMenuHandler::RunContextMenu (see #3293). This change also explicitly blocks (and doesn't retry) FrameAttached requests from PDF viewer and print preview excluded frames (see #3664). Known issues specific to Chrome runtime + Alloy style: - DevTools popup with windowless rendering doesn't load successfully. Use windowed rendering or remote debugging as a workaround. - Chrome style Window with Alloy style BrowserView (`--use-alloy-style --use-chrome-style-window`) does not show Chrome theme changes. To test: - Run `ceftests --enable-chrome-runtime --use-alloy-style [--use-chrome-style-window] [--use-views|--use-native] --gtest_filter=...` - Run `cefclient --enable-chrome-runtime --use-alloy-style [--use-chrome-style-window] [--use-views|--use-native|--off-screen-rendering-enabled]` - Run `cefsimple --enable-chrome-runtime --use-alloy-style [--use-views]`
2024-04-17 18:01:26 +02:00
"libcef/browser/chrome/chrome_web_contents_view_delegate_cef.h",
"libcef/browser/chrome/extensions/chrome_extension_util.cc",
"libcef/browser/chrome/extensions/chrome_extension_util.h",
"libcef/browser/chrome/extensions/chrome_mime_handler_view_guest_delegate_cef.cc",
"libcef/browser/chrome/extensions/chrome_mime_handler_view_guest_delegate_cef.h",
"libcef/browser/chrome/views/browser_platform_delegate_chrome_child_window.cc",
"libcef/browser/chrome/views/browser_platform_delegate_chrome_child_window.h",
"libcef/browser/chrome/views/browser_platform_delegate_chrome_views.cc",
"libcef/browser/chrome/views/browser_platform_delegate_chrome_views.h",
"libcef/browser/chrome/views/chrome_browser_frame.cc",
"libcef/browser/chrome/views/chrome_browser_frame.h",
"libcef/browser/chrome/views/chrome_browser_view.cc",
"libcef/browser/chrome/views/chrome_browser_view.h",
"libcef/browser/chrome/views/chrome_child_window.cc",
"libcef/browser/chrome/views/chrome_child_window.h",
"libcef/browser/chrome/views/chrome_views_util.cc",
"libcef/browser/chrome/views/chrome_views_util.h",
"libcef/browser/chrome/views/toolbar_view_impl.cc",
"libcef/browser/chrome/views/toolbar_view_impl.h",
"libcef/browser/chrome/views/toolbar_view_view.cc",
"libcef/browser/chrome/views/toolbar_view_view.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/context.cc",
"libcef/browser/context.h",
"libcef/browser/context_menu_params_impl.cc",
"libcef/browser/context_menu_params_impl.h",
Add support for direct DevTools protocol messaging (fixes issue #2961). This change allows the client to directly send and receive DevTools protocol messages (send method calls, and receive method results and events) without requiring a DevTools front-end or remote-debugging session. This change includes additional supporting changes: - Add a new CefRequestHandler::OnDocumentAvailableInMainFrame callback (see issue #1454). - Add a CefParseJSON variant that accepts a UTF8-encoded buffer. - Add a `--devtools-protocol-log-file=<path>` command-line flag for logging protocol messages sent to/from the DevTools front-end while it is displayed. This is useful for understanding existing DevTools protocol usage. - Add a new "libcef_static_unittests" executable target to support light-weight unit tests of libcef_static internals (e.g. without requiring exposure via the CEF API). Files to be unittested are placed in the new "libcef_static_unittested" source_set which is then included by both the existing libcef_static library and the new unittests executable target. - Linux: Remove use_bundled_fontconfig=false, which is no longer required and causes unittest build errors (see issue #2424). This change also adds a cefclient demo for configuring offline mode using the DevTools protocol (fixes issue #245). This is controlled by the "Offline mode" context menu option and the `--offline` command-line switch which will launch cefclient in offline mode. When cefclient is offline all network requests will fail with ERR_INTERNET_DISCONNECTED and navigator.onLine will return false when called from JavaScript in any frame. This mode is per-browser so newly created browser windows will have the default mode. Note that configuring offline mode in this way will not update the Network tab UI ("Throtting" option) in a displayed DevTools front-end instance.
2020-06-13 02:54:08 +02:00
"libcef/browser/devtools/devtools_controller.cc",
"libcef/browser/devtools/devtools_controller.h",
chrome: Add support for Alloy style browsers and windows (see #3681) Split the Alloy runtime into bootstrap and style components. Support creation of Alloy style browsers and windows with the Chrome runtime. Chrome runtime (`--enable-chrome-runtime`) + Alloy style (`--use-alloy-style`) supports Views (`--use-views`), native parent (`--use-native`) and windowless rendering (`--off-screen-rendering-enabled`). Print preview is supported in all cases except with windowless rendering on all platforms and native parent on MacOS. It is disabled by default with Alloy style for legacy compatibility. Where supported it can be enabled or disabled globally using `--[enable|disable]-print-preview` or configured on a per-RequestContext basis using the `printing.print_preview_disabled` preference. It also behaves as expected when triggered via the PDF viewer print button. Chrome runtime + Alloy style behavior differs from Alloy runtime in the following significant ways: - Supports Chrome error pages by default. - DevTools popups are Chrome style only (cannot be windowless). - The Alloy extension API will not supported. Chrome runtime + Alloy style passes all expected Alloy ceftests except the following: - `DisplayTest.AutoResize` (Alloy extension API not supported) - `DownloadTest.*` (Download API not yet supported) - `ExtensionTest.*` (Alloy extension API not supported) This change also adds Chrome runtime support for CefContextMenuHandler::RunContextMenu (see #3293). This change also explicitly blocks (and doesn't retry) FrameAttached requests from PDF viewer and print preview excluded frames (see #3664). Known issues specific to Chrome runtime + Alloy style: - DevTools popup with windowless rendering doesn't load successfully. Use windowed rendering or remote debugging as a workaround. - Chrome style Window with Alloy style BrowserView (`--use-alloy-style --use-chrome-style-window`) does not show Chrome theme changes. To test: - Run `ceftests --enable-chrome-runtime --use-alloy-style [--use-chrome-style-window] [--use-views|--use-native] --gtest_filter=...` - Run `cefclient --enable-chrome-runtime --use-alloy-style [--use-chrome-style-window] [--use-views|--use-native|--off-screen-rendering-enabled]` - Run `cefsimple --enable-chrome-runtime --use-alloy-style [--use-views]`
2024-04-17 18:01:26 +02:00
"libcef/browser/devtools/devtools_protocol_manager.cc",
"libcef/browser/devtools/devtools_protocol_manager.h",
"libcef/browser/devtools/devtools_window_runner.cc",
chrome: Add support for Alloy style browsers and windows (see #3681) Split the Alloy runtime into bootstrap and style components. Support creation of Alloy style browsers and windows with the Chrome runtime. Chrome runtime (`--enable-chrome-runtime`) + Alloy style (`--use-alloy-style`) supports Views (`--use-views`), native parent (`--use-native`) and windowless rendering (`--off-screen-rendering-enabled`). Print preview is supported in all cases except with windowless rendering on all platforms and native parent on MacOS. It is disabled by default with Alloy style for legacy compatibility. Where supported it can be enabled or disabled globally using `--[enable|disable]-print-preview` or configured on a per-RequestContext basis using the `printing.print_preview_disabled` preference. It also behaves as expected when triggered via the PDF viewer print button. Chrome runtime + Alloy style behavior differs from Alloy runtime in the following significant ways: - Supports Chrome error pages by default. - DevTools popups are Chrome style only (cannot be windowless). - The Alloy extension API will not supported. Chrome runtime + Alloy style passes all expected Alloy ceftests except the following: - `DisplayTest.AutoResize` (Alloy extension API not supported) - `DownloadTest.*` (Download API not yet supported) - `ExtensionTest.*` (Alloy extension API not supported) This change also adds Chrome runtime support for CefContextMenuHandler::RunContextMenu (see #3293). This change also explicitly blocks (and doesn't retry) FrameAttached requests from PDF viewer and print preview excluded frames (see #3664). Known issues specific to Chrome runtime + Alloy style: - DevTools popup with windowless rendering doesn't load successfully. Use windowed rendering or remote debugging as a workaround. - Chrome style Window with Alloy style BrowserView (`--use-alloy-style --use-chrome-style-window`) does not show Chrome theme changes. To test: - Run `ceftests --enable-chrome-runtime --use-alloy-style [--use-chrome-style-window] [--use-views|--use-native] --gtest_filter=...` - Run `cefclient --enable-chrome-runtime --use-alloy-style [--use-chrome-style-window] [--use-views|--use-native|--off-screen-rendering-enabled]` - Run `cefsimple --enable-chrome-runtime --use-alloy-style [--use-views]`
2024-04-17 18:01:26 +02:00
"libcef/browser/devtools/devtools_window_runner.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/download_item_impl.cc",
"libcef/browser/download_item_impl.h",
"libcef/browser/download_manager_delegate.cc",
"libcef/browser/download_manager_delegate.h",
"libcef/browser/download_manager_delegate_impl.cc",
"libcef/browser/download_manager_delegate_impl.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/file_dialog_manager.cc",
"libcef/browser/file_dialog_manager.h",
Use Chrome file dialogs on all platforms and runtimes (fixes issue #3314) All file dialogs irrespective of source, platform and runtime will now be routed through CefFileDialogManager and trigger CefDialogHandler callbacks (see issue #3293). Adds Chrome runtime support for CefBrowserHost::RunFileDialog and CefDialogHandler callbacks. Adds Alloy runtime support for internal GTK file and print dialogs on Linux subject to the following limitations: 1. Internal GTK implementation: - Cannot be used with multi-threaded-message-loop because Chromium's internal GTK implementation is not thread-safe (does not use GDK threads). - Dialogs will not be modal to application windows when used with off-screen rendering due to lack of access to the client's top-level GtkWindow. 2. Cefclient CefDialogHandler implementation: - Cannot be used with Views because it requires a top-level GtkWindow. Due to the above limitations no dialog implementation is currently provided for Views + multi-threaded-message-loop on Linux. In cases where both implementations are supported the cefclient version is now behind an optional `--use-client-dialogs` command-line flag. Expressly forbids multiple simultaneous file dialogs with the internal platform implementation which uses modal dialogs. CefDialogHandler will still be notified and can optionally handle each request without a modal dialog (see issue #3154). Removes some RunFileDialog parameters that are not supported by the Chrome file dialog implementation (selected_accept_filter parameter, cef_file_dialog_mode_t overwrite/read-only flags).
2022-04-15 21:55:23 +02:00
"libcef/browser/file_dialog_runner.cc",
"libcef/browser/file_dialog_runner.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/frame_host_impl.cc",
"libcef/browser/frame_host_impl.h",
"libcef/browser/frame_service_base.h",
"libcef/browser/global_preference_manager_impl.cc",
"libcef/browser/global_preference_manager_impl.h",
"libcef/browser/hang_monitor.cc",
"libcef/browser/hang_monitor.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/image_impl.cc",
"libcef/browser/image_impl.h",
"libcef/browser/iothread_state.cc",
"libcef/browser/iothread_state.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/javascript_dialog_runner.h",
"libcef/browser/javascript_dialog_manager.cc",
"libcef/browser/javascript_dialog_manager.h",
"libcef/browser/main_runner.cc",
"libcef/browser/main_runner.h",
"libcef/browser/media_access_query.cc",
"libcef/browser/media_access_query.h",
"libcef/browser/media_router/media_route_impl.cc",
"libcef/browser/media_router/media_route_impl.h",
"libcef/browser/media_router/media_router_impl.cc",
"libcef/browser/media_router/media_router_impl.h",
"libcef/browser/media_router/media_router_manager.cc",
"libcef/browser/media_router/media_router_manager.h",
"libcef/browser/media_router/media_sink_impl.cc",
"libcef/browser/media_router/media_sink_impl.h",
"libcef/browser/media_router/media_source_impl.cc",
"libcef/browser/media_router/media_source_impl.h",
"libcef/browser/media_stream_registrar.cc",
"libcef/browser/media_stream_registrar.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/menu_manager.cc",
"libcef/browser/menu_manager.h",
"libcef/browser/menu_model_impl.cc",
"libcef/browser/menu_model_impl.h",
"libcef/browser/menu_runner.h",
"libcef/browser/native/browser_platform_delegate_native.cc",
"libcef/browser/native/browser_platform_delegate_native.h",
"libcef/browser/native/cursor_util.h",
"libcef/browser/native/cursor_util.cc",
"libcef/browser/native/window_delegate_view.cc",
"libcef/browser/native/window_delegate_view.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/navigation_entry_impl.cc",
"libcef/browser/navigation_entry_impl.h",
"libcef/browser/net/crlset_file_util_impl.cc",
Add chrome runtime support for more callbacks and ceftests (see issue #2969) This change adds support for: - Protocol and request handling. - Loading and navigation events. - Display and focus events. - Mouse/keyboard events. - Popup browsers. - Callbacks in the renderer process. - Misc. functionality required for ceftests. This change also adds a new CefBrowserProcessHandler::GetCookieableSchemes callback for configuring global state that will be applied to all CefCookieManagers by default. This global callback is currently required by the chrome runtime because the primary ProfileImpl is created via ChromeBrowserMainParts::PreMainMessageLoopRun (CreatePrimaryProfile) before OnContextCreated can be called. ProfileImpl will use the "C:\Users\[user]\AppData\Local\CEF\User Data\Default" directory by default (on Windows). Cookies may persist in this directory when running ceftests and may need to be manually deleted if those tests fail. Remaining work includes: - Support for client-created request contexts. - Embedding the browser in a Views hierarchy (cefclient support). - TryCloseBrowser and DoClose support. - Most of the CefSettings configuration. - DevTools protocol and window control (ShowDevTools, ExecuteDevToolsMethod). - CEF-specific WebUI pages (about, license, webui-hosts). - Context menu customization (CefContextMenuHandler). - Auto resize (SetAutoResizeEnabled). - Zoom settings (SetZoomLevel). - File dialog runner (RunFileDialog). - File and JS dialog handlers (CefDialogHandler, CefJSDialogHandler). - Extension loading (LoadExtension, etc). - Plugin loading (OnBeforePluginLoad). - Widevine loading (CefRegisterWidevineCdm). - PDF and print preview does not display. - Crash reporting is untested. - Mac: Web content loads but does not display. The following ceftests are now passing when run with the "--enable-chrome-runtime" command-line flag: CorsTest.* DisplayTest.*:-DisplayTest.AutoResize DOMTest.* DraggableRegionsTest.* ImageTest.* MessageRouterTest.* NavigationTest.* ParserTest.* RequestContextTest.*Global* RequestTest.* ResourceManagerTest.* ResourceRequestHandlerTest.* ResponseTest.* SchemeHandlerTest.* ServerTest.* StreamResourceHandlerTest.* StreamTest.* StringTest.* TaskTest.* TestServerTest.* ThreadTest.* URLRequestTest.*Global* V8Test.*:-V8Test.OnUncaughtExceptionDevTools ValuesTest.* WaitableEventTest.* XmlReaderTest.* ZipReaderTest.*
2020-09-25 03:40:47 +02:00
"libcef/browser/net/throttle_handler.cc",
"libcef/browser/net/throttle_handler.h",
"libcef/browser/net_service/browser_urlrequest_impl.cc",
"libcef/browser/net_service/browser_urlrequest_impl.h",
Implement NetworkService request interception/handling (see issue #2622). Implementation notes: - Chromium change: CookieMonster::SetCookieableSchemes needs to be called immediately after the CookieMonster is created in NetworkContext:: ApplyContextParamsToBuilder. Add a Profile::GetCookieableSchemes method and NetworkContextParams.cookieable_schemes member (set from ProfileNetworkContextService::CreateNetworkContextParams) to support that. - Chromium change: Add a ContentBrowserClient::HandleExternalProtocol variant that exposes additional NetworkService request information. - GetResourceResponseFilter is not yet implemented. API changes: - Resource-related callbacks have been moved from CefRequestHandler to a new CefResourceRequestHandler interface which is returned via the GetResourceRequestHandler method. If the CefRequestHandler declines to handle a resource it can optionally be handled by the CefRequestContextHandler, if any, associated with the loading context. - The OnProtocolExecution callback has been moved from CefRequestHandler to CefResourceRequestHandler and will be called if a custom scheme request is unhandled. - Cookie send/save permission callbacks have been moved from CefRequestHandler and CefResourceHandler to CefResourceRequestHandler. - New methods added to CefResourceHandler that better match NetworkService execution sequence expectations. The old methods are now deprecated. - New methods added to CefRequest and CefResponse. Known behavior changes with the NetworkService implementation: - Modifying the |new_url| parameter in OnResourceRedirect will no longer result in the method being called an additional time (likely a bug in the old implementation). - Modifying the request URL in OnResourceResponse would previously cause a redirect. This behavior is now deprecated because the NetworkService does not support this functionality when using default network loaders. Temporary support has been added in combination with CefResourceHandler usage only. - Other changes to the request object in OnResourceResponse will now cause the request to be restarted. This means that OnBeforeResourceLoad, etc, will be called an additional time with the new request information. - CefResponse::GetMimeType will now be empty for non-200 responses. - Requests using custom schemes can now be handled via CefResourceRequestHandler with the same callback behavior as builtin schemes. - Redirects of custom scheme requests will now be followed as expected. - Default handling of builtin schemes can now be disabled by setting |disable_default_handling| to true in GetResourceRequestHandler. - Unhandled requests (custom scheme or builtin scheme with default handling disabled) will fail with an CefResponse::GetError value of ERR_UNKNOWN_URL_SCHEME. - The CefSchemeHandlerFactory::Create callback will now include cookie headers. To test: - Run `cefclient --enable-network-service`. All resources should load successfully (this tests the transparent proxy capability). - All tests pass with NetworkService disabled. - The following tests pass with NetworkService enabled: - CookieTest.* - FrameTest.* (excluding .*Nav) - NavigationTest.* (excluding .Redirect*) - RequestHandlerTest.* - RequestContextTest.Basic* - RequestContextTest.Popup* - RequestTest.* - ResourceManagerTest.* - ResourceRequestHandlerTest.* (excluding .Filter*) - SchemeHandlerTest.* - StreamResourceHandlerTest.*
2019-04-24 04:50:25 +02:00
"libcef/browser/net_service/cookie_helper.cc",
"libcef/browser/net_service/cookie_helper.h",
"libcef/browser/net_service/cookie_manager_impl.cc",
"libcef/browser/net_service/cookie_manager_impl.h",
"libcef/browser/net_service/login_delegate.cc",
"libcef/browser/net_service/login_delegate.h",
Implement NetworkService request interception/handling (see issue #2622). Implementation notes: - Chromium change: CookieMonster::SetCookieableSchemes needs to be called immediately after the CookieMonster is created in NetworkContext:: ApplyContextParamsToBuilder. Add a Profile::GetCookieableSchemes method and NetworkContextParams.cookieable_schemes member (set from ProfileNetworkContextService::CreateNetworkContextParams) to support that. - Chromium change: Add a ContentBrowserClient::HandleExternalProtocol variant that exposes additional NetworkService request information. - GetResourceResponseFilter is not yet implemented. API changes: - Resource-related callbacks have been moved from CefRequestHandler to a new CefResourceRequestHandler interface which is returned via the GetResourceRequestHandler method. If the CefRequestHandler declines to handle a resource it can optionally be handled by the CefRequestContextHandler, if any, associated with the loading context. - The OnProtocolExecution callback has been moved from CefRequestHandler to CefResourceRequestHandler and will be called if a custom scheme request is unhandled. - Cookie send/save permission callbacks have been moved from CefRequestHandler and CefResourceHandler to CefResourceRequestHandler. - New methods added to CefResourceHandler that better match NetworkService execution sequence expectations. The old methods are now deprecated. - New methods added to CefRequest and CefResponse. Known behavior changes with the NetworkService implementation: - Modifying the |new_url| parameter in OnResourceRedirect will no longer result in the method being called an additional time (likely a bug in the old implementation). - Modifying the request URL in OnResourceResponse would previously cause a redirect. This behavior is now deprecated because the NetworkService does not support this functionality when using default network loaders. Temporary support has been added in combination with CefResourceHandler usage only. - Other changes to the request object in OnResourceResponse will now cause the request to be restarted. This means that OnBeforeResourceLoad, etc, will be called an additional time with the new request information. - CefResponse::GetMimeType will now be empty for non-200 responses. - Requests using custom schemes can now be handled via CefResourceRequestHandler with the same callback behavior as builtin schemes. - Redirects of custom scheme requests will now be followed as expected. - Default handling of builtin schemes can now be disabled by setting |disable_default_handling| to true in GetResourceRequestHandler. - Unhandled requests (custom scheme or builtin scheme with default handling disabled) will fail with an CefResponse::GetError value of ERR_UNKNOWN_URL_SCHEME. - The CefSchemeHandlerFactory::Create callback will now include cookie headers. To test: - Run `cefclient --enable-network-service`. All resources should load successfully (this tests the transparent proxy capability). - All tests pass with NetworkService disabled. - The following tests pass with NetworkService enabled: - CookieTest.* - FrameTest.* (excluding .*Nav) - NavigationTest.* (excluding .Redirect*) - RequestHandlerTest.* - RequestContextTest.Basic* - RequestContextTest.Popup* - RequestTest.* - ResourceManagerTest.* - ResourceRequestHandlerTest.* (excluding .Filter*) - SchemeHandlerTest.* - StreamResourceHandlerTest.*
2019-04-24 04:50:25 +02:00
"libcef/browser/net_service/proxy_url_loader_factory.cc",
"libcef/browser/net_service/proxy_url_loader_factory.h",
"libcef/browser/net_service/resource_handler_wrapper.cc",
"libcef/browser/net_service/resource_handler_wrapper.h",
"libcef/browser/net_service/resource_request_handler_wrapper.cc",
"libcef/browser/net_service/resource_request_handler_wrapper.h",
"libcef/browser/net_service/response_filter_wrapper.cc",
"libcef/browser/net_service/response_filter_wrapper.h",
Implement NetworkService request interception/handling (see issue #2622). Implementation notes: - Chromium change: CookieMonster::SetCookieableSchemes needs to be called immediately after the CookieMonster is created in NetworkContext:: ApplyContextParamsToBuilder. Add a Profile::GetCookieableSchemes method and NetworkContextParams.cookieable_schemes member (set from ProfileNetworkContextService::CreateNetworkContextParams) to support that. - Chromium change: Add a ContentBrowserClient::HandleExternalProtocol variant that exposes additional NetworkService request information. - GetResourceResponseFilter is not yet implemented. API changes: - Resource-related callbacks have been moved from CefRequestHandler to a new CefResourceRequestHandler interface which is returned via the GetResourceRequestHandler method. If the CefRequestHandler declines to handle a resource it can optionally be handled by the CefRequestContextHandler, if any, associated with the loading context. - The OnProtocolExecution callback has been moved from CefRequestHandler to CefResourceRequestHandler and will be called if a custom scheme request is unhandled. - Cookie send/save permission callbacks have been moved from CefRequestHandler and CefResourceHandler to CefResourceRequestHandler. - New methods added to CefResourceHandler that better match NetworkService execution sequence expectations. The old methods are now deprecated. - New methods added to CefRequest and CefResponse. Known behavior changes with the NetworkService implementation: - Modifying the |new_url| parameter in OnResourceRedirect will no longer result in the method being called an additional time (likely a bug in the old implementation). - Modifying the request URL in OnResourceResponse would previously cause a redirect. This behavior is now deprecated because the NetworkService does not support this functionality when using default network loaders. Temporary support has been added in combination with CefResourceHandler usage only. - Other changes to the request object in OnResourceResponse will now cause the request to be restarted. This means that OnBeforeResourceLoad, etc, will be called an additional time with the new request information. - CefResponse::GetMimeType will now be empty for non-200 responses. - Requests using custom schemes can now be handled via CefResourceRequestHandler with the same callback behavior as builtin schemes. - Redirects of custom scheme requests will now be followed as expected. - Default handling of builtin schemes can now be disabled by setting |disable_default_handling| to true in GetResourceRequestHandler. - Unhandled requests (custom scheme or builtin scheme with default handling disabled) will fail with an CefResponse::GetError value of ERR_UNKNOWN_URL_SCHEME. - The CefSchemeHandlerFactory::Create callback will now include cookie headers. To test: - Run `cefclient --enable-network-service`. All resources should load successfully (this tests the transparent proxy capability). - All tests pass with NetworkService disabled. - The following tests pass with NetworkService enabled: - CookieTest.* - FrameTest.* (excluding .*Nav) - NavigationTest.* (excluding .Redirect*) - RequestHandlerTest.* - RequestContextTest.Basic* - RequestContextTest.Popup* - RequestTest.* - ResourceManagerTest.* - ResourceRequestHandlerTest.* (excluding .Filter*) - SchemeHandlerTest.* - StreamResourceHandlerTest.*
2019-04-24 04:50:25 +02:00
"libcef/browser/net_service/stream_reader_url_loader.cc",
"libcef/browser/net_service/stream_reader_url_loader.h",
"libcef/browser/net_service/url_loader_factory_getter.cc",
"libcef/browser/net_service/url_loader_factory_getter.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/origin_whitelist_impl.cc",
"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/host_display_client_osr.cc",
"libcef/browser/osr/host_display_client_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",
2016-06-23 19:42:00 +02:00
"libcef/browser/osr/osr_util.cc",
"libcef/browser/osr/osr_util.h",
"libcef/browser/osr/render_widget_host_view_osr.cc",
"libcef/browser/osr/render_widget_host_view_osr.h",
"libcef/browser/osr/synthetic_gesture_target_osr.cc",
"libcef/browser/osr/synthetic_gesture_target_osr.h",
"libcef/browser/osr/touch_handle_drawable_osr.cc",
"libcef/browser/osr/touch_handle_drawable_osr.h",
"libcef/browser/osr/touch_selection_controller_client_osr.cc",
"libcef/browser/osr/touch_selection_controller_client_osr.h",
"libcef/browser/osr/video_consumer_osr.cc",
"libcef/browser/osr/video_consumer_osr.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/osr/web_contents_view_osr.cc",
"libcef/browser/osr/web_contents_view_osr.h",
"libcef/browser/path_util_impl.cc",
"libcef/browser/permission_prompt.cc",
"libcef/browser/permission_prompt.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/prefs/browser_prefs.cc",
"libcef/browser/prefs/browser_prefs.h",
"libcef/browser/prefs/pref_helper.cc",
"libcef/browser/prefs/pref_helper.h",
"libcef/browser/prefs/pref_registrar.cc",
"libcef/browser/prefs/pref_registrar.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/prefs/renderer_prefs.cc",
"libcef/browser/prefs/renderer_prefs.h",
"libcef/browser/print_settings_impl.cc",
"libcef/browser/print_settings_impl.h",
"libcef/browser/printing/print_util.cc",
"libcef/browser/printing/print_util.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/process_util_impl.cc",
"libcef/browser/request_context_handler_map.cc",
"libcef/browser/request_context_handler_map.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/request_context_impl.cc",
"libcef/browser/request_context_impl.h",
"libcef/browser/scheme_impl.cc",
"libcef/browser/server_impl.cc",
"libcef/browser/server_impl.h",
"libcef/browser/simple_menu_model_impl.cc",
"libcef/browser/simple_menu_model_impl.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/ssl_info_impl.cc",
"libcef/browser/ssl_info_impl.h",
"libcef/browser/ssl_status_impl.cc",
"libcef/browser/ssl_status_impl.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/stream_impl.cc",
"libcef/browser/stream_impl.h",
"libcef/browser/task_manager_impl.cc",
"libcef/browser/task_manager_impl.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/trace_impl.cc",
"libcef/browser/trace_subscriber.cc",
"libcef/browser/trace_subscriber.h",
"libcef/browser/thread_util.h",
"libcef/browser/ui_thread.cc",
"libcef/browser/ui_thread.h",
"libcef/browser/views/basic_label_button_impl.cc",
"libcef/browser/views/basic_label_button_impl.h",
"libcef/browser/views/basic_label_button_view.cc",
"libcef/browser/views/basic_label_button_view.h",
"libcef/browser/views/basic_panel_impl.cc",
"libcef/browser/views/basic_panel_impl.h",
"libcef/browser/views/basic_panel_view.cc",
"libcef/browser/views/basic_panel_view.h",
"libcef/browser/views/box_layout_impl.cc",
"libcef/browser/views/box_layout_impl.h",
"libcef/browser/views/browser_platform_delegate_views.cc",
"libcef/browser/views/browser_platform_delegate_views.h",
"libcef/browser/views/browser_view_impl.cc",
"libcef/browser/views/browser_view_impl.h",
"libcef/browser/views/browser_view_view.cc",
"libcef/browser/views/browser_view_view.h",
"libcef/browser/views/button_impl.h",
"libcef/browser/views/button_view.h",
views: Add support for OS and Chrome themes (fixes #3610, fixes #3671) Controls now respect OS and Chrome themes by default for both Alloy and Chrome runtimes. Chrome themes (mode and colors) can be configured using the new CefRequestContext::SetChromeColorScheme method. Individual theme colors can be overridden using the new CefWindowDelegate:: OnThemeColorsChanged and CefWindow::SetThemeColor methods. The `--force-light-mode` and `--force-dark-mode` command-line flags are now respected on all platforms as an override for the OS theme. The current Chrome theme, if any, will take precedence over the OS theme when determining light/dark status. On Windows and MacOS the titlebar color will also be updated to match the light/dark theme. Testable as follows: - Run: `cefclient --enable-chrome-runtime` OR `cefclient --use-views --persist-user-preferences --cache-path=...` - App launches with default OS light/dark theme colors. - Change OS dark/light theme under system settings. Notice that theme colors change as expected. - Right click, select items from the new Theme sub-menu. Notice that theme colors behave as expected. - Exit and relaunch the app. Notice that the last-used theme colors are applied on app restart. - Add `--background-color=green` to above command-line. - Perform the same actions as above. Notice that all controls start and remain green throughout (except some icons with Chrome runtime). - Add `--force-light-mode` or `--force-dark-mode` to above command-line. - Perform the same actions as above. Notice that OS dark/light theme changes are ignored, but Chrome theme changes work as expected.
2024-03-29 17:48:33 +01:00
"libcef/browser/views/color_provider_tracker.cc",
"libcef/browser/views/color_provider_tracker.h",
"libcef/browser/views/display_impl.cc",
"libcef/browser/views/display_impl.h",
"libcef/browser/views/fill_layout_impl.cc",
"libcef/browser/views/fill_layout_impl.h",
"libcef/browser/views/label_button_impl.h",
"libcef/browser/views/label_button_view.h",
"libcef/browser/views/layout_impl.h",
"libcef/browser/views/layout_adapter.cc",
"libcef/browser/views/layout_adapter.h",
"libcef/browser/views/layout_util.cc",
"libcef/browser/views/layout_util.h",
"libcef/browser/views/menu_button_impl.cc",
"libcef/browser/views/menu_button_impl.h",
"libcef/browser/views/menu_button_view.cc",
"libcef/browser/views/menu_button_view.h",
"libcef/browser/views/menu_runner_views.cc",
"libcef/browser/views/menu_runner_views.h",
"libcef/browser/views/overlay_view_host.cc",
"libcef/browser/views/overlay_view_host.h",
"libcef/browser/views/panel_impl.h",
"libcef/browser/views/panel_view.h",
"libcef/browser/views/scroll_view_impl.cc",
"libcef/browser/views/scroll_view_impl.h",
"libcef/browser/views/scroll_view_view.cc",
"libcef/browser/views/scroll_view_view.h",
"libcef/browser/views/textfield_impl.cc",
"libcef/browser/views/textfield_impl.h",
"libcef/browser/views/textfield_view.cc",
"libcef/browser/views/textfield_view.h",
"libcef/browser/views/view_adapter.cc",
"libcef/browser/views/view_adapter.h",
"libcef/browser/views/view_impl.h",
"libcef/browser/views/view_util.cc",
"libcef/browser/views/view_util.h",
"libcef/browser/views/view_view.h",
views: Add support for OS and Chrome themes (fixes #3610, fixes #3671) Controls now respect OS and Chrome themes by default for both Alloy and Chrome runtimes. Chrome themes (mode and colors) can be configured using the new CefRequestContext::SetChromeColorScheme method. Individual theme colors can be overridden using the new CefWindowDelegate:: OnThemeColorsChanged and CefWindow::SetThemeColor methods. The `--force-light-mode` and `--force-dark-mode` command-line flags are now respected on all platforms as an override for the OS theme. The current Chrome theme, if any, will take precedence over the OS theme when determining light/dark status. On Windows and MacOS the titlebar color will also be updated to match the light/dark theme. Testable as follows: - Run: `cefclient --enable-chrome-runtime` OR `cefclient --use-views --persist-user-preferences --cache-path=...` - App launches with default OS light/dark theme colors. - Change OS dark/light theme under system settings. Notice that theme colors change as expected. - Right click, select items from the new Theme sub-menu. Notice that theme colors behave as expected. - Exit and relaunch the app. Notice that the last-used theme colors are applied on app restart. - Add `--background-color=green` to above command-line. - Perform the same actions as above. Notice that all controls start and remain green throughout (except some icons with Chrome runtime). - Add `--force-light-mode` or `--force-dark-mode` to above command-line. - Perform the same actions as above. Notice that OS dark/light theme changes are ignored, but Chrome theme changes work as expected.
2024-03-29 17:48:33 +01:00
"libcef/browser/views/widget.cc",
"libcef/browser/views/widget.h",
views: Add support for modal browser dialogs A modal dialog is a child CefWindow that implements some special behaviors relative to a parent CefWindow. Like any CefWindow it can be framed with titlebar or frameless, and optionally contain draggable regions (subject to platform limitations described below). Modal dialogs are shown centered on the parent window (inside a single display) and always stay on top of the parent window in z-order. Sizing behavior and available window buttons are controlled via the usual CefWindowDelegate callbacks. For example, the dialog can have a preferred size with resize, minimize and maximize disabled (via GetPreferredSize, CanResize, CanMinimize and CanMaximize respectively). This change adds support for two modality modes. With window modality all controls in the parent window are disabled. With browser modality only the browser view in the parent window is disabled. Both modality modes require that a valid parent window be returned via GetParentWindow. For window modality return true from IsWindowModalDialog and call CefWindow::Show. For browser modality return false from IsWindowModalDialog (the default value) and call CefWindow::ShowAsBrowserModalDialog with a reference to the parent window's browser view. Window modal dialog behavior depends on the platform. On Windows and Linux these dialogs have a titlebar and can be moved independent of the parent window. On macOS these dialogs do not have a titlebar, move with the parent window, and do not support draggable regions (because they are implemented using sheets). On Linux disabling the parent window controls requires a window manager the supports _NET_WM_STATE_MODAL. Browser modal dialog behavior is similar on all platforms. The dialog will be automatically sized and positioned relative to the parent window's browser view. Closing the parent window or navigating the parent browser view will dismiss the dialog. The dialog can also be moved independent of the parent window though it will be recentered when the parent window itself is resized or redisplayed. On MacOS the dialog will move along with the parent window while on Windows and Linux the parent window can be moved independently. To test: Use the Tests > Dialog Window menu option in cefclient with Views enabled (`--use-views` or `--enable-chrome-runtime` command-line flag). Browser modal dialog is the default behavior. For window modal dialog add the `--use-window-modal-dialog` command-line flag.
2023-06-14 10:20:02 +02:00
"libcef/browser/views/widget_destruction_observer.h",
views: Add support for OS and Chrome themes (fixes #3610, fixes #3671) Controls now respect OS and Chrome themes by default for both Alloy and Chrome runtimes. Chrome themes (mode and colors) can be configured using the new CefRequestContext::SetChromeColorScheme method. Individual theme colors can be overridden using the new CefWindowDelegate:: OnThemeColorsChanged and CefWindow::SetThemeColor methods. The `--force-light-mode` and `--force-dark-mode` command-line flags are now respected on all platforms as an override for the OS theme. The current Chrome theme, if any, will take precedence over the OS theme when determining light/dark status. On Windows and MacOS the titlebar color will also be updated to match the light/dark theme. Testable as follows: - Run: `cefclient --enable-chrome-runtime` OR `cefclient --use-views --persist-user-preferences --cache-path=...` - App launches with default OS light/dark theme colors. - Change OS dark/light theme under system settings. Notice that theme colors change as expected. - Right click, select items from the new Theme sub-menu. Notice that theme colors behave as expected. - Exit and relaunch the app. Notice that the last-used theme colors are applied on app restart. - Add `--background-color=green` to above command-line. - Perform the same actions as above. Notice that all controls start and remain green throughout (except some icons with Chrome runtime). - Add `--force-light-mode` or `--force-dark-mode` to above command-line. - Perform the same actions as above. Notice that OS dark/light theme changes are ignored, but Chrome theme changes work as expected.
2024-03-29 17:48:33 +01:00
"libcef/browser/views/widget_impl.cc",
"libcef/browser/views/widget_impl.h",
"libcef/browser/views/window_impl.cc",
"libcef/browser/views/window_impl.h",
"libcef/browser/views/window_view.cc",
"libcef/browser/views/window_view.h",
"libcef/browser/x509_certificate_impl.cc",
"libcef/browser/x509_certificate_impl.h",
"libcef/browser/x509_cert_principal_impl.cc",
"libcef/browser/x509_cert_principal_impl.h",
2016-06-23 19:42:00 +02:00
"libcef/browser/xml_reader_impl.cc",
"libcef/browser/xml_reader_impl.h",
"libcef/browser/zip_reader_impl.cc",
"libcef/browser/zip_reader_impl.h",
"libcef/common/app_manager.cc",
"libcef/common/app_manager.h",
2016-06-23 19:42:00 +02:00
"libcef/common/base_impl.cc",
"libcef/common/cef_switches.cc",
"libcef/common/cef_switches.h",
"libcef/common/chrome/chrome_content_client_cef.cc",
"libcef/common/chrome/chrome_content_client_cef.h",
"libcef/common/chrome/chrome_main_delegate_cef.cc",
"libcef/common/chrome/chrome_main_delegate_cef.h",
2016-06-23 19:42:00 +02:00
"libcef/common/command_line_impl.cc",
"libcef/common/command_line_impl.h",
"libcef/common/crash_reporter_client.cc",
"libcef/common/crash_reporter_client.h",
"libcef/common/crash_reporting.cc",
"libcef/common/crash_reporting.h",
2016-06-23 19:42:00 +02:00
"libcef/common/drag_data_impl.cc",
"libcef/common/drag_data_impl.h",
"libcef/common/file_util_impl.cc",
Move message routing from CefBrowser to CefFrame (see issue #2498). This change moves the SendProcessMessage method from CefBrowser to CefFrame and adds CefBrowser parameters to OnProcessMessageReceived and OnDraggableRegionsChanged. The internal implementation has changed as follows: - Frame IDs are now a 64-bit combination of the 32-bit render_process_id and render_routing_id values that uniquely identify a RenderFrameHost (RFH). - CefFrameHostImpl objects are now managed by CefBrowserInfo with life span tied to RFH expectations. Specifically, a CefFrameHostImpl object representing a sub-frame will be created when a RenderFrame is created in the renderer process and detached when the associated RenderFrame is deleted or the renderer process in which it runs has died. - The CefFrameHostImpl object representing the main frame will always be valid but the underlying RFH (and associated frame ID) may change over time as a result of cross-origin navigations. Despite these changes calling LoadURL on the main frame object in the browser process will always navigate as expected. - Speculative RFHs, which may be created as a result of a cross-origin navigation and discarded if that navigation is not committed, are now handled correctly (e.g. ignored in most cases until they're committed). - It is less likely, but still possible, to receive a CefFrame object with an invalid frame ID (ID < 0). This can happen in cases where a RFH has not yet been created for a sub-frame. For example, when OnBeforeBrowse is called before initiating navigation in a previously nonexisting sub-frame. To test: All tests pass with NetworkService enabled and disabled.
2019-05-24 22:23:43 +02:00
"libcef/common/frame_util.cc",
"libcef/common/frame_util.h",
"libcef/common/i18n_util_impl.cc",
2016-06-23 19:42:00 +02:00
"libcef/common/json_impl.cc",
"libcef/common/net/http_header_utils.cc",
"libcef/common/net/http_header_utils.h",
"libcef/common/net/scheme_registration.cc",
"libcef/common/net/scheme_registration.h",
"libcef/common/net/url_util.cc",
"libcef/common/net/url_util.h",
Implement NetworkService request interception/handling (see issue #2622). Implementation notes: - Chromium change: CookieMonster::SetCookieableSchemes needs to be called immediately after the CookieMonster is created in NetworkContext:: ApplyContextParamsToBuilder. Add a Profile::GetCookieableSchemes method and NetworkContextParams.cookieable_schemes member (set from ProfileNetworkContextService::CreateNetworkContextParams) to support that. - Chromium change: Add a ContentBrowserClient::HandleExternalProtocol variant that exposes additional NetworkService request information. - GetResourceResponseFilter is not yet implemented. API changes: - Resource-related callbacks have been moved from CefRequestHandler to a new CefResourceRequestHandler interface which is returned via the GetResourceRequestHandler method. If the CefRequestHandler declines to handle a resource it can optionally be handled by the CefRequestContextHandler, if any, associated with the loading context. - The OnProtocolExecution callback has been moved from CefRequestHandler to CefResourceRequestHandler and will be called if a custom scheme request is unhandled. - Cookie send/save permission callbacks have been moved from CefRequestHandler and CefResourceHandler to CefResourceRequestHandler. - New methods added to CefResourceHandler that better match NetworkService execution sequence expectations. The old methods are now deprecated. - New methods added to CefRequest and CefResponse. Known behavior changes with the NetworkService implementation: - Modifying the |new_url| parameter in OnResourceRedirect will no longer result in the method being called an additional time (likely a bug in the old implementation). - Modifying the request URL in OnResourceResponse would previously cause a redirect. This behavior is now deprecated because the NetworkService does not support this functionality when using default network loaders. Temporary support has been added in combination with CefResourceHandler usage only. - Other changes to the request object in OnResourceResponse will now cause the request to be restarted. This means that OnBeforeResourceLoad, etc, will be called an additional time with the new request information. - CefResponse::GetMimeType will now be empty for non-200 responses. - Requests using custom schemes can now be handled via CefResourceRequestHandler with the same callback behavior as builtin schemes. - Redirects of custom scheme requests will now be followed as expected. - Default handling of builtin schemes can now be disabled by setting |disable_default_handling| to true in GetResourceRequestHandler. - Unhandled requests (custom scheme or builtin scheme with default handling disabled) will fail with an CefResponse::GetError value of ERR_UNKNOWN_URL_SCHEME. - The CefSchemeHandlerFactory::Create callback will now include cookie headers. To test: - Run `cefclient --enable-network-service`. All resources should load successfully (this tests the transparent proxy capability). - All tests pass with NetworkService disabled. - The following tests pass with NetworkService enabled: - CookieTest.* - FrameTest.* (excluding .*Nav) - NavigationTest.* (excluding .Redirect*) - RequestHandlerTest.* - RequestContextTest.Basic* - RequestContextTest.Popup* - RequestTest.* - ResourceManagerTest.* - ResourceRequestHandlerTest.* (excluding .Filter*) - SchemeHandlerTest.* - StreamResourceHandlerTest.*
2019-04-24 04:50:25 +02:00
"libcef/common/net_service/net_service_util.cc",
"libcef/common/net_service/net_service_util.h",
2016-06-23 19:42:00 +02:00
"libcef/common/parser_impl.cc",
"libcef/common/process_message_impl.cc",
"libcef/common/process_message_impl.h",
"libcef/common/process_message_smr_impl.cc",
"libcef/common/process_message_smr_impl.h",
2016-06-23 19:42:00 +02:00
"libcef/common/request_impl.cc",
"libcef/common/request_impl.h",
"libcef/common/resource_bundle_delegate.cc",
"libcef/common/resource_bundle_delegate.h",
2016-06-23 19:42:00 +02:00
"libcef/common/resource_bundle_impl.cc",
"libcef/common/resource_bundle_impl.h",
"libcef/common/resource_util.cc",
"libcef/common/resource_util.h",
2016-06-23 19:42:00 +02:00
"libcef/common/response_impl.cc",
"libcef/common/response_impl.h",
"libcef/common/scheme_registrar_impl.cc",
"libcef/common/scheme_registrar_impl.h",
"libcef/common/string_list_impl.cc",
"libcef/common/string_map_impl.cc",
"libcef/common/string_multimap_impl.cc",
"libcef/common/string_types_impl.cc",
"libcef/common/string_util.cc",
"libcef/common/string_util.h",
2016-06-23 19:42:00 +02:00
"libcef/common/task_impl.cc",
"libcef/common/task_runner_impl.cc",
"libcef/common/task_runner_impl.h",
"libcef/common/task_runner_manager.cc",
"libcef/common/task_runner_manager.h",
2016-11-12 00:22:53 +01:00
"libcef/common/thread_impl.cc",
"libcef/common/thread_impl.h",
2016-06-23 19:42:00 +02:00
"libcef/common/time_impl.cc",
"libcef/common/time_util.h",
"libcef/common/tracker.cc",
"libcef/common/tracker.h",
"libcef/common/urlrequest_impl.cc",
"libcef/common/value_base.cc",
"libcef/common/value_base.h",
"libcef/common/values_impl.cc",
"libcef/common/values_impl.h",
"libcef/common/waitable_event_impl.cc",
"libcef/common/waitable_event_impl.h",
2016-06-23 19:42:00 +02:00
"libcef/renderer/browser_impl.cc",
"libcef/renderer/browser_impl.h",
Add chrome runtime support for more callbacks and ceftests (see issue #2969) This change adds support for: - Protocol and request handling. - Loading and navigation events. - Display and focus events. - Mouse/keyboard events. - Popup browsers. - Callbacks in the renderer process. - Misc. functionality required for ceftests. This change also adds a new CefBrowserProcessHandler::GetCookieableSchemes callback for configuring global state that will be applied to all CefCookieManagers by default. This global callback is currently required by the chrome runtime because the primary ProfileImpl is created via ChromeBrowserMainParts::PreMainMessageLoopRun (CreatePrimaryProfile) before OnContextCreated can be called. ProfileImpl will use the "C:\Users\[user]\AppData\Local\CEF\User Data\Default" directory by default (on Windows). Cookies may persist in this directory when running ceftests and may need to be manually deleted if those tests fail. Remaining work includes: - Support for client-created request contexts. - Embedding the browser in a Views hierarchy (cefclient support). - TryCloseBrowser and DoClose support. - Most of the CefSettings configuration. - DevTools protocol and window control (ShowDevTools, ExecuteDevToolsMethod). - CEF-specific WebUI pages (about, license, webui-hosts). - Context menu customization (CefContextMenuHandler). - Auto resize (SetAutoResizeEnabled). - Zoom settings (SetZoomLevel). - File dialog runner (RunFileDialog). - File and JS dialog handlers (CefDialogHandler, CefJSDialogHandler). - Extension loading (LoadExtension, etc). - Plugin loading (OnBeforePluginLoad). - Widevine loading (CefRegisterWidevineCdm). - PDF and print preview does not display. - Crash reporting is untested. - Mac: Web content loads but does not display. The following ceftests are now passing when run with the "--enable-chrome-runtime" command-line flag: CorsTest.* DisplayTest.*:-DisplayTest.AutoResize DOMTest.* DraggableRegionsTest.* ImageTest.* MessageRouterTest.* NavigationTest.* ParserTest.* RequestContextTest.*Global* RequestTest.* ResourceManagerTest.* ResourceRequestHandlerTest.* ResponseTest.* SchemeHandlerTest.* ServerTest.* StreamResourceHandlerTest.* StreamTest.* StringTest.* TaskTest.* TestServerTest.* ThreadTest.* URLRequestTest.*Global* V8Test.*:-V8Test.OnUncaughtExceptionDevTools ValuesTest.* WaitableEventTest.* XmlReaderTest.* ZipReaderTest.*
2020-09-25 03:40:47 +02:00
"libcef/renderer/chrome/chrome_content_renderer_client_cef.cc",
"libcef/renderer/chrome/chrome_content_renderer_client_cef.h",
2016-06-23 19:42:00 +02:00
"libcef/renderer/dom_document_impl.cc",
"libcef/renderer/dom_document_impl.h",
"libcef/renderer/dom_node_impl.cc",
"libcef/renderer/dom_node_impl.h",
"libcef/renderer/frame_impl.cc",
"libcef/renderer/frame_impl.h",
"libcef/renderer/render_frame_observer.cc",
"libcef/renderer/render_frame_observer.h",
"libcef/renderer/render_frame_util.cc",
"libcef/renderer/render_frame_util.h",
"libcef/renderer/render_manager.cc",
"libcef/renderer/render_manager.h",
2016-06-23 19:42:00 +02:00
"libcef/renderer/thread_util.h",
"libcef/renderer/v8_impl.cc",
"libcef/renderer/v8_impl.h",
# For Chrome runtime support.
"//chrome/app/chrome_main_delegate.cc",
"//chrome/app/chrome_main_delegate.h",
2016-06-23 19:42:00 +02:00
]
configs += [
"libcef/features:config",
2016-06-23 19:42:00 +02:00
"//build/config:precompiled_headers",
]
public_configs = [
"libcef/features:config",
2016-06-23 19:42:00 +02:00
]
include_dirs = [
# Crashpad code uses paths relative to this directory.
"//third_party/crashpad/crashpad",
2016-06-23 19:42:00 +02:00
]
public_deps = [
# Bring in feature flag defines.
"//cef/libcef/features",
# Support relative include paths.
"//base",
"//third_party/abseil-cpp:absl",
]
2016-06-23 19:42:00 +02:00
deps = [
":cef_make_headers",
"libcef/common/mojom",
2016-06-23 19:42:00 +02:00
Add support for direct DevTools protocol messaging (fixes issue #2961). This change allows the client to directly send and receive DevTools protocol messages (send method calls, and receive method results and events) without requiring a DevTools front-end or remote-debugging session. This change includes additional supporting changes: - Add a new CefRequestHandler::OnDocumentAvailableInMainFrame callback (see issue #1454). - Add a CefParseJSON variant that accepts a UTF8-encoded buffer. - Add a `--devtools-protocol-log-file=<path>` command-line flag for logging protocol messages sent to/from the DevTools front-end while it is displayed. This is useful for understanding existing DevTools protocol usage. - Add a new "libcef_static_unittests" executable target to support light-weight unit tests of libcef_static internals (e.g. without requiring exposure via the CEF API). Files to be unittested are placed in the new "libcef_static_unittested" source_set which is then included by both the existing libcef_static library and the new unittests executable target. - Linux: Remove use_bundled_fontconfig=false, which is no longer required and causes unittest build errors (see issue #2424). This change also adds a cefclient demo for configuring offline mode using the DevTools protocol (fixes issue #245). This is controlled by the "Offline mode" context menu option and the `--offline` command-line switch which will launch cefclient in offline mode. When cefclient is offline all network requests will fail with ERR_INTERNET_DISCONNECTED and navigator.onLine will return false when called from JavaScript in any frame. This mode is per-browser so newly created browser windows will have the default mode. Note that configuring offline mode in this way will not update the Network tab UI ("Throtting" option) in a displayed DevTools front-end instance.
2020-06-13 02:54:08 +02:00
":libcef_static_unittested",
2016-06-23 19:42:00 +02:00
# Normal build dependencies. Should be sorted alphabetically.
"//base:base_static",
"//cc",
"//chrome:dependencies",
"//chrome:packed_resources",
"//chrome:resources",
"//chrome:strings",
"//chrome/common:buildflags",
"//chrome/services/printing:lib",
2016-06-23 19:42:00 +02:00
"//components/cdm/renderer",
"//components/certificate_transparency",
"//components/component_updater",
2016-06-23 19:42:00 +02:00
"//components/content_settings/core/browser",
"//components/content_settings/core/common",
"//components/crx_file",
"//components/google/core/common",
2016-06-23 19:42:00 +02:00
"//components/keyed_service/content:content",
"//components/keyed_service/core:core",
"//components/media_router/common/mojom:media_router",
2016-06-23 19:42:00 +02:00
"//components/navigation_interception",
"//components/network_session_configurator/common",
2016-06-23 19:42:00 +02:00
"//components/pdf/browser",
"//components/pdf/renderer",
"//components/plugins/renderer",
"//components/pref_registry",
"//components/printing/browser",
"//components/printing/common",
"//components/printing/renderer",
"//components/proxy_config",
"//components/services/print_compositor/public/cpp",
"//components/services/print_compositor/public/mojom",
2016-06-23 19:42:00 +02:00
"//components/update_client",
"//components/url_formatter",
"//components/user_prefs",
"//components/version_info",
"//components/visitedlink/browser",
"//components/visitedlink/common",
"//components/visitedlink/renderer",
"//components/viz/service",
2016-06-23 19:42:00 +02:00
"//components/web_cache/renderer",
"//content/public/app",
2016-06-23 19:42:00 +02:00
"//content/public/browser",
"//content/public/child",
2016-06-23 19:42:00 +02:00
"//content/public/common",
"//content/public/gpu",
"//content/public/renderer",
"//content/public/utility",
"//crypto",
"//device/base",
2016-06-23 19:42:00 +02:00
"//extensions/browser",
"//extensions/buildflags",
2016-06-23 19:42:00 +02:00
"//extensions/common/api",
"//extensions/common:core_api_provider",
2016-06-23 19:42:00 +02:00
"//extensions/renderer",
"//gpu",
"//ipc",
"//media",
"//net",
"//pdf",
"//ppapi/buildflags",
"//printing/buildflags",
"//services/network:network_service",
"//services/network/public/cpp",
"//services/service_manager/public/cpp",
2016-06-23 19:42:00 +02:00
"//skia",
"//storage/browser",
"//third_party/blink/public:blink",
"//third_party/brotli:dec",
"//third_party/cld_3/src/src:cld_3",
"//third_party/crashpad/crashpad/handler",
2016-06-23 19:42:00 +02:00
"//third_party/hunspell",
"//third_party/leveldatabase",
"//third_party/libxml:libxml",
"//third_party/widevine/cdm:headers",
"//third_party/widevine/cdm",
2016-06-23 19:42:00 +02:00
"//third_party/icu",
"//third_party/zlib:minizip",
"//ui/base",
"//ui/base/ime",
"//ui/events",
2016-06-23 19:42:00 +02:00
"//ui/events:events_base",
"//ui/gfx",
"//ui/gfx/geometry",
"//ui/gfx/ipc",
"//ui/gfx/ipc/geometry",
"//ui/gfx/ipc/skia",
"//ui/gl",
"//ui/strings",
"//ui/views",
"//ui/views/controls/webview",
2016-06-23 19:42:00 +02:00
"//url",
"//v8",
]
if (is_win) {
sources += includes_win + [
2016-06-23 19:42:00 +02:00
"libcef/browser/native/browser_platform_delegate_native_win.cc",
"libcef/browser/native/browser_platform_delegate_native_win.h",
"libcef/browser/osr/browser_platform_delegate_osr_win.cc",
"libcef/browser/osr/browser_platform_delegate_osr_win.h",
]
deps += [
"//chrome/install_static:secondary_module",
"//chrome/chrome_elf",
]
if (is_component_build) {
deps += [ "//content:sandbox_helper_win" ]
}
data_deps = [
"//chrome/elevation_service",
]
2016-06-23 19:42:00 +02:00
}
if (is_linux) {
sources += includes_linux + [
2016-06-23 19:42:00 +02:00
"libcef/browser/native/browser_platform_delegate_native_linux.cc",
"libcef/browser/native/browser_platform_delegate_native_linux.h",
"libcef/browser/osr/browser_platform_delegate_osr_linux.cc",
"libcef/browser/osr/browser_platform_delegate_osr_linux.h",
"libcef/browser/printing/print_dialog_linux.cc",
"libcef/browser/printing/print_dialog_linux.h",
"libcef/common/util_linux.h",
"libcef/common/util_linux.cc",
2016-06-23 19:42:00 +02:00
]
views: Add support for OS and Chrome themes (fixes #3610, fixes #3671) Controls now respect OS and Chrome themes by default for both Alloy and Chrome runtimes. Chrome themes (mode and colors) can be configured using the new CefRequestContext::SetChromeColorScheme method. Individual theme colors can be overridden using the new CefWindowDelegate:: OnThemeColorsChanged and CefWindow::SetThemeColor methods. The `--force-light-mode` and `--force-dark-mode` command-line flags are now respected on all platforms as an override for the OS theme. The current Chrome theme, if any, will take precedence over the OS theme when determining light/dark status. On Windows and MacOS the titlebar color will also be updated to match the light/dark theme. Testable as follows: - Run: `cefclient --enable-chrome-runtime` OR `cefclient --use-views --persist-user-preferences --cache-path=...` - App launches with default OS light/dark theme colors. - Change OS dark/light theme under system settings. Notice that theme colors change as expected. - Right click, select items from the new Theme sub-menu. Notice that theme colors behave as expected. - Exit and relaunch the app. Notice that the last-used theme colors are applied on app restart. - Add `--background-color=green` to above command-line. - Perform the same actions as above. Notice that all controls start and remain green throughout (except some icons with Chrome runtime). - Add `--force-light-mode` or `--force-dark-mode` to above command-line. - Perform the same actions as above. Notice that OS dark/light theme changes are ignored, but Chrome theme changes work as expected.
2024-03-29 17:48:33 +01:00
deps += [
"//build/config/freetype",
"//third_party/fontconfig",
]
if (ozone_platform_x11) {
sources += [
"libcef/browser/native/window_x11.cc",
"libcef/browser/native/window_x11.h",
]
views: Add support for OS and Chrome themes (fixes #3610, fixes #3671) Controls now respect OS and Chrome themes by default for both Alloy and Chrome runtimes. Chrome themes (mode and colors) can be configured using the new CefRequestContext::SetChromeColorScheme method. Individual theme colors can be overridden using the new CefWindowDelegate:: OnThemeColorsChanged and CefWindow::SetThemeColor methods. The `--force-light-mode` and `--force-dark-mode` command-line flags are now respected on all platforms as an override for the OS theme. The current Chrome theme, if any, will take precedence over the OS theme when determining light/dark status. On Windows and MacOS the titlebar color will also be updated to match the light/dark theme. Testable as follows: - Run: `cefclient --enable-chrome-runtime` OR `cefclient --use-views --persist-user-preferences --cache-path=...` - App launches with default OS light/dark theme colors. - Change OS dark/light theme under system settings. Notice that theme colors change as expected. - Right click, select items from the new Theme sub-menu. Notice that theme colors behave as expected. - Exit and relaunch the app. Notice that the last-used theme colors are applied on app restart. - Add `--background-color=green` to above command-line. - Perform the same actions as above. Notice that all controls start and remain green throughout (except some icons with Chrome runtime). - Add `--force-light-mode` or `--force-dark-mode` to above command-line. - Perform the same actions as above. Notice that OS dark/light theme changes are ignored, but Chrome theme changes work as expected.
2024-03-29 17:48:33 +01:00
} else {
deps += [ "//third_party/angle:libEGL" ]
}
views: Add support for OS and Chrome themes (fixes #3610, fixes #3671) Controls now respect OS and Chrome themes by default for both Alloy and Chrome runtimes. Chrome themes (mode and colors) can be configured using the new CefRequestContext::SetChromeColorScheme method. Individual theme colors can be overridden using the new CefWindowDelegate:: OnThemeColorsChanged and CefWindow::SetThemeColor methods. The `--force-light-mode` and `--force-dark-mode` command-line flags are now respected on all platforms as an override for the OS theme. The current Chrome theme, if any, will take precedence over the OS theme when determining light/dark status. On Windows and MacOS the titlebar color will also be updated to match the light/dark theme. Testable as follows: - Run: `cefclient --enable-chrome-runtime` OR `cefclient --use-views --persist-user-preferences --cache-path=...` - App launches with default OS light/dark theme colors. - Change OS dark/light theme under system settings. Notice that theme colors change as expected. - Right click, select items from the new Theme sub-menu. Notice that theme colors behave as expected. - Exit and relaunch the app. Notice that the last-used theme colors are applied on app restart. - Add `--background-color=green` to above command-line. - Perform the same actions as above. Notice that all controls start and remain green throughout (except some icons with Chrome runtime). - Add `--force-light-mode` or `--force-dark-mode` to above command-line. - Perform the same actions as above. Notice that OS dark/light theme changes are ignored, but Chrome theme changes work as expected.
2024-03-29 17:48:33 +01:00
if (use_dbus) {
deps += [ "//dbus" ]
defines = [ "USE_DBUS" ]
}
2016-06-23 19:42:00 +02:00
}
if (is_mac) {
sources += includes_mac + [
chrome: Add support for Alloy style browsers and windows (see #3681) Split the Alloy runtime into bootstrap and style components. Support creation of Alloy style browsers and windows with the Chrome runtime. Chrome runtime (`--enable-chrome-runtime`) + Alloy style (`--use-alloy-style`) supports Views (`--use-views`), native parent (`--use-native`) and windowless rendering (`--off-screen-rendering-enabled`). Print preview is supported in all cases except with windowless rendering on all platforms and native parent on MacOS. It is disabled by default with Alloy style for legacy compatibility. Where supported it can be enabled or disabled globally using `--[enable|disable]-print-preview` or configured on a per-RequestContext basis using the `printing.print_preview_disabled` preference. It also behaves as expected when triggered via the PDF viewer print button. Chrome runtime + Alloy style behavior differs from Alloy runtime in the following significant ways: - Supports Chrome error pages by default. - DevTools popups are Chrome style only (cannot be windowless). - The Alloy extension API will not supported. Chrome runtime + Alloy style passes all expected Alloy ceftests except the following: - `DisplayTest.AutoResize` (Alloy extension API not supported) - `DownloadTest.*` (Download API not yet supported) - `ExtensionTest.*` (Alloy extension API not supported) This change also adds Chrome runtime support for CefContextMenuHandler::RunContextMenu (see #3293). This change also explicitly blocks (and doesn't retry) FrameAttached requests from PDF viewer and print preview excluded frames (see #3664). Known issues specific to Chrome runtime + Alloy style: - DevTools popup with windowless rendering doesn't load successfully. Use windowed rendering or remote debugging as a workaround. - Chrome style Window with Alloy style BrowserView (`--use-alloy-style --use-chrome-style-window`) does not show Chrome theme changes. To test: - Run `ceftests --enable-chrome-runtime --use-alloy-style [--use-chrome-style-window] [--use-views|--use-native] --gtest_filter=...` - Run `cefclient --enable-chrome-runtime --use-alloy-style [--use-chrome-style-window] [--use-views|--use-native|--off-screen-rendering-enabled]` - Run `cefsimple --enable-chrome-runtime --use-alloy-style [--use-views]`
2024-04-17 18:01:26 +02:00
"libcef/browser/chrome/chrome_content_browser_client_cef_mac.mm",
"libcef/browser/chrome/chrome_web_contents_view_delegate_cef_mac.mm",
2016-06-23 19:42:00 +02:00
"libcef/browser/native/browser_platform_delegate_native_mac.h",
"libcef/browser/native/browser_platform_delegate_native_mac.mm",
"libcef/browser/native/cursor_util_mac.mm",
2016-06-23 19:42:00 +02:00
"libcef/browser/native/javascript_dialog_runner_mac.h",
"libcef/browser/native/javascript_dialog_runner_mac.mm",
"libcef/browser/native/menu_runner_mac.h",
"libcef/browser/native/menu_runner_mac.mm",
"libcef/browser/osr/browser_platform_delegate_osr_mac.h",
"libcef/browser/osr/browser_platform_delegate_osr_mac.mm",
"libcef/browser/views/native_widget_mac.h",
"libcef/browser/views/native_widget_mac.mm",
"libcef/browser/views/ns_window.h",
"libcef/browser/views/ns_window.mm",
"libcef/browser/views/view_util_mac.mm",
2016-06-23 19:42:00 +02:00
"libcef/common/util_mac.h",
"libcef/common/util_mac.mm",
# For Chrome runtime support.
"//chrome/app/chrome_main_mac.h",
"//chrome/app/chrome_main_mac.mm",
2016-06-23 19:42:00 +02:00
]
chrome: Add support for Alloy style browsers and windows (see #3681) Split the Alloy runtime into bootstrap and style components. Support creation of Alloy style browsers and windows with the Chrome runtime. Chrome runtime (`--enable-chrome-runtime`) + Alloy style (`--use-alloy-style`) supports Views (`--use-views`), native parent (`--use-native`) and windowless rendering (`--off-screen-rendering-enabled`). Print preview is supported in all cases except with windowless rendering on all platforms and native parent on MacOS. It is disabled by default with Alloy style for legacy compatibility. Where supported it can be enabled or disabled globally using `--[enable|disable]-print-preview` or configured on a per-RequestContext basis using the `printing.print_preview_disabled` preference. It also behaves as expected when triggered via the PDF viewer print button. Chrome runtime + Alloy style behavior differs from Alloy runtime in the following significant ways: - Supports Chrome error pages by default. - DevTools popups are Chrome style only (cannot be windowless). - The Alloy extension API will not supported. Chrome runtime + Alloy style passes all expected Alloy ceftests except the following: - `DisplayTest.AutoResize` (Alloy extension API not supported) - `DownloadTest.*` (Download API not yet supported) - `ExtensionTest.*` (Alloy extension API not supported) This change also adds Chrome runtime support for CefContextMenuHandler::RunContextMenu (see #3293). This change also explicitly blocks (and doesn't retry) FrameAttached requests from PDF viewer and print preview excluded frames (see #3664). Known issues specific to Chrome runtime + Alloy style: - DevTools popup with windowless rendering doesn't load successfully. Use windowed rendering or remote debugging as a workaround. - Chrome style Window with Alloy style BrowserView (`--use-alloy-style --use-chrome-style-window`) does not show Chrome theme changes. To test: - Run `ceftests --enable-chrome-runtime --use-alloy-style [--use-chrome-style-window] [--use-views|--use-native] --gtest_filter=...` - Run `cefclient --enable-chrome-runtime --use-alloy-style [--use-chrome-style-window] [--use-views|--use-native|--off-screen-rendering-enabled]` - Run `cefsimple --enable-chrome-runtime --use-alloy-style [--use-views]`
2024-04-17 18:01:26 +02:00
} else {
sources += [
"libcef/browser/chrome/chrome_web_contents_view_delegate_cef.cc",
]
2016-06-23 19:42:00 +02:00
}
if (ozone_platform_x11) {
2016-06-23 19:42:00 +02:00
deps += [ "//ui/events/devices/x11" ]
}
if (v8_use_external_startup_data && use_v8_context_snapshot) {
deps += [ "//tools/v8_context_snapshot" ]
}
if (use_aura) {
2016-06-23 19:42:00 +02:00
sources += [
"libcef/browser/native/browser_platform_delegate_native_aura.cc",
"libcef/browser/native/browser_platform_delegate_native_aura.h",
"libcef/browser/native/cursor_util_aura.cc",
"libcef/browser/native/menu_runner_views_aura.cc",
"libcef/browser/native/menu_runner_views_aura.h",
"libcef/browser/views/view_util_aura.cc",
2016-06-23 19:42:00 +02:00
]
deps += [
"//ui/aura",
"//ui/wm",
"//ui/wm/public",
2016-06-23 19:42:00 +02:00
]
}
if (enable_cdm_host_verification) {
sources += [
"libcef/common/cdm_host_file_path.cc",
"libcef/common/cdm_host_file_path.h",
]
}
2016-06-23 19:42:00 +02:00
}
#
# libcef_dll_wrapper static targets.
#
# Configuration that will be applied to all targets that build autogen files.
config("libcef_autogen_config") {
if (is_clang) {
cflags = [
# Disable clang warnings related to CEF's translation layer templates.
"-Wno-undefined-var-template",
]
}
}
# Configuration that supports #include paths relative to src/cef/ for CEF
# client-side code. CEF library-side code (Chromium code and cef/libcef/
# directory) uses #include paths relative to src/. See libcef/features:config
# for CEF library-side configuration.
config("libcef_includes_config") {
2016-06-23 19:42:00 +02:00
include_dirs = [
# cef/include/ directory and CEF client-side code use #includes relative to
# the cef/ directory.
2016-06-23 19:42:00 +02:00
".",
# CEF generated header files that also need to be discoverable.
# These #includes from client-side code will not be prefixed with cef/.
# They will be copied to the include/ directory in the binary distribution.
"$root_out_dir/includes/cef",
2016-06-23 19:42:00 +02:00
]
}
# Configuration that will be applied to all targets that depend on
# libcef_dll_wrapper.
config("libcef_dll_wrapper_config") {
configs = [
":libcef_autogen_config",
":libcef_includes_config",
]
if (is_win) {
if (current_cpu == "x86") {
# Set the initial stack size to 0.5MiB, instead of the 1.5MiB minimum
# needed by CEF's main thread. This saves significant memory on threads
# (like those in the Windows thread pool, and others) whose stack size we
# can only control through this setting. The main thread (in 32-bit builds
# only) uses fibers to switch to a 4MiB stack at runtime via
# CefRunWinMainWithPreferredStackSize().
ldflags = [ "/STACK:0x80000" ]
} else {
# Increase the initial stack size to 8MiB from the default 1MiB.
ldflags = [ "/STACK:0x800000" ]
}
}
# Build using the minimum C++ version supported by the CEF binary distribution.
# Chromium (and libcef) may build with a newer C++ version so this helps to
# avoid accidental usage of new/unsupported language features in sample apps.
# For Chromium defaults see //build/config/compiler/BUILD.gn.
if (is_win) {
cflags_cc = [ "/std:c++17" ]
} else {
cflags_cc = [ "-std=c++17" ]
}
if (is_mac) {
cflags_objcc = [ "-std=c++17" ]
}
2016-06-23 19:42:00 +02:00
}
# libcef_dll_wrapper target.
static_library("libcef_dll_wrapper") {
sources = includes_common +
gypi_paths.autogen_cpp_includes +
gypi_paths2.includes_capi +
gypi_paths.autogen_capi_includes +
gypi_paths2.includes_wrapper +
gypi_paths2.libcef_dll_wrapper_sources_base +
gypi_paths2.libcef_dll_wrapper_sources_common +
gypi_paths.autogen_client_side
if (is_mac) {
sources += gypi_paths2.libcef_dll_wrapper_sources_mac
}
defines = [ "WRAPPING_CEF_SHARED" ]
configs += [ ":libcef_dll_wrapper_config" ]
2016-06-23 19:42:00 +02:00
public_configs = [ ":libcef_dll_wrapper_config" ]
deps = [ ":cef_make_headers" ]
2016-06-23 19:42:00 +02:00
}
#
# cef_sandbox target.
#
if (is_win) {
static_library("cef_sandbox") {
sources = [ "libcef_dll/sandbox/sandbox_win.cc" ]
configs += [ ":libcef_includes_config" ]
deps = [
":make_config_header",
"libcef/features",
"//sandbox",
]
2016-06-23 19:42:00 +02:00
}
}
if (is_mac) {
static_library("cef_sandbox") {
sources = [ "libcef_dll/sandbox/sandbox_mac.mm" ]
configs += [ ":libcef_includes_config" ]
deps = [
":make_config_header",
"//build/config:executable_deps",
"//sandbox/mac:seatbelt",
]
}
}
2016-06-23 19:42:00 +02:00
#
# Resource grit/pack targets.
#
# Included in locales/*.pak via //chrome/chrome_repack_locales.gni.
2016-06-23 19:42:00 +02:00
grit("cef_strings") {
source = "libcef/resources/cef_strings.grd"
outputs = [
"grit/cef_strings.h",
]
all_locales = platform_pak_locales + [ "fake-bidi" ]
2016-06-23 19:42:00 +02:00
foreach(locale, all_locales) {
outputs += [ "cef_strings_${locale}.pak" ]
}
}
# Included in resources.pak via //chrome/chrome_paks.gni.
2016-06-23 19:42:00 +02:00
grit("cef_resources") {
source = "libcef/resources/cef_resources.grd"
outputs = [
"grit/cef_resources.h",
"cef_resources.pak",
]
grit_flags = [
"-E",
"root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
]
2016-06-23 19:42:00 +02:00
}
# Helper for generating pack header files.
template("make_pack_header") {
assert(defined(invoker.header))
assert(defined(invoker.inputs))
action("make_pack_header_${target_name}") {
script = "tools/make_pack_header.py"
inputs = invoker.inputs
outputs = [ invoker.header ]
args = rebase_path(outputs, root_build_dir) +
rebase_path(inputs, root_build_dir)
if (defined(invoker.deps)) {
deps = invoker.deps
}
}
}
# Generate cef_pack_resources.h.
make_pack_header("resources") {
header = "$root_out_dir/includes/cef/include/cef_pack_resources.h"
inputs = [
"$root_gen_dir/base/tracing/protos/grit/tracing_proto_resources.h",
"$root_gen_dir/cef/grit/cef_resources.h",
"$root_gen_dir/chrome/grit/browser_resources.h",
"$root_gen_dir/chrome/grit/common_resources.h",
"$root_gen_dir/chrome/grit/component_extension_resources.h",
"$root_gen_dir/chrome/grit/dev_ui_browser_resources.h",
"$root_gen_dir/chrome/grit/pdf_resources.h",
"$root_gen_dir/chrome/grit/renderer_resources.h",
"$root_gen_dir/components/grit/components_resources.h",
"$root_gen_dir/components/grit/dev_ui_components_resources.h",
"$root_gen_dir/content/browser/devtools/grit/devtools_resources.h",
"$root_gen_dir/content/browser/tracing/grit/tracing_resources.h",
"$root_gen_dir/content/browser/webrtc/resources/grit/webrtc_internals_resources.h",
"$root_gen_dir/content/grit/content_resources.h",
"$root_gen_dir/content/grit/gpu_resources.h",
"$root_gen_dir/content/grit/histograms_resources.h",
"$root_gen_dir/content/grit/process_resources.h",
"$root_gen_dir/content/grit/service_worker_resources.h",
"$root_gen_dir/extensions/grit/extensions_browser_resources.h",
"$root_gen_dir/extensions/grit/extensions_renderer_resources.h",
"$root_gen_dir/extensions/grit/extensions_resources.h",
"$root_gen_dir/mojo/public/js/grit/mojo_bindings_resources.h",
"$root_gen_dir/net/grit/net_resources.h",
"$root_gen_dir/third_party/blink/public/resources/grit/blink_image_resources.h",
"$root_gen_dir/third_party/blink/public/resources/grit/blink_resources.h",
"$root_gen_dir/ui/resources/grit/ui_resources.h",
"$root_gen_dir/ui/resources/grit/webui_resources.h",
"$root_gen_dir/ui/views/resources/grit/views_resources.h",
]
deps = [
":cef_resources",
"//base/tracing/protos:chrome_track_event_resources",
"//chrome/browser:dev_ui_browser_resources",
"//chrome/browser:resources",
"//chrome/browser/resources:component_extension_resources",
"//chrome/browser/resources/pdf:resources",
"//chrome/common:resources",
"//chrome/renderer:resources",
"//components/resources:components_resources",
"//components/resources:dev_ui_components_resources",
"//content/browser/devtools:devtools_resources",
"//content/browser/resources/gpu:resources",
"//content/browser/resources/histograms:resources",
"//content/browser/resources/process:resources",
"//content/browser/resources/service_worker:resources",
"//content/browser/tracing:resources",
"//content/browser/webrtc/resources",
"//content:content_resources",
"//extensions:extensions_browser_resources",
"//extensions:extensions_renderer_resources",
"//extensions:extensions_resources_grd",
"//mojo/public/js:resources",
"//net:net_resources",
"//third_party/blink/public:image_resources",
"//third_party/blink/public:resources",
"//ui/resources:ui_resources_grd",
"//ui/resources:webui_resources_grd",
"//ui/views/resources:resources_grd",
]
}
# Generate cef_pack_strings.h.
make_pack_header("strings") {
header = "$root_out_dir/includes/cef/include/cef_pack_strings.h"
inputs = [
"$root_gen_dir/cef/grit/cef_strings.h",
"$root_gen_dir/chrome/grit/branded_strings.h",
"$root_gen_dir/chrome/grit/generated_resources.h",
"$root_gen_dir/chrome/grit/locale_settings.h",
"$root_gen_dir/chrome/grit/platform_locale_settings.h",
"$root_gen_dir/components/omnibox/resources/grit/omnibox_pedal_synonyms.h",
"$root_gen_dir/components/strings/grit/components_branded_strings.h",
"$root_gen_dir/components/strings/grit/components_strings.h",
"$root_gen_dir/extensions/strings/grit/extensions_strings.h",
"$root_gen_dir/services/strings/grit/services_strings.h",
"$root_gen_dir/third_party/blink/public/strings/grit/blink_strings.h",
"$root_gen_dir/third_party/blink/public/strings/grit/permission_element_strings.h",
"$root_gen_dir/ui/strings/grit/app_locale_settings.h",
"$root_gen_dir/ui/strings/grit/auto_image_annotation_strings.h",
"$root_gen_dir/ui/strings/grit/ui_strings.h",
]
deps = [
":cef_strings",
"//chrome/app:branded_strings",
"//chrome/app:generated_resources",
"//chrome/app/resources:locale_settings",
"//chrome/app/resources:platform_locale_settings",
"//components/omnibox/resources:omnibox_pedal_synonyms",
"//components/strings:components_branded_strings",
"//components/strings:components_locale_settings",
"//components/strings:components_strings",
"//extensions/strings",
"//services/strings",
"//third_party/blink/public/strings",
"//third_party/blink/public/strings:permission_element_strings",
"//ui/strings:app_locale_settings",
"//ui/strings:auto_image_annotation_strings",
"//ui/strings:ui_strings",
]
}
# Generate cef_command_ids.h.
make_pack_header("command_ids") {
header = "$root_out_dir/includes/cef/include/cef_command_ids.h"
inputs = [
"//chrome/app/chrome_command_ids.h",
]
}
# Generate cef_api_hash.h.
action("make_api_hash_header") {
script = "tools/make_api_hash_header.py"
# List of all C API files that will be checked for changes by cef_api_hash.py.
inputs = gypi_paths2.includes_common_capi +
gypi_paths2.includes_linux_capi +
gypi_paths2.includes_mac_capi +
gypi_paths2.includes_win_capi +
gypi_paths2.includes_capi +
gypi_paths.autogen_capi_includes
include_dir = [ "include" ]
outputs = [ "$root_out_dir/includes/cef/include/cef_api_hash.h" ]
args = rebase_path(outputs + include_dir, root_build_dir)
}
# This no-op action lists args.gn as an output, allowing it to be referenced as
# an input (trigger) for other actions. Otherwise, GN will complain that no
# target generates the args.gn file because its below the $root_out_dir.
action("args_gn_source") {
script = "//build/noop.py"
outputs = [ "$root_out_dir/args.gn" ]
}
# Generate cef_config.h.
action("make_config_header") {
script = "tools/make_config_header.py"
deps = [ ":args_gn_source" ]
inputs = [ "$root_out_dir/args.gn" ]
outputs = [ "$root_out_dir/includes/cef/include/cef_config.h" ]
args = rebase_path(outputs + inputs, root_build_dir)
}
# Generate cef_color_ids.h.
action("make_colorids_header") {
script = "tools/make_colorids_header.py"
inputs = [
"//ui/color/color_id.h",
"//components/color/color_id.h",
"//chrome/browser/ui/color/chrome_color_id.h",
]
outputs = [ "$root_out_dir/includes/cef/include/cef_color_ids.h" ]
args = rebase_path(outputs + inputs, root_build_dir)
}
# Generate pack files and associated CEF header files.
group("cef_make_headers") {
deps = [
":make_pack_header_resources",
":make_pack_header_strings",
":make_pack_header_command_ids",
":make_api_hash_header",
":make_config_header",
":make_colorids_header",
]
}
2016-06-23 19:42:00 +02:00
#
# libcef dll/framework target.
#
if (is_mac) {
cef_framework_name = "Chromium Embedded Framework"
tweak_info_plist("cef_framework_plist") {
info_plist = "libcef/resources/framework-Info.plist"
args = [
"--breakpad=0",
2016-06-23 19:42:00 +02:00
"--keystone=0",
"--scm=1",
"--version",
cef_plist_version,
2016-06-23 19:42:00 +02:00
"--branding",
cef_framework_name,
]
}
bundle_data("cef_framework_resources") {
sources = []
public_deps = []
2016-06-23 19:42:00 +02:00
if (icu_use_data_file) {
sources += [ "$root_out_dir/icudtl.dat" ]
public_deps += [ "//third_party/icu:icudata", ]
}
sources += [ "//ui/gl/resources/angle-metal/gpu_shader_cache.bin" ]
2016-06-23 19:42:00 +02:00
if (v8_use_external_startup_data) {
sources += [
"$root_out_dir/snapshot_blob.bin",
]
public_deps += [ "//v8" ]
if (use_v8_context_snapshot) {
sources += [ "$root_out_dir/$v8_context_snapshot_filename" ]
public_deps += [ "//tools/v8_context_snapshot" ]
}
2016-06-23 19:42:00 +02:00
}
outputs = [
"{{bundle_resources_dir}}/{{source_file_part}}",
]
}
# Add the ANGLE .dylibs in the MODULE_DIR of the Framework app bundle.
bundle_data("cef_framework_angle_binaries") {
sources = [
"$root_out_dir/egl_intermediates/libEGL.dylib",
"$root_out_dir/egl_intermediates/libGLESv2.dylib",
]
outputs = [
"{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
]
public_deps = [
"//ui/gl:angle_library_copy",
]
}
# Add the SwiftShader .dylibs in the MODULE_DIR of the Framework app bundle.
bundle_data("cef_framework_swiftshader_binaries") {
sources = [
"$root_out_dir/vk_intermediates/libvk_swiftshader.dylib",
"$root_out_dir/vk_intermediates/vk_swiftshader_icd.json",
]
outputs = [
"{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
]
public_deps = [
"//ui/gl:swiftshader_vk_library_copy",
]
}
2016-06-23 19:42:00 +02:00
mac_framework_bundle("cef_framework") {
# Necessary because the libcef_test_support target is testonly.
testonly = true
2016-06-23 19:42:00 +02:00
output_name = cef_framework_name
framework_version = "A"
framework_contents = [
"Libraries",
"Resources",
]
sources = includes_common +
includes_mac +
2016-06-23 19:42:00 +02:00
gypi_paths.autogen_cpp_includes +
gypi_paths2.includes_capi +
gypi_paths.autogen_capi_includes +
gypi_paths2.libcef_sources_common +
gypi_paths.autogen_library_side
deps = [
":cef_framework_angle_binaries",
2016-06-23 19:42:00 +02:00
":cef_framework_resources",
":cef_framework_swiftshader_binaries",
2016-06-23 19:42:00 +02:00
":libcef_static",
":libcef_test_support",
2016-06-23 19:42:00 +02:00
]
configs += [
":libcef_autogen_config",
]
# We don't link the framework so just use the path from the main executable.
ldflags = [
"-Wl,-install_name,@executable_path/../Frameworks/$output_name.framework/$output_name",
"-compatibility_version",
cef_dylib_version,
"-current_version",
cef_dylib_version,
]
if (is_component_build) {
# Set up the rpath for the framework so that it can find dylibs in the
# root output directory. The framework is at
# $app_name.app/Contents/Frameworks/$output_name.framework/Versions/A/$output_name
# so use loader_path to go back to the root output directory.
ldflags += [
"-rpath",
"@loader_path/../../../../../..",
]
}
2016-06-23 19:42:00 +02:00
info_plist_target = ":cef_framework_plist"
}
} else {
config("pdb_larger_than_4gb") {
if (is_win && symbol_level == 2) {
# These binaries create PDBs larger than 4 GiB. Increasing the PDB page
# size allows larger PDBs, but not all tools can handle such large PDBs
# yet.
ldflags = [ "/pdbpagesize:8192" ]
}
}
2016-06-23 19:42:00 +02:00
shared_library("libcef") {
# Necessary because the libcef_test_support target is testonly.
testonly = true
sources = includes_common +
2016-06-23 19:42:00 +02:00
gypi_paths.autogen_cpp_includes +
gypi_paths2.includes_capi +
gypi_paths.autogen_capi_includes +
gypi_paths2.libcef_sources_common +
gypi_paths.autogen_library_side
deps = [
":libcef_static",
":libcef_test_support",
2016-06-23 19:42:00 +02:00
]
configs += [
":libcef_autogen_config",
":pdb_larger_than_4gb",
]
2016-06-23 19:42:00 +02:00
if (is_win) {
sources += includes_win + [
2016-06-23 19:42:00 +02:00
"libcef_dll/libcef_dll.rc",
]
deps += [
2016-06-23 19:42:00 +02:00
# Bring in ui_unscaled_resources.rc which contains custom cursors.
# TODO(cef): Remove this once custom cursors can be loaded via
# ResourceBundle. See crbug.com/147663.
"//ui/resources:ui_unscaled_resources_grd",
]
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
configs += [ "//build/config/win:delayloads" ]
libs = [
"comctl32.lib",
# For D3D11_DECODER_PROFILE_H264_VLD_NOFGT.
"dxguid.lib",
]
2016-06-23 19:42:00 +02:00
}
if (is_linux) {
# Disable 'duplicate symbol' linker errors.
ldflags = [ "-Wl,--allow-multiple-definition" ]
if (!is_debug && !use_partition_alloc_as_malloc) {
# Only export necessary symbols from libcef.so.
# Don't do this in Debug builds because it causes the resulting
# application to crash.
# Also need to do this for ASAN builds to work around
# https://crbug.com/832808.
ldflags += [ "-Wl,--version-script=" +
rebase_path("//cef/libcef_dll/libcef.lst") ]
}
2016-06-23 19:42:00 +02:00
}
}
}
#
# Executable/app targets.
#
# Source files for TeamCity GTest integration.
# See tests/gtest/teamcity/README.cef for details.
source_set("gtest_teamcity") {
testonly = true
sources = [
"tests/gtest/teamcity/include/teamcity_gtest.h",
"tests/gtest/teamcity/src/teamcity_gtest.cpp",
"tests/gtest/teamcity/src/teamcity_gtest.h",
"tests/gtest/teamcity/src/teamcity_messages.cpp",
"tests/gtest/teamcity/src/teamcity_messages.h",
]
deps = [
"//testing/gtest",
]
configs += [
"libcef/features:config",
"//build/config:precompiled_headers",
]
}
2016-06-23 19:42:00 +02:00
if (is_mac) {
# Helper for generating the CEF app bundle.
template("cef_app") {
assert(defined(invoker.helper_info_plist))
assert(defined(invoker.helper_sources))
assert(defined(invoker.info_plist))
assert(defined(invoker.sources))
app_name = target_name
app_helper_name = "$app_name Helper"
app_testonly = defined(invoker.testonly) && invoker.testonly
tweak_info_plist("${app_name}_helper_plist") {
testonly = app_testonly
info_plist = invoker.helper_info_plist
args = [
"--breakpad=0",
"--keystone=0",
"--scm=0",
"--version",
cef_plist_version,
2016-06-23 19:42:00 +02:00
]
}
template("cef_helper_app") {
mac_app_bundle(target_name) {
assert(defined(invoker.helper_sources))
assert(defined(invoker.helper_name_suffix))
assert(defined(invoker.helper_bundle_id_suffix))
2016-06-23 19:42:00 +02:00
testonly = app_testonly
output_name = app_helper_name + invoker.helper_name_suffix
2016-06-23 19:42:00 +02:00
sources = invoker.helper_sources
2016-06-23 19:42:00 +02:00
extra_substitutions = [
"BUNDLE_ID_SUFFIX=${invoker.helper_bundle_id_suffix}",
]
2016-06-23 19:42:00 +02:00
deps = [
":cef_make_headers",
":cef_sandbox",
":libcef_dll_wrapper",
]
if (defined(invoker.helper_deps)) {
deps += invoker.helper_deps
}
ldflags = [
# The helper is in $app_name.app/Contents/Frameworks/$app_name Helper.app/Contents/MacOS/
# so set rpath up to the base.
"-rpath",
"@executable_path/../../../../../..",
]
info_plist_target = ":${app_name}_helper_plist"
if (defined(invoker.helper_frameworks)) {
frameworks = invoker.helper_frameworks
}
if (defined(invoker.helper_defines)) {
defines = invoker.helper_defines
}
}
}
# From //chrome/BUILD.gn:
# Helper app to display alert notifications. This is necessary as an app can
# only display either banner or alert style notifications and the main app
# will display banners.
alert_helper_params = [
"alerts",
".alerts",
" (Alerts)",
]
# Merge all helper apps needed by //content and //chrome.
chrome_mac_helpers = content_mac_helpers + [ alert_helper_params ]
foreach(helper_params, chrome_mac_helpers) {
_helper_target = helper_params[0]
_helper_bundle_id = helper_params[1]
_helper_suffix = helper_params[2]
cef_helper_app("${app_name}_helper_app_${_helper_target}") {
helper_sources = invoker.helper_sources
if (defined(invoker.helper_deps)) {
helper_deps = invoker.helper_deps
}
if (defined(invoker.helper_frameworks)) {
helper_frameworks = invoker.helper_frameworks
}
if (defined(invoker.helper_defines)) {
helper_defines = invoker.helper_defines
}
helper_name_suffix = _helper_suffix
helper_bundle_id_suffix = _helper_bundle_id
}
2016-06-23 19:42:00 +02:00
}
bundle_data("${app_name}_framework_bundle_data") {
testonly = app_testonly
sources = [
"$root_out_dir/$cef_framework_name.framework",
]
public_deps = [
":cef_framework",
2016-06-23 19:42:00 +02:00
]
foreach(helper_params, chrome_mac_helpers) {
sources += [
"$root_out_dir/${app_helper_name}${helper_params[2]}.app",
]
public_deps += [ ":${app_name}_helper_app_${helper_params[0]}" ]
}
2016-06-23 19:42:00 +02:00
outputs = [
"{{bundle_contents_dir}}/Frameworks/{{source_file_part}}",
2016-06-23 19:42:00 +02:00
]
}
tweak_info_plist("${app_name}_plist") {
testonly = app_testonly
info_plist = invoker.info_plist
args = [
"--scm=1",
"--version",
cef_plist_version,
2016-06-23 19:42:00 +02:00
]
}
mac_app_bundle(app_name) {
testonly = app_testonly
output_name = app_name
sources = invoker.sources
public_deps = [ ":libcef_dll_wrapper" ]
2016-06-23 19:42:00 +02:00
deps = [
":cef_make_headers",
":libcef_dll_wrapper",
2016-06-23 19:42:00 +02:00
":${app_name}_framework_bundle_data",
]
if (defined(invoker.deps)) {
deps += invoker.deps
}
if (defined(invoker.frameworks)) {
frameworks = invoker.frameworks
2016-06-23 19:42:00 +02:00
}
if (defined(invoker.defines)) {
defines = invoker.defines
}
2016-06-23 19:42:00 +02:00
info_plist_target = ":${app_name}_plist"
}
}
#
# cefclient app targets.
#
bundle_data("cefclient_resources_bundle_data") {
sources = gypi_paths2.shared_sources_resources +
gypi_paths2.cefclient_sources_resources + [
"tests/cefclient/mac/cefclient.icns",
2016-06-23 19:42:00 +02:00
]
outputs = [
"{{bundle_resources_dir}}/{{source_file_part}}",
]
}
bundle_data("cefclient_resources_bundle_data_english") {
sources = [
"tests/cefclient/mac/English.lproj/InfoPlist.strings",
2016-06-23 19:42:00 +02:00
]
outputs = [
"{{bundle_resources_dir}}/English.lproj/{{source_file_part}}",
]
}
mac_xib_bundle_data("cefclient_xibs") {
sources = [
"tests/cefclient/mac/English.lproj/MainMenu.xib",
2016-06-23 19:42:00 +02:00
]
output_path = "{{bundle_resources_dir}}/English.lproj"
}
cef_app("cefclient") {
# Necessary because the cef_framework target is testonly.
testonly = true
helper_info_plist = "tests/cefclient/mac/helper-Info.plist.in"
helper_sources = includes_common +
includes_mac +
2016-06-23 19:42:00 +02:00
gypi_paths2.includes_wrapper +
gypi_paths2.includes_wrapper_mac +
gypi_paths2.shared_sources_common +
gypi_paths2.shared_sources_renderer +
gypi_paths2.shared_sources_mac_helper +
2016-06-23 19:42:00 +02:00
gypi_paths2.cefclient_sources_common +
gypi_paths2.cefclient_sources_renderer
helper_defines = [
"CEF_USE_SANDBOX",
]
2016-06-23 19:42:00 +02:00
info_plist = "tests/cefclient/mac/Info.plist.in"
sources = includes_common +
includes_mac +
2016-06-23 19:42:00 +02:00
gypi_paths2.includes_wrapper +
gypi_paths2.includes_wrapper_mac +
gypi_paths2.shared_sources_browser +
gypi_paths2.shared_sources_common +
gypi_paths2.shared_sources_mac +
2016-06-23 19:42:00 +02:00
gypi_paths2.cefclient_sources_browser +
gypi_paths2.cefclient_sources_common +
gypi_paths2.cefclient_sources_mac
deps = [
":cefclient_resources_bundle_data",
":cefclient_resources_bundle_data_english",
":cefclient_xibs",
]
frameworks = [
2016-06-23 19:42:00 +02:00
"AppKit.framework",
"IOSurface.framework",
2016-06-23 19:42:00 +02:00
"OpenGL.framework",
]
defines = [
"CEF_USE_SANDBOX",
]
2016-06-23 19:42:00 +02:00
}
#
# cefsimple app targets.
#
bundle_data("cefsimple_resources_bundle_data") {
sources = [
"tests/cefsimple/mac/cefsimple.icns",
]
outputs = [
"{{bundle_resources_dir}}/{{source_file_part}}",
]
}
bundle_data("cefsimple_resources_bundle_data_english") {
sources = [
"tests/cefsimple/mac/English.lproj/InfoPlist.strings",
]
outputs = [
"{{bundle_resources_dir}}/English.lproj/{{source_file_part}}",
]
}
mac_xib_bundle_data("cefsimple_xibs") {
sources = [
"tests/cefsimple/mac/English.lproj/MainMenu.xib",
]
output_path = "{{bundle_resources_dir}}/English.lproj"
}
cef_app("cefsimple") {
# Necessary because the cef_framework target is testonly.
testonly = true
helper_info_plist = "tests/cefsimple/mac/helper-Info.plist.in"
helper_sources = includes_common +
includes_mac +
2016-06-23 19:42:00 +02:00
gypi_paths2.includes_wrapper +
gypi_paths2.includes_wrapper_mac +
2016-06-23 19:42:00 +02:00
gypi_paths2.cefsimple_sources_mac_helper
helper_defines = [
"CEF_USE_SANDBOX",
]
2016-06-23 19:42:00 +02:00
info_plist = "tests/cefsimple/mac/Info.plist.in"
sources = includes_common +
includes_mac +
2016-06-23 19:42:00 +02:00
gypi_paths2.includes_wrapper +
gypi_paths2.includes_wrapper_mac +
2016-06-23 19:42:00 +02:00
gypi_paths2.cefsimple_sources_common +
gypi_paths2.cefsimple_sources_mac
deps = [
":cefsimple_resources_bundle_data",
":cefsimple_resources_bundle_data_english",
":cefsimple_xibs",
]
frameworks = [
"AppKit.framework",
]
defines = [
"CEF_USE_SANDBOX",
]
2016-06-23 19:42:00 +02:00
}
#
# ceftests app targets.
2016-06-23 19:42:00 +02:00
#
bundle_data("ceftests_resources_bundle_data") {
sources = gypi_paths2.shared_sources_resources + [
"tests/ceftests/mac/ceftests.icns",
]
outputs = [
"{{bundle_resources_dir}}/{{source_file_part}}",
]
}
bundle_data("ceftests_resources_bundle_data_english") {
sources = [
"tests/ceftests/mac/English.lproj/InfoPlist.strings",
]
outputs = [
"{{bundle_resources_dir}}/English.lproj/{{source_file_part}}",
]
}
mac_xib_bundle_data("ceftests_xibs") {
sources = [
"tests/ceftests/mac/English.lproj/MainMenu.xib",
]
output_path = "{{bundle_resources_dir}}/English.lproj"
}
cef_app("ceftests") {
2016-06-23 19:42:00 +02:00
testonly = true
helper_info_plist = "tests/ceftests/mac/helper-Info.plist.in"
helper_sources = gypi_paths2.shared_sources_common +
gypi_paths2.shared_sources_renderer +
gypi_paths2.shared_sources_mac_helper +
gypi_paths2.ceftests_sources_mac_helper +
gypi_paths2.ceftests_sources_mac_helper_shared
helper_deps = [
":gtest_teamcity",
"//testing/gtest",
2016-06-23 19:42:00 +02:00
]
helper_frameworks = [
"AppKit.framework",
]
helper_defines = [
"CEF_USE_SANDBOX",
"CEF_TESTS_IN_SRC_DIRECTORY",
]
2016-06-23 19:42:00 +02:00
info_plist = "tests/ceftests/mac/Info.plist.in"
sources = includes_common +
includes_mac +
gypi_paths2.includes_wrapper +
gypi_paths2.includes_wrapper_mac +
gypi_paths2.shared_sources_browser +
gypi_paths2.shared_sources_common +
gypi_paths2.shared_sources_mac +
gypi_paths2.ceftests_sources_common +
gypi_paths2.ceftests_sources_mac
deps = [
":ceftests_resources_bundle_data",
":ceftests_resources_bundle_data_english",
":ceftests_xibs",
":gtest_teamcity",
"//testing/gtest",
2016-06-23 19:42:00 +02:00
]
frameworks = [
2016-06-23 19:42:00 +02:00
"AppKit.framework",
]
defines = [
"CEF_USE_SANDBOX",
"CEF_TESTS_IN_SRC_DIRECTORY",
]
2016-06-23 19:42:00 +02:00
}
} else {
#
# cefclient targets.
#
# The cefclient target depends on packages that are not available in the
# default sysroot environment.
if (is_linux && !use_sysroot) {
pkg_config("glib") {
packages = [
"glib-2.0",
]
}
}
if (is_linux && cef_use_gtk) {
2016-06-23 19:42:00 +02:00
pkg_config("gtk") {
packages = [
"gmodule-2.0",
"gtk+-3.0",
2016-06-23 19:42:00 +02:00
"gthread-2.0",
"gtk+-unix-print-3.0",
"xi",
2016-06-23 19:42:00 +02:00
]
}
}
if (is_linux) {
copy("copy_cefclient_files") {
sources = gypi_paths2.shared_sources_resources +
gypi_paths2.cefclient_sources_resources
outputs = [ "${root_out_dir}/cefclient_files/{{source_file_part}}" ]
2016-06-23 19:42:00 +02:00
}
}
executable("cefclient") {
# Necessary because the libcef target is testonly.
testonly = true
sources = includes_common +
2016-06-23 19:42:00 +02:00
gypi_paths2.includes_wrapper +
gypi_paths2.shared_sources_browser +
gypi_paths2.shared_sources_common +
gypi_paths2.shared_sources_renderer +
2016-06-23 19:42:00 +02:00
gypi_paths2.cefclient_sources_browser +
gypi_paths2.cefclient_sources_common +
gypi_paths2.cefclient_sources_renderer
2016-06-23 19:42:00 +02:00
deps = [
":libcef",
":libcef_dll_wrapper",
]
defines = [
"CEF_USE_SANDBOX",
]
2016-06-23 19:42:00 +02:00
if (is_win) {
sources += includes_win +
gypi_paths2.shared_sources_win +
gypi_paths2.cefclient_sources_win +
gypi_paths2.cefclient_sources_resources_win_rc
2016-06-23 19:42:00 +02:00
# Set /SUBSYSTEM:WINDOWS.
configs -= [ "//build/config/win:console" ]
configs += [ "//build/config/win:windowed" ]
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
configs += [ "//build/config/win:delayloads" ]
defines += [
2016-06-23 19:42:00 +02:00
"CEF_USE_ATL",
]
deps += [
":cef_sandbox",
"//build/win:default_exe_manifest",
]
libs = [
"comctl32.lib",
"d3d11.lib",
"imm32.lib",
"oleacc.lib",
"rpcrt4.lib",
"shlwapi.lib",
2016-06-23 19:42:00 +02:00
]
if (target_cpu != "arm64") {
libs += [
"glu32.lib",
"opengl32.lib",
]
ldflags = [
"/DELAYLOAD:glu32.dll",
"/DELAYLOAD:oleaut32.dll",
"/DELAYLOAD:opengl32.dll",
]
}
2016-06-23 19:42:00 +02:00
}
if (is_linux) {
sources += includes_linux +
gypi_paths2.shared_sources_linux +
2016-06-23 19:42:00 +02:00
gypi_paths2.cefclient_sources_linux
deps += [
":copy_cefclient_files",
]
libs = [
"GL",
2016-06-23 19:42:00 +02:00
"X11",
]
if (cef_use_gtk) {
2016-06-23 19:42:00 +02:00
configs += [
":gtk",
]
cflags = [
# Don't warn about deprecated GDK/GTK functions.
"-Wno-deprecated-declarations",
]
2016-06-23 19:42:00 +02:00
}
if (!is_component_build) {
2016-06-23 19:42:00 +02:00
# Set rpath to find our own libfreetype even in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
}
}
#
# cefsimple targets.
#
executable("cefsimple") {
# Necessary because the libcef target is testonly.
testonly = true
sources = includes_common +
2016-06-23 19:42:00 +02:00
gypi_paths2.includes_wrapper +
gypi_paths2.cefsimple_sources_common
deps = [
":libcef",
":libcef_dll_wrapper",
]
defines = [
"CEF_USE_SANDBOX",
]
2016-06-23 19:42:00 +02:00
if (is_win) {
sources += includes_win +
gypi_paths2.cefsimple_sources_win +
gypi_paths2.cefsimple_sources_resources_win_rc
2016-06-23 19:42:00 +02:00
# Set /SUBSYSTEM:WINDOWS.
configs -= [ "//build/config/win:console" ]
configs += [ "//build/config/win:windowed" ]
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
configs += [ "//build/config/win:delayloads" ]
2016-06-23 19:42:00 +02:00
deps += [
":cef_sandbox",
"//build/win:default_exe_manifest",
]
libs = [
"comctl32.lib",
"shlwapi.lib",
"rpcrt4.lib",
]
}
if (is_linux) {
sources += includes_linux +
2016-06-23 19:42:00 +02:00
gypi_paths2.cefsimple_sources_linux
if (ozone_platform_x11) {
libs = [
"X11",
]
}
2016-06-23 19:42:00 +02:00
if (!is_component_build) {
# Set rpath to find our own libfreetype even in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
}
}
#
# ceftests targets.
2016-06-23 19:42:00 +02:00
#
if (is_linux) {
copy("copy_ceftests_files") {
sources = gypi_paths2.shared_sources_resources
outputs = [ "${root_out_dir}/ceftests_files/{{source_file_part}}" ]
}
}
2016-06-23 19:42:00 +02:00
executable("ceftests") {
2016-06-23 19:42:00 +02:00
testonly = true
sources = includes_common +
gypi_paths2.includes_wrapper +
gypi_paths2.shared_sources_browser +
gypi_paths2.shared_sources_common +
gypi_paths2.shared_sources_renderer +
gypi_paths2.ceftests_sources_common
2016-06-23 19:42:00 +02:00
deps = [
2016-06-23 19:42:00 +02:00
":libcef",
":libcef_dll_wrapper",
":gtest_teamcity",
"//testing/gtest",
2016-06-23 19:42:00 +02:00
]
defines = [
"CEF_USE_SANDBOX",
"CEF_TESTS_IN_SRC_DIRECTORY",
]
2016-06-23 19:42:00 +02:00
if (is_win) {
sources += gypi_paths2.shared_sources_win +
gypi_paths2.ceftests_sources_win +
gypi_paths2.ceftests_sources_resources_win_rc
2016-06-23 19:42:00 +02:00
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
configs += [ "//build/config/win:delayloads" ]
2016-06-23 19:42:00 +02:00
deps += [
":cef_sandbox",
"//build/win:default_exe_manifest",
]
}
if (is_linux) {
sources += gypi_paths2.shared_sources_linux +
gypi_paths2.ceftests_sources_linux
2016-06-23 19:42:00 +02:00
if (ozone_platform_x11) {
libs = [
"X11",
]
} else {
if (!use_sysroot) {
configs += [ ":glib" ]
}
}
2016-06-23 19:42:00 +02:00
deps += [
":copy_ceftests_files",
2016-06-23 19:42:00 +02:00
]
}
if (is_linux && !is_component_build) {
# Set rpath to find our own libfreetype even in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
}
}