mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
23 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1701b8e6d5 | ||
|
c410c950de | ||
|
c8b1a8cb23 | ||
|
74eca7268f | ||
|
3d8f1c9064 | ||
|
e997249d53 | ||
|
3ccd305f6d | ||
|
99c85e32ac | ||
|
6da73a3d31 | ||
|
44f7b57e79 | ||
|
331f668eee | ||
|
14bd14567f | ||
|
69ce47ae4c | ||
|
0580f93839 | ||
|
3c3e543b44 | ||
|
fae4a6f0bd | ||
|
91ba12468b | ||
|
739021e4a8 | ||
|
853ea8846a | ||
|
9f45038464 | ||
|
39993d8c0c | ||
|
0f68a0d7a3 | ||
|
a0566e64d8 |
@@ -7,5 +7,6 @@
|
||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
|
||||
{
|
||||
'chromium_checkout': 'refs/tags/125.0.6422.0'
|
||||
'chromium_checkout': 'refs/tags/125.0.6422.142',
|
||||
'depot_tools_checkout': '3e4ab13934'
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=7733ed87ade32dfd311c24c51263d20b9b469868$
|
||||
// $hash=6ee74f31d37a1b5ab3c9c5ccbe2dce9841329b38$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
|
||||
@@ -911,6 +911,8 @@ typedef struct _cef_browser_host_t {
|
||||
/// Returns the extension hosted in this browser or NULL if no extension is
|
||||
/// hosted. See cef_request_context_t::LoadExtension for details.
|
||||
///
|
||||
/// WARNING: This function is deprecated and will be removed in ~M127.
|
||||
///
|
||||
struct _cef_extension_t*(CEF_CALLBACK* get_extension)(
|
||||
struct _cef_browser_host_t* self);
|
||||
|
||||
@@ -919,6 +921,8 @@ typedef struct _cef_browser_host_t {
|
||||
/// script. Background hosts do not have a window and are not displayable. See
|
||||
/// cef_request_context_t::LoadExtension for details.
|
||||
///
|
||||
/// WARNING: This function is deprecated and will be removed in ~M127.
|
||||
///
|
||||
int(CEF_CALLBACK* is_background_host)(struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=0ca2b788f70f8c9f5b2706d691d8e063be00ed19$
|
||||
// $hash=634054ad25154c30fb4ec630fe7fb79b0cf1f9b3$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_
|
||||
@@ -54,6 +54,8 @@ struct _cef_request_context_t;
|
||||
/// Object representing an extension. Methods may be called on any thread unless
|
||||
/// otherwise indicated.
|
||||
///
|
||||
/// WARNING: This API is deprecated and will be removed in ~M127.
|
||||
///
|
||||
typedef struct _cef_extension_t {
|
||||
///
|
||||
/// Base structure.
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=5cfff4465a586d2b2ea7b54a9549096faec415f6$
|
||||
// $hash=ebac34c9b85de780ce7524211c5dd61a80d4576c$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_
|
||||
@@ -80,6 +80,8 @@ typedef struct _cef_get_extension_resource_callback_t {
|
||||
/// cef_request_context_t::LoadExtension for information about extension
|
||||
/// loading.
|
||||
///
|
||||
/// WARNING: This API is deprecated and will be removed in ~M127.
|
||||
///
|
||||
typedef struct _cef_extension_handler_t {
|
||||
///
|
||||
/// Base structure.
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=7df03921b2ee743fb059f13e545ccf89904eb060$
|
||||
// $hash=2c496139ca9a59303b1493ee93d2c3ae96a956c0$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
|
||||
@@ -253,6 +253,8 @@ typedef struct _cef_request_context_t {
|
||||
/// See https://developer.chrome.com/extensions for extension implementation
|
||||
/// and usage documentation.
|
||||
///
|
||||
/// WARNING: This function is deprecated and will be removed in ~M127.
|
||||
///
|
||||
void(CEF_CALLBACK* load_extension)(struct _cef_request_context_t* self,
|
||||
const cef_string_t* root_directory,
|
||||
struct _cef_dictionary_value_t* manifest,
|
||||
@@ -264,6 +266,8 @@ typedef struct _cef_request_context_t {
|
||||
/// access to the extension (see HasExtension). This function must be called
|
||||
/// on the browser process UI thread.
|
||||
///
|
||||
/// WARNING: This function is deprecated and will be removed in ~M127.
|
||||
///
|
||||
int(CEF_CALLBACK* did_load_extension)(struct _cef_request_context_t* self,
|
||||
const cef_string_t* extension_id);
|
||||
|
||||
@@ -273,6 +277,8 @@ typedef struct _cef_request_context_t {
|
||||
/// extension (see DidLoadExtension). This function must be called on the
|
||||
/// browser process UI thread.
|
||||
///
|
||||
/// WARNING: This function is deprecated and will be removed in ~M127.
|
||||
///
|
||||
int(CEF_CALLBACK* has_extension)(struct _cef_request_context_t* self,
|
||||
const cef_string_t* extension_id);
|
||||
|
||||
@@ -282,6 +288,8 @@ typedef struct _cef_request_context_t {
|
||||
/// extension ID values. Returns true (1) on success. This function must be
|
||||
/// called on the browser process UI thread.
|
||||
///
|
||||
/// WARNING: This function is deprecated and will be removed in ~M127.
|
||||
///
|
||||
int(CEF_CALLBACK* get_extensions)(struct _cef_request_context_t* self,
|
||||
cef_string_list_t extension_ids);
|
||||
|
||||
@@ -290,6 +298,8 @@ typedef struct _cef_request_context_t {
|
||||
/// extension is accessible in this context (see HasExtension). This function
|
||||
/// must be called on the browser process UI thread.
|
||||
///
|
||||
/// WARNING: This function is deprecated and will be removed in ~M127.
|
||||
///
|
||||
struct _cef_extension_t*(CEF_CALLBACK* get_extension)(
|
||||
struct _cef_request_context_t* self,
|
||||
const cef_string_t* extension_id);
|
||||
|
@@ -942,6 +942,8 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
|
||||
/// Returns the extension hosted in this browser or NULL if no extension is
|
||||
/// hosted. See CefRequestContext::LoadExtension for details.
|
||||
///
|
||||
/// WARNING: This method is deprecated and will be removed in ~M127.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefExtension> GetExtension() = 0;
|
||||
|
||||
@@ -950,6 +952,8 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
|
||||
/// Background hosts do not have a window and are not displayable. See
|
||||
/// CefRequestContext::LoadExtension for details.
|
||||
///
|
||||
/// WARNING: This method is deprecated and will be removed in ~M127.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsBackgroundHost() = 0;
|
||||
|
||||
|
@@ -48,6 +48,8 @@ class CefRequestContext;
|
||||
/// Object representing an extension. Methods may be called on any thread unless
|
||||
/// otherwise indicated.
|
||||
///
|
||||
/// WARNING: This API is deprecated and will be removed in ~M127.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefExtension : public CefBaseRefCounted {
|
||||
public:
|
||||
|
@@ -70,6 +70,8 @@ class CefGetExtensionResourceCallback : public CefBaseRefCounted {
|
||||
/// The methods of this class will be called on the UI thread. See
|
||||
/// CefRequestContext::LoadExtension for information about extension loading.
|
||||
///
|
||||
/// WARNING: This API is deprecated and will be removed in ~M127.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefExtensionHandler : public virtual CefBaseRefCounted {
|
||||
public:
|
||||
|
@@ -266,6 +266,8 @@ class CefRequestContext : public CefPreferenceManager {
|
||||
/// See https://developer.chrome.com/extensions for extension implementation
|
||||
/// and usage documentation.
|
||||
///
|
||||
/// WARNING: This method is deprecated and will be removed in ~M127.
|
||||
///
|
||||
/*--cef(optional_param=manifest,optional_param=handler)--*/
|
||||
virtual void LoadExtension(const CefString& root_directory,
|
||||
CefRefPtr<CefDictionaryValue> manifest,
|
||||
@@ -277,6 +279,8 @@ class CefRequestContext : public CefPreferenceManager {
|
||||
/// access to the extension (see HasExtension). This method must be called on
|
||||
/// the browser process UI thread.
|
||||
///
|
||||
/// WARNING: This method is deprecated and will be removed in ~M127.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool DidLoadExtension(const CefString& extension_id) = 0;
|
||||
|
||||
@@ -286,6 +290,8 @@ class CefRequestContext : public CefPreferenceManager {
|
||||
/// extension (see DidLoadExtension). This method must be called on the
|
||||
/// browser process UI thread.
|
||||
///
|
||||
/// WARNING: This method is deprecated and will be removed in ~M127.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool HasExtension(const CefString& extension_id) = 0;
|
||||
|
||||
@@ -295,6 +301,8 @@ class CefRequestContext : public CefPreferenceManager {
|
||||
/// extension ID values. Returns true on success. This method must be called
|
||||
/// on the browser process UI thread.
|
||||
///
|
||||
/// WARNING: This method is deprecated and will be removed in ~M127.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool GetExtensions(std::vector<CefString>& extension_ids) = 0;
|
||||
|
||||
@@ -303,6 +311,8 @@ class CefRequestContext : public CefPreferenceManager {
|
||||
/// extension is accessible in this context (see HasExtension). This method
|
||||
/// must be called on the browser process UI thread.
|
||||
///
|
||||
/// WARNING: This method is deprecated and will be removed in ~M127.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefExtension> GetExtension(
|
||||
const CefString& extension_id) = 0;
|
||||
|
@@ -117,7 +117,10 @@ void CefAudioCapturer::OnCaptureError(
|
||||
media::AudioCapturerSource::ErrorCode code,
|
||||
const std::string& message) {
|
||||
audio_handler_->OnAudioStreamError(browser_, message);
|
||||
StopStream();
|
||||
|
||||
if (code != media::AudioCapturerSource::ErrorCode::kSocketError) {
|
||||
StopStream();
|
||||
}
|
||||
}
|
||||
|
||||
void CefAudioCapturer::StopStream() {
|
||||
|
@@ -118,6 +118,14 @@ void ChromeContentBrowserClientCef::AppendExtraCommandLineSwitches(
|
||||
// Propagate the following switches to all command lines (along with any
|
||||
// associated values) if present in the browser command line.
|
||||
static const char* const kSwitchNames[] = {
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
switches::kFrameworkDirPath,
|
||||
switches::kMainBundlePath,
|
||||
#endif
|
||||
switches::kLocalesDirPath,
|
||||
switches::kLogItems,
|
||||
switches::kLogSeverity,
|
||||
switches::kResourcesDirPath,
|
||||
switches::kUserAgentProductAndVersion,
|
||||
};
|
||||
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames);
|
||||
@@ -125,6 +133,19 @@ void ChromeContentBrowserClientCef::AppendExtraCommandLineSwitches(
|
||||
|
||||
const std::string& process_type =
|
||||
command_line->GetSwitchValueASCII(switches::kProcessType);
|
||||
|
||||
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
|
||||
if (process_type == switches::kZygoteProcess &&
|
||||
browser_cmd->HasSwitch(switches::kBrowserSubprocessPath)) {
|
||||
// Force use of the sub-process executable path for the zygote process.
|
||||
const base::FilePath& subprocess_path =
|
||||
browser_cmd->GetSwitchValuePath(switches::kBrowserSubprocessPath);
|
||||
if (!subprocess_path.empty()) {
|
||||
command_line->SetProgram(subprocess_path);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (process_type == switches::kRendererProcess) {
|
||||
// Propagate the following switches to the renderer command line (along with
|
||||
// any associated values) if present in the browser command line.
|
||||
|
@@ -64,4 +64,12 @@ bool GetAlloyTabById(int tab_id,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsAlloyContents(content::WebContents* contents, bool primary_only) {
|
||||
auto browser = CefBrowserHostBase::GetBrowserForContents(contents);
|
||||
if (browser && browser->IsAlloyStyle()) {
|
||||
return !primary_only || browser->GetWebContents() == contents;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace cef
|
||||
|
@@ -21,6 +21,10 @@ bool GetAlloyTabById(int tab_id,
|
||||
bool include_incognito,
|
||||
content::WebContents** contents);
|
||||
|
||||
// Returns true if |contents| is owned by an Alloy style CefBrowserHost.
|
||||
// If |primary_only| is false then guest contents will also be matched.
|
||||
bool IsAlloyContents(content::WebContents* contents, bool primary_only);
|
||||
|
||||
} // namespace cef
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_CHROME_EXTENSIONS_CHROME_EXTENSION_UTIL_H_
|
||||
|
@@ -9,6 +9,7 @@
|
||||
#include "libcef/browser/views/window_view.h"
|
||||
|
||||
#include "chrome/browser/themes/theme_service.h"
|
||||
#include "chrome/browser/themes/theme_service_factory.h"
|
||||
#include "chrome/browser/ui/browser.h"
|
||||
#include "chrome/browser/ui/browser_commands.h"
|
||||
#include "chrome/browser/ui/views/frame/browser_view.h"
|
||||
@@ -22,6 +23,10 @@
|
||||
ChromeBrowserFrame::ChromeBrowserFrame(CefWindowView* window_view)
|
||||
: window_view_(window_view) {}
|
||||
|
||||
ChromeBrowserFrame::~ChromeBrowserFrame() {
|
||||
DCHECK(associated_profiles_.empty());
|
||||
}
|
||||
|
||||
void ChromeBrowserFrame::Init(BrowserView* browser_view,
|
||||
std::unique_ptr<Browser> browser) {
|
||||
DCHECK(browser_view);
|
||||
@@ -64,17 +69,71 @@ void ChromeBrowserFrame::Initialized() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void ChromeBrowserFrame::AddAssociatedProfile(Profile* /*profile*/) {
|
||||
// Calls ThemeChanged().
|
||||
UserChangedTheme(BrowserThemeChangeType::kBrowserTheme);
|
||||
void ChromeBrowserFrame::AddAssociatedProfile(Profile* profile) {
|
||||
DCHECK(profile);
|
||||
|
||||
// Always call ThemeChanged() when the Chrome style BrowserView is added.
|
||||
bool call_theme_changed =
|
||||
browser_view_ && browser_view_->GetProfile() == profile;
|
||||
|
||||
ProfileMap::iterator it = associated_profiles_.find(profile);
|
||||
if (it != associated_profiles_.end()) {
|
||||
// Another instance of a known Profile.
|
||||
(it->second)++;
|
||||
} else {
|
||||
auto* current_profile = GetThemeProfile();
|
||||
|
||||
associated_profiles_.insert(std::make_pair(profile, 1));
|
||||
|
||||
if (auto* theme_service = ThemeServiceFactory::GetForProfile(profile)) {
|
||||
theme_service->AddObserver(this);
|
||||
}
|
||||
|
||||
// Potentially switching to a different theme.
|
||||
call_theme_changed |= GetThemeProfile() != current_profile;
|
||||
}
|
||||
|
||||
if (call_theme_changed) {
|
||||
// Calls ThemeChanged().
|
||||
UserChangedTheme(BrowserThemeChangeType::kBrowserTheme);
|
||||
}
|
||||
}
|
||||
|
||||
void ChromeBrowserFrame::RemoveAssociatedProfile(Profile* /*profile*/) {}
|
||||
void ChromeBrowserFrame::RemoveAssociatedProfile(Profile* profile) {
|
||||
DCHECK(profile);
|
||||
ProfileMap::iterator it = associated_profiles_.find(profile);
|
||||
if (it == associated_profiles_.end()) {
|
||||
DCHECK(false); // Not reached.
|
||||
return;
|
||||
}
|
||||
if (--(it->second) > 0) {
|
||||
// More instances of the Profile exist.
|
||||
return;
|
||||
}
|
||||
|
||||
auto* current_profile = GetThemeProfile();
|
||||
|
||||
associated_profiles_.erase(it);
|
||||
|
||||
if (auto* theme_service = ThemeServiceFactory::GetForProfile(profile)) {
|
||||
theme_service->RemoveObserver(this);
|
||||
}
|
||||
|
||||
auto* new_profile = GetThemeProfile();
|
||||
if (new_profile != current_profile) {
|
||||
// Switching to a different theme.
|
||||
NotifyThemeColorsChanged(/*chrome_theme=*/!!new_profile);
|
||||
}
|
||||
}
|
||||
|
||||
Profile* ChromeBrowserFrame::GetThemeProfile() const {
|
||||
// Always prefer the Browser Profile, if any.
|
||||
if (browser_view_) {
|
||||
return browser_view_->GetProfile();
|
||||
}
|
||||
if (!associated_profiles_.empty()) {
|
||||
return associated_profiles_.begin()->first;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -148,6 +207,31 @@ void ChromeBrowserFrame::OnNativeThemeUpdated(ui::NativeTheme* observed_theme) {
|
||||
native_theme_change_ = false;
|
||||
}
|
||||
|
||||
ui::ColorProviderKey ChromeBrowserFrame::GetColorProviderKey() const {
|
||||
if (browser_view_) {
|
||||
// Use the default Browser implementation.
|
||||
return BrowserFrame::GetColorProviderKey();
|
||||
}
|
||||
|
||||
const auto& widget_key = Widget::GetColorProviderKey();
|
||||
if (auto* profile = GetThemeProfile()) {
|
||||
return CefWidget::GetColorProviderKey(widget_key, profile);
|
||||
}
|
||||
return widget_key;
|
||||
}
|
||||
|
||||
void ChromeBrowserFrame::OnThemeChanged() {
|
||||
if (browser_view_) {
|
||||
// Ignore these notifications if we have a Browser.
|
||||
return;
|
||||
}
|
||||
|
||||
// When the Chrome theme changes, the NativeTheme may also change.
|
||||
SelectNativeTheme();
|
||||
|
||||
NotifyThemeColorsChanged(/*chrome_theme=*/true);
|
||||
}
|
||||
|
||||
void ChromeBrowserFrame::OnColorProviderCacheResetMissed() {
|
||||
// Ignore calls during Widget::Init().
|
||||
if (!initialized_) {
|
||||
|
@@ -6,10 +6,13 @@
|
||||
#define CEF_LIBCEF_BROWSER_CHROME_VIEWS_CHROME_BROWSER_FRAME_H_
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "libcef/browser/views/color_provider_tracker.h"
|
||||
#include "libcef/browser/views/widget.h"
|
||||
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "chrome/browser/themes/theme_service_observer.h"
|
||||
#include "chrome/browser/ui/browser.h"
|
||||
#include "chrome/browser/ui/views/frame/browser_frame.h"
|
||||
|
||||
@@ -96,9 +99,11 @@ class CefWindowView;
|
||||
// CefWindowView::CreateWidget() when the Chrome runtime is enabled.
|
||||
class ChromeBrowserFrame : public BrowserFrame,
|
||||
public CefWidget,
|
||||
public CefColorProviderTracker::Observer {
|
||||
public CefColorProviderTracker::Observer,
|
||||
public ThemeServiceObserver {
|
||||
public:
|
||||
explicit ChromeBrowserFrame(CefWindowView* window_view);
|
||||
~ChromeBrowserFrame() override;
|
||||
|
||||
ChromeBrowserFrame(const ChromeBrowserFrame&) = delete;
|
||||
ChromeBrowserFrame& operator=(const ChromeBrowserFrame&) = delete;
|
||||
@@ -131,6 +136,10 @@ class ChromeBrowserFrame : public BrowserFrame,
|
||||
|
||||
// ui::NativeThemeObserver methods:
|
||||
void OnNativeThemeUpdated(ui::NativeTheme* observed_theme) override;
|
||||
ui::ColorProviderKey GetColorProviderKey() const override;
|
||||
|
||||
// ThemeServiceObserver methods:
|
||||
void OnThemeChanged() override;
|
||||
|
||||
BrowserView* browser_view() const { return browser_view_; }
|
||||
|
||||
@@ -146,6 +155,10 @@ class ChromeBrowserFrame : public BrowserFrame,
|
||||
bool initialized_ = false;
|
||||
bool native_theme_change_ = false;
|
||||
|
||||
// Map of Profile* to count.
|
||||
using ProfileMap = std::map<Profile*, size_t>;
|
||||
ProfileMap associated_profiles_;
|
||||
|
||||
CefColorProviderTracker color_provider_tracker_{this};
|
||||
|
||||
base::WeakPtrFactory<ChromeBrowserFrame> weak_ptr_factory_{this};
|
||||
|
@@ -359,6 +359,7 @@ class InterceptedRequest : public network::mojom::URLLoader,
|
||||
GURL redirect_url_;
|
||||
GURL header_client_redirect_url_;
|
||||
const net::MutableNetworkTrafficAnnotationTag traffic_annotation_;
|
||||
std::optional<network::mojom::CredentialsMode> original_crendentials_mode_;
|
||||
|
||||
mojo::Receiver<network::mojom::URLLoader> proxied_loader_receiver_;
|
||||
mojo::Remote<network::mojom::URLLoaderClient> target_client_;
|
||||
@@ -507,6 +508,7 @@ void InterceptedRequest::Restart() {
|
||||
// Match logic in CorsURLLoader::StartNetworkRequest.
|
||||
const auto response_tainting = CalculateResponseTainting(
|
||||
should_check_cors, request_.mode, tainted_origin);
|
||||
original_crendentials_mode_ = request_.credentials_mode;
|
||||
request_.credentials_mode =
|
||||
network::cors::CalculateCredentialsFlag(request_.credentials_mode,
|
||||
response_tainting)
|
||||
@@ -875,6 +877,14 @@ void InterceptedRequest::ContinueAfterIntercept() {
|
||||
target_loader_.BindNewPipeAndPassReceiver(), id_, options, request_,
|
||||
proxied_client_receiver_.BindNewPipeAndPassRemote(),
|
||||
traffic_annotation_);
|
||||
if (original_crendentials_mode_) {
|
||||
// Restore the original |credentials_mode| value after calling
|
||||
// CreateLoaderAndStart. This matches the logic in CorsURLLoader::
|
||||
// StartNetworkRequest and allows InterceptedRequest::Restart to compute
|
||||
// the correct |credentials_mode| during a fetch request redirect.
|
||||
request_.credentials_mode = *original_crendentials_mode_;
|
||||
original_crendentials_mode_.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include "chrome/browser/media/webrtc/permission_bubble_media_access_handler.h"
|
||||
#include "chrome/browser/net/profile_network_context_service.h"
|
||||
#include "chrome/browser/net/system_network_context_manager.h"
|
||||
#include "chrome/browser/permissions/quiet_notification_permission_ui_state.h"
|
||||
#include "chrome/browser/prefs/chrome_command_line_pref_store.h"
|
||||
#include "chrome/browser/preloading/preloading_prefs.h"
|
||||
#include "chrome/browser/printing/print_preview_sticky_settings.h"
|
||||
@@ -265,6 +266,7 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
|
||||
prefetch::RegisterPredictionOptionsProfilePrefs(registry.get());
|
||||
privacy_sandbox::RegisterProfilePrefs(registry.get());
|
||||
ProfileNetworkContextService::RegisterProfilePrefs(registry.get());
|
||||
QuietNotificationPermissionUiState::RegisterProfilePrefs(registry.get());
|
||||
RegisterBrowserViewProfilePrefs(registry.get());
|
||||
safe_browsing::RegisterProfilePrefs(registry.get());
|
||||
unified_consent::UnifiedConsentService::RegisterPrefs(registry.get());
|
||||
|
@@ -9,6 +9,27 @@
|
||||
#include "libcef/browser/views/widget_impl.h"
|
||||
#include "libcef/browser/views/window_impl.h"
|
||||
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/themes/theme_service.h"
|
||||
#include "chrome/browser/themes/theme_service_factory.h"
|
||||
|
||||
namespace {
|
||||
|
||||
ui::ColorProviderKey::SchemeVariant GetSchemeVariant(
|
||||
ui::mojom::BrowserColorVariant color_variant) {
|
||||
using BCV = ui::mojom::BrowserColorVariant;
|
||||
using SV = ui::ColorProviderKey::SchemeVariant;
|
||||
static constexpr auto kSchemeVariantMap = base::MakeFixedFlatMap<BCV, SV>({
|
||||
{BCV::kTonalSpot, SV::kTonalSpot},
|
||||
{BCV::kNeutral, SV::kNeutral},
|
||||
{BCV::kVibrant, SV::kVibrant},
|
||||
{BCV::kExpressive, SV::kExpressive},
|
||||
});
|
||||
return kSchemeVariantMap.at(color_variant);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
CefWidget* CefWidget::Create(CefWindowView* window_view) {
|
||||
if (window_view->IsChromeStyle()) {
|
||||
@@ -30,3 +51,60 @@ CefWidget* CefWidget::GetForWidget(views::Widget* widget) {
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// static
|
||||
ui::ColorProviderKey CefWidget::GetColorProviderKey(
|
||||
const ui::ColorProviderKey& widget_key,
|
||||
Profile* profile) {
|
||||
// Based on BrowserFrame::GetColorProviderKey.
|
||||
auto key = widget_key;
|
||||
|
||||
const auto* theme_service = ThemeServiceFactory::GetForProfile(profile);
|
||||
CHECK(theme_service);
|
||||
|
||||
// color_mode.
|
||||
[&key, theme_service]() {
|
||||
const auto browser_color_scheme = theme_service->GetBrowserColorScheme();
|
||||
if (browser_color_scheme != ThemeService::BrowserColorScheme::kSystem) {
|
||||
key.color_mode =
|
||||
browser_color_scheme == ThemeService::BrowserColorScheme::kLight
|
||||
? ui::ColorProviderKey::ColorMode::kLight
|
||||
: ui::ColorProviderKey::ColorMode::kDark;
|
||||
}
|
||||
}();
|
||||
|
||||
// user_color.
|
||||
// Device theme retains the user_color from `Widget`.
|
||||
if (!theme_service->UsingDeviceTheme()) {
|
||||
if (theme_service->UsingAutogeneratedTheme()) {
|
||||
key.user_color = theme_service->GetAutogeneratedThemeColor();
|
||||
} else if (auto user_color = theme_service->GetUserColor()) {
|
||||
key.user_color = user_color;
|
||||
}
|
||||
}
|
||||
|
||||
// user_color_source.
|
||||
if (theme_service->UsingDeviceTheme()) {
|
||||
key.user_color_source = ui::ColorProviderKey::UserColorSource::kAccent;
|
||||
} else if (theme_service->GetIsGrayscale()) {
|
||||
key.user_color_source = ui::ColorProviderKey::UserColorSource::kGrayscale;
|
||||
} else if (theme_service->GetIsBaseline()) {
|
||||
key.user_color_source = ui::ColorProviderKey::UserColorSource::kBaseline;
|
||||
} else {
|
||||
CHECK(key.user_color.has_value());
|
||||
key.user_color_source = ui::ColorProviderKey::UserColorSource::kAccent;
|
||||
}
|
||||
|
||||
// scheme_variant.
|
||||
ui::mojom::BrowserColorVariant color_variant =
|
||||
theme_service->GetBrowserColorVariant();
|
||||
if (!theme_service->UsingDeviceTheme() &&
|
||||
color_variant != ui::mojom::BrowserColorVariant::kSystem) {
|
||||
key.scheme_variant = GetSchemeVariant(color_variant);
|
||||
}
|
||||
|
||||
// frame_type.
|
||||
key.frame_type = ui::ColorProviderKey::FrameType::kNative;
|
||||
|
||||
return key;
|
||||
}
|
||||
|
@@ -6,6 +6,8 @@
|
||||
#define CEF_LIBCEF_BROWSER_VIEWS_WIDGET_H_
|
||||
#pragma once
|
||||
|
||||
#include "ui/color/color_provider_key.h"
|
||||
|
||||
class CefWindowView;
|
||||
class Profile;
|
||||
|
||||
@@ -42,7 +44,6 @@ class CefWidget {
|
||||
|
||||
// Track all Profiles associated with this Widget. Called from
|
||||
// CefBrowserViewImpl::AddedToWidget and DisassociateFromWidget.
|
||||
// |profile| is only used with the Alloy runtime.
|
||||
virtual void AddAssociatedProfile(Profile* profile) = 0;
|
||||
virtual void RemoveAssociatedProfile(Profile* profile) = 0;
|
||||
|
||||
@@ -59,6 +60,10 @@ class CefWidget {
|
||||
|
||||
protected:
|
||||
virtual ~CefWidget() = default;
|
||||
|
||||
static ui::ColorProviderKey GetColorProviderKey(
|
||||
const ui::ColorProviderKey& widget_key,
|
||||
Profile* profile);
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_VIEWS_WIDGET_H_
|
||||
|
@@ -16,23 +16,6 @@
|
||||
#include "ui/linux/linux_ui.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
ui::ColorProviderKey::SchemeVariant GetSchemeVariant(
|
||||
ui::mojom::BrowserColorVariant color_variant) {
|
||||
using BCV = ui::mojom::BrowserColorVariant;
|
||||
using SV = ui::ColorProviderKey::SchemeVariant;
|
||||
static constexpr auto kSchemeVariantMap = base::MakeFixedFlatMap<BCV, SV>({
|
||||
{BCV::kTonalSpot, SV::kTonalSpot},
|
||||
{BCV::kNeutral, SV::kNeutral},
|
||||
{BCV::kVibrant, SV::kVibrant},
|
||||
{BCV::kExpressive, SV::kExpressive},
|
||||
});
|
||||
return kSchemeVariantMap.at(color_variant);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
CefWidgetImpl::CefWidgetImpl(CefWindowView* window_view)
|
||||
: window_view_(window_view) {}
|
||||
|
||||
@@ -157,62 +140,11 @@ void CefWidgetImpl::OnNativeThemeUpdated(ui::NativeTheme* observed_theme) {
|
||||
}
|
||||
|
||||
ui::ColorProviderKey CefWidgetImpl::GetColorProviderKey() const {
|
||||
auto* profile = GetThemeProfile();
|
||||
if (!profile) {
|
||||
return Widget::GetColorProviderKey();
|
||||
const auto& widget_key = Widget::GetColorProviderKey();
|
||||
if (auto* profile = GetThemeProfile()) {
|
||||
return CefWidget::GetColorProviderKey(widget_key, profile);
|
||||
}
|
||||
|
||||
// Based on BrowserFrame::GetColorProviderKey.
|
||||
auto key = Widget::GetColorProviderKey();
|
||||
|
||||
const auto* theme_service = ThemeServiceFactory::GetForProfile(profile);
|
||||
CHECK(theme_service);
|
||||
|
||||
// color_mode.
|
||||
[&key, theme_service]() {
|
||||
const auto browser_color_scheme = theme_service->GetBrowserColorScheme();
|
||||
if (browser_color_scheme != ThemeService::BrowserColorScheme::kSystem) {
|
||||
key.color_mode =
|
||||
browser_color_scheme == ThemeService::BrowserColorScheme::kLight
|
||||
? ui::ColorProviderKey::ColorMode::kLight
|
||||
: ui::ColorProviderKey::ColorMode::kDark;
|
||||
}
|
||||
}();
|
||||
|
||||
// user_color.
|
||||
// Device theme retains the user_color from `Widget`.
|
||||
if (!theme_service->UsingDeviceTheme()) {
|
||||
if (theme_service->UsingAutogeneratedTheme()) {
|
||||
key.user_color = theme_service->GetAutogeneratedThemeColor();
|
||||
} else if (auto user_color = theme_service->GetUserColor()) {
|
||||
key.user_color = user_color;
|
||||
}
|
||||
}
|
||||
|
||||
// user_color_source.
|
||||
if (theme_service->UsingDeviceTheme()) {
|
||||
key.user_color_source = ui::ColorProviderKey::UserColorSource::kAccent;
|
||||
} else if (theme_service->GetIsGrayscale()) {
|
||||
key.user_color_source = ui::ColorProviderKey::UserColorSource::kGrayscale;
|
||||
} else if (theme_service->GetIsBaseline()) {
|
||||
key.user_color_source = ui::ColorProviderKey::UserColorSource::kBaseline;
|
||||
} else {
|
||||
CHECK(key.user_color.has_value());
|
||||
key.user_color_source = ui::ColorProviderKey::UserColorSource::kAccent;
|
||||
}
|
||||
|
||||
// scheme_variant.
|
||||
ui::mojom::BrowserColorVariant color_variant =
|
||||
theme_service->GetBrowserColorVariant();
|
||||
if (!theme_service->UsingDeviceTheme() &&
|
||||
color_variant != ui::mojom::BrowserColorVariant::kSystem) {
|
||||
key.scheme_variant = GetSchemeVariant(color_variant);
|
||||
}
|
||||
|
||||
// frame_type.
|
||||
key.frame_type = ui::ColorProviderKey::FrameType::kNative;
|
||||
|
||||
return key;
|
||||
return widget_key;
|
||||
}
|
||||
|
||||
void CefWidgetImpl::OnThemeChanged() {
|
||||
|
@@ -556,6 +556,12 @@ std::optional<int> AlloyMainDelegate::BasicStartupComplete() {
|
||||
|
||||
logging::InitLogging(log_settings);
|
||||
|
||||
if (is_browser) {
|
||||
LOG(WARNING)
|
||||
<< "Alloy bootstrap is deprecated and will be removed in ~M127. See "
|
||||
"https://github.com/chromiumembedded/cef/issues/3685";
|
||||
}
|
||||
|
||||
ContentSettingsPattern::SetNonWildcardDomainNonPortSchemes(
|
||||
kNonWildcardDomainNonPortSchemes, kNonWildcardDomainNonPortSchemesSize);
|
||||
|
||||
|
@@ -18,15 +18,18 @@
|
||||
#include "base/base_switches.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/threading/threading_features.h"
|
||||
#include "chrome/browser/metrics/chrome_feature_list_creator.h"
|
||||
#include "chrome/browser/policy/chrome_browser_policy_connector.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/embedder_support/switches.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "sandbox/policy/switches.h"
|
||||
#include "third_party/blink/public/common/switches.h"
|
||||
#include "ui/base/ui_base_paths.h"
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
@@ -40,6 +43,76 @@ namespace {
|
||||
base::LazyInstance<ChromeContentRendererClientCef>::DestructorAtExit
|
||||
g_chrome_content_renderer_client = LAZY_INSTANCE_INITIALIZER;
|
||||
|
||||
void InitLogging(const base::CommandLine* command_line) {
|
||||
logging::LogSeverity log_severity = logging::LOGGING_INFO;
|
||||
|
||||
std::string log_severity_str =
|
||||
command_line->GetSwitchValueASCII(switches::kLogSeverity);
|
||||
if (!log_severity_str.empty()) {
|
||||
if (base::EqualsCaseInsensitiveASCII(log_severity_str,
|
||||
switches::kLogSeverity_Verbose)) {
|
||||
log_severity = logging::LOGGING_VERBOSE;
|
||||
} else if (base::EqualsCaseInsensitiveASCII(
|
||||
log_severity_str, switches::kLogSeverity_Warning)) {
|
||||
log_severity = logging::LOGGING_WARNING;
|
||||
} else if (base::EqualsCaseInsensitiveASCII(log_severity_str,
|
||||
switches::kLogSeverity_Error)) {
|
||||
log_severity = logging::LOGGING_ERROR;
|
||||
} else if (base::EqualsCaseInsensitiveASCII(log_severity_str,
|
||||
switches::kLogSeverity_Fatal)) {
|
||||
log_severity = logging::LOGGING_FATAL;
|
||||
} else if (base::EqualsCaseInsensitiveASCII(
|
||||
log_severity_str, switches::kLogSeverity_Disable)) {
|
||||
log_severity = LOGSEVERITY_DISABLE;
|
||||
}
|
||||
}
|
||||
|
||||
if (log_severity == LOGSEVERITY_DISABLE) {
|
||||
// By default, ERROR and FATAL messages will always be output to stderr due
|
||||
// to the kAlwaysPrintErrorLevel value in base/logging.cc. We change the log
|
||||
// level here so that only FATAL messages are output.
|
||||
logging::SetMinLogLevel(logging::LOGGING_FATAL);
|
||||
} else {
|
||||
logging::SetMinLogLevel(log_severity);
|
||||
}
|
||||
|
||||
// Customization of items automatically prepended to log lines.
|
||||
std::string log_items_str =
|
||||
command_line->GetSwitchValueASCII(switches::kLogItems);
|
||||
if (!log_items_str.empty()) {
|
||||
bool enable_log_of_process_id, enable_log_of_thread_id,
|
||||
enable_log_of_time_stamp, enable_log_of_tick_count;
|
||||
enable_log_of_process_id = enable_log_of_thread_id =
|
||||
enable_log_of_time_stamp = enable_log_of_tick_count = false;
|
||||
|
||||
for (const auto& cur_item_to_log :
|
||||
base::SplitStringPiece(log_items_str, ",", base::TRIM_WHITESPACE,
|
||||
base::SPLIT_WANT_NONEMPTY)) {
|
||||
// if "none" mode is present, all items are disabled.
|
||||
if (base::EqualsCaseInsensitiveASCII(cur_item_to_log,
|
||||
switches::kLogItems_None)) {
|
||||
enable_log_of_process_id = enable_log_of_thread_id =
|
||||
enable_log_of_time_stamp = enable_log_of_tick_count = false;
|
||||
break;
|
||||
} else if (base::EqualsCaseInsensitiveASCII(cur_item_to_log,
|
||||
switches::kLogItems_PId)) {
|
||||
enable_log_of_process_id = true;
|
||||
} else if (base::EqualsCaseInsensitiveASCII(cur_item_to_log,
|
||||
switches::kLogItems_TId)) {
|
||||
enable_log_of_thread_id = true;
|
||||
} else if (base::EqualsCaseInsensitiveASCII(
|
||||
cur_item_to_log, switches::kLogItems_TimeStamp)) {
|
||||
enable_log_of_time_stamp = true;
|
||||
} else if (base::EqualsCaseInsensitiveASCII(
|
||||
cur_item_to_log, switches::kLogItems_TickCount)) {
|
||||
enable_log_of_tick_count = true;
|
||||
}
|
||||
}
|
||||
logging::SetLogItems(enable_log_of_process_id, enable_log_of_thread_id,
|
||||
enable_log_of_time_stamp, enable_log_of_tick_count);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
ChromeMainDelegateCef::ChromeMainDelegateCef(CefMainRunnerHandler* runner,
|
||||
@@ -87,6 +160,39 @@ std::optional<int> ChromeMainDelegateCef::BasicStartupComplete() {
|
||||
|
||||
bool no_sandbox = settings_->no_sandbox ? true : false;
|
||||
|
||||
if (settings_->browser_subprocess_path.length > 0) {
|
||||
base::FilePath file_path =
|
||||
base::FilePath(CefString(&settings_->browser_subprocess_path));
|
||||
if (!file_path.empty()) {
|
||||
command_line->AppendSwitchPath(switches::kBrowserSubprocessPath,
|
||||
file_path);
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// The sandbox is not supported when using a separate subprocess
|
||||
// executable on Windows.
|
||||
no_sandbox = true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
if (settings_->framework_dir_path.length > 0) {
|
||||
base::FilePath file_path =
|
||||
base::FilePath(CefString(&settings_->framework_dir_path));
|
||||
if (!file_path.empty()) {
|
||||
command_line->AppendSwitchPath(switches::kFrameworkDirPath, file_path);
|
||||
}
|
||||
}
|
||||
|
||||
if (settings_->main_bundle_path.length > 0) {
|
||||
base::FilePath file_path =
|
||||
base::FilePath(CefString(&settings_->main_bundle_path));
|
||||
if (!file_path.empty()) {
|
||||
command_line->AppendSwitchPath(switches::kMainBundlePath, file_path);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (no_sandbox) {
|
||||
command_line->AppendSwitch(sandbox::policy::switches::kNoSandbox);
|
||||
}
|
||||
@@ -108,12 +214,92 @@ std::optional<int> ChromeMainDelegateCef::BasicStartupComplete() {
|
||||
command_line->AppendSwitchASCII(switches::kLang, "en-US");
|
||||
}
|
||||
|
||||
if (!command_line->HasSwitch(switches::kLogFile) &&
|
||||
settings_->log_file.length > 0) {
|
||||
auto log_file = base::FilePath(CefString(&settings_->log_file));
|
||||
command_line->AppendSwitchPath(switches::kLogFile, log_file);
|
||||
}
|
||||
|
||||
if (!command_line->HasSwitch(switches::kLogSeverity) &&
|
||||
settings_->log_severity != LOGSEVERITY_DEFAULT) {
|
||||
std::string log_severity;
|
||||
switch (settings_->log_severity) {
|
||||
case LOGSEVERITY_VERBOSE:
|
||||
log_severity = switches::kLogSeverity_Verbose;
|
||||
break;
|
||||
case LOGSEVERITY_INFO:
|
||||
log_severity = switches::kLogSeverity_Info;
|
||||
break;
|
||||
case LOGSEVERITY_WARNING:
|
||||
log_severity = switches::kLogSeverity_Warning;
|
||||
break;
|
||||
case LOGSEVERITY_ERROR:
|
||||
log_severity = switches::kLogSeverity_Error;
|
||||
break;
|
||||
case LOGSEVERITY_FATAL:
|
||||
log_severity = switches::kLogSeverity_Fatal;
|
||||
break;
|
||||
case LOGSEVERITY_DISABLE:
|
||||
log_severity = switches::kLogSeverity_Disable;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (!log_severity.empty()) {
|
||||
command_line->AppendSwitchASCII(switches::kLogSeverity, log_severity);
|
||||
}
|
||||
}
|
||||
|
||||
if (!command_line->HasSwitch(switches::kLogItems) &&
|
||||
settings_->log_items != LOG_ITEMS_DEFAULT) {
|
||||
std::string log_items_str;
|
||||
if (settings_->log_items == LOG_ITEMS_NONE) {
|
||||
log_items_str = std::string(switches::kLogItems_None);
|
||||
} else {
|
||||
std::vector<std::string_view> added_items;
|
||||
if (settings_->log_items & LOG_ITEMS_FLAG_PROCESS_ID) {
|
||||
added_items.emplace_back(switches::kLogItems_PId);
|
||||
}
|
||||
if (settings_->log_items & LOG_ITEMS_FLAG_THREAD_ID) {
|
||||
added_items.emplace_back(switches::kLogItems_TId);
|
||||
}
|
||||
if (settings_->log_items & LOG_ITEMS_FLAG_TIME_STAMP) {
|
||||
added_items.emplace_back(switches::kLogItems_TimeStamp);
|
||||
}
|
||||
if (settings_->log_items & LOG_ITEMS_FLAG_TICK_COUNT) {
|
||||
added_items.emplace_back(switches::kLogItems_TickCount);
|
||||
}
|
||||
if (!added_items.empty()) {
|
||||
log_items_str = base::JoinString(added_items, ",");
|
||||
}
|
||||
}
|
||||
if (!log_items_str.empty()) {
|
||||
command_line->AppendSwitchASCII(switches::kLogItems, log_items_str);
|
||||
}
|
||||
}
|
||||
|
||||
if (settings_->javascript_flags.length > 0) {
|
||||
command_line->AppendSwitchASCII(
|
||||
blink::switches::kJavaScriptFlags,
|
||||
CefString(&settings_->javascript_flags).ToString());
|
||||
}
|
||||
|
||||
if (settings_->resources_dir_path.length > 0) {
|
||||
base::FilePath file_path =
|
||||
base::FilePath(CefString(&settings_->resources_dir_path));
|
||||
if (!file_path.empty()) {
|
||||
command_line->AppendSwitchPath(switches::kResourcesDirPath, file_path);
|
||||
}
|
||||
}
|
||||
|
||||
if (settings_->locales_dir_path.length > 0) {
|
||||
base::FilePath file_path =
|
||||
base::FilePath(CefString(&settings_->locales_dir_path));
|
||||
if (!file_path.empty()) {
|
||||
command_line->AppendSwitchPath(switches::kLocalesDirPath, file_path);
|
||||
}
|
||||
}
|
||||
|
||||
if (settings_->remote_debugging_port >= 1024 &&
|
||||
settings_->remote_debugging_port <= 65535) {
|
||||
command_line->AppendSwitchASCII(
|
||||
@@ -161,6 +347,9 @@ std::optional<int> ChromeMainDelegateCef::BasicStartupComplete() {
|
||||
std::ignore = commandLinePtr->Detach(nullptr);
|
||||
}
|
||||
|
||||
// Call as early as possible.
|
||||
InitLogging(command_line);
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
util_mac::BasicStartupComplete();
|
||||
#endif
|
||||
@@ -193,6 +382,43 @@ void ChromeMainDelegateCef::PreSandboxStartup() {
|
||||
// Initialize crash reporting state for this process/module.
|
||||
// chrome::DIR_CRASH_DUMPS must be configured before calling this function.
|
||||
crash_reporting::PreSandboxStartup(*command_line, process_type);
|
||||
|
||||
base::FilePath resources_dir;
|
||||
if (command_line->HasSwitch(switches::kResourcesDirPath)) {
|
||||
resources_dir =
|
||||
command_line->GetSwitchValuePath(switches::kResourcesDirPath);
|
||||
}
|
||||
if (resources_dir.empty()) {
|
||||
resources_dir = resource_util::GetResourcesDir();
|
||||
}
|
||||
if (!resources_dir.empty()) {
|
||||
base::PathService::Override(chrome::DIR_RESOURCES, resources_dir);
|
||||
}
|
||||
|
||||
if (command_line->HasSwitch(switches::kLocalesDirPath)) {
|
||||
const auto& locales_dir =
|
||||
command_line->GetSwitchValuePath(switches::kLocalesDirPath);
|
||||
if (!locales_dir.empty()) {
|
||||
base::PathService::Override(ui::DIR_LOCALES, locales_dir);
|
||||
}
|
||||
}
|
||||
|
||||
#if !BUILDFLAG(IS_WIN)
|
||||
// Call after InitLogging() potentially changes values in
|
||||
// chrome/app/chrome_main_delegate.cc.
|
||||
InitLogging(command_line);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ChromeMainDelegateCef::SandboxInitialized(
|
||||
const std::string& process_type) {
|
||||
ChromeMainDelegate::SandboxInitialized(process_type);
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// Call after InitLogging() potentially changes values in
|
||||
// chrome/app/chrome_main_delegate.cc.
|
||||
InitLogging(base::CommandLine::ForCurrentProcess());
|
||||
#endif
|
||||
}
|
||||
|
||||
std::optional<int> ChromeMainDelegateCef::PreBrowserMain() {
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#include "libcef/common/app_manager.h"
|
||||
#include "libcef/common/chrome/chrome_content_client_cef.h"
|
||||
#include "libcef/common/main_runner_handler.h"
|
||||
#include "libcef/common/resource_bundle_delegate.h"
|
||||
#include "libcef/common/task_runner_manager.h"
|
||||
|
||||
#include "chrome/app/chrome_main_delegate.h"
|
||||
@@ -38,6 +39,7 @@ class ChromeMainDelegateCef : public ChromeMainDelegate,
|
||||
// ChromeMainDelegate overrides.
|
||||
std::optional<int> BasicStartupComplete() override;
|
||||
void PreSandboxStartup() override;
|
||||
void SandboxInitialized(const std::string& process_type) override;
|
||||
std::optional<int> PreBrowserMain() override;
|
||||
std::optional<int> PostEarlyInitialization(InvokedIn invoked_in) override;
|
||||
absl::variant<int, content::MainFunctionParams> RunProcess(
|
||||
@@ -71,6 +73,11 @@ class ChromeMainDelegateCef : public ChromeMainDelegate,
|
||||
scoped_refptr<base::SingleThreadTaskRunner> GetRenderTaskRunner() override;
|
||||
scoped_refptr<base::SingleThreadTaskRunner> GetWebWorkerTaskRunner() override;
|
||||
|
||||
// ChromeMainDelegate overrides.
|
||||
ui::ResourceBundle::Delegate* GetResourceBundleDelegate() override {
|
||||
return &resource_bundle_delegate_;
|
||||
}
|
||||
|
||||
private:
|
||||
ChromeContentBrowserClientCef* content_browser_client() const;
|
||||
ChromeContentRendererClientCef* content_renderer_client() const;
|
||||
@@ -81,6 +88,8 @@ class ChromeMainDelegateCef : public ChromeMainDelegate,
|
||||
|
||||
// We use this instead of ChromeMainDelegate::chrome_content_client_.
|
||||
ChromeContentClientCef chrome_content_client_cef_;
|
||||
|
||||
CefResourceBundleDelegate resource_bundle_delegate_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_COMMON_CHROME_CHROME_MAIN_DELEGATE_CEF_
|
||||
|
@@ -1,6 +1,14 @@
|
||||
#include "libcef/common/resource_bundle_delegate.h"
|
||||
|
||||
#include "libcef/common/app_manager.h"
|
||||
#include "libcef/features/runtime.h"
|
||||
|
||||
CefResourceBundleDelegate::CefResourceBundleDelegate() {
|
||||
// Alloy bootstrap explicitly enables pack file loading in
|
||||
// AlloyMainDelegate::InitializeResourceBundle, and it is otherwise disabled
|
||||
// by default. Chrome bootstrap does not support this.
|
||||
allow_pack_file_load_ = cef::IsChromeRuntimeEnabled();
|
||||
}
|
||||
|
||||
base::FilePath CefResourceBundleDelegate::GetPathForResourcePack(
|
||||
const base::FilePath& pack_path,
|
||||
|
@@ -7,13 +7,16 @@
|
||||
#define CEF_LIBCEF_COMMON_RESOURCE_BUNDLE_DELEGATE_H_
|
||||
#pragma once
|
||||
|
||||
#include "cef/libcef/features/features.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
|
||||
class AlloyContentClient;
|
||||
|
||||
class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate {
|
||||
public:
|
||||
CefResourceBundleDelegate() = default;
|
||||
CefResourceBundleDelegate();
|
||||
|
||||
CefResourceBundleDelegate(const CefResourceBundleDelegate&) = delete;
|
||||
CefResourceBundleDelegate& operator=(const CefResourceBundleDelegate&) =
|
||||
delete;
|
||||
|
||||
void set_pack_loading_disabled(bool val) { pack_loading_disabled_ = val; }
|
||||
bool pack_loading_disabled() const { return pack_loading_disabled_; }
|
||||
@@ -40,7 +43,7 @@ class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate {
|
||||
|
||||
private:
|
||||
bool pack_loading_disabled_ = false;
|
||||
bool allow_pack_file_load_ = false;
|
||||
bool allow_pack_file_load_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_COMMON_RESOURCE_BUNDLE_DELEGATE_H_
|
||||
|
@@ -223,6 +223,9 @@ patches = [
|
||||
#
|
||||
# Apply dynamic light/dark theme changes to web content.
|
||||
# https://issues.chromium.org/issues/332328864#comment3
|
||||
#
|
||||
# Pass ui::ResourceBundle::Delegate to InitSharedInstanceWithLocale.
|
||||
# https://github.com/chromiumembedded/cef/issues/3685
|
||||
'name': 'chrome_runtime',
|
||||
},
|
||||
{
|
||||
@@ -254,6 +257,11 @@ patches = [
|
||||
# https://github.com/chromiumembedded/cef/issues/2969
|
||||
'name': 'chrome_browser_context_menus',
|
||||
},
|
||||
{
|
||||
# Support DevTools windows with Chrome runtime Alloy style OSR.
|
||||
# https://github.com/chromiumembedded/cef/issues/3681
|
||||
'name': 'chrome_browser_devtools_osr',
|
||||
},
|
||||
{
|
||||
# Support use of chrome native dialogs with CEF runtimes.
|
||||
# - Adds support for FileSelectHelper and SelectFileDialog interception.
|
||||
@@ -348,6 +356,11 @@ patches = [
|
||||
# https://github.com/chromiumembedded/cef/issues/2969
|
||||
'name': 'chrome_browser_profile_menu',
|
||||
},
|
||||
{
|
||||
# chrome: Enable logging by default for Release builds.
|
||||
# https://github.com/chromiumembedded/cef/issues/2969
|
||||
'name': 'chrome_common_logging',
|
||||
},
|
||||
{
|
||||
# alloy: Don't require heap profiler for utility processes.
|
||||
# Avoids a DCHECK added in https://crrev.com/c21e9f71d1f2e
|
||||
@@ -736,6 +749,9 @@ patches = [
|
||||
#
|
||||
# mac: Add fallback for unsupported --lang values.
|
||||
# https://github.com/chromiumembedded/cef/issues/3653
|
||||
#
|
||||
# Pass ui::ResourceBundle::Delegate to InitSharedInstanceWithLocale.
|
||||
# https://github.com/chromiumembedded/cef/issues/3685
|
||||
'name': 'mac_chrome_locale_3623'
|
||||
},
|
||||
{
|
||||
@@ -790,5 +806,12 @@ patches = [
|
||||
# Reverts
|
||||
# https://chromium-review.googlesource.com/c/chromium/src/+/5454331
|
||||
'name': 'win_partition_freelist_entry_336007395'
|
||||
},
|
||||
{
|
||||
# Revert unretained dangling ptr detector crash by default.
|
||||
# https://github.com/chromiumembedded/cef/issues/3693
|
||||
# Reverts
|
||||
# https://chromium-review.googlesource.com/c/chromium/src/+/5351597
|
||||
'name': 'base_allocator_unretained_dangling_ptr_5351597'
|
||||
}
|
||||
]
|
||||
|
@@ -0,0 +1,13 @@
|
||||
diff --git base/allocator/partition_alloc_features.cc base/allocator/partition_alloc_features.cc
|
||||
index a2616fced0f5b..cacd41b0ffa23 100644
|
||||
--- base/allocator/partition_alloc_features.cc
|
||||
+++ base/allocator/partition_alloc_features.cc
|
||||
@@ -36,7 +36,7 @@ const base::FeatureParam<UnretainedDanglingPtrMode>
|
||||
kUnretainedDanglingPtrModeParam = {
|
||||
&kPartitionAllocUnretainedDanglingPtr,
|
||||
"mode",
|
||||
- UnretainedDanglingPtrMode::kCrash,
|
||||
+ UnretainedDanglingPtrMode::kDumpWithoutCrashing,
|
||||
&kUnretainedDanglingPtrModeOption,
|
||||
};
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
|
||||
index 70c3930b4d357..f71d0ff5bd9a7 100644
|
||||
index df3456f3a4b38..7ef1e33807cd9 100644
|
||||
--- chrome/browser/BUILD.gn
|
||||
+++ chrome/browser/BUILD.gn
|
||||
@@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni")
|
||||
@@ -18,7 +18,7 @@ index 70c3930b4d357..f71d0ff5bd9a7 100644
|
||||
"//chrome:extra_resources",
|
||||
"//chrome:resources",
|
||||
"//chrome:strings",
|
||||
@@ -2759,6 +2761,10 @@ static_library("browser") {
|
||||
@@ -2760,6 +2762,10 @@ static_library("browser") {
|
||||
]
|
||||
}
|
||||
|
||||
|
@@ -74,7 +74,7 @@ index 8fbc9ab537c6d..e87d068678767 100644
|
||||
}
|
||||
|
||||
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
|
||||
index d6c14b3d70a75..577586f0dd8b4 100644
|
||||
index aba6af9ae6940..6904372deb361 100644
|
||||
--- chrome/browser/ui/BUILD.gn
|
||||
+++ chrome/browser/ui/BUILD.gn
|
||||
@@ -8,6 +8,7 @@ import("//build/config/compiler/compiler.gni")
|
||||
@@ -113,7 +113,7 @@ index d6c14b3d70a75..577586f0dd8b4 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",
|
||||
@@ -5062,8 +5070,6 @@ static_library("ui") {
|
||||
@@ -5063,8 +5071,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",
|
||||
@@ -122,7 +122,7 @@ index d6c14b3d70a75..577586f0dd8b4 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",
|
||||
@@ -6895,6 +6901,7 @@ static_library("ui") {
|
||||
@@ -6896,6 +6902,7 @@ static_library("ui") {
|
||||
if (enable_printing) {
|
||||
deps += [
|
||||
"//components/printing/browser",
|
||||
@@ -131,7 +131,7 @@ index d6c14b3d70a75..577586f0dd8b4 100644
|
||||
]
|
||||
}
|
||||
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
|
||||
index cf9de7df6299d..3f93ff73ab038 100644
|
||||
index 03620f99e45d9..fbca89163c8e7 100644
|
||||
--- chrome/browser/ui/browser.cc
|
||||
+++ chrome/browser/ui/browser.cc
|
||||
@@ -267,6 +267,25 @@
|
||||
@@ -171,7 +171,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
tab_strip_model_delegate_(
|
||||
std::make_unique<chrome::BrowserTabStripModelDelegate>(this)),
|
||||
tab_strip_model_(std::make_unique<TabStripModel>(
|
||||
@@ -678,6 +701,12 @@ Browser::~Browser() {
|
||||
@@ -679,6 +702,12 @@ Browser::~Browser() {
|
||||
// away so they don't try and call back to us.
|
||||
if (select_file_dialog_.get())
|
||||
select_file_dialog_->ListenerDestroyed();
|
||||
@@ -184,7 +184,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1109,6 +1138,8 @@ void Browser::WindowFullscreenStateChanged() {
|
||||
@@ -1110,6 +1139,8 @@ void Browser::WindowFullscreenStateChanged() {
|
||||
->WindowFullscreenStateChanged();
|
||||
command_controller_->FullscreenStateChanged();
|
||||
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN);
|
||||
@@ -193,7 +193,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
}
|
||||
|
||||
void Browser::FullscreenTopUIStateChanged() {
|
||||
@@ -1450,6 +1481,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
|
||||
@@ -1451,6 +1482,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
|
||||
if (exclusive_access_manager_->HandleUserKeyEvent(event))
|
||||
return content::KeyboardEventProcessingResult::HANDLED;
|
||||
|
||||
@@ -208,7 +208,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
return window()->PreHandleKeyboardEvent(event);
|
||||
}
|
||||
|
||||
@@ -1457,8 +1496,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
|
||||
@@ -1458,8 +1497,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
|
||||
const NativeWebKeyboardEvent& event) {
|
||||
DevToolsWindow* devtools_window =
|
||||
DevToolsWindow::GetInstanceForInspectedWebContents(source);
|
||||
@@ -229,7 +229,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
}
|
||||
|
||||
bool Browser::TabsNeedBeforeUnloadFired() const {
|
||||
@@ -1660,6 +1709,16 @@ WebContents* Browser::OpenURLFromTab(
|
||||
@@ -1661,6 +1710,16 @@ WebContents* Browser::OpenURLFromTab(
|
||||
}
|
||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
|
||||
@@ -246,7 +246,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
NavigateParams nav_params(this, params.url, params.transition);
|
||||
nav_params.FillNavigateParamsFromOpenURLParams(params);
|
||||
nav_params.source_contents = source;
|
||||
@@ -1822,6 +1881,8 @@ void Browser::LoadingStateChanged(WebContents* source,
|
||||
@@ -1823,6 +1882,8 @@ void Browser::LoadingStateChanged(WebContents* source,
|
||||
bool should_show_loading_ui) {
|
||||
ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD);
|
||||
UpdateWindowForLoadingStateChanged(source, should_show_loading_ui);
|
||||
@@ -255,7 +255,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
}
|
||||
|
||||
void Browser::CloseContents(WebContents* source) {
|
||||
@@ -1850,6 +1911,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
|
||||
@@ -1851,6 +1912,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
|
||||
}
|
||||
|
||||
void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
|
||||
@@ -264,7 +264,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
if (!GetStatusBubble())
|
||||
return;
|
||||
|
||||
@@ -1857,6 +1920,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
|
||||
@@ -1858,6 +1921,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
|
||||
GetStatusBubble()->SetURL(url);
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
void Browser::ContentsMouseEvent(WebContents* source,
|
||||
bool motion,
|
||||
bool exited) {
|
||||
@@ -1881,6 +1955,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
|
||||
@@ -1882,6 +1956,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
void Browser::BeforeUnloadFired(WebContents* web_contents,
|
||||
bool proceed,
|
||||
bool* proceed_to_fire_unload) {
|
||||
@@ -1980,12 +2067,24 @@ void Browser::WebContentsCreated(WebContents* source_contents,
|
||||
@@ -1981,12 +2068,24 @@ void Browser::WebContentsCreated(WebContents* source_contents,
|
||||
|
||||
// Make the tab show up in the task manager.
|
||||
task_manager::WebContentsTags::CreateForTabContents(new_contents);
|
||||
@@ -327,7 +327,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
// Don't show the page hung dialog when a HTML popup hangs because
|
||||
// the dialog will take the focus and immediately close the popup.
|
||||
RenderWidgetHostView* view = render_widget_host->GetView();
|
||||
@@ -1998,6 +2097,13 @@ void Browser::RendererUnresponsive(
|
||||
@@ -1999,6 +2098,13 @@ void Browser::RendererUnresponsive(
|
||||
void Browser::RendererResponsive(
|
||||
WebContents* source,
|
||||
content::RenderWidgetHost* render_widget_host) {
|
||||
@@ -341,7 +341,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
RenderWidgetHostView* view = render_widget_host->GetView();
|
||||
if (view && !render_widget_host->GetView()->IsHTMLFormPopup()) {
|
||||
TabDialogs::FromWebContents(source)->HideHungRendererDialog(
|
||||
@@ -2051,6 +2157,11 @@ void Browser::DraggableRegionsChanged(
|
||||
@@ -2052,6 +2158,11 @@ void Browser::DraggableRegionsChanged(
|
||||
if (app_controller_) {
|
||||
app_controller_->DraggableRegionsChanged(regions, contents);
|
||||
}
|
||||
@@ -353,7 +353,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
}
|
||||
|
||||
void Browser::DidFinishNavigation(
|
||||
@@ -2132,11 +2243,15 @@ void Browser::EnterFullscreenModeForTab(
|
||||
@@ -2133,11 +2244,15 @@ void Browser::EnterFullscreenModeForTab(
|
||||
const blink::mojom::FullscreenOptions& options) {
|
||||
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
|
||||
requesting_frame, options.display_id);
|
||||
@@ -369,7 +369,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
}
|
||||
|
||||
bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) {
|
||||
@@ -2336,6 +2451,15 @@ void Browser::RequestMediaAccessPermission(
|
||||
@@ -2337,6 +2452,15 @@ void Browser::RequestMediaAccessPermission(
|
||||
content::WebContents* web_contents,
|
||||
const content::MediaStreamRequest& request,
|
||||
content::MediaResponseCallback callback) {
|
||||
@@ -385,7 +385,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
const extensions::Extension* extension =
|
||||
GetExtensionForOrigin(profile_, request.security_origin);
|
||||
MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
|
||||
@@ -2880,9 +3004,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
|
||||
@@ -2881,9 +3005,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
|
||||
// Browser, Getters for UI (private):
|
||||
|
||||
StatusBubble* Browser::GetStatusBubble() {
|
||||
@@ -398,7 +398,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
}
|
||||
|
||||
// We hide the status bar for web apps windows as this matches native
|
||||
@@ -2890,6 +3016,12 @@ StatusBubble* Browser::GetStatusBubble() {
|
||||
@@ -2891,6 +3017,12 @@ StatusBubble* Browser::GetStatusBubble() {
|
||||
// mode, as the minimal browser UI includes the status bar.
|
||||
if (web_app::AppBrowserController::IsWebApp(this) &&
|
||||
!app_controller()->HasMinimalUiButtons()) {
|
||||
@@ -411,7 +411,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -3026,6 +3158,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
|
||||
@@ -3027,6 +3159,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
|
||||
BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this);
|
||||
web_contents_collection_.StopObserving(web_contents);
|
||||
}
|
||||
@@ -420,7 +420,7 @@ index cf9de7df6299d..3f93ff73ab038 100644
|
||||
}
|
||||
|
||||
void Browser::TabDetachedAtImpl(content::WebContents* contents,
|
||||
@@ -3180,6 +3314,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature(
|
||||
@@ -3181,6 +3315,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature(
|
||||
|
||||
bool Browser::SupportsWindowFeatureImpl(WindowFeature feature,
|
||||
bool check_can_support) const {
|
||||
|
36
patch/patches/chrome_browser_devtools_osr.patch
Normal file
36
patch/patches/chrome_browser_devtools_osr.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
diff --git chrome/browser/devtools/chrome_devtools_manager_delegate.cc chrome/browser/devtools/chrome_devtools_manager_delegate.cc
|
||||
index 19c2d39b6aa73..099dcb71a6373 100644
|
||||
--- chrome/browser/devtools/chrome_devtools_manager_delegate.cc
|
||||
+++ chrome/browser/devtools/chrome_devtools_manager_delegate.cc
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "build/build_config.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
+#include "cef/libcef/features/features.h"
|
||||
#include "chrome/browser/browser_features.h"
|
||||
#include "chrome/browser/devtools/chrome_devtools_session.h"
|
||||
#include "chrome/browser/devtools/device/android_device_manager.h"
|
||||
@@ -66,6 +67,10 @@
|
||||
#include "ash/constants/ash_switches.h"
|
||||
#endif
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+#include "cef/libcef/browser/chrome/extensions/chrome_extension_util.h"
|
||||
+#endif
|
||||
+
|
||||
using content::DevToolsAgentHost;
|
||||
|
||||
const char ChromeDevToolsManagerDelegate::kTypeApp[] = "app";
|
||||
@@ -246,6 +251,12 @@ std::string ChromeDevToolsManagerDelegate::GetTargetType(
|
||||
return DevToolsAgentHost::kTypePage;
|
||||
}
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ if (cef::IsAlloyContents(web_contents, /*primary_only=*/true)) {
|
||||
+ return DevToolsAgentHost::kTypePage;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
return DevToolsAgentHost::kTypeOther;
|
||||
}
|
||||
|
35
patch/patches/chrome_common_logging.patch
Normal file
35
patch/patches/chrome_common_logging.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
diff --git chrome/common/features.gni chrome/common/features.gni
|
||||
index 01367ff6efd6c..975ea8e446dce 100644
|
||||
--- chrome/common/features.gni
|
||||
+++ chrome/common/features.gni
|
||||
@@ -7,6 +7,7 @@ import("//build/config/chromeos/ui_mode.gni")
|
||||
import("//build/config/compiler/compiler.gni")
|
||||
import("//build/config/dcheck_always_on.gni")
|
||||
import("//build/config/features.gni")
|
||||
+import("//cef/libcef/features/features.gni")
|
||||
import("//components/compose/features.gni")
|
||||
import("//components/feed/features.gni")
|
||||
import("//components/nacl/features.gni")
|
||||
@@ -31,7 +32,7 @@ assert(use_blink, "Chromium without blink shouldn't use anything in //chrome")
|
||||
declare_args() {
|
||||
# Enables the build to have logging enabled by default.
|
||||
# This is intended for use only in developer builds.
|
||||
- chrome_enable_logging_by_default = is_debug
|
||||
+ chrome_enable_logging_by_default = is_debug || enable_cef
|
||||
|
||||
# Platforms where Chrome x509 server certificate enterprise policies are
|
||||
# supported. This must must match the supported_on/future_on list of the
|
||||
@@ -90,11 +91,13 @@ declare_args() {
|
||||
# optimize_webui was moved to ui/base/ui_features.gni
|
||||
}
|
||||
|
||||
+if (!enable_cef) {
|
||||
# Logging must be disabled by default in all official builds (including special
|
||||
# DCHECK-enabled builds). Logging is enabled by default for debug builds, and
|
||||
# may be selectively enabled by default for release builds.
|
||||
assert(!chrome_enable_logging_by_default || !is_official_build,
|
||||
"Logging must be disabled by default in Official builds")
|
||||
+}
|
||||
|
||||
# Use brlapi from brltty for braille display support.
|
||||
use_brlapi = is_chromeos_ash
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc
|
||||
index c09a805c4ed7b..de89b16690593 100644
|
||||
index 363f485ce3564..91aa4ec8b2689 100644
|
||||
--- chrome/app/chrome_main_delegate.cc
|
||||
+++ chrome/app/chrome_main_delegate.cc
|
||||
@@ -37,6 +37,7 @@
|
||||
@@ -20,7 +20,7 @@ index c09a805c4ed7b..de89b16690593 100644
|
||||
#if BUILDFLAG(IS_CHROMEOS_LACROS)
|
||||
// In debug builds of Lacros, we keep track of when the user data dir
|
||||
// is initialized, to ensure the cryptohome is not accessed before login
|
||||
@@ -854,6 +858,10 @@ ChromeMainDelegate::~ChromeMainDelegate() {
|
||||
@@ -845,6 +849,10 @@ ChromeMainDelegate::~ChromeMainDelegate() {
|
||||
ChromeMainDelegate::~ChromeMainDelegate() = default;
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
@@ -31,7 +31,7 @@ index c09a805c4ed7b..de89b16690593 100644
|
||||
std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
|
||||
InvokedIn invoked_in) {
|
||||
DUMP_WILL_BE_CHECK(base::ThreadPoolInstance::Get());
|
||||
@@ -879,7 +887,7 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
|
||||
@@ -870,7 +878,7 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
|
||||
// future session's metrics.
|
||||
DeferBrowserMetrics(user_data_dir);
|
||||
|
||||
@@ -40,7 +40,17 @@ index c09a805c4ed7b..de89b16690593 100644
|
||||
// In the case the process is not the singleton process, the uninstall tasks
|
||||
// need to be executed here. A window will be displayed asking to close all
|
||||
// running instances.
|
||||
@@ -1069,7 +1077,8 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
|
||||
@@ -1043,7 +1051,8 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
|
||||
|
||||
// Initializes the resource bundle and determines the locale.
|
||||
std::string actual_locale = LoadLocalState(
|
||||
- chrome_feature_list_creator, invoked_in_browser->is_running_test);
|
||||
+ chrome_feature_list_creator, GetResourceBundleDelegate(),
|
||||
+ invoked_in_browser->is_running_test);
|
||||
chrome_feature_list_creator->SetApplicationLocale(actual_locale);
|
||||
chrome_feature_list_creator->OverrideCachedUIStrings();
|
||||
|
||||
@@ -1062,7 +1071,8 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
|
||||
|
||||
if (base::FeatureList::IsEnabled(
|
||||
features::kWriteBasicSystemProfileToPersistentHistogramsFile)) {
|
||||
@@ -50,7 +60,7 @@ index c09a805c4ed7b..de89b16690593 100644
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
record =
|
||||
base::FeatureList::IsEnabled(chrome::android::kUmaBackgroundSessions);
|
||||
@@ -1505,6 +1514,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
@@ -1507,6 +1517,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
std::string process_type =
|
||||
command_line.GetSwitchValueASCII(switches::kProcessType);
|
||||
|
||||
@@ -58,7 +68,7 @@ index c09a805c4ed7b..de89b16690593 100644
|
||||
crash_reporter::InitializeCrashKeys();
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS_LACROS)
|
||||
@@ -1523,6 +1533,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
@@ -1525,6 +1536,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
InitMacCrashReporter(command_line, process_type);
|
||||
SetUpInstallerPreferences(command_line);
|
||||
#endif
|
||||
@@ -66,7 +76,17 @@ index c09a805c4ed7b..de89b16690593 100644
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
child_process_logging::Init();
|
||||
@@ -1733,6 +1744,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
@@ -1705,7 +1717,8 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
#else
|
||||
const std::string loaded_locale =
|
||||
ui::ResourceBundle::InitSharedInstanceWithLocale(
|
||||
- locale, nullptr, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
|
||||
+ locale, GetResourceBundleDelegate(),
|
||||
+ ui::ResourceBundle::LOAD_COMMON_RESOURCES);
|
||||
|
||||
base::FilePath resources_pack_path;
|
||||
base::PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);
|
||||
@@ -1735,6 +1748,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
|
||||
}
|
||||
|
||||
@@ -74,7 +94,7 @@ index c09a805c4ed7b..de89b16690593 100644
|
||||
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
|
||||
// Zygote needs to call InitCrashReporter() in RunZygote().
|
||||
if (process_type != switches::kZygoteProcess) {
|
||||
@@ -1768,6 +1780,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
@@ -1770,6 +1784,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
|
||||
// After all the platform Breakpads have been initialized, store the command
|
||||
// line for crash reporting.
|
||||
crash_keys::SetCrashKeysFromCommandLine(command_line);
|
||||
@@ -82,7 +102,7 @@ index c09a805c4ed7b..de89b16690593 100644
|
||||
|
||||
#if BUILDFLAG(ENABLE_PDF)
|
||||
MaybePatchGdiGetFontData();
|
||||
@@ -1893,6 +1906,7 @@ void ChromeMainDelegate::ZygoteForked() {
|
||||
@@ -1895,6 +1910,7 @@ void ChromeMainDelegate::ZygoteForked() {
|
||||
SetUpProfilingShutdownHandler();
|
||||
}
|
||||
|
||||
@@ -90,7 +110,7 @@ index c09a805c4ed7b..de89b16690593 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 =
|
||||
@@ -1905,6 +1919,7 @@ void ChromeMainDelegate::ZygoteForked() {
|
||||
@@ -1907,6 +1923,7 @@ void ChromeMainDelegate::ZygoteForked() {
|
||||
|
||||
// Reset the command line for the newly spawned process.
|
||||
crash_keys::SetCrashKeysFromCommandLine(*command_line);
|
||||
@@ -98,7 +118,7 @@ index c09a805c4ed7b..de89b16690593 100644
|
||||
}
|
||||
|
||||
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
||||
@@ -2001,6 +2016,7 @@ void ChromeMainDelegate::InitializeMemorySystem() {
|
||||
@@ -2003,6 +2020,7 @@ void ChromeMainDelegate::InitializeMemorySystem() {
|
||||
const bool is_browser_process = process_type.empty();
|
||||
const bool gwp_asan_boost_sampling = is_browser_process || IsCanaryDev();
|
||||
|
||||
@@ -106,7 +126,7 @@ index c09a805c4ed7b..de89b16690593 100644
|
||||
memory_system::Initializer()
|
||||
.SetGwpAsanParameters(gwp_asan_boost_sampling, process_type)
|
||||
.SetProfilingClientParameters(chrome::GetChannel(),
|
||||
@@ -2010,5 +2026,5 @@ void ChromeMainDelegate::InitializeMemorySystem() {
|
||||
@@ -2012,5 +2030,5 @@ void ChromeMainDelegate::InitializeMemorySystem() {
|
||||
memory_system::DispatcherParameters::
|
||||
AllocationTraceRecorderInclusion::kDynamic,
|
||||
process_type)
|
||||
@@ -114,10 +134,18 @@ index c09a805c4ed7b..de89b16690593 100644
|
||||
+ .Initialize(*memory_system_);
|
||||
}
|
||||
diff --git chrome/app/chrome_main_delegate.h chrome/app/chrome_main_delegate.h
|
||||
index 3553377e96017..5207128b768f2 100644
|
||||
index 3553377e96017..9f6edc70ef1d4 100644
|
||||
--- chrome/app/chrome_main_delegate.h
|
||||
+++ chrome/app/chrome_main_delegate.h
|
||||
@@ -49,6 +49,8 @@ class ChromeMainDelegate : public content::ContentMainDelegate {
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "chrome/common/chrome_content_client.h"
|
||||
#include "components/memory_system/memory_system.h"
|
||||
#include "content/public/app/content_main_delegate.h"
|
||||
+#include "ui/base/resource/resource_bundle.h"
|
||||
|
||||
namespace base {
|
||||
class CommandLine;
|
||||
@@ -49,6 +50,8 @@ class ChromeMainDelegate : public content::ContentMainDelegate {
|
||||
|
||||
~ChromeMainDelegate() override;
|
||||
|
||||
@@ -126,7 +154,17 @@ index 3553377e96017..5207128b768f2 100644
|
||||
protected:
|
||||
// content::ContentMainDelegate:
|
||||
std::optional<int> BasicStartupComplete() override;
|
||||
@@ -98,7 +100,7 @@ class ChromeMainDelegate : public content::ContentMainDelegate {
|
||||
@@ -92,13 +95,17 @@ class ChromeMainDelegate : public content::ContentMainDelegate {
|
||||
|
||||
void InitializeMemorySystem();
|
||||
|
||||
+ virtual ui::ResourceBundle::Delegate* GetResourceBundleDelegate() {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
std::unique_ptr<ChromeContentBrowserClient> chrome_content_browser_client_;
|
||||
std::unique_ptr<ChromeContentUtilityClient> chrome_content_utility_client_;
|
||||
std::unique_ptr<tracing::TracingSamplerProfiler> tracing_sampler_profiler_;
|
||||
|
||||
ChromeContentClient chrome_content_client_;
|
||||
|
||||
@@ -536,7 +574,7 @@ index e21d5dbffda0b..113df89dcd68a 100644
|
||||
#endif
|
||||
|
||||
diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc
|
||||
index 14c785c5686a8..ed24f5f045006 100644
|
||||
index 934683953cd7d..8f17a64145bd8 100644
|
||||
--- chrome/browser/prefs/browser_prefs.cc
|
||||
+++ chrome/browser/prefs/browser_prefs.cc
|
||||
@@ -16,6 +16,7 @@
|
||||
@@ -547,7 +585,7 @@ index 14c785c5686a8..ed24f5f045006 100644
|
||||
#include "chrome/browser/about_flags.h"
|
||||
#include "chrome/browser/accessibility/accessibility_labels_service.h"
|
||||
#include "chrome/browser/accessibility/invert_bubble_prefs.h"
|
||||
@@ -194,6 +195,10 @@
|
||||
@@ -195,6 +196,10 @@
|
||||
#include "chrome/browser/background/background_mode_manager.h"
|
||||
#endif
|
||||
|
||||
@@ -558,7 +596,7 @@ index 14c785c5686a8..ed24f5f045006 100644
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
#include "chrome/browser/accessibility/animation_policy_prefs.h"
|
||||
#include "chrome/browser/apps/platform_apps/shortcut_manager.h"
|
||||
@@ -1743,7 +1748,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
@@ -1745,7 +1750,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
@@ -568,7 +606,7 @@ index 14c785c5686a8..ed24f5f045006 100644
|
||||
downgrade::RegisterPrefs(registry);
|
||||
#endif
|
||||
|
||||
@@ -1779,6 +1785,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
@@ -1781,6 +1787,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
|
||||
// This is intentionally last.
|
||||
RegisterLocalStatePrefsForMigration(registry);
|
||||
@@ -580,7 +618,7 @@ index 14c785c5686a8..ed24f5f045006 100644
|
||||
}
|
||||
|
||||
// Register prefs applicable to all profiles.
|
||||
@@ -2213,6 +2224,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
@@ -2216,6 +2227,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 01d45469f3bae..d1bed9648e4a2 100644
|
||||
index 60c670c77de04..1876ff2da6098 100644
|
||||
--- chrome/browser/ui/browser_command_controller.cc
|
||||
+++ chrome/browser/ui/browser_command_controller.cc
|
||||
@@ -401,6 +401,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
|
||||
@@ -403,6 +403,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 01d45469f3bae..d1bed9648e4a2 100644
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -417,6 +418,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
|
||||
@@ -419,6 +420,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
|
||||
DCHECK(command_updater_.IsCommandEnabled(id))
|
||||
<< "Invalid/disabled command " << id;
|
||||
|
||||
@@ -24,7 +24,7 @@ index 01d45469f3bae..d1bed9648e4a2 100644
|
||||
// The order of commands in this switch statement must match the function
|
||||
// declaration order in browser.h!
|
||||
switch (id) {
|
||||
@@ -1179,11 +1187,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
|
||||
@@ -1197,11 +1205,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
|
||||
// BrowserCommandController, private:
|
||||
|
||||
bool BrowserCommandController::IsShowingMainUI() {
|
||||
@@ -41,10 +41,10 @@ index 01d45469f3bae..d1bed9648e4a2 100644
|
||||
|
||||
bool BrowserCommandController::IsWebAppOrCustomTab() const {
|
||||
diff --git chrome/browser/ui/toolbar/app_menu_model.cc chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
index fc51015c70183..52de604f96d9e 100644
|
||||
index f080bd8292259..51b40ac1c9e19 100644
|
||||
--- chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
+++ chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
@@ -728,6 +728,57 @@ SaveAndShareSubMenuModel::SaveAndShareSubMenuModel(
|
||||
@@ -730,6 +730,57 @@ SaveAndShareSubMenuModel::SaveAndShareSubMenuModel(
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ index fc51015c70183..52de604f96d9e 100644
|
||||
} // namespace
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1572,7 +1623,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const {
|
||||
@@ -1581,7 +1632,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ index fc51015c70183..52de604f96d9e 100644
|
||||
GlobalError* error =
|
||||
GlobalErrorServiceFactory::GetForProfile(browser_->profile())
|
||||
->GetGlobalErrorByMenuItemCommandID(command_id);
|
||||
@@ -1587,6 +1638,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const {
|
||||
@@ -1596,6 +1647,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ index fc51015c70183..52de604f96d9e 100644
|
||||
bool AppMenuModel::IsCommandIdAlerted(int command_id) const {
|
||||
if (command_id == IDC_VIEW_PASSWORDS ||
|
||||
command_id == IDC_SHOW_PASSWORD_MANAGER) {
|
||||
@@ -1755,11 +1830,15 @@ void AppMenuModel::Build() {
|
||||
@@ -1764,11 +1839,15 @@ void AppMenuModel::Build() {
|
||||
kDefaultIconSize));
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ index fc51015c70183..52de604f96d9e 100644
|
||||
|
||||
AddItemWithStringId(IDC_PRINT, IDS_PRINT);
|
||||
|
||||
@@ -1852,9 +1931,13 @@ void AppMenuModel::Build() {
|
||||
@@ -1861,9 +1940,13 @@ void AppMenuModel::Build() {
|
||||
kMoreToolsMenuItem);
|
||||
|
||||
if (!features::IsChromeRefresh2023()) {
|
||||
@@ -180,7 +180,7 @@ index fc51015c70183..52de604f96d9e 100644
|
||||
}
|
||||
|
||||
if (!features::IsChromeRefresh2023()) {
|
||||
@@ -1943,6 +2026,11 @@ void AppMenuModel::Build() {
|
||||
@@ -1952,6 +2035,11 @@ void AppMenuModel::Build() {
|
||||
SetCommandIcon(this, IDC_EXIT, kExitMenuIcon);
|
||||
}
|
||||
|
||||
@@ -193,10 +193,10 @@ index fc51015c70183..52de604f96d9e 100644
|
||||
}
|
||||
|
||||
diff --git chrome/browser/ui/toolbar/app_menu_model.h chrome/browser/ui/toolbar/app_menu_model.h
|
||||
index c477fba63fd1a..3b9eaad8e1906 100644
|
||||
index cc5c28f04e079..8d23e5a3a09c9 100644
|
||||
--- chrome/browser/ui/toolbar/app_menu_model.h
|
||||
+++ chrome/browser/ui/toolbar/app_menu_model.h
|
||||
@@ -218,6 +218,7 @@ class AppMenuModel : public ui::SimpleMenuModel,
|
||||
@@ -220,6 +220,7 @@ class AppMenuModel : public ui::SimpleMenuModel,
|
||||
void ExecuteCommand(int command_id, int event_flags) override;
|
||||
bool IsCommandIdChecked(int command_id) const override;
|
||||
bool IsCommandIdEnabled(int command_id) const override;
|
||||
@@ -204,7 +204,7 @@ index c477fba63fd1a..3b9eaad8e1906 100644
|
||||
bool IsCommandIdAlerted(int command_id) const override;
|
||||
bool IsElementIdAlerted(ui::ElementIdentifier element_id) const override;
|
||||
bool GetAcceleratorForCommandId(int command_id,
|
||||
@@ -259,6 +260,8 @@ class AppMenuModel : public ui::SimpleMenuModel,
|
||||
@@ -261,6 +262,8 @@ class AppMenuModel : public ui::SimpleMenuModel,
|
||||
safety_hub::SafetyHubModuleType sh_module,
|
||||
int event_flags);
|
||||
|
||||
@@ -233,7 +233,7 @@ index 0ccfe39eb5696..c9424316b6d14 100644
|
||||
return gfx::Rect();
|
||||
}
|
||||
diff --git chrome/browser/ui/views/frame/browser_frame.cc chrome/browser/ui/views/frame/browser_frame.cc
|
||||
index 8dd3620ba2720..ab3a92fd7ebe4 100644
|
||||
index 8dd3620ba2720..e3bac8207de24 100644
|
||||
--- chrome/browser/ui/views/frame/browser_frame.cc
|
||||
+++ chrome/browser/ui/views/frame/browser_frame.cc
|
||||
@@ -114,15 +114,23 @@ ui::ColorProviderKey::SchemeVariant GetSchemeVariant(
|
||||
@@ -332,16 +332,7 @@ index 8dd3620ba2720..ab3a92fd7ebe4 100644
|
||||
chrome::SaveWindowWorkspace(browser_view_->browser(), GetWorkspace());
|
||||
chrome::SaveWindowVisibleOnAllWorkspaces(browser_view_->browser(),
|
||||
IsVisibleOnAllWorkspaces());
|
||||
@@ -483,6 +515,8 @@ void BrowserFrame::OnNativeThemeUpdated(ui::NativeTheme* observed_theme) {
|
||||
|
||||
ui::ColorProviderKey BrowserFrame::GetColorProviderKey() const {
|
||||
auto key = Widget::GetColorProviderKey();
|
||||
+ if (!browser_view_)
|
||||
+ return key;
|
||||
|
||||
key.app_controller = browser_view_->browser()->app_controller();
|
||||
|
||||
@@ -572,6 +606,13 @@ void BrowserFrame::SelectNativeTheme() {
|
||||
@@ -572,6 +604,13 @@ void BrowserFrame::SelectNativeTheme() {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -355,7 +346,7 @@ index 8dd3620ba2720..ab3a92fd7ebe4 100644
|
||||
// Ignore the system theme for web apps with window-controls-overlay as the
|
||||
// display_override so the web contents can blend with the overlay by using
|
||||
// the developer-provided theme color for a better experience. Context:
|
||||
@@ -637,5 +678,8 @@ bool BrowserFrame::RegenerateFrameOnThemeChange(
|
||||
@@ -637,5 +676,8 @@ bool BrowserFrame::RegenerateFrameOnThemeChange(
|
||||
}
|
||||
|
||||
bool BrowserFrame::IsIncognitoBrowser() const {
|
||||
@@ -411,7 +402,7 @@ index 2e973c9e279b0..8662f9cf14b17 100644
|
||||
// regenerated.
|
||||
bool RegenerateFrameOnThemeChange(BrowserThemeChangeType theme_change_type);
|
||||
diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc
|
||||
index 110812d2874d7..89b28bdb32d90 100644
|
||||
index 46723938c5456..f7585de92bd66 100644
|
||||
--- chrome/browser/ui/views/frame/browser_view.cc
|
||||
+++ chrome/browser/ui/views/frame/browser_view.cc
|
||||
@@ -346,11 +346,10 @@ using content::NativeWebKeyboardEvent;
|
||||
@@ -485,7 +476,7 @@ index 110812d2874d7..89b28bdb32d90 100644
|
||||
|
||||
contents_separator_ =
|
||||
top_container_->AddChildView(std::make_unique<ContentsSeparator>());
|
||||
@@ -1017,7 +1041,9 @@ BrowserView::~BrowserView() {
|
||||
@@ -1016,7 +1040,9 @@ BrowserView::~BrowserView() {
|
||||
|
||||
// All the tabs should have been destroyed already. If we were closed by the
|
||||
// OS with some tabs than the NativeBrowserFrame should have destroyed them.
|
||||
@@ -495,7 +486,7 @@ index 110812d2874d7..89b28bdb32d90 100644
|
||||
|
||||
// Stop the animation timer explicitly here to avoid running it in a nested
|
||||
// message loop, which may run by Browser destructor.
|
||||
@@ -1031,12 +1057,14 @@ BrowserView::~BrowserView() {
|
||||
@@ -1030,12 +1056,14 @@ BrowserView::~BrowserView() {
|
||||
// child views and it is an observer for avatar toolbar button if any.
|
||||
autofill_bubble_handler_.reset();
|
||||
|
||||
@@ -510,7 +501,7 @@ index 110812d2874d7..89b28bdb32d90 100644
|
||||
|
||||
// The TabStrip attaches a listener to the model. Make sure we shut down the
|
||||
// TabStrip first so that it can cleanly remove the listener.
|
||||
@@ -1060,7 +1088,9 @@ BrowserView::~BrowserView() {
|
||||
@@ -1059,7 +1087,9 @@ BrowserView::~BrowserView() {
|
||||
|
||||
// `SidePanelUI::RemoveSidePanelUIForBrowser()` deletes the
|
||||
// SidePanelCoordinator.
|
||||
@@ -520,7 +511,7 @@ index 110812d2874d7..89b28bdb32d90 100644
|
||||
}
|
||||
|
||||
// static
|
||||
@@ -2032,9 +2062,14 @@ void BrowserView::OnExclusiveAccessUserInput() {
|
||||
@@ -2031,9 +2061,14 @@ void BrowserView::OnExclusiveAccessUserInput() {
|
||||
|
||||
bool BrowserView::ShouldHideUIForFullscreen() const {
|
||||
// Immersive mode needs UI for the slide-down top panel.
|
||||
@@ -536,7 +527,7 @@ index 110812d2874d7..89b28bdb32d90 100644
|
||||
return frame_->GetFrameView()->ShouldHideTopUIForFullscreen();
|
||||
}
|
||||
|
||||
@@ -3170,7 +3205,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() {
|
||||
@@ -3169,7 +3204,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() {
|
||||
}
|
||||
|
||||
DownloadBubbleUIController* BrowserView::GetDownloadBubbleUIController() {
|
||||
@@ -546,7 +537,7 @@ index 110812d2874d7..89b28bdb32d90 100644
|
||||
if (auto* download_button = toolbar_button_provider_->GetDownloadButton())
|
||||
return download_button->bubble_controller();
|
||||
return nullptr;
|
||||
@@ -3725,7 +3761,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
|
||||
@@ -3724,7 +3760,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
|
||||
if (top_container()->parent() == this)
|
||||
return;
|
||||
|
||||
@@ -556,7 +547,7 @@ index 110812d2874d7..89b28bdb32d90 100644
|
||||
top_container()->DestroyLayer();
|
||||
AddChildViewAt(top_container(), 0);
|
||||
EnsureFocusOrder();
|
||||
@@ -4207,11 +4244,38 @@ void BrowserView::GetAccessiblePanes(std::vector<views::View*>* panes) {
|
||||
@@ -4206,11 +4243,38 @@ void BrowserView::GetAccessiblePanes(std::vector<views::View*>* panes) {
|
||||
bool BrowserView::ShouldDescendIntoChildForEventHandling(
|
||||
gfx::NativeView child,
|
||||
const gfx::Point& location) {
|
||||
@@ -597,7 +588,7 @@ index 110812d2874d7..89b28bdb32d90 100644
|
||||
// Draggable regions are defined relative to the web contents.
|
||||
gfx::Point point_in_contents_web_view_coords(location);
|
||||
views::View::ConvertPointToTarget(GetWidget()->GetRootView(),
|
||||
@@ -4220,7 +4284,7 @@ bool BrowserView::ShouldDescendIntoChildForEventHandling(
|
||||
@@ -4219,7 +4283,7 @@ bool BrowserView::ShouldDescendIntoChildForEventHandling(
|
||||
|
||||
// Draggable regions should be ignored for clicks into any browser view's
|
||||
// owned widgets, for example alerts, permission prompts or find bar.
|
||||
@@ -606,7 +597,7 @@ index 110812d2874d7..89b28bdb32d90 100644
|
||||
point_in_contents_web_view_coords.x(),
|
||||
point_in_contents_web_view_coords.y()) ||
|
||||
WidgetOwnedByAnchorContainsPoint(point_in_contents_web_view_coords);
|
||||
@@ -4331,8 +4395,10 @@ void BrowserView::Layout(PassKey) {
|
||||
@@ -4330,8 +4394,10 @@ void BrowserView::Layout(PassKey) {
|
||||
|
||||
// TODO(jamescook): Why was this in the middle of layout code?
|
||||
toolbar_->location_bar()->omnibox_view()->SetFocusBehavior(
|
||||
@@ -619,7 +610,7 @@ index 110812d2874d7..89b28bdb32d90 100644
|
||||
|
||||
// Some of the situations when the BrowserView is laid out are:
|
||||
// - Enter/exit immersive fullscreen mode.
|
||||
@@ -4398,6 +4464,11 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -4397,6 +4463,11 @@ void BrowserView::AddedToWidget() {
|
||||
SetThemeProfileForWindow(GetNativeWindow(), browser_->profile());
|
||||
#endif
|
||||
|
||||
@@ -631,7 +622,7 @@ index 110812d2874d7..89b28bdb32d90 100644
|
||||
toolbar_->Init();
|
||||
|
||||
// TODO(pbos): Investigate whether the side panels should be creatable when
|
||||
@@ -4445,13 +4516,9 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -4444,13 +4515,9 @@ void BrowserView::AddedToWidget() {
|
||||
|
||||
EnsureFocusOrder();
|
||||
|
||||
@@ -647,7 +638,7 @@ index 110812d2874d7..89b28bdb32d90 100644
|
||||
using_native_frame_ = frame_->ShouldUseNativeFrame();
|
||||
|
||||
MaybeInitializeWebUITabStrip();
|
||||
@@ -4882,7 +4949,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
|
||||
@@ -4881,7 +4948,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
|
||||
// Undo our anti-jankiness hacks and force a re-layout.
|
||||
in_process_fullscreen_ = false;
|
||||
ToolbarSizeChanged(false);
|
||||
@@ -657,7 +648,7 @@ index 110812d2874d7..89b28bdb32d90 100644
|
||||
}
|
||||
|
||||
bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const {
|
||||
@@ -5304,6 +5372,8 @@ Profile* BrowserView::GetProfile() {
|
||||
@@ -5303,6 +5371,8 @@ Profile* BrowserView::GetProfile() {
|
||||
}
|
||||
|
||||
void BrowserView::UpdateUIForTabFullscreen() {
|
||||
@@ -666,7 +657,7 @@ index 110812d2874d7..89b28bdb32d90 100644
|
||||
frame()->GetFrameView()->UpdateFullscreenTopUI();
|
||||
}
|
||||
|
||||
@@ -5326,6 +5396,8 @@ void BrowserView::HideDownloadShelf() {
|
||||
@@ -5325,6 +5395,8 @@ void BrowserView::HideDownloadShelf() {
|
||||
}
|
||||
|
||||
bool BrowserView::CanUserExitFullscreen() const {
|
||||
@@ -989,7 +980,7 @@ index 880d83324cfa6..a6a80cd0b3def 100644
|
||||
}
|
||||
|
||||
diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
index e97342ef97514..e373f6374fa4c 100644
|
||||
index 8c3395ee6d7fd..3bedbe48a7696 100644
|
||||
--- chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
+++ chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
@@ -191,7 +191,7 @@ class TabstripLikeBackground : public views::Background {
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc
|
||||
index 1dcae1e41f4dc..43951c1c55f1a 100644
|
||||
index 6cb4496b03c26..323c87c5fbf55 100644
|
||||
--- content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -1624,7 +1624,8 @@ bool RenderProcessHostImpl::Init() {
|
||||
@@ -1628,7 +1628,8 @@ bool RenderProcessHostImpl::Init() {
|
||||
// initialized because in tests the factory may never have been initialized.
|
||||
if (!GetBrowserContext()->IsOffTheRecord() &&
|
||||
!base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
|
@@ -1,8 +1,21 @@
|
||||
diff --git chrome/browser/chrome_resource_bundle_helper.cc chrome/browser/chrome_resource_bundle_helper.cc
|
||||
index 0cfc966050b60..8268a8b1f4fcb 100644
|
||||
index 0cfc966050b60..bbc20cffaee1a 100644
|
||||
--- chrome/browser/chrome_resource_bundle_helper.cc
|
||||
+++ chrome/browser/chrome_resource_bundle_helper.cc
|
||||
@@ -82,16 +82,8 @@ std::string InitResourceBundleAndDetermineLocale(PrefService* local_state,
|
||||
@@ -68,8 +68,10 @@ extern void InitializeLocalState(
|
||||
|
||||
// Initializes the shared instance of ResourceBundle and returns the application
|
||||
// locale. An empty |actual_locale| value indicates failure.
|
||||
-std::string InitResourceBundleAndDetermineLocale(PrefService* local_state,
|
||||
- bool is_running_tests) {
|
||||
+std::string InitResourceBundleAndDetermineLocale(
|
||||
+ PrefService* local_state,
|
||||
+ ui::ResourceBundle::Delegate* resource_bundle_delegate,
|
||||
+ bool is_running_tests) {
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// In order for SetLoadSecondaryLocalePaks() to work ResourceBundle must
|
||||
// not have been created yet.
|
||||
@@ -82,16 +84,8 @@ std::string InitResourceBundleAndDetermineLocale(PrefService* local_state,
|
||||
.empty());
|
||||
#endif
|
||||
|
||||
@@ -20,6 +33,52 @@ index 0cfc966050b60..8268a8b1f4fcb 100644
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
ui::ResourceBundle::SetLottieParsingFunctions(
|
||||
@@ -103,7 +97,8 @@ std::string InitResourceBundleAndDetermineLocale(PrefService* local_state,
|
||||
// On a POSIX OS other than ChromeOS, the parameter that is passed to the
|
||||
// method InitSharedInstance is ignored.
|
||||
std::string actual_locale = ui::ResourceBundle::InitSharedInstanceWithLocale(
|
||||
- preferred_locale, nullptr, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
|
||||
+ preferred_locale, resource_bundle_delegate,
|
||||
+ ui::ResourceBundle::LOAD_COMMON_RESOURCES);
|
||||
CHECK(!actual_locale.empty())
|
||||
<< "Locale could not be found for " << preferred_locale;
|
||||
|
||||
@@ -155,6 +150,7 @@ std::string InitResourceBundleAndDetermineLocale(PrefService* local_state,
|
||||
|
||||
std::string LoadLocalState(
|
||||
ChromeFeatureListCreator* chrome_feature_list_creator,
|
||||
+ ui::ResourceBundle::Delegate* resource_bundle_delegate,
|
||||
bool is_running_tests) {
|
||||
base::FilePath user_data_dir;
|
||||
if (!base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir))
|
||||
@@ -166,5 +162,6 @@ std::string LoadLocalState(
|
||||
new ChromeCommandLinePrefStore(base::CommandLine::ForCurrentProcess()));
|
||||
|
||||
return InitResourceBundleAndDetermineLocale(
|
||||
- chrome_feature_list_creator->local_state(), is_running_tests);
|
||||
+ chrome_feature_list_creator->local_state(), resource_bundle_delegate,
|
||||
+ is_running_tests);
|
||||
}
|
||||
diff --git chrome/browser/chrome_resource_bundle_helper.h chrome/browser/chrome_resource_bundle_helper.h
|
||||
index 0b22e445bc3ff..1d7c6b319ba4b 100644
|
||||
--- chrome/browser/chrome_resource_bundle_helper.h
|
||||
+++ chrome/browser/chrome_resource_bundle_helper.h
|
||||
@@ -7,12 +7,15 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
+#include "ui/base/resource/resource_bundle.h"
|
||||
+
|
||||
class ChromeFeatureListCreator;
|
||||
|
||||
// Loads the local state, and returns the application locale. An empty return
|
||||
// value indicates the ResouceBundle couldn't be loaded.
|
||||
std::string LoadLocalState(
|
||||
ChromeFeatureListCreator* chrome_feature_list_creator,
|
||||
+ ui::ResourceBundle::Delegate* resource_bundle_delegate,
|
||||
bool is_running_tests);
|
||||
|
||||
#endif // CHROME_BROWSER_CHROME_RESOURCE_BUNDLE_HELPER_H_
|
||||
diff --git components/language/core/browser/locale_util.cc components/language/core/browser/locale_util.cc
|
||||
index aa43742055b04..e84f21ab963cc 100644
|
||||
--- components/language/core/browser/locale_util.cc
|
||||
|
@@ -24,7 +24,7 @@ index ecabd51db586d..a7ae5e101ca02 100644
|
||||
Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture;
|
||||
|
||||
diff --git media/video/renderable_gpu_memory_buffer_video_frame_pool.cc media/video/renderable_gpu_memory_buffer_video_frame_pool.cc
|
||||
index a7ac0f10f11e5..bb1d7dc6e9168 100644
|
||||
index a7ac0f10f11e5..bbbfefd486660 100644
|
||||
--- media/video/renderable_gpu_memory_buffer_video_frame_pool.cc
|
||||
+++ media/video/renderable_gpu_memory_buffer_video_frame_pool.cc
|
||||
@@ -198,7 +198,7 @@ gfx::Size GetBufferSizeInPixelsForVideoPixelFormat(
|
||||
@@ -46,7 +46,7 @@ index a7ac0f10f11e5..bb1d7dc6e9168 100644
|
||||
+ // once the GMB is returned from CopyRequest. So there will be no race
|
||||
+ // condition on that texture. We can request a GMB without a keyed mutex to
|
||||
+ // accelerate and probably prevent some driver deadlock.
|
||||
+ if (format_ == PIXEL_FORMAT_ARGB) {
|
||||
+ if (format_ == PIXEL_FORMAT_ARGB || format_ == PIXEL_FORMAT_ABGR) {
|
||||
+ // This value is 'borrowed', SCANOUT_VEA_CPU_READ is probably invalid
|
||||
+ // cause there's no real SCANOUT on Windows. We simply use this enum as a
|
||||
+ // flag to disable mutex in the GMBFactoryDXGI because this enum is also
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc
|
||||
index 9203a7ad0ef6c..b7ba771e6eea0 100644
|
||||
index 3a2e1ab68fa5f..b70522fd8de80 100644
|
||||
--- content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -10605,6 +10605,7 @@ void RenderFrameHostImpl::CommitNavigation(
|
||||
|
@@ -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 a52e22d0d43e3..e8403dac2961a 100644
|
||||
index f14801e94238e..fbf5b4a2ecebd 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 @@
|
||||
@@ -18,7 +18,7 @@ index a52e22d0d43e3..e8403dac2961a 100644
|
||||
#include "content/public/common/page_visibility_state.h"
|
||||
#include "services/service_manager/public/cpp/interface_provider.h"
|
||||
#include "third_party/blink/public/common/input/web_input_event.h"
|
||||
@@ -724,10 +726,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() {
|
||||
@@ -717,10 +719,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() {
|
||||
void RenderWidgetHostViewAura::UpdateBackgroundColor() {
|
||||
DCHECK(GetBackgroundColor());
|
||||
|
||||
@@ -35,7 +35,7 @@ index a52e22d0d43e3..e8403dac2961a 100644
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
@@ -2357,6 +2361,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
|
||||
@@ -2350,6 +2354,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
|
||||
window_->layer()->SetColor(GetBackgroundColor() ? *GetBackgroundColor()
|
||||
: SK_ColorWHITE);
|
||||
UpdateFrameSinkIdRegistration();
|
||||
|
@@ -61,7 +61,7 @@ index 1a49cf67e0b17..edf5896d3594e 100644
|
||||
case ui::SHOW_STATE_MAXIMIZED:
|
||||
return kSerializedShowStateMaximized;
|
||||
diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
index b1fd8fe22daa6..290912f76fb02 100644
|
||||
index c87f6ad832393..23cd3314c1bfe 100644
|
||||
--- content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
+++ content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
@@ -669,6 +669,14 @@ float RenderWidgetHostViewBase::GetScaleOverrideForCapture() const {
|
||||
@@ -350,7 +350,7 @@ index 3151a2c872f4e..e14caeb1e6645 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 b305f5c2238c2..e2bd0c430cea0 100644
|
||||
index 44462f6079955..88b24cb1a2a71 100644
|
||||
--- ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
|
||||
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
|
||||
@@ -285,8 +285,8 @@ void DesktopWindowTreeHostPlatform::Init(const Widget::InitParams& params) {
|
||||
@@ -365,7 +365,7 @@ index b305f5c2238c2..e2bd0c430cea0 100644
|
||||
|
||||
// Calculate initial bounds.
|
||||
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
index 99e20655e847e..6c3b3028e67fd 100644
|
||||
index b73f359426432..2f9bcb469bbb5 100644
|
||||
--- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
@@ -20,6 +20,7 @@
|
||||
@@ -423,7 +423,7 @@ index 99e20655e847e..6c3b3028e67fd 100644
|
||||
// Stack immediately above its parent so that it does not cover other
|
||||
// root-level windows, with the exception of menus, to allow them to be
|
||||
// displayed on top of other windows.
|
||||
@@ -1020,10 +1041,23 @@ void DesktopWindowTreeHostWin::HandleWindowMinimizedOrRestored(bool restored) {
|
||||
@@ -1025,10 +1046,23 @@ void DesktopWindowTreeHostWin::HandleWindowMinimizedOrRestored(bool restored) {
|
||||
if (!native_widget_delegate_->IsNativeWidgetInitialized())
|
||||
return;
|
||||
|
||||
@@ -449,7 +449,7 @@ index 99e20655e847e..6c3b3028e67fd 100644
|
||||
}
|
||||
|
||||
void DesktopWindowTreeHostWin::HandleClientSizeChanged(
|
||||
@@ -1040,11 +1074,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() {
|
||||
@@ -1045,11 +1079,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() {
|
||||
}
|
||||
|
||||
void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) {
|
||||
@@ -467,7 +467,7 @@ index 99e20655e847e..6c3b3028e67fd 100644
|
||||
}
|
||||
|
||||
bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) {
|
||||
@@ -1052,6 +1090,12 @@ bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) {
|
||||
@@ -1057,6 +1095,12 @@ bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) {
|
||||
if (ui::PlatformEventSource::ShouldIgnoreNativePlatformEvents())
|
||||
return true;
|
||||
|
||||
@@ -480,7 +480,7 @@ index 99e20655e847e..6c3b3028e67fd 100644
|
||||
SendEventToSink(event);
|
||||
return event->handled();
|
||||
}
|
||||
@@ -1230,8 +1274,16 @@ void DesktopWindowTreeHostWin::SetBoundsInDIP(const gfx::Rect& bounds) {
|
||||
@@ -1235,8 +1279,16 @@ void DesktopWindowTreeHostWin::SetBoundsInDIP(const gfx::Rect& bounds) {
|
||||
// positions in variable-DPI situations. See https://crbug.com/1224715 for
|
||||
// details.
|
||||
aura::Window* root = nullptr;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc
|
||||
index c455f395b3d89..f39ffa5e1a7a4 100644
|
||||
index f1a5a2e1f4d66..262bcc0181333 100644
|
||||
--- content/browser/web_contents/web_contents_impl.cc
|
||||
+++ content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3551,6 +3551,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -33,7 +33,7 @@ index c455f395b3d89..f39ffa5e1a7a4 100644
|
||||
}
|
||||
|
||||
void WebContentsImpl::RenderWidgetDeleted(
|
||||
@@ -4583,6 +4593,15 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4584,6 +4594,15 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
create_params.picture_in_picture_options = *(params.pip_options);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ index c455f395b3d89..f39ffa5e1a7a4 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.
|
||||
@@ -8894,6 +8913,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node,
|
||||
@@ -8895,6 +8914,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node,
|
||||
}
|
||||
|
||||
CloseListenerManager::DidChangeFocusedFrame(this);
|
||||
|
@@ -69,6 +69,7 @@ class ClientBrowserDelegate : public ClientAppBrowser::Delegate {
|
||||
const CefString& current_directory) override {
|
||||
// Add logging for some common switches that the user may attempt to use.
|
||||
static const char* kIgnoredSwitches[] = {
|
||||
switches::kDisableChromeRuntime,
|
||||
switches::kEnableChromeRuntime,
|
||||
switches::kMultiThreadedMessageLoop,
|
||||
switches::kOffScreenRenderingEnabled,
|
||||
|
@@ -78,7 +78,7 @@ MainContextImpl::MainContextImpl(CefRefPtr<CefCommandLine> command_line,
|
||||
|
||||
// Enable Chrome runtime bootstrap. See issue #2969 for details.
|
||||
use_chrome_bootstrap_ =
|
||||
command_line_->HasSwitch(switches::kEnableChromeRuntime);
|
||||
!command_line_->HasSwitch(switches::kDisableChromeRuntime);
|
||||
|
||||
// Whether the Views framework will be used.
|
||||
use_views_ = command_line_->HasSwitch(switches::kUseViews);
|
||||
|
@@ -115,9 +115,13 @@ class ClientRequestContextHandler : public CefRequestContextHandler,
|
||||
|
||||
// Ensure a compatible set of window creation attributes.
|
||||
void SanityCheckWindowConfig(const bool is_devtools,
|
||||
bool& use_views,
|
||||
const bool use_views,
|
||||
bool& use_alloy_style,
|
||||
bool& with_osr) {
|
||||
// This configuration is not supported by cefclient architecture and
|
||||
// should use default window creation instead.
|
||||
CHECK(!(is_devtools && !use_views));
|
||||
|
||||
if (MainContext::Get()->UseChromeBootstrap()) {
|
||||
if (is_devtools && use_alloy_style) {
|
||||
LOG(WARNING)
|
||||
@@ -125,13 +129,6 @@ void SanityCheckWindowConfig(const bool is_devtools,
|
||||
" using Chrome style.";
|
||||
use_alloy_style = false;
|
||||
}
|
||||
|
||||
if (is_devtools && !use_views) {
|
||||
LOG(WARNING)
|
||||
<< "Native parent is not supported with Chrome runtime DevTools;"
|
||||
" using Views.";
|
||||
use_views = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!use_alloy_style && with_osr) {
|
||||
@@ -195,15 +192,15 @@ scoped_refptr<RootWindow> RootWindowManager::CreateRootWindowAsPopup(
|
||||
CefBrowserSettings& settings) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
|
||||
SanityCheckWindowConfig(is_devtools, use_views, use_alloy_style, with_osr);
|
||||
|
||||
if (MainContext::Get()->UseDefaultPopup()) {
|
||||
if (MainContext::Get()->UseDefaultPopup() || (is_devtools && !use_views)) {
|
||||
// Use default window creation for the popup. A new |client| instance is
|
||||
// still required by cefclient architecture.
|
||||
client = new DefaultClientHandler();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SanityCheckWindowConfig(is_devtools, use_views, use_alloy_style, with_osr);
|
||||
|
||||
if (!temp_window_) {
|
||||
// TempWindow must be created on the UI thread.
|
||||
temp_window_.reset(new TempWindow());
|
||||
|
@@ -58,13 +58,11 @@ int main(int argc, char* argv[]) {
|
||||
// Specify CEF global settings here.
|
||||
CefSettings settings;
|
||||
|
||||
// Use the CEF Chrome runtime if "--enable-chrome-runtime" is specified via
|
||||
// the command-line. Otherwise, use the CEF Alloy runtime. For more
|
||||
// information about CEF runtimes see
|
||||
// https://bitbucket.org/chromiumembedded/cef/wiki/Architecture.md#markdown-header-cef3
|
||||
if (command_line->HasSwitch("enable-chrome-runtime")) {
|
||||
settings.chrome_runtime = true;
|
||||
}
|
||||
// Use the CEF Chrome bootstrap unless "--disable-chrome-runtime" is specified
|
||||
// via the command-line. Otherwise, use the CEF Alloy bootstrap. The Alloy
|
||||
// bootstrap is deprecated and will be removed in ~M127. See
|
||||
// https://github.com/chromiumembedded/cef/issues/3685
|
||||
settings.chrome_runtime = !command_line->HasSwitch("disable-chrome-runtime");
|
||||
|
||||
// When generating projects with CMake the CEF_USE_SANDBOX value will be defined
|
||||
// automatically. Pass -DUSE_SANDBOX=OFF to the CMake command-line to disable
|
||||
|
@@ -150,13 +150,12 @@ int main(int argc, char* argv[]) {
|
||||
// Specify CEF global settings here.
|
||||
CefSettings settings;
|
||||
|
||||
// Use the CEF Chrome runtime if "--enable-chrome-runtime" is specified via
|
||||
// the command-line. Otherwise, use the CEF Alloy runtime. For more
|
||||
// information about CEF runtimes see
|
||||
// https://bitbucket.org/chromiumembedded/cef/wiki/Architecture.md#markdown-header-cef3
|
||||
if (command_line->HasSwitch("enable-chrome-runtime")) {
|
||||
settings.chrome_runtime = true;
|
||||
}
|
||||
// Use the CEF Chrome bootstrap unless "--disable-chrome-runtime" is
|
||||
// specified via the command-line. Otherwise, use the CEF Alloy bootstrap.
|
||||
// The Alloy bootstrap is deprecated and will be removed in ~M127. See
|
||||
// https://github.com/chromiumembedded/cef/issues/3685
|
||||
settings.chrome_runtime =
|
||||
!command_line->HasSwitch("disable-chrome-runtime");
|
||||
|
||||
// When generating projects with CMake the CEF_USE_SANDBOX value will be
|
||||
// defined automatically. Pass -DUSE_SANDBOX=OFF to the CMake command-line
|
||||
|
@@ -74,13 +74,11 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
|
||||
// Specify CEF global settings here.
|
||||
CefSettings settings;
|
||||
|
||||
// Use the CEF Chrome runtime if "--enable-chrome-runtime" is specified via
|
||||
// the command-line. Otherwise, use the CEF Alloy runtime. For more
|
||||
// information about CEF runtimes see
|
||||
// https://bitbucket.org/chromiumembedded/cef/wiki/Architecture.md#markdown-header-cef3
|
||||
if (command_line->HasSwitch("enable-chrome-runtime")) {
|
||||
settings.chrome_runtime = true;
|
||||
}
|
||||
// Use the CEF Chrome bootstrap unless "--disable-chrome-runtime" is specified
|
||||
// via the command-line. Otherwise, use the CEF Alloy bootstrap. The Alloy
|
||||
// bootstrap is deprecated and will be removed in ~M127. See
|
||||
// https://github.com/chromiumembedded/cef/issues/3685
|
||||
settings.chrome_runtime = !command_line->HasSwitch("disable-chrome-runtime");
|
||||
|
||||
#if !defined(CEF_USE_SANDBOX)
|
||||
settings.no_sandbox = true;
|
||||
|
@@ -113,11 +113,14 @@ void SimpleApp::OnContextInitialized() {
|
||||
CefRefPtr<CefCommandLine> command_line =
|
||||
CefCommandLine::GetGlobalCommandLine();
|
||||
|
||||
const bool enable_chrome_runtime =
|
||||
!command_line->HasSwitch("disable-chrome-runtime");
|
||||
|
||||
// Check if Alloy style will be used. Alloy style is always used with the
|
||||
// Alloy runtime bootstrap and optional with the Chrome runtime bootstrap.
|
||||
bool use_alloy_style = true;
|
||||
cef_runtime_style_t runtime_style = CEF_RUNTIME_STYLE_DEFAULT;
|
||||
if (command_line->HasSwitch("enable-chrome-runtime")) {
|
||||
if (enable_chrome_runtime) {
|
||||
use_alloy_style = command_line->HasSwitch("use-alloy-style");
|
||||
if (use_alloy_style) {
|
||||
runtime_style = CEF_RUNTIME_STYLE_ALLOY;
|
||||
@@ -139,10 +142,16 @@ void SimpleApp::OnContextInitialized() {
|
||||
url = "http://www.google.com";
|
||||
}
|
||||
|
||||
// Create the browser using the Views framework if "--use-views" is specified
|
||||
// via the command-line. Otherwise, create the browser using the native
|
||||
// platform framework.
|
||||
if (command_line->HasSwitch("use-views")) {
|
||||
// Views is enabled by default with the Chrome bootstrap (add `--use-native`
|
||||
// to disable). Views is disabled by default with the Alloy bootstrap (add
|
||||
// `--use-views` to enable).
|
||||
const bool use_views =
|
||||
(enable_chrome_runtime && !command_line->HasSwitch("use-native")) ||
|
||||
(!enable_chrome_runtime && command_line->HasSwitch("use-views"));
|
||||
|
||||
// If using Views create the browser using the Views framework, otherwise
|
||||
// create the browser using the native platform framework.
|
||||
if (use_views) {
|
||||
// Create the BrowserView.
|
||||
CefRefPtr<CefBrowserView> browser_view = CefBrowserView::CreateBrowserView(
|
||||
handler, url, browser_settings, nullptr, nullptr,
|
||||
|
@@ -934,9 +934,14 @@ class AudioTestHandler : public TestHandler, public CefAudioHandler {
|
||||
|
||||
void OnAudioStreamError(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& message) override {
|
||||
LOG(WARNING) << "OnAudioStreamError: message = " << message << ".";
|
||||
got_on_audio_stream_error_.yes();
|
||||
DestroyTest();
|
||||
// Since 7c88225, when Chromium closes a socket, the following error is
|
||||
// propagated to the audio capturer. Ignore this error for test destruction.
|
||||
const CefString& socket_error("Socket closed unexpectedly");
|
||||
if (message.compare(socket_error) != 0) {
|
||||
LOG(WARNING) << "OnAudioStreamError: message = " << message << ".";
|
||||
got_on_audio_stream_error_.yes();
|
||||
DestroyTest();
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -945,8 +950,6 @@ class AudioTestHandler : public TestHandler, public CefAudioHandler {
|
||||
EXPECT_TRUE(got_audio_parameters_);
|
||||
EXPECT_TRUE(got_on_audio_stream_started_);
|
||||
EXPECT_TRUE(got_on_audio_stream_packet_);
|
||||
EXPECT_TRUE(got_on_audio_stream_stopped_);
|
||||
EXPECT_FALSE(got_on_audio_stream_error_);
|
||||
TestHandler::DestroyTest();
|
||||
}
|
||||
|
||||
|
@@ -46,6 +46,7 @@ const char kCRLSetsPath[] = "crl-sets-path";
|
||||
const char kLoadExtension[] = "load-extension";
|
||||
const char kNoActivate[] = "no-activate";
|
||||
const char kEnableChromeRuntime[] = "enable-chrome-runtime";
|
||||
const char kDisableChromeRuntime[] = "disable-chrome-runtime";
|
||||
const char kShowChromeToolbar[] = "show-chrome-toolbar";
|
||||
const char kInitialShowState[] = "initial-show-state";
|
||||
const char kUseDefaultPopup[] = "use-default-popup";
|
||||
|
@@ -40,6 +40,7 @@ extern const char kCRLSetsPath[];
|
||||
extern const char kLoadExtension[];
|
||||
extern const char kNoActivate[];
|
||||
extern const char kEnableChromeRuntime[];
|
||||
extern const char kDisableChromeRuntime[];
|
||||
extern const char kShowChromeToolbar[];
|
||||
extern const char kInitialShowState[];
|
||||
extern const char kUseDefaultPopup[];
|
||||
|
Reference in New Issue
Block a user