mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
27 Commits
5bafd32ee1
...
5845
Author | SHA1 | Date | |
---|---|---|---|
|
d8c85aca1d | ||
|
c17cdea4be | ||
|
d6ef581328 | ||
|
5332865267 | ||
|
375735a3c6 | ||
|
480de6611b | ||
|
9c7dc32f63 | ||
|
d6abd3cde7 | ||
|
c6a20bc586 | ||
|
f38f362349 | ||
|
32577ce2db | ||
|
da9d816a3c | ||
|
0b8c26575e | ||
|
376a7808ef | ||
|
557a56f083 | ||
|
6bc25d5061 | ||
|
31fb97aeb7 | ||
|
5e0d8ce439 | ||
|
11a25f9f01 | ||
|
9cfd5006bd | ||
|
c783652ca9 | ||
|
c182ee2af6 | ||
|
5ab64c1012 | ||
|
67c33c2cff | ||
|
3539a99aab | ||
|
e3e4100162 | ||
|
6ca8278198 |
@@ -7,5 +7,6 @@
|
||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
|
||||
{
|
||||
'chromium_checkout': 'refs/tags/116.0.5845.0'
|
||||
'chromium_checkout': 'refs/tags/116.0.5845.190',
|
||||
'depot_tools_checkout': '6d0c235dae'
|
||||
}
|
||||
|
@@ -1,2 +1,2 @@
|
||||
@echo off
|
||||
python.bat tools\gclient_hook.py
|
||||
python3.bat tools\gclient_hook.py
|
||||
|
@@ -23,7 +23,6 @@
|
||||
'include/base/cef_ptr_util.h',
|
||||
'include/base/cef_ref_counted.h',
|
||||
'include/base/cef_scoped_refptr.h',
|
||||
'include/base/cef_template_util.h',
|
||||
'include/base/cef_thread_checker.h',
|
||||
'include/base/cef_trace_event.h',
|
||||
'include/base/cef_tuple.h',
|
||||
|
@@ -84,7 +84,6 @@
|
||||
|
||||
#include "include/base/cef_build.h"
|
||||
#include "include/base/cef_compiler_specific.h"
|
||||
#include "include/base/cef_template_util.h"
|
||||
#include "include/base/internal/cef_bind_internal.h"
|
||||
|
||||
#if defined(OS_APPLE) && !HAS_FEATURE(objc_arc)
|
||||
@@ -105,7 +104,7 @@ BindOnce(Functor&& functor, Args&&... args) {
|
||||
"BindOnce requires non-const rvalue for OnceCallback binding."
|
||||
" I.e.: base::BindOnce(std::move(callback)).");
|
||||
static_assert(
|
||||
conjunction<cef_internal::AssertBindArgIsNotBasePassed<
|
||||
std::conjunction<cef_internal::AssertBindArgIsNotBasePassed<
|
||||
std::decay_t<Args>>...>::value,
|
||||
"Use std::move() instead of base::Passed() with base::BindOnce()");
|
||||
|
||||
|
@@ -50,7 +50,6 @@
|
||||
#include "include/base/cef_compiler_specific.h"
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_scoped_refptr.h"
|
||||
#include "include/base/cef_template_util.h"
|
||||
#include "include/base/cef_thread_checker.h"
|
||||
|
||||
namespace base {
|
||||
@@ -485,7 +484,7 @@ class RefCountedData
|
||||
RefCountedData(const T& in_value) : data(in_value) {}
|
||||
RefCountedData(T&& in_value) : data(std::move(in_value)) {}
|
||||
template <typename... Args>
|
||||
explicit RefCountedData(in_place_t, Args&&... args)
|
||||
explicit RefCountedData(std::in_place_t, Args&&... args)
|
||||
: data(std::forward<Args>(args)...) {}
|
||||
|
||||
T data;
|
||||
|
@@ -1,417 +0,0 @@
|
||||
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011
|
||||
// Google Inc. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_
|
||||
#define CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_
|
||||
#pragma once
|
||||
|
||||
#if defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/template_util.h"
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
|
||||
#include <stddef.h>
|
||||
#include <iosfwd>
|
||||
#include <iterator>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "include/base/cef_build.h"
|
||||
|
||||
// Some versions of libstdc++ have partial support for type_traits, but misses
|
||||
// a smaller subset while removing some of the older non-standard stuff. Assume
|
||||
// that all versions below 5.0 fall in this category, along with one 5.0
|
||||
// experimental release. Test for this by consulting compiler major version,
|
||||
// the only reliable option available, so theoretically this could fail should
|
||||
// you attempt to mix an earlier version of libstdc++ with >= GCC5. But
|
||||
// that's unlikely to work out, especially as GCC5 changed ABI.
|
||||
#define CR_GLIBCXX_5_0_0 20150123
|
||||
#if (defined(__GNUC__) && __GNUC__ < 5) || \
|
||||
(defined(__GLIBCXX__) && __GLIBCXX__ == CR_GLIBCXX_5_0_0)
|
||||
#define CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX
|
||||
#endif
|
||||
|
||||
// This hacks around using gcc with libc++ which has some incompatibilies.
|
||||
// - is_trivially_* doesn't work: https://llvm.org/bugs/show_bug.cgi?id=27538
|
||||
// TODO(danakj): Remove this when android builders are all using a newer version
|
||||
// of gcc, or the android ndk is updated to a newer libc++ that works with older
|
||||
// gcc versions.
|
||||
#if !defined(__clang__) && defined(_LIBCPP_VERSION)
|
||||
#define CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX
|
||||
#endif
|
||||
|
||||
namespace base {
|
||||
|
||||
template <class T>
|
||||
struct is_non_const_reference : std::false_type {};
|
||||
template <class T>
|
||||
struct is_non_const_reference<T&> : std::true_type {};
|
||||
template <class T>
|
||||
struct is_non_const_reference<const T&> : std::false_type {};
|
||||
|
||||
namespace internal {
|
||||
|
||||
// Implementation detail of base::void_t below.
|
||||
template <typename...>
|
||||
struct make_void {
|
||||
using type = void;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
// base::void_t is an implementation of std::void_t from C++17.
|
||||
//
|
||||
// We use |base::internal::make_void| as a helper struct to avoid a C++14
|
||||
// defect:
|
||||
// http://en.cppreference.com/w/cpp/types/void_t
|
||||
// http://open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1558
|
||||
template <typename... Ts>
|
||||
using void_t = typename ::base::internal::make_void<Ts...>::type;
|
||||
|
||||
namespace internal {
|
||||
|
||||
// Uses expression SFINAE to detect whether using operator<< would work.
|
||||
template <typename T, typename = void>
|
||||
struct SupportsOstreamOperator : std::false_type {};
|
||||
template <typename T>
|
||||
struct SupportsOstreamOperator<T,
|
||||
decltype(void(std::declval<std::ostream&>()
|
||||
<< std::declval<T>()))>
|
||||
: std::true_type {};
|
||||
|
||||
template <typename T, typename = void>
|
||||
struct SupportsToString : std::false_type {};
|
||||
template <typename T>
|
||||
struct SupportsToString<T, decltype(void(std::declval<T>().ToString()))>
|
||||
: std::true_type {};
|
||||
|
||||
// Used to detect whether the given type is an iterator. This is normally used
|
||||
// with std::enable_if to provide disambiguation for functions that take
|
||||
// templatzed iterators as input.
|
||||
template <typename T, typename = void>
|
||||
struct is_iterator : std::false_type {};
|
||||
|
||||
template <typename T>
|
||||
struct is_iterator<T,
|
||||
void_t<typename std::iterator_traits<T>::iterator_category>>
|
||||
: std::true_type {};
|
||||
|
||||
// Helper to express preferences in an overload set. If more than one overload
|
||||
// are available for a given set of parameters the overload with the higher
|
||||
// priority will be chosen.
|
||||
template <size_t I>
|
||||
struct priority_tag : priority_tag<I - 1> {};
|
||||
|
||||
template <>
|
||||
struct priority_tag<0> {};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
// is_trivially_copyable is especially hard to get right.
|
||||
// - Older versions of libstdc++ will fail to have it like they do for other
|
||||
// type traits. This has become a subset of the second point, but used to be
|
||||
// handled independently.
|
||||
// - An experimental release of gcc includes most of type_traits but misses
|
||||
// is_trivially_copyable, so we still have to avoid using libstdc++ in this
|
||||
// case, which is covered by CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX.
|
||||
// - When compiling libc++ from before r239653, with a gcc compiler, the
|
||||
// std::is_trivially_copyable can fail. So we need to work around that by not
|
||||
// using the one in libc++ in this case. This is covered by the
|
||||
// CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX define, and is discussed in
|
||||
// https://llvm.org/bugs/show_bug.cgi?id=27538#c1 where they point out that
|
||||
// in libc++'s commit r239653 this is fixed by libc++ checking for gcc 5.1.
|
||||
// - In both of the above cases we are using the gcc compiler. When defining
|
||||
// this ourselves on compiler intrinsics, the __is_trivially_copyable()
|
||||
// intrinsic is not available on gcc before version 5.1 (see the discussion in
|
||||
// https://llvm.org/bugs/show_bug.cgi?id=27538#c1 again), so we must check for
|
||||
// that version.
|
||||
// - When __is_trivially_copyable() is not available because we are on gcc older
|
||||
// than 5.1, we need to fall back to something, so we use __has_trivial_copy()
|
||||
// instead based on what was done one-off in bit_cast() previously.
|
||||
|
||||
// TODO(crbug.com/554293): Remove this when all platforms have this in the std
|
||||
// namespace and it works with gcc as needed.
|
||||
#if defined(CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX) || \
|
||||
defined(CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX)
|
||||
template <typename T>
|
||||
struct is_trivially_copyable {
|
||||
// TODO(danakj): Remove this when android builders are all using a newer version
|
||||
// of gcc, or the android ndk is updated to a newer libc++ that does this for
|
||||
// us.
|
||||
#if _GNUC_VER >= 501
|
||||
static constexpr bool value = __is_trivially_copyable(T);
|
||||
#else
|
||||
static constexpr bool value =
|
||||
__has_trivial_copy(T) && __has_trivial_destructor(T);
|
||||
#endif
|
||||
};
|
||||
#else
|
||||
template <class T>
|
||||
using is_trivially_copyable = std::is_trivially_copyable<T>;
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 7
|
||||
// Workaround for g++7 and earlier family.
|
||||
// Due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80654, without this
|
||||
// Optional<std::vector<T>> where T is non-copyable causes a compile error.
|
||||
// As we know it is not trivially copy constructible, explicitly declare so.
|
||||
template <typename T>
|
||||
struct is_trivially_copy_constructible
|
||||
: std::is_trivially_copy_constructible<T> {};
|
||||
|
||||
template <typename... T>
|
||||
struct is_trivially_copy_constructible<std::vector<T...>> : std::false_type {};
|
||||
#else
|
||||
// Otherwise use std::is_trivially_copy_constructible as is.
|
||||
template <typename T>
|
||||
using is_trivially_copy_constructible = std::is_trivially_copy_constructible<T>;
|
||||
#endif
|
||||
|
||||
// base::in_place_t is an implementation of std::in_place_t from
|
||||
// C++17. A tag type used to request in-place construction in template vararg
|
||||
// constructors.
|
||||
|
||||
// Specification:
|
||||
// https://en.cppreference.com/w/cpp/utility/in_place
|
||||
struct in_place_t {};
|
||||
constexpr in_place_t in_place = {};
|
||||
|
||||
// base::in_place_type_t is an implementation of std::in_place_type_t from
|
||||
// C++17. A tag type used for in-place construction when the type to construct
|
||||
// needs to be specified, such as with base::unique_any, designed to be a
|
||||
// drop-in replacement.
|
||||
|
||||
// Specification:
|
||||
// http://en.cppreference.com/w/cpp/utility/in_place
|
||||
template <typename T>
|
||||
struct in_place_type_t {};
|
||||
|
||||
template <typename T>
|
||||
struct is_in_place_type_t {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
struct is_in_place_type_t<in_place_type_t<Ts...>> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
// C++14 implementation of C++17's std::bool_constant.
|
||||
//
|
||||
// Reference: https://en.cppreference.com/w/cpp/types/integral_constant
|
||||
// Specification: https://wg21.link/meta.type.synop
|
||||
template <bool B>
|
||||
using bool_constant = std::integral_constant<bool, B>;
|
||||
|
||||
// C++14 implementation of C++17's std::conjunction.
|
||||
//
|
||||
// Reference: https://en.cppreference.com/w/cpp/types/conjunction
|
||||
// Specification: https://wg21.link/meta.logical#1.itemdecl:1
|
||||
template <typename...>
|
||||
struct conjunction : std::true_type {};
|
||||
|
||||
template <typename B1>
|
||||
struct conjunction<B1> : B1 {};
|
||||
|
||||
template <typename B1, typename... Bn>
|
||||
struct conjunction<B1, Bn...>
|
||||
: std::conditional_t<static_cast<bool>(B1::value), conjunction<Bn...>, B1> {
|
||||
};
|
||||
|
||||
// C++14 implementation of C++17's std::disjunction.
|
||||
//
|
||||
// Reference: https://en.cppreference.com/w/cpp/types/disjunction
|
||||
// Specification: https://wg21.link/meta.logical#itemdecl:2
|
||||
template <typename...>
|
||||
struct disjunction : std::false_type {};
|
||||
|
||||
template <typename B1>
|
||||
struct disjunction<B1> : B1 {};
|
||||
|
||||
template <typename B1, typename... Bn>
|
||||
struct disjunction<B1, Bn...>
|
||||
: std::conditional_t<static_cast<bool>(B1::value), B1, disjunction<Bn...>> {
|
||||
};
|
||||
|
||||
// C++14 implementation of C++17's std::negation.
|
||||
//
|
||||
// Reference: https://en.cppreference.com/w/cpp/types/negation
|
||||
// Specification: https://wg21.link/meta.logical#itemdecl:3
|
||||
template <typename B>
|
||||
struct negation : bool_constant<!static_cast<bool>(B::value)> {};
|
||||
|
||||
// Implementation of C++17's invoke_result.
|
||||
//
|
||||
// This implementation adds references to `Functor` and `Args` to work around
|
||||
// some quirks of std::result_of. See the #Notes section of [1] for details.
|
||||
//
|
||||
// References:
|
||||
// [1] https://en.cppreference.com/w/cpp/types/result_of
|
||||
// [2] https://wg21.link/meta.trans.other#lib:invoke_result
|
||||
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
|
||||
template <typename Functor, typename... Args>
|
||||
using invoke_result = std::invoke_result<Functor, Args...>;
|
||||
#else
|
||||
template <typename Functor, typename... Args>
|
||||
using invoke_result = std::result_of<Functor && (Args && ...)>;
|
||||
#endif
|
||||
|
||||
// Implementation of C++17's std::invoke_result_t.
|
||||
//
|
||||
// Reference: https://wg21.link/meta.type.synop#lib:invoke_result_t
|
||||
template <typename Functor, typename... Args>
|
||||
using invoke_result_t = typename invoke_result<Functor, Args...>::type;
|
||||
|
||||
namespace internal {
|
||||
|
||||
// Base case, `InvokeResult` does not have a nested type member. This means `F`
|
||||
// could not be invoked with `Args...` and thus is not invocable.
|
||||
template <typename InvokeResult, typename R, typename = void>
|
||||
struct IsInvocableImpl : std::false_type {};
|
||||
|
||||
// Happy case, `InvokeResult` does have a nested type member. Now check whether
|
||||
// `InvokeResult::type` is convertible to `R`. Short circuit in case
|
||||
// `std::is_void<R>`.
|
||||
template <typename InvokeResult, typename R>
|
||||
struct IsInvocableImpl<InvokeResult, R, void_t<typename InvokeResult::type>>
|
||||
: disjunction<std::is_void<R>,
|
||||
std::is_convertible<typename InvokeResult::type, R>> {};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
// Implementation of C++17's std::is_invocable_r.
|
||||
//
|
||||
// Returns whether `F` can be invoked with `Args...` and the result is
|
||||
// convertible to `R`.
|
||||
//
|
||||
// Reference: https://wg21.link/meta.rel#lib:is_invocable_r
|
||||
template <typename R, typename F, typename... Args>
|
||||
struct is_invocable_r
|
||||
: internal::IsInvocableImpl<invoke_result<F, Args...>, R> {};
|
||||
|
||||
// Implementation of C++17's std::is_invocable.
|
||||
//
|
||||
// Returns whether `F` can be invoked with `Args...`.
|
||||
//
|
||||
// Reference: https://wg21.link/meta.rel#lib:is_invocable
|
||||
template <typename F, typename... Args>
|
||||
struct is_invocable : is_invocable_r<void, F, Args...> {};
|
||||
|
||||
namespace internal {
|
||||
|
||||
// The indirection with std::is_enum<T> is required, because instantiating
|
||||
// std::underlying_type_t<T> when T is not an enum is UB prior to C++20.
|
||||
template <typename T, bool = std::is_enum<T>::value>
|
||||
struct IsScopedEnumImpl : std::false_type {};
|
||||
|
||||
template <typename T>
|
||||
struct IsScopedEnumImpl<T, /*std::is_enum<T>::value=*/true>
|
||||
: negation<std::is_convertible<T, std::underlying_type_t<T>>> {};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
// Implementation of C++23's std::is_scoped_enum
|
||||
//
|
||||
// Reference: https://en.cppreference.com/w/cpp/types/is_scoped_enum
|
||||
template <typename T>
|
||||
struct is_scoped_enum : internal::IsScopedEnumImpl<T> {};
|
||||
|
||||
// Implementation of C++20's std::remove_cvref.
|
||||
//
|
||||
// References:
|
||||
// - https://en.cppreference.com/w/cpp/types/remove_cvref
|
||||
// - https://wg21.link/meta.trans.other#lib:remove_cvref
|
||||
template <typename T>
|
||||
struct remove_cvref {
|
||||
using type = std::remove_cv_t<std::remove_reference_t<T>>;
|
||||
};
|
||||
|
||||
// Implementation of C++20's std::remove_cvref_t.
|
||||
//
|
||||
// References:
|
||||
// - https://en.cppreference.com/w/cpp/types/remove_cvref
|
||||
// - https://wg21.link/meta.type.synop#lib:remove_cvref_t
|
||||
template <typename T>
|
||||
using remove_cvref_t = typename remove_cvref<T>::type;
|
||||
|
||||
// Simplified implementation of C++20's std::iter_value_t.
|
||||
// As opposed to std::iter_value_t, this implementation does not restrict
|
||||
// the type of `Iter` and does not consider specializations of
|
||||
// `indirectly_readable_traits`.
|
||||
//
|
||||
// Reference: https://wg21.link/readable.traits#2
|
||||
template <typename Iter>
|
||||
using iter_value_t =
|
||||
typename std::iterator_traits<remove_cvref_t<Iter>>::value_type;
|
||||
|
||||
// Simplified implementation of C++20's std::iter_reference_t.
|
||||
// As opposed to std::iter_reference_t, this implementation does not restrict
|
||||
// the type of `Iter`.
|
||||
//
|
||||
// Reference: https://wg21.link/iterator.synopsis#:~:text=iter_reference_t
|
||||
template <typename Iter>
|
||||
using iter_reference_t = decltype(*std::declval<Iter&>());
|
||||
|
||||
// Simplified implementation of C++20's std::indirect_result_t. As opposed to
|
||||
// std::indirect_result_t, this implementation does not restrict the type of
|
||||
// `Func` and `Iters`.
|
||||
//
|
||||
// Reference: https://wg21.link/iterator.synopsis#:~:text=indirect_result_t
|
||||
template <typename Func, typename... Iters>
|
||||
using indirect_result_t = invoke_result_t<Func, iter_reference_t<Iters>...>;
|
||||
|
||||
// Simplified implementation of C++20's std::projected. As opposed to
|
||||
// std::projected, this implementation does not explicitly restrict the type of
|
||||
// `Iter` and `Proj`, but rather does so implicitly by requiring
|
||||
// `indirect_result_t<Proj, Iter>` is a valid type. This is required for SFINAE
|
||||
// friendliness.
|
||||
//
|
||||
// Reference: https://wg21.link/projected
|
||||
template <typename Iter,
|
||||
typename Proj,
|
||||
typename IndirectResultT = indirect_result_t<Proj, Iter>>
|
||||
struct projected {
|
||||
using value_type = remove_cvref_t<IndirectResultT>;
|
||||
|
||||
IndirectResultT operator*() const; // not defined
|
||||
};
|
||||
|
||||
} // namespace base
|
||||
|
||||
#undef CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX
|
||||
#undef CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX
|
||||
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_
|
@@ -68,7 +68,6 @@
|
||||
#include "include/base/cef_build.h"
|
||||
#include "include/base/cef_compiler_specific.h"
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_template_util.h"
|
||||
#include "include/base/cef_weak_ptr.h"
|
||||
#include "include/base/internal/cef_callback_internal.h"
|
||||
#include "include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h"
|
||||
@@ -356,14 +355,14 @@ template <typename Functor, typename SFINAE = void>
|
||||
struct IsCallableObject : std::false_type {};
|
||||
|
||||
template <typename Callable>
|
||||
struct IsCallableObject<Callable, void_t<decltype(&Callable::operator())>>
|
||||
struct IsCallableObject<Callable, std::void_t<decltype(&Callable::operator())>>
|
||||
: std::true_type {};
|
||||
|
||||
// HasRefCountedTypeAsRawPtr inherits from true_type when any of the |Args| is a
|
||||
// raw pointer to a RefCounted type.
|
||||
template <typename... Ts>
|
||||
struct HasRefCountedTypeAsRawPtr
|
||||
: disjunction<NeedsScopedRefptrButGetsRawPtr<Ts>...> {};
|
||||
: std::disjunction<NeedsScopedRefptrButGetsRawPtr<Ts>...> {};
|
||||
|
||||
// ForceVoidReturn<>
|
||||
//
|
||||
@@ -878,7 +877,7 @@ BanUnconstructedRefCountedReceiver(const Receiver& receiver, Unused&&...) {
|
||||
// This stores all the state passed into Bind().
|
||||
template <typename Functor, typename... BoundArgs>
|
||||
struct BindState final : BindStateBase {
|
||||
using IsCancellable = bool_constant<
|
||||
using IsCancellable = std::bool_constant<
|
||||
CallbackCancellationTraits<Functor,
|
||||
std::tuple<BoundArgs...>>::is_cancellable>;
|
||||
template <typename ForwardFunctor, typename... ForwardBoundArgs>
|
||||
@@ -1252,7 +1251,7 @@ decltype(auto) BindImpl(Functor&& functor, Args&&... args) {
|
||||
// PolymorphicInvoke, to which CallbackType will cast back.
|
||||
using PolymorphicInvoke = typename CallbackType::PolymorphicInvoke;
|
||||
PolymorphicInvoke invoke_func =
|
||||
GetInvokeFunc<Invoker>(bool_constant<kIsOnce>());
|
||||
GetInvokeFunc<Invoker>(std::bool_constant<kIsOnce>());
|
||||
|
||||
using InvokeFuncStorage = BindStateBase::InvokeFuncStorage;
|
||||
return CallbackType(BindState::Create(
|
||||
|
@@ -34,8 +34,6 @@
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include "include/base/cef_template_util.h"
|
||||
|
||||
// It is dangerous to post a task with a T* argument where T is a subtype of
|
||||
// RefCounted(Base|ThreadSafeBase), since by the time the parameter is used, the
|
||||
// object may already have been deleted since it was not held with a
|
||||
@@ -54,16 +52,16 @@ struct IsRefCountedType : std::false_type {};
|
||||
|
||||
template <typename T>
|
||||
struct IsRefCountedType<T,
|
||||
void_t<decltype(std::declval<T*>()->AddRef()),
|
||||
decltype(std::declval<T*>()->Release())>>
|
||||
std::void_t<decltype(std::declval<T*>()->AddRef()),
|
||||
decltype(std::declval<T*>()->Release())>>
|
||||
: std::true_type {};
|
||||
|
||||
// Human readable translation: you needed to be a scoped_refptr if you are a raw
|
||||
// pointer type and are convertible to a RefCounted(Base|ThreadSafeBase) type.
|
||||
template <typename T>
|
||||
struct NeedsScopedRefptrButGetsRawPtr
|
||||
: conjunction<std::is_pointer<T>,
|
||||
IsRefCountedType<std::remove_pointer_t<T>>> {
|
||||
: std::conjunction<std::is_pointer<T>,
|
||||
IsRefCountedType<std::remove_pointer_t<T>>> {
|
||||
static_assert(!std::is_reference<T>::value,
|
||||
"NeedsScopedRefptrButGetsRawPtr requires non-reference type.");
|
||||
};
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=94e93810316b74e54eb315d97c6fc6f1cc0c9cc5$
|
||||
// $hash=d49d6b19e52e8a0496c69ec5cbd00750f7ac4740$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_DELEGATE_CAPI_H_
|
||||
@@ -124,9 +124,8 @@ typedef struct _cef_browser_view_delegate_t {
|
||||
///
|
||||
/// Called when |browser_view| receives a gesture command. Return true (1) to
|
||||
/// handle (or disable) a |gesture_command| or false (0) to propagate the
|
||||
/// gesture to the browser for default handling. This function will only be
|
||||
/// called with the Alloy runtime. To handle these commands with the Chrome
|
||||
/// runtime implement cef_command_handler_t::OnChromeCommand instead.
|
||||
/// gesture to the browser for default handling. With the Chrome runtime these
|
||||
/// commands can also be handled via cef_command_handler_t::OnChromeCommand.
|
||||
///
|
||||
int(CEF_CALLBACK* on_gesture_command)(
|
||||
struct _cef_browser_view_delegate_t* self,
|
||||
|
@@ -118,9 +118,8 @@ class CefBrowserViewDelegate : public CefViewDelegate {
|
||||
///
|
||||
/// Called when |browser_view| receives a gesture command. Return true to
|
||||
/// handle (or disable) a |gesture_command| or false to propagate the gesture
|
||||
/// to the browser for default handling. This method will only be called with
|
||||
/// the Alloy runtime. To handle these commands with the Chrome runtime
|
||||
/// implement CefCommandHandler::OnChromeCommand instead.
|
||||
/// to the browser for default handling. With the Chrome runtime these
|
||||
/// commands can also be handled via CefCommandHandler::OnChromeCommand.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool OnGestureCommand(CefRefPtr<CefBrowserView> browser_view,
|
||||
|
@@ -70,6 +70,13 @@ void ChromeBrowserView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
|
||||
browser_view_delegate_->OnBoundsChanged();
|
||||
}
|
||||
|
||||
void ChromeBrowserView::OnGestureEvent(ui::GestureEvent* event) {
|
||||
if (browser_view_delegate_->OnGestureEvent(event)) {
|
||||
return;
|
||||
}
|
||||
ParentClass::OnGestureEvent(event);
|
||||
}
|
||||
|
||||
ToolbarView* ChromeBrowserView::OverrideCreateToolbar(
|
||||
Browser* browser,
|
||||
BrowserView* browser_view) {
|
||||
|
@@ -45,6 +45,7 @@ class ChromeBrowserView
|
||||
const views::ViewHierarchyChangedDetails& details) override;
|
||||
void AddedToWidget() override;
|
||||
void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
|
||||
void OnGestureEvent(ui::GestureEvent* event) override;
|
||||
|
||||
// BrowserView methods:
|
||||
ToolbarView* OverrideCreateToolbar(Browser* browser,
|
||||
|
@@ -273,8 +273,8 @@ void CefMainRunner::Shutdown(base::OnceClosure shutdown_on_ui_thread,
|
||||
void CefMainRunner::RunMessageLoop() {
|
||||
base::RunLoop run_loop;
|
||||
|
||||
DCHECK(quit_when_idle_callback_.is_null());
|
||||
quit_when_idle_callback_ = run_loop.QuitWhenIdleClosure();
|
||||
DCHECK(quit_callback_.is_null());
|
||||
quit_callback_ = run_loop.QuitClosure();
|
||||
|
||||
main_delegate_->BeforeMainMessageLoopRun(&run_loop);
|
||||
|
||||
@@ -283,11 +283,11 @@ void CefMainRunner::RunMessageLoop() {
|
||||
}
|
||||
|
||||
void CefMainRunner::QuitMessageLoop() {
|
||||
if (!quit_when_idle_callback_.is_null()) {
|
||||
if (!quit_callback_.is_null()) {
|
||||
if (main_delegate_->HandleMainMessageLoopQuit()) {
|
||||
return;
|
||||
}
|
||||
std::move(quit_when_idle_callback_).Run();
|
||||
std::move(quit_callback_).Run();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -89,7 +89,7 @@ class CefMainRunner : public CefMainRunnerHandler {
|
||||
std::unique_ptr<CefUIThread> ui_thread_;
|
||||
|
||||
// Used to quit the current base::RunLoop.
|
||||
base::OnceClosure quit_when_idle_callback_;
|
||||
base::OnceClosure quit_callback_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_MAIN_RUNNER_H_
|
||||
|
@@ -90,7 +90,7 @@ scoped_refptr<ui::PlatformCursor> ToPlatformCursor(
|
||||
if (ui_cursor.type() == ui::mojom::CursorType::kCustom) {
|
||||
platform_cursor = ui::CursorFactory::GetInstance()->CreateImageCursor(
|
||||
ui::mojom::CursorType::kCustom, ui_cursor.custom_bitmap(),
|
||||
ui_cursor.custom_hotspot());
|
||||
ui_cursor.custom_hotspot(), ui_cursor.image_scale_factor());
|
||||
} else {
|
||||
cursor_loader.SetDisplay(GetDisplay(browser));
|
||||
|
||||
|
@@ -13,8 +13,27 @@
|
||||
#include "libcef/browser/views/window_impl.h"
|
||||
|
||||
#include "content/public/browser/native_web_keyboard_event.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/content_accelerators/accelerator_util.h"
|
||||
|
||||
namespace {
|
||||
|
||||
absl::optional<cef_gesture_command_t> GetGestureCommand(
|
||||
ui::GestureEvent* event) {
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
if (event->details().type() == ui::ET_GESTURE_SWIPE) {
|
||||
if (event->details().swipe_left()) {
|
||||
return CEF_GESTURE_COMMAND_BACK;
|
||||
} else if (event->details().swipe_right()) {
|
||||
return CEF_GESTURE_COMMAND_FORWARD;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
CefRefPtr<CefBrowserView> CefBrowserView::CreateBrowserView(
|
||||
CefRefPtr<CefClient> client,
|
||||
@@ -218,21 +237,27 @@ void CefBrowserViewImpl::OnBoundsChanged() {
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserViewImpl::OnGestureCommand(cef_gesture_command_t command) {
|
||||
if (delegate()->OnGestureCommand(this, command)) {
|
||||
return;
|
||||
}
|
||||
bool CefBrowserViewImpl::OnGestureEvent(ui::GestureEvent* event) {
|
||||
if (auto command = GetGestureCommand(event)) {
|
||||
if (delegate() && delegate()->OnGestureCommand(this, *command)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (browser_) {
|
||||
switch (command) {
|
||||
case CEF_GESTURE_COMMAND_BACK:
|
||||
browser_->GoBack();
|
||||
break;
|
||||
case CEF_GESTURE_COMMAND_FORWARD:
|
||||
browser_->GoForward();
|
||||
break;
|
||||
if (!cef::IsChromeRuntimeEnabled() && browser_) {
|
||||
// Default handling for the Alloy runtime.
|
||||
switch (*command) {
|
||||
case CEF_GESTURE_COMMAND_BACK:
|
||||
browser_->GoBack();
|
||||
break;
|
||||
case CEF_GESTURE_COMMAND_FORWARD:
|
||||
browser_->GoForward();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
CefBrowserViewImpl::CefBrowserViewImpl(
|
||||
|
@@ -74,7 +74,7 @@ class CefBrowserViewImpl
|
||||
// CefBrowserViewView::Delegate methods:
|
||||
void OnBrowserViewAdded() override;
|
||||
void OnBoundsChanged() override;
|
||||
void OnGestureCommand(cef_gesture_command_t command) override;
|
||||
bool OnGestureEvent(ui::GestureEvent* event) override;
|
||||
|
||||
// Return the WebView representation of this object.
|
||||
views::WebView* web_view() const;
|
||||
|
@@ -4,28 +4,8 @@
|
||||
|
||||
#include "libcef/browser/views/browser_view_view.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "libcef/browser/views/browser_view_impl.h"
|
||||
|
||||
namespace {
|
||||
|
||||
std::optional<cef_gesture_command_t> GetGestureCommand(
|
||||
ui::GestureEvent* event) {
|
||||
#if defined(OS_MAC)
|
||||
if (event->details().type() == ui::ET_GESTURE_SWIPE) {
|
||||
if (event->details().swipe_left()) {
|
||||
return cef_gesture_command_t::CEF_GESTURE_COMMAND_BACK;
|
||||
} else if (event->details().swipe_right()) {
|
||||
return cef_gesture_command_t::CEF_GESTURE_COMMAND_FORWARD;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
CefBrowserViewView::CefBrowserViewView(CefBrowserViewDelegate* cef_delegate,
|
||||
Delegate* browser_view_delegate)
|
||||
: ParentClass(cef_delegate), browser_view_delegate_(browser_view_delegate) {
|
||||
@@ -60,7 +40,8 @@ void CefBrowserViewView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
|
||||
}
|
||||
|
||||
void CefBrowserViewView::OnGestureEvent(ui::GestureEvent* event) {
|
||||
if (auto command = GetGestureCommand(event)) {
|
||||
browser_view_delegate_->OnGestureCommand(*command);
|
||||
if (browser_view_delegate_->OnGestureEvent(event)) {
|
||||
return;
|
||||
}
|
||||
ParentClass::OnGestureEvent(event);
|
||||
}
|
||||
|
@@ -41,8 +41,9 @@ class CefBrowserViewView
|
||||
// Called when the BrowserView bounds have changed.
|
||||
virtual void OnBoundsChanged() = 0;
|
||||
|
||||
// Called when the BrowserView receives a gesture command.
|
||||
virtual void OnGestureCommand(cef_gesture_command_t command) = 0;
|
||||
// Called when the BrowserView receives a gesture event.
|
||||
// Returns true if the gesture was handled.
|
||||
virtual bool OnGestureEvent(ui::GestureEvent* event) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~Delegate() {}
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include "net/base/features.h"
|
||||
#include "sandbox/policy/switches.h"
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/common/switches.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
#include "ui/base/ui_base_features.h"
|
||||
@@ -271,6 +272,15 @@ absl::optional<int> AlloyMainDelegate::BasicStartupComplete() {
|
||||
disable_features.push_back(features::kBackForwardCache.name);
|
||||
}
|
||||
|
||||
if (blink::features::kDocumentPictureInPictureAPI.default_state ==
|
||||
base::FEATURE_ENABLED_BY_DEFAULT) {
|
||||
// Disable DocumentPictureInPictureAPI globally so that
|
||||
// blink::RuntimeEnabledFeatures::DocumentPictureInPictureAPIEnabled
|
||||
// reports the correct value in the renderer process (see issue #3448).
|
||||
disable_features.push_back(
|
||||
blink::features::kDocumentPictureInPictureAPI.name);
|
||||
}
|
||||
|
||||
if (!disable_features.empty()) {
|
||||
DCHECK(!base::FeatureList::GetInstance());
|
||||
std::string disable_features_str =
|
||||
|
@@ -61,19 +61,19 @@ void ChromeMainRunnerDelegate::BeforeMainMessageLoopRun(
|
||||
keep_alive_ = std::make_unique<ScopedKeepAlive>(
|
||||
KeepAliveOrigin::APP_CONTROLLER, KeepAliveRestartOption::DISABLED);
|
||||
|
||||
// The idle callback will be executed from BrowserProcessImpl::Unpin() via
|
||||
// The QuitClosure will be executed from BrowserProcessImpl::Unpin() via
|
||||
// KeepAliveRegistry when the last ScopedKeepAlive is released.
|
||||
// ScopedKeepAlives are also held by Browser objects.
|
||||
DCHECK(g_browser_process);
|
||||
static_cast<BrowserProcessImpl*>(g_browser_process)
|
||||
->SetQuitClosure(run_loop->QuitWhenIdleClosure());
|
||||
->SetQuitClosure(run_loop->QuitClosure());
|
||||
}
|
||||
|
||||
bool ChromeMainRunnerDelegate::HandleMainMessageLoopQuit() {
|
||||
// May be called multiple times. See comments in RunMainMessageLoopBefore.
|
||||
keep_alive_.reset();
|
||||
|
||||
// Cancel direct execution of the QuitWhenIdleClosure() in
|
||||
// Cancel direct execution of the QuitClosure() in
|
||||
// CefMainRunner::QuitMessageLoop. We instead wait for all Chrome browser
|
||||
// windows to exit.
|
||||
return true;
|
||||
|
@@ -639,5 +639,17 @@ patches = [
|
||||
# win/linux: Fix rounding errors with Screen[Win] DIP/pixel conversions.
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=1443650#c18
|
||||
'name': 'screen_1443650'
|
||||
},
|
||||
{
|
||||
# mac: Keep bubble popups on-screen.
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=893292#c10
|
||||
'name': 'mac_platform_style_bubble_893292'
|
||||
},
|
||||
{
|
||||
# win: Add support for "force-light-mode" command-line option.
|
||||
# mac: Add support for "force-light-mode" and "force-dark-mode".
|
||||
# https://github.com/chromiumembedded/cef/issues/3534
|
||||
# https://chromium-review.googlesource.com/c/chromium/src/+/4766248
|
||||
'name': 'light_mode_3534'
|
||||
}
|
||||
]
|
||||
|
@@ -20,10 +20,10 @@ index 2bfca65cd8d13..0a5b7a68fca46 100644
|
||||
|
||||
// Make an exception to allow most visited tiles to commit in
|
||||
diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc
|
||||
index 948ee821dfea0..d63fd2bb9508b 100644
|
||||
index a09b5bc4973fc..3593dd66d977f 100644
|
||||
--- content/browser/renderer_host/navigation_request.cc
|
||||
+++ content/browser/renderer_host/navigation_request.cc
|
||||
@@ -7281,10 +7281,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
|
||||
@@ -7301,10 +7301,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
|
||||
bool use_opaque_origin =
|
||||
(sandbox_flags & network::mojom::WebSandboxFlags::kOrigin) ==
|
||||
network::mojom::WebSandboxFlags::kOrigin;
|
||||
@@ -47,9 +47,9 @@ index 948ee821dfea0..d63fd2bb9508b 100644
|
||||
}
|
||||
|
||||
return origin_and_debug_info;
|
||||
@@ -7314,6 +7326,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
|
||||
GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
|
||||
SandboxFlagsToCommit());
|
||||
@@ -7408,6 +7420,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
|
||||
DetermineInitiatorRelationship(initiator_rfh,
|
||||
frame_tree_node_->current_frame_host()));
|
||||
|
||||
+ if (origin_with_debug_info.first.opaque() &&
|
||||
+ origin_with_debug_info.second.find("cef_nonstandard") !=
|
||||
|
@@ -13,10 +13,10 @@ index 9d9c17ffd6474..4eb79c65369af 100644
|
||||
};
|
||||
|
||||
diff --git content/public/browser/webui_config_map.h content/public/browser/webui_config_map.h
|
||||
index 19777632921fc..a22db4c49fd84 100644
|
||||
index a80034506bf45..4bda477df0558 100644
|
||||
--- content/public/browser/webui_config_map.h
|
||||
+++ content/public/browser/webui_config_map.h
|
||||
@@ -60,6 +60,10 @@ class CONTENT_EXPORT WebUIConfigMap {
|
||||
@@ -61,6 +61,10 @@ class CONTENT_EXPORT WebUIConfigMap {
|
||||
// Returns the size of the map, i.e. how many WebUIConfigs are registered.
|
||||
size_t GetSizeForTesting() { return configs_map_.size(); }
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn
|
||||
index d751ddbb3fd58..87941c9f50dac 100644
|
||||
index ae742b0b85a50..5bf9b34cd3e3b 100644
|
||||
--- build/config/compiler/BUILD.gn
|
||||
+++ build/config/compiler/BUILD.gn
|
||||
@@ -2051,8 +2051,6 @@ config("thin_archive") {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
|
||||
index c7ff5942d379b..c6d138ad64f95 100644
|
||||
index 01194da83fe3f..dd65ddd171c54 100644
|
||||
--- chrome/browser/BUILD.gn
|
||||
+++ chrome/browser/BUILD.gn
|
||||
@@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni")
|
||||
@@ -10,7 +10,7 @@ index c7ff5942d379b..c6d138ad64f95 100644
|
||||
import("//chrome/browser/buildflags.gni")
|
||||
import("//chrome/browser/downgrade/buildflags.gni")
|
||||
import("//chrome/common/features.gni")
|
||||
@@ -1965,6 +1966,7 @@ static_library("browser") {
|
||||
@@ -1969,6 +1970,7 @@ static_library("browser") {
|
||||
"//build/config/chromebox_for_meetings:buildflags",
|
||||
"//build/config/compiler:compiler_buildflags",
|
||||
"//cc",
|
||||
@@ -18,7 +18,7 @@ index c7ff5942d379b..c6d138ad64f95 100644
|
||||
"//chrome:extra_resources",
|
||||
"//chrome:resources",
|
||||
"//chrome:strings",
|
||||
@@ -2556,6 +2558,10 @@ static_library("browser") {
|
||||
@@ -2564,6 +2566,10 @@ static_library("browser") {
|
||||
]
|
||||
}
|
||||
|
||||
|
@@ -13,7 +13,7 @@ index 2480282a19d12..dbd1fbf8a15b5 100644
|
||||
return false;
|
||||
}
|
||||
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
|
||||
index 16bf45bea457e..d9db045e7bd68 100644
|
||||
index d7bb16c28835b..e5931106d9e05 100644
|
||||
--- chrome/browser/ui/BUILD.gn
|
||||
+++ chrome/browser/ui/BUILD.gn
|
||||
@@ -9,6 +9,7 @@ import("//build/config/compiler/compiler.gni")
|
||||
@@ -43,7 +43,7 @@ index 16bf45bea457e..d9db045e7bd68 100644
|
||||
"//chrome:resources",
|
||||
"//chrome:strings",
|
||||
"//chrome/app:chrome_dll_resources",
|
||||
@@ -2726,6 +2732,8 @@ static_library("ui") {
|
||||
@@ -2727,6 +2733,8 @@ static_library("ui") {
|
||||
"views/apps/app_dialog/app_block_dialog_view.h",
|
||||
"views/apps/app_dialog/app_pause_dialog_view.cc",
|
||||
"views/apps/app_dialog/app_pause_dialog_view.h",
|
||||
@@ -52,7 +52,7 @@ index 16bf45bea457e..d9db045e7bd68 100644
|
||||
"views/apps/app_info_dialog/arc_app_info_links_panel.cc",
|
||||
"views/apps/app_info_dialog/arc_app_info_links_panel.h",
|
||||
"views/apps/chrome_app_window_client_views_chromeos.cc",
|
||||
@@ -4528,8 +4536,6 @@ static_library("ui") {
|
||||
@@ -4529,8 +4537,6 @@ static_library("ui") {
|
||||
"views/accessibility/theme_tracking_non_accessible_image_view.h",
|
||||
"views/apps/app_dialog/app_dialog_view.cc",
|
||||
"views/apps/app_dialog/app_dialog_view.h",
|
||||
@@ -61,7 +61,7 @@ index 16bf45bea457e..d9db045e7bd68 100644
|
||||
"views/apps/app_info_dialog/app_info_dialog_container.cc",
|
||||
"views/apps/app_info_dialog/app_info_dialog_container.h",
|
||||
"views/apps/app_info_dialog/app_info_dialog_views.cc",
|
||||
@@ -6135,6 +6141,7 @@ static_library("ui") {
|
||||
@@ -6141,6 +6147,7 @@ static_library("ui") {
|
||||
if (enable_printing) {
|
||||
deps += [
|
||||
"//components/printing/browser",
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git chrome/browser/renderer_context_menu/render_view_context_menu.cc chrome/browser/renderer_context_menu/render_view_context_menu.cc
|
||||
index 2ab92db1a1136..dc9f25b79f3bd 100644
|
||||
index 7f04636806afe..b08bd90bf0681 100644
|
||||
--- chrome/browser/renderer_context_menu/render_view_context_menu.cc
|
||||
+++ chrome/browser/renderer_context_menu/render_view_context_menu.cc
|
||||
@@ -330,6 +330,13 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() {
|
||||
@@ -331,6 +331,13 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() {
|
||||
return callback.get();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ index 2ab92db1a1136..dc9f25b79f3bd 100644
|
||||
enum class UmaEnumIdLookupType {
|
||||
GeneralEnumId,
|
||||
ContextSpecificEnumId,
|
||||
@@ -577,6 +584,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) {
|
||||
@@ -580,6 +587,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) {
|
||||
if (ContextMenuMatcher::IsExtensionsCustomCommandId(id))
|
||||
return 1;
|
||||
|
||||
@@ -27,7 +27,7 @@ index 2ab92db1a1136..dc9f25b79f3bd 100644
|
||||
id = CollapseCommandsForUMA(id);
|
||||
const auto& map = GetIdcToUmaMap(type);
|
||||
auto it = map.find(id);
|
||||
@@ -824,6 +835,14 @@ RenderViewContextMenu::RenderViewContextMenu(
|
||||
@@ -827,6 +838,14 @@ RenderViewContextMenu::RenderViewContextMenu(
|
||||
#if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
|
||||
pdf_ocr_submenu_model_ = std::make_unique<ui::SimpleMenuModel>(this);
|
||||
#endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
|
||||
@@ -42,7 +42,7 @@ index 2ab92db1a1136..dc9f25b79f3bd 100644
|
||||
}
|
||||
|
||||
RenderViewContextMenu::~RenderViewContextMenu() = default;
|
||||
@@ -1260,6 +1279,12 @@ void RenderViewContextMenu::InitMenu() {
|
||||
@@ -1263,6 +1282,12 @@ void RenderViewContextMenu::InitMenu() {
|
||||
autofill::PopupHidingReason::kContextMenuOpened);
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ index 2ab92db1a1136..dc9f25b79f3bd 100644
|
||||
}
|
||||
|
||||
Profile* RenderViewContextMenu::GetProfile() const {
|
||||
@@ -3281,6 +3306,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting(
|
||||
@@ -3302,6 +3327,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting(
|
||||
execute_plugin_action_callback_ = std::move(cb);
|
||||
}
|
||||
|
||||
|
@@ -99,7 +99,7 @@ index a3ee1846fcf77..13edaf1203d69 100644
|
||||
return raw_otr_profile;
|
||||
}
|
||||
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
|
||||
index 92dec1c25477c..0723bdb6bc6ad 100644
|
||||
index 9eb766c7a5818..3a66b90b55dd6 100644
|
||||
--- chrome/browser/profiles/profile_manager.cc
|
||||
+++ chrome/browser/profiles/profile_manager.cc
|
||||
@@ -389,7 +389,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
|
||||
@@ -112,7 +112,7 @@ index 92dec1c25477c..0723bdb6bc6ad 100644
|
||||
|
||||
zombie_metrics_timer_.Start(FROM_HERE, base::Minutes(30), this,
|
||||
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
|
||||
index 60c9fd19fe15b..2a3e317d9c240 100644
|
||||
index 9bb7cd968c95d..bf16634f7dfe8 100644
|
||||
--- chrome/browser/profiles/profile_manager.h
|
||||
+++ chrome/browser/profiles/profile_manager.h
|
||||
@@ -130,7 +130,7 @@ class ProfileManager : public Profile::Delegate {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn
|
||||
index d0d299f92a292..3bee2edbcd073 100644
|
||||
index 408c5117c7e92..ce620089a5616 100644
|
||||
--- chrome/browser/safe_browsing/BUILD.gn
|
||||
+++ chrome/browser/safe_browsing/BUILD.gn
|
||||
@@ -32,6 +32,7 @@ static_library("safe_browsing") {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn
|
||||
index 75bb3119411d2..462fa070d07a8 100644
|
||||
index 76f0adaaa659d..ec6b3ac2bcd55 100644
|
||||
--- chrome/renderer/BUILD.gn
|
||||
+++ chrome/renderer/BUILD.gn
|
||||
@@ -5,6 +5,7 @@
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc
|
||||
index 3a1539905f1fb..84071f39325a2 100644
|
||||
index d55fc46d9dc0a..0f4dd2b3e68f9 100644
|
||||
--- chrome/app/chrome_main_delegate.cc
|
||||
+++ chrome/app/chrome_main_delegate.cc
|
||||
@@ -40,6 +40,7 @@
|
||||
@@ -10,7 +10,7 @@ index 3a1539905f1fb..84071f39325a2 100644
|
||||
#include "chrome/browser/buildflags.h"
|
||||
#include "chrome/browser/chrome_content_browser_client.h"
|
||||
#include "chrome/browser/chrome_resource_bundle_helper.h"
|
||||
@@ -504,6 +505,8 @@ struct MainFunction {
|
||||
@@ -505,6 +506,8 @@ struct MainFunction {
|
||||
|
||||
// Initializes the user data dir. Must be called before InitializeLocalState().
|
||||
void InitializeUserDataDir(base::CommandLine* command_line) {
|
||||
@@ -19,7 +19,7 @@ index 3a1539905f1fb..84071f39325a2 100644
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// Reach out to chrome_elf for the truth on the user data directory.
|
||||
// Note that in tests, this links to chrome_elf_test_stubs.
|
||||
@@ -653,6 +656,10 @@ ChromeMainDelegate::~ChromeMainDelegate() {
|
||||
@@ -654,6 +657,10 @@ ChromeMainDelegate::~ChromeMainDelegate() {
|
||||
ChromeMainDelegate::~ChromeMainDelegate() = default;
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
@@ -30,7 +30,7 @@ index 3a1539905f1fb..84071f39325a2 100644
|
||||
absl::optional<int> ChromeMainDelegate::PostEarlyInitialization(
|
||||
InvokedIn invoked_in) {
|
||||
DCHECK(base::ThreadPoolInstance::Get());
|
||||
@@ -876,7 +883,8 @@ absl::optional<int> ChromeMainDelegate::PostEarlyInitialization(
|
||||
@@ -877,7 +884,8 @@ absl::optional<int> ChromeMainDelegate::PostEarlyInitialization(
|
||||
|
||||
if (base::FeatureList::IsEnabled(
|
||||
features::kWriteBasicSystemProfileToPersistentHistogramsFile)) {
|
||||
@@ -40,7 +40,7 @@ index 3a1539905f1fb..84071f39325a2 100644
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
record =
|
||||
base::FeatureList::IsEnabled(chrome::android::kUmaBackgroundSessions);
|
||||
@@ -1304,6 +1312,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
@@ -1306,6 +1314,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
std::string process_type =
|
||||
command_line.GetSwitchValueASCII(switches::kProcessType);
|
||||
|
||||
@@ -48,7 +48,7 @@ index 3a1539905f1fb..84071f39325a2 100644
|
||||
crash_reporter::InitializeCrashKeys();
|
||||
|
||||
#if BUILDFLAG(IS_POSIX)
|
||||
@@ -1314,6 +1323,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
@@ -1316,6 +1325,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
InitMacCrashReporter(command_line, process_type);
|
||||
SetUpInstallerPreferences(command_line);
|
||||
#endif
|
||||
@@ -56,7 +56,7 @@ index 3a1539905f1fb..84071f39325a2 100644
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
child_process_logging::Init();
|
||||
@@ -1508,6 +1518,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
@@ -1510,6 +1520,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ index 3a1539905f1fb..84071f39325a2 100644
|
||||
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
|
||||
// Zygote needs to call InitCrashReporter() in RunZygote().
|
||||
if (process_type != switches::kZygoteProcess) {
|
||||
@@ -1551,6 +1562,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
@@ -1553,6 +1564,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
// After all the platform Breakpads have been initialized, store the command
|
||||
// line for crash reporting.
|
||||
crash_keys::SetCrashKeysFromCommandLine(command_line);
|
||||
@@ -72,7 +72,7 @@ index 3a1539905f1fb..84071f39325a2 100644
|
||||
|
||||
#if BUILDFLAG(ENABLE_PDF)
|
||||
MaybePatchGdiGetFontData();
|
||||
@@ -1670,6 +1682,7 @@ void ChromeMainDelegate::ZygoteForked() {
|
||||
@@ -1672,6 +1684,7 @@ void ChromeMainDelegate::ZygoteForked() {
|
||||
SetUpProfilingShutdownHandler();
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ index 3a1539905f1fb..84071f39325a2 100644
|
||||
// Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets
|
||||
// this up for the browser process in a different manner.
|
||||
const base::CommandLine* command_line =
|
||||
@@ -1692,6 +1705,7 @@ void ChromeMainDelegate::ZygoteForked() {
|
||||
@@ -1694,6 +1707,7 @@ void ChromeMainDelegate::ZygoteForked() {
|
||||
|
||||
// Reset the command line for the newly spawned process.
|
||||
crash_keys::SetCrashKeysFromCommandLine(*command_line);
|
||||
@@ -88,7 +88,7 @@ index 3a1539905f1fb..84071f39325a2 100644
|
||||
}
|
||||
|
||||
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
||||
@@ -1789,6 +1803,7 @@ void ChromeMainDelegate::InitializeMemorySystem() {
|
||||
@@ -1791,6 +1805,7 @@ void ChromeMainDelegate::InitializeMemorySystem() {
|
||||
channel == version_info::Channel::DEV);
|
||||
const bool gwp_asan_boost_sampling = is_canary_dev || is_browser_process;
|
||||
|
||||
@@ -96,7 +96,7 @@ index 3a1539905f1fb..84071f39325a2 100644
|
||||
memory_system::Initializer()
|
||||
.SetGwpAsanParameters(gwp_asan_boost_sampling, process_type)
|
||||
.SetProfilingClientParameters(channel,
|
||||
@@ -1797,5 +1812,5 @@ void ChromeMainDelegate::InitializeMemorySystem() {
|
||||
@@ -1799,5 +1814,5 @@ void ChromeMainDelegate::InitializeMemorySystem() {
|
||||
PoissonAllocationSamplerInclusion::kEnforce,
|
||||
memory_system::DispatcherParameters::
|
||||
AllocationTraceRecorderInclusion::kDynamic)
|
||||
@@ -233,7 +233,7 @@ index ad3976cb46454..b49f7467156ed 100644
|
||||
+#endif
|
||||
}
|
||||
diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc
|
||||
index 6c5105b963a03..7b326cbc9246c 100644
|
||||
index c9d9ffa8d77a3..43e1701c73f2b 100644
|
||||
--- chrome/browser/chrome_content_browser_client.cc
|
||||
+++ chrome/browser/chrome_content_browser_client.cc
|
||||
@@ -41,6 +41,7 @@
|
||||
@@ -265,7 +265,7 @@ index 6c5105b963a03..7b326cbc9246c 100644
|
||||
// static
|
||||
void ChromeContentBrowserClient::RegisterLocalStatePrefs(
|
||||
PrefRegistrySimple* registry) {
|
||||
@@ -4316,9 +4324,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
|
||||
@@ -4343,9 +4351,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
|
||||
&search::HandleNewTabURLReverseRewrite);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
@@ -277,7 +277,7 @@ index 6c5105b963a03..7b326cbc9246c 100644
|
||||
}
|
||||
|
||||
base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() {
|
||||
@@ -6335,7 +6345,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated(
|
||||
@@ -6362,7 +6372,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated(
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ index 6c5105b963a03..7b326cbc9246c 100644
|
||||
content::BrowserContext* context,
|
||||
bool in_memory,
|
||||
const base::FilePath& relative_partition_path,
|
||||
@@ -6353,6 +6363,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams(
|
||||
@@ -6380,6 +6390,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams(
|
||||
network_context_params->user_agent = GetUserAgentBasedOnPolicy(context);
|
||||
network_context_params->accept_language = GetApplicationLocale();
|
||||
}
|
||||
@@ -295,7 +295,7 @@ index 6c5105b963a03..7b326cbc9246c 100644
|
||||
}
|
||||
|
||||
std::vector<base::FilePath>
|
||||
@@ -7377,10 +7389,10 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted(
|
||||
@@ -7404,10 +7416,10 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted(
|
||||
const auto now = base::TimeTicks::Now();
|
||||
const auto timeout = GetKeepaliveTimerTimeout(context);
|
||||
keepalive_deadline_ = std::max(keepalive_deadline_, now + timeout);
|
||||
@@ -308,7 +308,7 @@ index 6c5105b963a03..7b326cbc9246c 100644
|
||||
FROM_HERE, keepalive_deadline_ - now,
|
||||
base::BindOnce(
|
||||
&ChromeContentBrowserClient::OnKeepaliveTimerFired,
|
||||
@@ -7399,7 +7411,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() {
|
||||
@@ -7426,7 +7438,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() {
|
||||
--num_keepalive_requests_;
|
||||
if (num_keepalive_requests_ == 0) {
|
||||
DVLOG(1) << "Stopping the keepalive timer";
|
||||
@@ -318,7 +318,7 @@ index 6c5105b963a03..7b326cbc9246c 100644
|
||||
// This deletes the keep alive handle attached to the timer function and
|
||||
// unblock the shutdown sequence.
|
||||
}
|
||||
@@ -7535,7 +7548,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired(
|
||||
@@ -7562,7 +7575,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired(
|
||||
const auto now = base::TimeTicks::Now();
|
||||
const auto then = keepalive_deadline_;
|
||||
if (now < then) {
|
||||
@@ -328,7 +328,7 @@ index 6c5105b963a03..7b326cbc9246c 100644
|
||||
base::BindOnce(&ChromeContentBrowserClient::OnKeepaliveTimerFired,
|
||||
weak_factory_.GetWeakPtr(),
|
||||
diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h
|
||||
index 599083d73c876..c6c565291a8fe 100644
|
||||
index e162b2d33f7bd..864ffbffb9f0a 100644
|
||||
--- chrome/browser/chrome_content_browser_client.h
|
||||
+++ chrome/browser/chrome_content_browser_client.h
|
||||
@@ -136,6 +136,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
|
||||
@@ -340,7 +340,7 @@ index 599083d73c876..c6c565291a8fe 100644
|
||||
// TODO(https://crbug.com/787567): This file is about calls from content/ out
|
||||
// to chrome/ to get values or notify about events, but both of these
|
||||
// functions are from chrome/ to chrome/ and don't involve content/ at all.
|
||||
@@ -630,7 +632,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
|
||||
@@ -634,7 +636,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
|
||||
override;
|
||||
void OnNetworkServiceCreated(
|
||||
network::mojom::NetworkService* network_service) override;
|
||||
@@ -349,7 +349,7 @@ index 599083d73c876..c6c565291a8fe 100644
|
||||
content::BrowserContext* context,
|
||||
bool in_memory,
|
||||
const base::FilePath& relative_partition_path,
|
||||
@@ -1049,7 +1051,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
|
||||
@@ -1053,7 +1055,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
uint64_t num_keepalive_requests_ = 0;
|
||||
@@ -359,7 +359,7 @@ index 599083d73c876..c6c565291a8fe 100644
|
||||
#endif
|
||||
|
||||
diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc
|
||||
index 645106f10a85f..67a5dd14b1a2b 100644
|
||||
index af2d036f0b354..a7f185904e1be 100644
|
||||
--- chrome/browser/prefs/browser_prefs.cc
|
||||
+++ chrome/browser/prefs/browser_prefs.cc
|
||||
@@ -13,6 +13,7 @@
|
||||
@@ -381,7 +381,7 @@ index 645106f10a85f..67a5dd14b1a2b 100644
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
#include "chrome/browser/accessibility/animation_policy_prefs.h"
|
||||
#include "chrome/browser/apps/platform_apps/shortcut_manager.h"
|
||||
@@ -1529,6 +1534,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
@@ -1538,6 +1543,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
|
||||
// This is intentionally last.
|
||||
RegisterLocalStatePrefsForMigration(registry);
|
||||
@@ -393,7 +393,7 @@ index 645106f10a85f..67a5dd14b1a2b 100644
|
||||
}
|
||||
|
||||
// Register prefs applicable to all profiles.
|
||||
@@ -1930,6 +1940,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
@@ -1939,6 +1949,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
const std::string& locale) {
|
||||
RegisterProfilePrefs(registry, locale);
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc
|
||||
index 728db9db53e6c..6a6f6bede9985 100644
|
||||
index 405c0ac7c41ef..99abcefc0c061 100644
|
||||
--- chrome/browser/ui/browser_command_controller.cc
|
||||
+++ chrome/browser/ui/browser_command_controller.cc
|
||||
@@ -408,6 +408,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
|
||||
@@ -400,6 +400,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
|
||||
// choose to not implement CommandUpdaterDelegate inside this class and
|
||||
// therefore command_updater_ doesn't have the delegate set).
|
||||
if (!SupportsCommand(id) || !IsCommandEnabled(id)) {
|
||||
@@ -10,7 +10,7 @@ index 728db9db53e6c..6a6f6bede9985 100644
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -424,6 +425,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
|
||||
@@ -416,6 +417,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
|
||||
DCHECK(command_updater_.IsCommandEnabled(id))
|
||||
<< "Invalid/disabled command " << id;
|
||||
|
||||
@@ -24,7 +24,7 @@ index 728db9db53e6c..6a6f6bede9985 100644
|
||||
// The order of commands in this switch statement must match the function
|
||||
// declaration order in browser.h!
|
||||
switch (id) {
|
||||
@@ -1155,11 +1163,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
|
||||
@@ -1147,11 +1155,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
|
||||
// BrowserCommandController, private:
|
||||
|
||||
bool BrowserCommandController::IsShowingMainUI() {
|
||||
@@ -41,7 +41,7 @@ index 728db9db53e6c..6a6f6bede9985 100644
|
||||
|
||||
bool BrowserCommandController::IsWebAppOrCustomTab() const {
|
||||
diff --git chrome/browser/ui/toolbar/app_menu_model.cc chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
index 9bbe98269afb6..99ba07e148f84 100644
|
||||
index ca8fd414586c1..820df2f729fba 100644
|
||||
--- chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
+++ chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
@@ -585,6 +585,57 @@ SaveAndShareSubMenuModel::SaveAndShareSubMenuModel(
|
||||
@@ -142,7 +142,7 @@ index 9bbe98269afb6..99ba07e148f84 100644
|
||||
bool AppMenuModel::IsCommandIdAlerted(int command_id) const {
|
||||
if ((command_id == IDC_RECENT_TABS_MENU) ||
|
||||
(command_id == AppMenuModel::kMinRecentTabsCommandId)) {
|
||||
@@ -1468,11 +1543,15 @@ void AppMenuModel::Build() {
|
||||
@@ -1472,11 +1547,15 @@ void AppMenuModel::Build() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ index 9bbe98269afb6..99ba07e148f84 100644
|
||||
|
||||
AddItemWithStringId(IDC_PRINT, IDS_PRINT);
|
||||
|
||||
@@ -1545,9 +1624,13 @@ void AppMenuModel::Build() {
|
||||
@@ -1549,9 +1628,13 @@ void AppMenuModel::Build() {
|
||||
kMoreToolsMenuItem);
|
||||
|
||||
if (!features::IsChromeRefresh2023()) {
|
||||
@@ -180,7 +180,7 @@ index 9bbe98269afb6..99ba07e148f84 100644
|
||||
}
|
||||
|
||||
if (!features::IsChromeRefresh2023()) {
|
||||
@@ -1629,6 +1712,11 @@ void AppMenuModel::Build() {
|
||||
@@ -1633,6 +1716,11 @@ void AppMenuModel::Build() {
|
||||
SetCommandIcon(this, IDC_EXIT, kExitMenuIcon);
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ index 9bbe98269afb6..99ba07e148f84 100644
|
||||
}
|
||||
|
||||
diff --git chrome/browser/ui/toolbar/app_menu_model.h chrome/browser/ui/toolbar/app_menu_model.h
|
||||
index 4d70f711ce633..2a3834702dca2 100644
|
||||
index 96c64caf86ef7..27d346fdbf5a5 100644
|
||||
--- chrome/browser/ui/toolbar/app_menu_model.h
|
||||
+++ chrome/browser/ui/toolbar/app_menu_model.h
|
||||
@@ -194,6 +194,7 @@ class AppMenuModel : public ui::SimpleMenuModel,
|
||||
@@ -355,10 +355,10 @@ index 965bd2525b212..6a637609b65e9 100644
|
||||
BrowserFrame(const BrowserFrame&) = delete;
|
||||
BrowserFrame& operator=(const BrowserFrame&) = delete;
|
||||
diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc
|
||||
index 306affc1d9573..3a7cad35c6352 100644
|
||||
index 37850210f4b6e..7edd178950679 100644
|
||||
--- chrome/browser/ui/views/frame/browser_view.cc
|
||||
+++ chrome/browser/ui/views/frame/browser_view.cc
|
||||
@@ -320,11 +320,10 @@ using content::NativeWebKeyboardEvent;
|
||||
@@ -327,11 +327,10 @@ using content::NativeWebKeyboardEvent;
|
||||
using content::WebContents;
|
||||
using web_modal::WebContentsModalDialogHost;
|
||||
|
||||
@@ -373,7 +373,7 @@ index 306affc1d9573..3a7cad35c6352 100644
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
// UMA histograms that record animation smoothness for tab loading animation.
|
||||
@@ -793,11 +792,22 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver {
|
||||
@@ -800,11 +799,22 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// BrowserView, public:
|
||||
|
||||
@@ -397,7 +397,7 @@ index 306affc1d9573..3a7cad35c6352 100644
|
||||
SetShowIcon(
|
||||
::ShouldShowWindowIcon(browser_.get(), AppUsesWindowControlsOverlay()));
|
||||
|
||||
@@ -841,7 +851,6 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
|
||||
@@ -848,7 +858,6 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
|
||||
}
|
||||
|
||||
browser_->tab_strip_model()->AddObserver(this);
|
||||
@@ -405,7 +405,7 @@ index 306affc1d9573..3a7cad35c6352 100644
|
||||
|
||||
// Top container holds tab strip region and toolbar and lives at the front of
|
||||
// the view hierarchy.
|
||||
@@ -897,8 +906,15 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
|
||||
@@ -904,8 +913,15 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
|
||||
contents_container->SetLayoutManager(std::make_unique<ContentsLayoutManager>(
|
||||
devtools_web_view_, contents_web_view_));
|
||||
|
||||
@@ -423,7 +423,7 @@ index 306affc1d9573..3a7cad35c6352 100644
|
||||
|
||||
contents_separator_ =
|
||||
top_container_->AddChildView(std::make_unique<ContentsSeparator>());
|
||||
@@ -1086,12 +1102,14 @@ gfx::Size BrowserView::GetWebAppFrameToolbarPreferredSize() const {
|
||||
@@ -1093,12 +1109,14 @@ gfx::Size BrowserView::GetWebAppFrameToolbarPreferredSize() const {
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
bool BrowserView::UsesImmersiveFullscreenMode() const {
|
||||
@@ -440,7 +440,7 @@ index 306affc1d9573..3a7cad35c6352 100644
|
||||
}
|
||||
|
||||
bool BrowserView::UsesImmersiveFullscreenTabbedMode() const {
|
||||
@@ -1816,6 +1834,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const {
|
||||
@@ -1823,6 +1841,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const {
|
||||
if (immersive_mode_controller_->IsEnabled())
|
||||
return false;
|
||||
|
||||
@@ -449,7 +449,7 @@ index 306affc1d9573..3a7cad35c6352 100644
|
||||
return frame_->GetFrameView()->ShouldHideTopUIForFullscreen();
|
||||
}
|
||||
|
||||
@@ -2759,7 +2779,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() {
|
||||
@@ -2821,7 +2841,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() {
|
||||
}
|
||||
|
||||
DownloadBubbleUIController* BrowserView::GetDownloadBubbleUIController() {
|
||||
@@ -459,7 +459,7 @@ index 306affc1d9573..3a7cad35c6352 100644
|
||||
if (auto* download_button = toolbar_button_provider_->GetDownloadButton())
|
||||
return download_button->bubble_controller();
|
||||
return nullptr;
|
||||
@@ -3295,7 +3316,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
|
||||
@@ -3357,7 +3378,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
|
||||
if (top_container()->parent() == this)
|
||||
return;
|
||||
|
||||
@@ -469,7 +469,7 @@ index 306affc1d9573..3a7cad35c6352 100644
|
||||
top_container()->DestroyLayer();
|
||||
AddChildViewAt(top_container(), 0);
|
||||
EnsureFocusOrder();
|
||||
@@ -3852,8 +3874,10 @@ void BrowserView::Layout() {
|
||||
@@ -3914,8 +3936,10 @@ void BrowserView::Layout() {
|
||||
|
||||
// TODO(jamescook): Why was this in the middle of layout code?
|
||||
toolbar_->location_bar()->omnibox_view()->SetFocusBehavior(
|
||||
@@ -482,7 +482,7 @@ index 306affc1d9573..3a7cad35c6352 100644
|
||||
|
||||
// Some of the situations when the BrowserView is laid out are:
|
||||
// - Enter/exit immersive fullscreen mode.
|
||||
@@ -3919,6 +3943,11 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -3981,6 +4005,11 @@ void BrowserView::AddedToWidget() {
|
||||
SetThemeProfileForWindow(GetNativeWindow(), browser_->profile());
|
||||
#endif
|
||||
|
||||
@@ -494,7 +494,7 @@ index 306affc1d9573..3a7cad35c6352 100644
|
||||
toolbar_->Init();
|
||||
|
||||
// TODO(pbos): Investigate whether the side panels should be creatable when
|
||||
@@ -3966,13 +3995,9 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -4028,13 +4057,9 @@ void BrowserView::AddedToWidget() {
|
||||
|
||||
EnsureFocusOrder();
|
||||
|
||||
@@ -510,7 +510,7 @@ index 306affc1d9573..3a7cad35c6352 100644
|
||||
using_native_frame_ = frame_->ShouldUseNativeFrame();
|
||||
|
||||
MaybeInitializeWebUITabStrip();
|
||||
@@ -4377,7 +4402,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
|
||||
@@ -4439,7 +4464,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
|
||||
// Undo our anti-jankiness hacks and force a re-layout.
|
||||
in_process_fullscreen_ = false;
|
||||
ToolbarSizeChanged(false);
|
||||
@@ -520,7 +520,7 @@ index 306affc1d9573..3a7cad35c6352 100644
|
||||
}
|
||||
|
||||
bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const {
|
||||
@@ -4748,6 +4774,8 @@ Profile* BrowserView::GetProfile() {
|
||||
@@ -4810,6 +4836,8 @@ Profile* BrowserView::GetProfile() {
|
||||
}
|
||||
|
||||
void BrowserView::UpdateUIForTabFullscreen() {
|
||||
@@ -529,7 +529,7 @@ index 306affc1d9573..3a7cad35c6352 100644
|
||||
frame()->GetFrameView()->UpdateFullscreenTopUI();
|
||||
}
|
||||
|
||||
@@ -4770,6 +4798,8 @@ void BrowserView::HideDownloadShelf() {
|
||||
@@ -4832,6 +4860,8 @@ void BrowserView::HideDownloadShelf() {
|
||||
}
|
||||
|
||||
bool BrowserView::CanUserExitFullscreen() const {
|
||||
@@ -539,10 +539,10 @@ index 306affc1d9573..3a7cad35c6352 100644
|
||||
}
|
||||
|
||||
diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h
|
||||
index bde91001c6f75..a7434456fc75f 100644
|
||||
index 7145cc6ad5d17..244541e471d2a 100644
|
||||
--- chrome/browser/ui/views/frame/browser_view.h
|
||||
+++ chrome/browser/ui/views/frame/browser_view.h
|
||||
@@ -123,11 +123,16 @@ class BrowserView : public BrowserWindow,
|
||||
@@ -124,11 +124,16 @@ class BrowserView : public BrowserWindow,
|
||||
public webapps::AppBannerManager::Observer {
|
||||
public:
|
||||
METADATA_HEADER(BrowserView);
|
||||
@@ -559,7 +559,7 @@ index bde91001c6f75..a7434456fc75f 100644
|
||||
void set_frame(BrowserFrame* frame) {
|
||||
frame_ = frame;
|
||||
paint_as_active_subscription_ =
|
||||
@@ -783,6 +788,12 @@ class BrowserView : public BrowserWindow,
|
||||
@@ -784,6 +789,12 @@ class BrowserView : public BrowserWindow,
|
||||
return web_app_frame_toolbar();
|
||||
}
|
||||
|
||||
@@ -618,7 +618,7 @@ index 5e059b9878fc2..c1f6fbcd40ec4 100644
|
||||
|
||||
ContentsWebView::~ContentsWebView() {
|
||||
diff --git chrome/browser/ui/views/page_action/page_action_icon_controller.cc chrome/browser/ui/views/page_action/page_action_icon_controller.cc
|
||||
index 21e08a062b192..c9b6ba5cc7538 100644
|
||||
index 09e828d1e079e..7f42618d67e77 100644
|
||||
--- chrome/browser/ui/views/page_action/page_action_icon_controller.cc
|
||||
+++ chrome/browser/ui/views/page_action/page_action_icon_controller.cc
|
||||
@@ -94,6 +94,12 @@ void PageActionIconController::Init(const PageActionIconParams& params,
|
||||
@@ -681,9 +681,18 @@ index fb8bfdbcb2bd5..741d84ecba4ea 100644
|
||||
}
|
||||
|
||||
diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
index c9e50271f2716..063e5b353f0a3 100644
|
||||
index c9e50271f2716..182d75fc96ab6 100644
|
||||
--- chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
+++ chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
@@ -182,7 +182,7 @@ class TabstripLikeBackground : public views::Background {
|
||||
void Paint(gfx::Canvas* canvas, views::View* view) const override {
|
||||
bool painted = TopContainerBackground::PaintThemeCustomImage(
|
||||
canvas, view, browser_view_, /*translate_view_coordinates=*/false);
|
||||
- if (!painted) {
|
||||
+ if (!painted && browser_view_->frame()->GetFrameView()) {
|
||||
SkColor frame_color =
|
||||
browser_view_->frame()->GetFrameView()->GetFrameColor(
|
||||
BrowserFrameActiveState::kUseCurrent);
|
||||
@@ -208,12 +208,13 @@ class ToolbarView::ContainerView : public views::View {
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// ToolbarView, public:
|
||||
|
@@ -34,10 +34,10 @@ index b8649b77e9a29..0d25d60e81b1a 100644
|
||||
factory = base::MakeRefCounted<network::WrapperSharedURLLoaderFactory>(
|
||||
std::move(loader_factory));
|
||||
diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc
|
||||
index d9b45cc4c8277..6dfa6ed1a6500 100644
|
||||
index d7a8a6d628b79..9dd5a6f5992f4 100644
|
||||
--- content/public/browser/content_browser_client.cc
|
||||
+++ content/public/browser/content_browser_client.cc
|
||||
@@ -1006,7 +1006,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload(
|
||||
@@ -1013,7 +1013,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload(
|
||||
void ContentBrowserClient::OnNetworkServiceCreated(
|
||||
network::mojom::NetworkService* network_service) {}
|
||||
|
||||
@@ -46,7 +46,7 @@ index d9b45cc4c8277..6dfa6ed1a6500 100644
|
||||
BrowserContext* context,
|
||||
bool in_memory,
|
||||
const base::FilePath& relative_partition_path,
|
||||
@@ -1015,6 +1015,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams(
|
||||
@@ -1022,6 +1022,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams(
|
||||
cert_verifier_creation_params) {
|
||||
network_context_params->user_agent = GetUserAgentBasedOnPolicy(context);
|
||||
network_context_params->accept_language = "en-us,en";
|
||||
@@ -55,18 +55,18 @@ index d9b45cc4c8277..6dfa6ed1a6500 100644
|
||||
|
||||
std::vector<base::FilePath>
|
||||
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
|
||||
index f750767092895..d19f046ed2846 100644
|
||||
index fe0b1b96209c4..e62fd5d108b89 100644
|
||||
--- content/public/browser/content_browser_client.h
|
||||
+++ content/public/browser/content_browser_client.h
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "content/public/browser/login_delegate.h"
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "content/public/browser/mojo_binder_policy_map.h"
|
||||
#include "content/public/browser/privacy_sandbox_invoking_api.h"
|
||||
#include "content/public/browser/storage_partition_config.h"
|
||||
+#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/common/alternative_error_page_override_info.mojom-forward.h"
|
||||
#include "content/public/common/page_visibility_state.h"
|
||||
#include "content/public/common/window_container_type.mojom-forward.h"
|
||||
@@ -1868,7 +1869,7 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -1878,7 +1879,7 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
//
|
||||
// If |relative_partition_path| is the empty string, it means this needs to
|
||||
// create the default NetworkContext for the BrowserContext.
|
||||
@@ -75,7 +75,7 @@ index f750767092895..d19f046ed2846 100644
|
||||
BrowserContext* context,
|
||||
bool in_memory,
|
||||
const base::FilePath& relative_partition_path,
|
||||
@@ -2076,6 +2077,19 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -2086,6 +2087,19 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
RenderFrameHost* initiator_document,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory);
|
||||
|
||||
@@ -95,7 +95,7 @@ index f750767092895..d19f046ed2846 100644
|
||||
// Creates an OverlayWindow to be used for video or Picture-in-Picture.
|
||||
// This window will house the content shown when in Picture-in-Picture mode.
|
||||
// This will return a new OverlayWindow.
|
||||
@@ -2132,6 +2146,10 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -2142,6 +2156,10 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
// Used as part of the user agent string.
|
||||
virtual std::string GetProduct();
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git tools/gritsettings/resource_ids.spec tools/gritsettings/resource_ids.spec
|
||||
index 887146425378c..7c823a9abc017 100644
|
||||
index a34293da90260..6795a4db9976a 100644
|
||||
--- tools/gritsettings/resource_ids.spec
|
||||
+++ tools/gritsettings/resource_ids.spec
|
||||
@@ -1188,6 +1188,15 @@
|
||||
|
117
patch/patches/light_mode_3534.patch
Normal file
117
patch/patches/light_mode_3534.patch
Normal file
@@ -0,0 +1,117 @@
|
||||
diff --git base/win/dark_mode_support.cc base/win/dark_mode_support.cc
|
||||
index 325bc70b6ba97..d4117dbb1d4d8 100644
|
||||
--- base/win/dark_mode_support.cc
|
||||
+++ base/win/dark_mode_support.cc
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
+#include "base/command_line.h"
|
||||
#include "base/native_library.h"
|
||||
#include "base/win/windows_version.h"
|
||||
|
||||
@@ -85,11 +86,20 @@ const DarkModeSupport& GetDarkModeSupport() {
|
||||
return dark_mode_support;
|
||||
}
|
||||
|
||||
+bool IsForcedLightMode() {
|
||||
+ static bool kIsForcedLightMode =
|
||||
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
+ "force-light-mode");
|
||||
+ return kIsForcedLightMode;
|
||||
+}
|
||||
+
|
||||
} // namespace
|
||||
|
||||
namespace base::win {
|
||||
|
||||
bool IsDarkModeAvailable() {
|
||||
+ if (IsForcedLightMode())
|
||||
+ return false;
|
||||
auto& dark_mode_support = GetDarkModeSupport();
|
||||
return (dark_mode_support.allow_dark_mode_for_app ||
|
||||
dark_mode_support.set_preferred_app_mode) &&
|
||||
diff --git ui/native_theme/native_theme_mac.mm ui/native_theme/native_theme_mac.mm
|
||||
index 37a21af908449..bb3d9a1841156 100644
|
||||
--- ui/native_theme/native_theme_mac.mm
|
||||
+++ ui/native_theme/native_theme_mac.mm
|
||||
@@ -47,6 +47,14 @@ bool IsDarkMode() {
|
||||
bool IsHighContrast() {
|
||||
return NSWorkspace.sharedWorkspace.accessibilityDisplayShouldIncreaseContrast;
|
||||
}
|
||||
+
|
||||
+bool IsForcedLightMode() {
|
||||
+ static bool kIsForcedLightMode =
|
||||
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
+ "force-light-mode");
|
||||
+ return kIsForcedLightMode;
|
||||
+}
|
||||
+
|
||||
} // namespace
|
||||
|
||||
// Helper object to respond to light mode/dark mode changeovers.
|
||||
@@ -549,11 +557,15 @@ void NativeThemeMac::PaintSelectedMenuItem(
|
||||
|
||||
void NativeThemeMac::InitializeDarkModeStateAndObserver() {
|
||||
__block auto theme = this;
|
||||
- set_use_dark_colors(IsDarkMode());
|
||||
+ if (!IsForcedLightMode()) {
|
||||
+ set_use_dark_colors(IsForcedDarkMode() || IsDarkMode());
|
||||
+ }
|
||||
set_preferred_color_scheme(CalculatePreferredColorScheme());
|
||||
appearance_observer_.reset(
|
||||
[[NativeThemeEffectiveAppearanceObserver alloc] initWithHandler:^{
|
||||
- theme->set_use_dark_colors(IsDarkMode());
|
||||
+ if (!IsForcedLightMode()) {
|
||||
+ theme->set_use_dark_colors(IsForcedDarkMode() || IsDarkMode());
|
||||
+ }
|
||||
theme->set_preferred_color_scheme(CalculatePreferredColorScheme());
|
||||
theme->NotifyOnNativeThemeUpdated();
|
||||
}]);
|
||||
@@ -562,7 +574,9 @@ void NativeThemeMac::InitializeDarkModeStateAndObserver() {
|
||||
void NativeThemeMac::ConfigureWebInstance() {
|
||||
// NativeThemeAura is used as web instance so we need to initialize its state.
|
||||
NativeTheme* web_instance = NativeTheme::GetInstanceForWeb();
|
||||
- web_instance->set_use_dark_colors(IsDarkMode());
|
||||
+ if (!IsForcedLightMode()) {
|
||||
+ web_instance->set_use_dark_colors(IsForcedDarkMode() || IsDarkMode());
|
||||
+ }
|
||||
web_instance->set_preferred_color_scheme(CalculatePreferredColorScheme());
|
||||
web_instance->SetPreferredContrast(CalculatePreferredContrast());
|
||||
|
||||
diff --git ui/native_theme/native_theme_win.cc ui/native_theme/native_theme_win.cc
|
||||
index 87807be3558a2..adb672aee957b 100644
|
||||
--- ui/native_theme/native_theme_win.cc
|
||||
+++ ui/native_theme/native_theme_win.cc
|
||||
@@ -621,14 +621,17 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
|
||||
// Windows high contrast modes are entirely different themes,
|
||||
// so let them take priority over dark mode.
|
||||
// ...unless --force-dark-mode was specified in which case caveat emptor.
|
||||
- if (InForcedColorsMode() && !IsForcedDarkMode())
|
||||
+ if (supports_windows_dark_mode_ && IsForcedDarkMode()) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ if (InForcedColorsMode())
|
||||
return false;
|
||||
return NativeTheme::ShouldUseDarkColors();
|
||||
}
|
||||
|
||||
NativeTheme::PreferredColorScheme
|
||||
NativeThemeWin::CalculatePreferredColorScheme() const {
|
||||
- if (!InForcedColorsMode())
|
||||
+ if (!InForcedColorsMode() || !supports_windows_dark_mode_)
|
||||
return NativeTheme::CalculatePreferredColorScheme();
|
||||
|
||||
// According to the spec, the preferred color scheme for web content is 'dark'
|
||||
@@ -1580,8 +1583,9 @@ void NativeThemeWin::RegisterThemeRegkeyObserver() {
|
||||
}
|
||||
|
||||
void NativeThemeWin::UpdateDarkModeStatus() {
|
||||
- bool dark_mode_enabled = false;
|
||||
- if (hkcu_themes_regkey_.Valid()) {
|
||||
+ bool dark_mode_enabled = ShouldUseDarkColors();
|
||||
+ if (supports_windows_dark_mode_ && !IsForcedDarkMode() &&
|
||||
+ hkcu_themes_regkey_.Valid()) {
|
||||
DWORD apps_use_light_theme = 1;
|
||||
hkcu_themes_regkey_.ReadValueDW(L"AppsUseLightTheme",
|
||||
&apps_use_light_theme);
|
28
patch/patches/mac_platform_style_bubble_893292.patch
Normal file
28
patch/patches/mac_platform_style_bubble_893292.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
diff --git chrome/browser/ui/views/profiles/profile_menu_view_base.cc chrome/browser/ui/views/profiles/profile_menu_view_base.cc
|
||||
index 4e887ec33d100..67af3165246e5 100644
|
||||
--- chrome/browser/ui/views/profiles/profile_menu_view_base.cc
|
||||
+++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc
|
||||
@@ -991,8 +991,8 @@ int ProfileMenuViewBase::GetMaxHeight() const {
|
||||
->GetDisplayNearestPoint(anchor_rect.CenterPoint())
|
||||
.work_area();
|
||||
int available_space = screen_space.bottom() - anchor_rect.bottom();
|
||||
-#if BUILDFLAG(IS_WIN)
|
||||
- // On Windows the bubble can also be show to the top of the anchor.
|
||||
+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
|
||||
+ // On Windows and macOS the bubble can also be show to the top of the anchor.
|
||||
available_space =
|
||||
std::max(available_space, anchor_rect.y() - screen_space.y());
|
||||
#endif
|
||||
diff --git ui/views/style/platform_style_mac.mm ui/views/style/platform_style_mac.mm
|
||||
index 256bde37abf47..9ddfa6fc59f0a 100644
|
||||
--- ui/views/style/platform_style_mac.mm
|
||||
+++ ui/views/style/platform_style_mac.mm
|
||||
@@ -43,7 +43,7 @@ const bool PlatformStyle::kTableViewSupportsKeyboardNavigationByCell = false;
|
||||
const bool PlatformStyle::kTreeViewSelectionPaintsEntireRow = true;
|
||||
const bool PlatformStyle::kUseRipples = false;
|
||||
const bool PlatformStyle::kInactiveWidgetControlsAppearDisabled = true;
|
||||
-const bool PlatformStyle::kAdjustBubbleIfOffscreen = false;
|
||||
+const bool PlatformStyle::kAdjustBubbleIfOffscreen = true;
|
||||
const View::FocusBehavior PlatformStyle::kDefaultFocusBehavior =
|
||||
View::FocusBehavior::ACCESSIBLE_ONLY;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
index c01cc787de463..9c09d462ce05e 100644
|
||||
index 0e521106dda6b..c83b024886bb9 100644
|
||||
--- content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -6,6 +6,7 @@
|
||||
@@ -27,7 +27,7 @@ index c01cc787de463..9c09d462ce05e 100644
|
||||
}
|
||||
|
||||
absl::optional<DisplayFeature> RenderWidgetHostViewAura::GetDisplayFeature() {
|
||||
@@ -2292,6 +2295,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
|
||||
@@ -2286,6 +2289,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
|
||||
// This needs to happen only after |window_| has been initialized using
|
||||
// Init(), because it needs to have the layer.
|
||||
window_->SetEmbedFrameSinkId(frame_sink_id_);
|
||||
|
@@ -156,7 +156,7 @@ index 61fd008fc067e..73909be088278 100644
|
||||
// reset to null.
|
||||
const CookieAccessDelegate* cookie_access_delegate() const {
|
||||
diff --git services/network/cookie_manager.cc services/network/cookie_manager.cc
|
||||
index ba7f48e90026c..a509cc4565e9f 100644
|
||||
index ad55d136252ad..8efd01a68afd2 100644
|
||||
--- services/network/cookie_manager.cc
|
||||
+++ services/network/cookie_manager.cc
|
||||
@@ -283,14 +283,9 @@ void CookieManager::FlushCookieStore(FlushCookieStoreCallback callback) {
|
||||
@@ -178,10 +178,10 @@ index ba7f48e90026c..a509cc4565e9f 100644
|
||||
|
||||
void CookieManager::SetForceKeepSessionState() {
|
||||
diff --git services/network/network_context.cc services/network/network_context.cc
|
||||
index d553d31e90ca7..c27dc5a747aca 100644
|
||||
index 4156311dfec3f..857ba9d46296d 100644
|
||||
--- services/network/network_context.cc
|
||||
+++ services/network/network_context.cc
|
||||
@@ -2349,16 +2349,20 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
@@ -2360,16 +2360,20 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
network_service_->network_quality_estimator());
|
||||
}
|
||||
|
||||
|
@@ -1,13 +1,13 @@
|
||||
diff --git chrome/browser/ui/views/chrome_views_delegate_linux.cc chrome/browser/ui/views/chrome_views_delegate_linux.cc
|
||||
index ecc07a2a60505..918116c0efeef 100644
|
||||
index ecc07a2a60505..82a379fa65e68 100644
|
||||
--- chrome/browser/ui/views/chrome_views_delegate_linux.cc
|
||||
+++ chrome/browser/ui/views/chrome_views_delegate_linux.cc
|
||||
@@ -51,7 +51,7 @@ NativeWidgetType GetNativeWidgetTypeForInitParams(
|
||||
if (params.requires_accelerated_widget)
|
||||
@@ -52,6 +52,8 @@ NativeWidgetType GetNativeWidgetTypeForInitParams(
|
||||
return NativeWidgetType::DESKTOP_NATIVE_WIDGET_AURA;
|
||||
|
||||
- return (params.parent &&
|
||||
+ return (params.parent && params.child &&
|
||||
return (params.parent &&
|
||||
+ (params.child ||
|
||||
+ params.type == views::Widget::InitParams::TYPE_BUBBLE) &&
|
||||
params.type != views::Widget::InitParams::TYPE_MENU &&
|
||||
params.type != views::Widget::InitParams::TYPE_TOOLTIP)
|
||||
? NativeWidgetType::NATIVE_WIDGET_AURA
|
||||
|
@@ -106,10 +106,10 @@ index 3c78525361ebf..c922dfe5019a3 100644
|
||||
|
||||
} // namespace gfx
|
||||
diff --git ui/views/animation/ink_drop_host.h ui/views/animation/ink_drop_host.h
|
||||
index c1c0631071a11..aa2c01ebce43e 100644
|
||||
index 109522be316f2..25fb550337fb6 100644
|
||||
--- ui/views/animation/ink_drop_host.h
|
||||
+++ ui/views/animation/ink_drop_host.h
|
||||
@@ -194,6 +194,8 @@ class VIEWS_EXPORT InkDropHost {
|
||||
@@ -189,6 +189,8 @@ class VIEWS_EXPORT InkDropHost {
|
||||
View* host_view() { return host_view_; }
|
||||
const View* host_view() const { return host_view_; }
|
||||
|
||||
@@ -240,10 +240,10 @@ index 711dc633bffc2..0fa2626150de2 100644
|
||||
std::unique_ptr<SelectionController> selection_controller_;
|
||||
|
||||
diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc
|
||||
index f8b3ded1dba82..86b9ddd90ee16 100644
|
||||
index 63c4954542acf..432eedd0243bc 100644
|
||||
--- ui/views/controls/menu/menu_controller.cc
|
||||
+++ ui/views/controls/menu/menu_controller.cc
|
||||
@@ -563,7 +563,8 @@ void MenuController::Run(Widget* parent,
|
||||
@@ -561,7 +561,8 @@ void MenuController::Run(Widget* parent,
|
||||
MenuAnchorPosition position,
|
||||
bool context_menu,
|
||||
bool is_nested_drag,
|
||||
@@ -253,7 +253,7 @@ index f8b3ded1dba82..86b9ddd90ee16 100644
|
||||
exit_type_ = ExitType::kNone;
|
||||
possible_drag_ = false;
|
||||
drag_in_progress_ = false;
|
||||
@@ -608,6 +609,7 @@ void MenuController::Run(Widget* parent,
|
||||
@@ -606,6 +607,7 @@ void MenuController::Run(Widget* parent,
|
||||
owner_->AddObserver(this);
|
||||
|
||||
native_view_for_gestures_ = native_view_for_gestures;
|
||||
@@ -261,7 +261,7 @@ index f8b3ded1dba82..86b9ddd90ee16 100644
|
||||
|
||||
// Only create a MenuPreTargetHandler for non-nested menus. Nested menus
|
||||
// will use the existing one.
|
||||
@@ -2239,6 +2241,7 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
|
||||
@@ -2231,6 +2233,7 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
|
||||
params.do_capture = do_capture;
|
||||
params.native_view_for_gestures = native_view_for_gestures_;
|
||||
params.owned_window_anchor = anchor;
|
||||
@@ -269,7 +269,7 @@ index f8b3ded1dba82..86b9ddd90ee16 100644
|
||||
if (item->GetParentMenuItem()) {
|
||||
params.context = item->GetWidget();
|
||||
// (crbug.com/1414232) The item to be open is a submenu. Make sure
|
||||
@@ -2943,8 +2946,13 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem(
|
||||
@@ -2935,8 +2938,13 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem(
|
||||
|
||||
void MenuController::OpenSubmenuChangeSelectionIfCan() {
|
||||
MenuItemView* item = pending_state_.item;
|
||||
@@ -284,7 +284,7 @@ index f8b3ded1dba82..86b9ddd90ee16 100644
|
||||
|
||||
// Show the sub-menu.
|
||||
SetSelection(item, SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY);
|
||||
@@ -2964,8 +2972,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() {
|
||||
@@ -2956,8 +2964,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() {
|
||||
void MenuController::CloseSubmenu() {
|
||||
MenuItemView* item = state_.item;
|
||||
DCHECK(item);
|
||||
@@ -396,10 +396,10 @@ index c048ab2aa5ae4..810f62eed6676 100644
|
||||
|
||||
explicit MenuHost(SubmenuView* submenu);
|
||||
diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc
|
||||
index f99daa29d9181..49b4a3da021ea 100644
|
||||
index f2490a947896e..2212a635e6923 100644
|
||||
--- ui/views/controls/menu/menu_item_view.cc
|
||||
+++ ui/views/controls/menu/menu_item_view.cc
|
||||
@@ -1096,6 +1096,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas,
|
||||
@@ -1055,6 +1055,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas,
|
||||
spilling_rect.set_y(spilling_rect.y() - corner_radius_);
|
||||
spilling_rect.set_height(spilling_rect.height() + corner_radius_);
|
||||
canvas->DrawRoundRect(spilling_rect, corner_radius_, flags);
|
||||
@@ -415,7 +415,7 @@ index f99daa29d9181..49b4a3da021ea 100644
|
||||
} else if (paint_as_selected) {
|
||||
gfx::Rect item_bounds = GetLocalBounds();
|
||||
if (type_ == Type::kActionableSubMenu) {
|
||||
@@ -1160,6 +1169,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) {
|
||||
@@ -1118,6 +1127,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) {
|
||||
}
|
||||
|
||||
SkColor MenuItemView::GetTextColor(bool minor, bool paint_as_selected) const {
|
||||
@@ -578,7 +578,7 @@ index 562b67396f27f..7679dbd79e565 100644
|
||||
|
||||
// Returns true if we're in a nested run loop running the menu.
|
||||
diff --git ui/views/controls/menu/menu_runner_impl.cc ui/views/controls/menu/menu_runner_impl.cc
|
||||
index c2513d2889a2b..5dfef1af49685 100644
|
||||
index e82249ad5e887..3a7429bcaf9f1 100644
|
||||
--- ui/views/controls/menu/menu_runner_impl.cc
|
||||
+++ ui/views/controls/menu/menu_runner_impl.cc
|
||||
@@ -117,6 +117,7 @@ void MenuRunnerImpl::RunMenuAt(Widget* parent,
|
||||
@@ -676,7 +676,7 @@ index cf696fbcf0714..5c48fd7410b88 100644
|
||||
|
||||
// Hides and cancels the menu.
|
||||
diff --git ui/views/controls/menu/menu_scroll_view_container.cc ui/views/controls/menu/menu_scroll_view_container.cc
|
||||
index 76bb4863858fb..feb949470219d 100644
|
||||
index 3ff9bc06e51c4..4b13811a51144 100644
|
||||
--- ui/views/controls/menu/menu_scroll_view_container.cc
|
||||
+++ ui/views/controls/menu/menu_scroll_view_container.cc
|
||||
@@ -257,6 +257,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view)
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
index d7ff9f7303d80..40aa86fe87638 100644
|
||||
index f1d50fba17a0a..0ee633dfd0a9d 100644
|
||||
--- content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
+++ content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
@@ -640,6 +640,14 @@ float RenderWidgetHostViewBase::GetScaleOverrideForCapture() const {
|
||||
@@ -641,6 +641,14 @@ float RenderWidgetHostViewBase::GetScaleOverrideForCapture() const {
|
||||
return scale_override_for_capture_;
|
||||
}
|
||||
|
||||
@@ -243,10 +243,10 @@ index 01d4ffe408a84..fbe41fefbb2bd 100644
|
||||
base::WeakPtrFactory<DesktopWindowTreeHostLinux> weak_factory_{this};
|
||||
};
|
||||
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
|
||||
index e589b36f45df8..6b25e64bee95a 100644
|
||||
index 9b36a7639e0ac..06cd2b0fc662f 100644
|
||||
--- ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
|
||||
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
|
||||
@@ -280,8 +280,8 @@ void DesktopWindowTreeHostPlatform::Init(const Widget::InitParams& params) {
|
||||
@@ -285,8 +285,8 @@ void DesktopWindowTreeHostPlatform::Init(const Widget::InitParams& params) {
|
||||
if (properties.parent_widget) {
|
||||
window_parent_ = DesktopWindowTreeHostPlatform::GetHostForWidget(
|
||||
properties.parent_widget);
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc
|
||||
index 4efa2e72fdc34..1319dfa2c2b2f 100644
|
||||
index c9b13be94c531..36cf5d46c137d 100644
|
||||
--- content/browser/web_contents/web_contents_impl.cc
|
||||
+++ content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3242,6 +3242,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3248,6 +3248,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
params.main_frame_name, GetOpener(), primary_main_frame_policy,
|
||||
base::UnguessableToken::Create());
|
||||
|
||||
@@ -15,7 +15,7 @@ index 4efa2e72fdc34..1319dfa2c2b2f 100644
|
||||
std::unique_ptr<WebContentsViewDelegate> delegate =
|
||||
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
||||
|
||||
@@ -3252,6 +3258,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3258,6 +3264,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
view_ = CreateWebContentsView(this, std::move(delegate),
|
||||
&render_view_host_delegate_view_);
|
||||
}
|
||||
@@ -23,7 +23,7 @@ index 4efa2e72fdc34..1319dfa2c2b2f 100644
|
||||
CHECK(render_view_host_delegate_view_);
|
||||
CHECK(view_.get());
|
||||
|
||||
@@ -3441,6 +3448,9 @@ void WebContentsImpl::RenderWidgetCreated(
|
||||
@@ -3447,6 +3454,9 @@ void WebContentsImpl::RenderWidgetCreated(
|
||||
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RenderWidgetCreated",
|
||||
"render_widget_host", render_widget_host);
|
||||
created_widgets_.insert(render_widget_host);
|
||||
@@ -33,7 +33,7 @@ index 4efa2e72fdc34..1319dfa2c2b2f 100644
|
||||
}
|
||||
|
||||
void WebContentsImpl::RenderWidgetDeleted(
|
||||
@@ -4170,6 +4180,15 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4176,6 +4186,15 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
create_params.picture_in_picture_options = *(params.pip_options);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ index 4efa2e72fdc34..1319dfa2c2b2f 100644
|
||||
// Check whether there is an available prerendered page for this navigation if
|
||||
// this is not for guest. If it exists, take WebContents pre-created for
|
||||
// hosting the prerendered page instead of creating new WebContents.
|
||||
@@ -8117,6 +8136,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node,
|
||||
@@ -8123,6 +8142,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node,
|
||||
// frames).
|
||||
SetFocusedFrameTree(&node->frame_tree());
|
||||
}
|
||||
|
@@ -135,6 +135,9 @@ MainContextImpl::MainContextImpl(CefRefPtr<CefCommandLine> command_line,
|
||||
// Parse the background color value.
|
||||
background_color_ =
|
||||
ParseColor(command_line_->GetSwitchValue(switches::kBackgroundColor));
|
||||
} else if (command_line_->HasSwitch("force-dark-mode")) {
|
||||
// Use black background color by default with dark mode.
|
||||
background_color_ = ParseColor("black");
|
||||
}
|
||||
|
||||
if (background_color_ == 0 && !use_views_) {
|
||||
|
@@ -44,9 +44,12 @@ char16_t GetMnemonic(const std::u16string& title) {
|
||||
|
||||
} // namespace
|
||||
|
||||
ViewsMenuBar::ViewsMenuBar(Delegate* delegate, int menu_id_start)
|
||||
ViewsMenuBar::ViewsMenuBar(Delegate* delegate,
|
||||
int menu_id_start,
|
||||
bool use_bottom_controls)
|
||||
: delegate_(delegate),
|
||||
id_start_(menu_id_start),
|
||||
use_bottom_controls_(use_bottom_controls),
|
||||
id_next_(menu_id_start),
|
||||
last_nav_with_keyboard_(false) {
|
||||
DCHECK(delegate_);
|
||||
@@ -164,12 +167,29 @@ void ViewsMenuBar::OnMenuButtonPressed(
|
||||
CefRefPtr<CefMenuButtonPressedLock> button_pressed_lock) {
|
||||
CefRefPtr<CefMenuModel> menu_model = GetMenuModel(menu_button->GetID());
|
||||
|
||||
const auto button_bounds = menu_button->GetBoundsInScreen();
|
||||
|
||||
// Adjust menu position to align with the button.
|
||||
CefPoint point = screen_point;
|
||||
if (CefIsRTL()) {
|
||||
point.x += menu_button->GetBounds().width - 4;
|
||||
point.x += button_bounds.width - 4;
|
||||
} else {
|
||||
point.x -= menu_button->GetBounds().width - 4;
|
||||
point.x -= button_bounds.width - 4;
|
||||
}
|
||||
|
||||
if (use_bottom_controls_) {
|
||||
const auto display_bounds =
|
||||
menu_button->GetWindow()->GetDisplay()->GetWorkArea();
|
||||
const int available_height = display_bounds.y + display_bounds.height -
|
||||
button_bounds.y - button_bounds.height;
|
||||
|
||||
// Approximation of the menu height.
|
||||
const int menu_height =
|
||||
static_cast<int>(menu_model->GetCount()) * button_bounds.height;
|
||||
if (menu_height > available_height) {
|
||||
// The menu will go upwards, so place it above the button.
|
||||
point.y -= button_bounds.height - 8;
|
||||
}
|
||||
}
|
||||
|
||||
// Keep track of the current |last_nav_with_keyboard_| status and restore it
|
||||
@@ -230,6 +250,10 @@ void ViewsMenuBar::MouseOutsideMenu(CefRefPtr<CefMenuModel> menu_model,
|
||||
|
||||
CefRefPtr<CefView> button = panel_->GetViewForID(id);
|
||||
CefRect button_bounds = button->GetBounds();
|
||||
|
||||
// Adjust for window coordinates.
|
||||
button_bounds.y += panel_bounds.y;
|
||||
|
||||
if (CefIsRTL()) {
|
||||
// Adjust for right-to-left button layout.
|
||||
button_bounds.x =
|
||||
|
@@ -39,7 +39,7 @@ class ViewsMenuBar : public CefMenuButtonDelegate, public CefMenuModelDelegate {
|
||||
// |menu_id_start| is the ID for the first CefMenuButton in the bar. An ID
|
||||
// range starting with |menu_id_start| and extending for a reasonable distance
|
||||
// should be reserved in the client for MenuBar usage.
|
||||
ViewsMenuBar(Delegate* delegate, int menu_id_start);
|
||||
ViewsMenuBar(Delegate* delegate, int menu_id_start, bool use_bottom_controls);
|
||||
|
||||
// Returns true if |menu_id| exists in the menu bar.
|
||||
bool HasMenuId(int menu_id) const;
|
||||
@@ -106,6 +106,7 @@ class ViewsMenuBar : public CefMenuButtonDelegate, public CefMenuModelDelegate {
|
||||
|
||||
Delegate* delegate_; // Not owned by this object.
|
||||
const int id_start_;
|
||||
const bool use_bottom_controls_;
|
||||
int id_next_;
|
||||
CefRefPtr<CefPanel> panel_;
|
||||
std::vector<CefRefPtr<CefMenuModel>> models_;
|
||||
|
@@ -47,25 +47,31 @@ std::array<ViewsOverlayControls::Command, 3> GetButtons() {
|
||||
#endif
|
||||
}
|
||||
|
||||
cef_docking_mode_t GetPanelDockingMode() {
|
||||
cef_docking_mode_t GetPanelDockingMode(bool use_bottom_controls) {
|
||||
#if defined(OS_MAC)
|
||||
return CEF_DOCKING_MODE_TOP_LEFT;
|
||||
return use_bottom_controls ? CEF_DOCKING_MODE_BOTTOM_LEFT
|
||||
: CEF_DOCKING_MODE_TOP_LEFT;
|
||||
#else
|
||||
return CEF_DOCKING_MODE_TOP_RIGHT;
|
||||
return use_bottom_controls ? CEF_DOCKING_MODE_BOTTOM_RIGHT
|
||||
: CEF_DOCKING_MODE_TOP_RIGHT;
|
||||
#endif
|
||||
}
|
||||
cef_docking_mode_t GetMenuDockingMode() {
|
||||
cef_docking_mode_t GetMenuDockingMode(bool use_bottom_controls) {
|
||||
#if defined(OS_MAC)
|
||||
return CEF_DOCKING_MODE_TOP_RIGHT;
|
||||
return use_bottom_controls ? CEF_DOCKING_MODE_BOTTOM_RIGHT
|
||||
: CEF_DOCKING_MODE_TOP_RIGHT;
|
||||
#else
|
||||
return CEF_DOCKING_MODE_TOP_LEFT;
|
||||
return use_bottom_controls ? CEF_DOCKING_MODE_BOTTOM_LEFT
|
||||
: CEF_DOCKING_MODE_TOP_LEFT;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
ViewsOverlayControls::ViewsOverlayControls(bool with_window_buttons)
|
||||
: with_window_buttons_(with_window_buttons) {}
|
||||
ViewsOverlayControls::ViewsOverlayControls(bool with_window_buttons,
|
||||
bool use_bottom_controls)
|
||||
: with_window_buttons_(with_window_buttons),
|
||||
use_bottom_controls_(use_bottom_controls) {}
|
||||
|
||||
void ViewsOverlayControls::Initialize(CefRefPtr<CefWindow> window,
|
||||
CefRefPtr<CefMenuButton> menu_button,
|
||||
@@ -78,6 +84,13 @@ void ViewsOverlayControls::Initialize(CefRefPtr<CefWindow> window,
|
||||
window_ = window;
|
||||
window_maximized_ = window_->IsMaximized();
|
||||
|
||||
CefInsets insets;
|
||||
if (use_bottom_controls_) {
|
||||
insets.Set(0, kInsets, kInsets, kInsets);
|
||||
} else {
|
||||
insets.Set(kInsets, kInsets, 0, kInsets);
|
||||
}
|
||||
|
||||
if (with_window_buttons_) {
|
||||
// Window control buttons. These controls are currently text which means
|
||||
// that we can't use a transparent background because subpixel text
|
||||
@@ -94,15 +107,17 @@ void ViewsOverlayControls::Initialize(CefRefPtr<CefWindow> window,
|
||||
for (auto button : GetButtons()) {
|
||||
panel_->AddChildView(CreateButton(button));
|
||||
}
|
||||
panel_controller_ = window->AddOverlayView(panel_, GetPanelDockingMode());
|
||||
panel_controller_->SetInsets(CefInsets(kInsets, kInsets, 0, kInsets));
|
||||
panel_controller_ = window->AddOverlayView(
|
||||
panel_, GetPanelDockingMode(use_bottom_controls_));
|
||||
panel_controller_->SetInsets(insets);
|
||||
panel_controller_->SetVisible(true);
|
||||
}
|
||||
|
||||
// Menu button.
|
||||
menu_button->SetBackgroundColor(kBackgroundColor);
|
||||
menu_controller_ = window_->AddOverlayView(menu_button, GetMenuDockingMode());
|
||||
menu_controller_->SetInsets(CefInsets(kInsets, kInsets, 0, kInsets));
|
||||
menu_controller_ = window_->AddOverlayView(
|
||||
menu_button, GetMenuDockingMode(use_bottom_controls_));
|
||||
menu_controller_->SetInsets(insets);
|
||||
menu_controller_->SetVisible(true);
|
||||
|
||||
// Location bar. Will be made visible in UpdateControls().
|
||||
@@ -130,10 +145,11 @@ void ViewsOverlayControls::Destroy() {
|
||||
|
||||
void ViewsOverlayControls::UpdateControls() {
|
||||
// Update location bar size, position and visibility.
|
||||
auto bounds = window_->GetBounds();
|
||||
const auto window_bounds = window_->GetBounds();
|
||||
auto bounds = window_bounds;
|
||||
bounds.x = kLocationBarPadding;
|
||||
bounds.width -= kLocationBarPadding * 2;
|
||||
bounds.y = kInsets;
|
||||
|
||||
if (is_chrome_toolbar_) {
|
||||
// Fit the standard Chrome toolbar.
|
||||
const auto preferred_size = location_bar_->GetPreferredSize();
|
||||
@@ -142,6 +158,13 @@ void ViewsOverlayControls::UpdateControls() {
|
||||
} else {
|
||||
bounds.height = menu_controller_->GetSize().height;
|
||||
}
|
||||
|
||||
if (use_bottom_controls_) {
|
||||
bounds.y = window_bounds.height - bounds.height - kInsets;
|
||||
} else {
|
||||
bounds.y = kInsets;
|
||||
}
|
||||
|
||||
if (bounds.width < kLocationBarPadding * 2) {
|
||||
// Not enough space.
|
||||
location_controller_->SetVisible(false);
|
||||
|
@@ -25,7 +25,7 @@ class ViewsOverlayControls : public CefButtonDelegate {
|
||||
kClose,
|
||||
};
|
||||
|
||||
explicit ViewsOverlayControls(bool with_window_buttons);
|
||||
ViewsOverlayControls(bool with_window_buttons, bool use_bottom_controls);
|
||||
|
||||
void Initialize(CefRefPtr<CefWindow> window,
|
||||
CefRefPtr<CefMenuButton> menu_button,
|
||||
@@ -54,6 +54,7 @@ class ViewsOverlayControls : public CefButtonDelegate {
|
||||
CefRefPtr<CefPanel> panel_;
|
||||
CefRefPtr<CefOverlayController> panel_controller_;
|
||||
const bool with_window_buttons_;
|
||||
const bool use_bottom_controls_;
|
||||
|
||||
// Location bar.
|
||||
CefRefPtr<CefView> location_bar_;
|
||||
|
@@ -346,7 +346,7 @@ void ViewsWindow::TakeFocus(bool next) {
|
||||
}
|
||||
|
||||
if (chrome_toolbar_type_ == CEF_CTT_NORMAL) {
|
||||
top_toolbar_->RequestFocus();
|
||||
toolbar_->RequestFocus();
|
||||
} else if (location_bar_) {
|
||||
// Give focus to the location bar.
|
||||
location_bar_->RequestFocus();
|
||||
@@ -550,14 +550,30 @@ void ViewsWindow::OnMenuButtonPressed(
|
||||
DCHECK(with_controls_ || with_overlay_controls_);
|
||||
DCHECK_EQ(ID_MENU_BUTTON, id);
|
||||
|
||||
const auto button_bounds = menu_button->GetBoundsInScreen();
|
||||
|
||||
auto point = screen_point;
|
||||
if (with_overlay_controls_) {
|
||||
// Align the menu correctly under the button.
|
||||
const int button_width = menu_button->GetSize().width;
|
||||
if (CefIsRTL()) {
|
||||
point.x += button_width - 4;
|
||||
point.x += button_bounds.width - 4;
|
||||
} else {
|
||||
point.x -= button_width - 4;
|
||||
point.x -= button_bounds.width - 4;
|
||||
}
|
||||
}
|
||||
|
||||
if (use_bottom_controls_) {
|
||||
const auto display_bounds =
|
||||
menu_button->GetWindow()->GetDisplay()->GetWorkArea();
|
||||
const int available_height = display_bounds.y + display_bounds.height -
|
||||
button_bounds.y - button_bounds.height;
|
||||
|
||||
// Approximation of the menu height.
|
||||
const int menu_height =
|
||||
static_cast<int>(button_menu_model_->GetCount()) * button_bounds.height;
|
||||
if (menu_height > available_height) {
|
||||
// The menu will go upwards, so place it above the button.
|
||||
point.y -= button_bounds.height - 8;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -677,9 +693,9 @@ void ViewsWindow::OnWindowDestroyed(CefRefPtr<CefWindow> window) {
|
||||
|
||||
browser_view_ = nullptr;
|
||||
button_menu_model_ = nullptr;
|
||||
if (top_menu_bar_) {
|
||||
top_menu_bar_->Reset();
|
||||
top_menu_bar_ = nullptr;
|
||||
if (menu_bar_) {
|
||||
menu_bar_->Reset();
|
||||
menu_bar_ = nullptr;
|
||||
}
|
||||
extensions_panel_ = nullptr;
|
||||
menu_button_ = nullptr;
|
||||
@@ -704,10 +720,10 @@ void ViewsWindow::OnWindowBoundsChanged(CefRefPtr<CefWindow> window,
|
||||
}
|
||||
|
||||
#if defined(OS_MAC)
|
||||
if (frameless_ && with_standard_buttons_ && top_toolbar_) {
|
||||
auto insets = top_toolbar_->GetInsets();
|
||||
if (frameless_ && with_standard_buttons_ && toolbar_) {
|
||||
auto insets = toolbar_->GetInsets();
|
||||
insets.left = window->IsFullscreen() ? 0 : kWindowButtonsWidth;
|
||||
top_toolbar_->SetInsets(insets);
|
||||
toolbar_->SetInsets(insets);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -846,8 +862,8 @@ bool ViewsWindow::OnKeyEvent(CefRefPtr<CefWindow> window,
|
||||
return true;
|
||||
}
|
||||
|
||||
if (menu_has_focus_ && top_menu_bar_) {
|
||||
return top_menu_bar_->OnKeyEvent(event);
|
||||
if (menu_has_focus_ && menu_bar_) {
|
||||
return menu_bar_->OnKeyEvent(event);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -882,14 +898,14 @@ void ViewsWindow::OnFocus(CefRefPtr<CefView> view) {
|
||||
|
||||
// Keep track of the non-menu view that was last focused.
|
||||
if (last_focused_view_ != view_id &&
|
||||
(!top_menu_bar_ || !top_menu_bar_->HasMenuId(view_id))) {
|
||||
(!menu_bar_ || !menu_bar_->HasMenuId(view_id))) {
|
||||
last_focused_view_ = view_id;
|
||||
}
|
||||
|
||||
// When focus leaves the menu buttons make them unfocusable.
|
||||
if (menu_has_focus_) {
|
||||
if (top_menu_bar_) {
|
||||
if (!top_menu_bar_->HasMenuId(view_id)) {
|
||||
if (menu_bar_) {
|
||||
if (!menu_bar_->HasMenuId(view_id)) {
|
||||
SetMenuFocusable(false);
|
||||
}
|
||||
} else if (view_id != ID_MENU_BUTTON) {
|
||||
@@ -922,18 +938,25 @@ void ViewsWindow::OnWindowChanged(CefRefPtr<CefView> view, bool added) {
|
||||
if (with_overlay_controls_) {
|
||||
// Add window buttons if we don't have standard ones
|
||||
const bool with_window_buttons = !with_standard_buttons_;
|
||||
overlay_controls_ = new ViewsOverlayControls(with_window_buttons);
|
||||
overlay_controls_ =
|
||||
new ViewsOverlayControls(with_window_buttons, use_bottom_controls_);
|
||||
overlay_controls_->Initialize(window_, CreateMenuButton(),
|
||||
CreateLocationBar(),
|
||||
chrome_toolbar_type_ != CEF_CTT_NONE);
|
||||
}
|
||||
} else {
|
||||
// Remove any controls that may include the Chrome toolbar before removing
|
||||
// the BrowserView.
|
||||
if (overlay_controls_) {
|
||||
// Overlay controls may include the Chrome toolbar, in which case they
|
||||
// need to be removed before the BrowserView.
|
||||
overlay_controls_->Destroy();
|
||||
overlay_controls_ = nullptr;
|
||||
location_bar_ = nullptr;
|
||||
} else if (use_bottom_controls_) {
|
||||
if (toolbar_) {
|
||||
window_->RemoveChildView(toolbar_);
|
||||
toolbar_ = nullptr;
|
||||
location_bar_ = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1003,11 +1026,13 @@ ViewsWindow::ViewsWindow(WindowType type,
|
||||
chrome_toolbar_type_ = CalculateChromeToolbarType(toolbar_type, hide_toolbar,
|
||||
with_overlay_controls_);
|
||||
|
||||
use_bottom_controls_ = command_line->HasSwitch(switches::kUseBottomControls);
|
||||
|
||||
#if !defined(OS_MAC)
|
||||
// On Mac we don't show a top menu on the window. The options are available in
|
||||
// the app menu instead.
|
||||
if (!command_line->HasSwitch(switches::kHideTopMenu)) {
|
||||
top_menu_bar_ = new ViewsMenuBar(this, ID_TOP_MENU_FIRST);
|
||||
menu_bar_ = new ViewsMenuBar(this, ID_TOP_MENU_FIRST, use_bottom_controls_);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1033,10 +1058,10 @@ void ViewsWindow::CreateMenuModel() {
|
||||
AddTestMenuItems(test_menu);
|
||||
AddFileMenuItems(button_menu_model_);
|
||||
|
||||
if (top_menu_bar_) {
|
||||
if (menu_bar_) {
|
||||
// Add the menus to the top menu bar.
|
||||
AddFileMenuItems(top_menu_bar_->CreateMenuModel("&File", nullptr));
|
||||
AddTestMenuItems(top_menu_bar_->CreateMenuModel("&Tests", nullptr));
|
||||
AddFileMenuItems(menu_bar_->CreateMenuModel("&File", nullptr));
|
||||
AddTestMenuItems(menu_bar_->CreateMenuModel("&Tests", nullptr));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1110,20 +1135,20 @@ void ViewsWindow::AddControls() {
|
||||
// Build the remainder of the UI now that the BrowserView has been added to
|
||||
// the CefWindow. This is a requirement to use Chrome toolbars.
|
||||
|
||||
CefRefPtr<CefPanel> top_menu_panel;
|
||||
if (top_menu_bar_) {
|
||||
top_menu_panel = top_menu_bar_->GetMenuPanel();
|
||||
CefRefPtr<CefPanel> menu_panel;
|
||||
if (menu_bar_) {
|
||||
menu_panel = menu_bar_->GetMenuPanel();
|
||||
}
|
||||
|
||||
LabelButtons browse_buttons;
|
||||
|
||||
if (chrome_toolbar_type_ == CEF_CTT_NORMAL) {
|
||||
// Chrome will provide a normal toolbar with location, menu, etc.
|
||||
top_toolbar_ = browser_view_->GetChromeToolbar();
|
||||
DCHECK(top_toolbar_);
|
||||
toolbar_ = browser_view_->GetChromeToolbar();
|
||||
DCHECK(toolbar_);
|
||||
}
|
||||
|
||||
if (!top_toolbar_) {
|
||||
if (!toolbar_) {
|
||||
// Create the browse buttons.
|
||||
browse_buttons.push_back(CreateBrowseButton("Back", ID_BACK_BUTTON));
|
||||
browse_buttons.push_back(CreateBrowseButton("Forward", ID_FORWARD_BUTTON));
|
||||
@@ -1133,48 +1158,56 @@ void ViewsWindow::AddControls() {
|
||||
CreateLocationBar();
|
||||
CreateMenuButton();
|
||||
|
||||
// Create the top panel.
|
||||
CefRefPtr<CefPanel> top_panel = CefPanel::CreatePanel(nullptr);
|
||||
// Create the toolbar panel.
|
||||
CefRefPtr<CefPanel> panel = CefPanel::CreatePanel(nullptr);
|
||||
|
||||
// Use a horizontal box layout for |top_panel|.
|
||||
CefBoxLayoutSettings top_panel_layout_settings;
|
||||
top_panel_layout_settings.horizontal = true;
|
||||
CefRefPtr<CefBoxLayout> top_panel_layout =
|
||||
top_panel->SetToBoxLayout(top_panel_layout_settings);
|
||||
// Use a horizontal box layout for |panel|.
|
||||
CefBoxLayoutSettings panel_layout_settings;
|
||||
panel_layout_settings.horizontal = true;
|
||||
CefRefPtr<CefBoxLayout> panel_layout =
|
||||
panel->SetToBoxLayout(panel_layout_settings);
|
||||
|
||||
// Add the buttons and URL textfield to |top_panel|.
|
||||
// Add the buttons and URL textfield to |panel|.
|
||||
for (auto& browse_button : browse_buttons) {
|
||||
top_panel->AddChildView(browse_button);
|
||||
panel->AddChildView(browse_button);
|
||||
}
|
||||
top_panel->AddChildView(location_bar_);
|
||||
panel->AddChildView(location_bar_);
|
||||
|
||||
UpdateExtensionControls();
|
||||
DCHECK(extensions_panel_);
|
||||
top_panel->AddChildView(extensions_panel_);
|
||||
panel->AddChildView(extensions_panel_);
|
||||
|
||||
top_panel->AddChildView(menu_button_);
|
||||
views_style::ApplyTo(top_panel);
|
||||
panel->AddChildView(menu_button_);
|
||||
views_style::ApplyTo(panel);
|
||||
|
||||
// Allow |location| to grow and fill any remaining space.
|
||||
top_panel_layout->SetFlexForView(location_bar_, 1);
|
||||
panel_layout->SetFlexForView(location_bar_, 1);
|
||||
|
||||
top_toolbar_ = top_panel;
|
||||
toolbar_ = panel;
|
||||
}
|
||||
|
||||
#if defined(OS_MAC)
|
||||
if (frameless_ && with_standard_buttons_) {
|
||||
auto insets = top_toolbar_->GetInsets();
|
||||
auto insets = toolbar_->GetInsets();
|
||||
insets.left = kWindowButtonsWidth;
|
||||
top_toolbar_->SetInsets(insets);
|
||||
toolbar_->SetInsets(insets);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Add the top panel and browser view to |window|.
|
||||
int top_index = 0;
|
||||
if (top_menu_panel) {
|
||||
window_->AddChildViewAt(top_menu_panel, top_index++);
|
||||
if (use_bottom_controls_) {
|
||||
// Add the panel at the bottom of |window|.
|
||||
window_->AddChildView(toolbar_);
|
||||
if (menu_panel) {
|
||||
window_->AddChildView(menu_panel);
|
||||
}
|
||||
} else {
|
||||
// Add the panel at the top of |window|.
|
||||
int index = 0;
|
||||
if (menu_panel) {
|
||||
window_->AddChildViewAt(menu_panel, index++);
|
||||
}
|
||||
window_->AddChildViewAt(toolbar_, index);
|
||||
}
|
||||
window_->AddChildViewAt(top_toolbar_, top_index);
|
||||
|
||||
// Lay out |window| so we can get the default button sizes.
|
||||
window_->Layout();
|
||||
@@ -1194,10 +1227,10 @@ void ViewsWindow::AddControls() {
|
||||
menu_button_->GetBounds().width + 100;
|
||||
}
|
||||
|
||||
// Minimum window height is the hight of the top toolbar plus some extra.
|
||||
int min_height = top_toolbar_->GetBounds().height + 100;
|
||||
if (top_menu_panel) {
|
||||
min_height += top_menu_panel->GetBounds().height;
|
||||
// Minimum window height is the hight of the toolbar plus some extra.
|
||||
int min_height = toolbar_->GetBounds().height + 100;
|
||||
if (menu_panel) {
|
||||
min_height += menu_panel->GetBounds().height;
|
||||
}
|
||||
|
||||
minimum_window_size_ = CefSize(min_width, min_height);
|
||||
@@ -1217,8 +1250,8 @@ void ViewsWindow::SetMenuFocusable(bool focusable) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (top_menu_bar_) {
|
||||
top_menu_bar_->SetMenuFocusable(focusable);
|
||||
if (menu_bar_) {
|
||||
menu_bar_->SetMenuFocusable(focusable);
|
||||
} else {
|
||||
window_->GetViewForID(ID_MENU_BUTTON)->SetFocusable(focusable);
|
||||
|
||||
@@ -1249,10 +1282,10 @@ void ViewsWindow::ShowTopControls(bool show) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Change the visibility of the top toolbar.
|
||||
if (top_toolbar_->IsVisible() != show) {
|
||||
top_toolbar_->SetVisible(show);
|
||||
top_toolbar_->InvalidateLayout();
|
||||
// Change the visibility of the toolbar.
|
||||
if (toolbar_->IsVisible() != show) {
|
||||
toolbar_->SetVisible(show);
|
||||
toolbar_->InvalidateLayout();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1266,11 +1299,11 @@ void ViewsWindow::UpdateExtensionControls() {
|
||||
if (!extensions_panel_) {
|
||||
extensions_panel_ = CefPanel::CreatePanel(nullptr);
|
||||
|
||||
// Use a horizontal box layout for |top_panel|.
|
||||
CefBoxLayoutSettings top_panel_layout_settings;
|
||||
top_panel_layout_settings.horizontal = true;
|
||||
CefRefPtr<CefBoxLayout> top_panel_layout =
|
||||
extensions_panel_->SetToBoxLayout(top_panel_layout_settings);
|
||||
// Use a horizontal box layout for |panel|.
|
||||
CefBoxLayoutSettings panel_layout_settings;
|
||||
panel_layout_settings.horizontal = true;
|
||||
CefRefPtr<CefBoxLayout> panel_layout =
|
||||
extensions_panel_->SetToBoxLayout(panel_layout_settings);
|
||||
} else {
|
||||
extensions_panel_->RemoveAllChildViews();
|
||||
}
|
||||
|
@@ -253,11 +253,12 @@ class ViewsWindow : public CefBrowserViewDelegate,
|
||||
bool with_standard_buttons_;
|
||||
ChromeToolbarType chrome_toolbar_type_;
|
||||
bool use_window_modal_dialog_;
|
||||
bool use_bottom_controls_;
|
||||
CefRefPtr<CefWindow> window_;
|
||||
|
||||
CefRefPtr<CefMenuModel> button_menu_model_;
|
||||
CefRefPtr<ViewsMenuBar> top_menu_bar_;
|
||||
CefRefPtr<CefView> top_toolbar_;
|
||||
CefRefPtr<ViewsMenuBar> menu_bar_;
|
||||
CefRefPtr<CefView> toolbar_;
|
||||
CefRefPtr<CefMenuButton> menu_button_;
|
||||
CefRefPtr<CefView> location_bar_;
|
||||
bool menu_has_focus_;
|
||||
|
@@ -55,6 +55,7 @@ const char kUseClientDialogs[] = "use-client-dialogs";
|
||||
const char kUseTestHttpServer[] = "use-test-http-server";
|
||||
const char kShowWindowButtons[] = "show-window-buttons";
|
||||
const char kUseWindowModalDialog[] = "use-window-modal-dialog";
|
||||
const char kUseBottomControls[] = "use-bottom-controls";
|
||||
|
||||
} // namespace switches
|
||||
} // namespace client
|
||||
|
@@ -49,6 +49,7 @@ extern const char kUseClientDialogs[];
|
||||
extern const char kUseTestHttpServer[];
|
||||
extern const char kShowWindowButtons[];
|
||||
extern const char kUseWindowModalDialog[];
|
||||
extern const char kUseBottomControls[];
|
||||
|
||||
} // namespace switches
|
||||
} // namespace client
|
||||
|
@@ -466,14 +466,18 @@ def GetConfigArgs(args, is_debug, cpu):
|
||||
"""
|
||||
add_args = {}
|
||||
|
||||
# Cannot create is_official_build=true is_debug=true builds.
|
||||
# This restriction is enforced in //build/config/BUILDCONFIG.gn.
|
||||
# Instead, our "official Debug" build is a Release build with dchecks and
|
||||
# symbols. Symbols will be generated by default for official builds; see the
|
||||
# definition of 'symbol_level' in //build/config/compiler/compiler.gni.
|
||||
if is_debug and GetArgValue(args, 'is_official_build'):
|
||||
is_debug = False
|
||||
add_args['dcheck_always_on'] = True
|
||||
if GetArgValue(args, 'is_official_build'):
|
||||
# Disable Chromium field trials in official builds.
|
||||
add_args['disable_fieldtrial_testing_config'] = True
|
||||
|
||||
# Cannot create is_official_build=true is_debug=true builds.
|
||||
# This restriction is enforced in //build/config/BUILDCONFIG.gn.
|
||||
# Instead, our "official Debug" build is a Release build with dchecks and
|
||||
# symbols. Symbols will be generated by default for official builds; see the
|
||||
# definition of 'symbol_level' in //build/config/compiler/compiler.gni.
|
||||
if is_debug:
|
||||
is_debug = False
|
||||
add_args['dcheck_always_on'] = True
|
||||
|
||||
result = MergeDicts(args, add_args, {
|
||||
'is_debug': is_debug,
|
||||
|
Reference in New Issue
Block a user