Update to Chromium version 93.0.4577.0 (#902210)

This commit is contained in:
Marshall Greenblatt 2021-07-23 12:40:13 -04:00
parent 1ffa5528b3
commit b4ea0496e7
141 changed files with 1188 additions and 1061 deletions

View File

@ -408,6 +408,12 @@ static_library("libcef_static") {
"libcef/browser/alloy/alloy_browser_host_impl.h", "libcef/browser/alloy/alloy_browser_host_impl.h",
"libcef/browser/alloy/alloy_browser_main.cc", "libcef/browser/alloy/alloy_browser_main.cc",
"libcef/browser/alloy/alloy_browser_main.h", "libcef/browser/alloy/alloy_browser_main.h",
"libcef/browser/alloy/alloy_content_browser_client.cc",
"libcef/browser/alloy/alloy_content_browser_client.h",
"libcef/browser/alloy/alloy_dialog_util.cc",
"libcef/browser/alloy/alloy_dialog_util.h",
"libcef/browser/alloy/alloy_download_util.cc",
"libcef/browser/alloy/alloy_download_util.h",
"libcef/browser/alloy/browser_platform_delegate_alloy.cc", "libcef/browser/alloy/browser_platform_delegate_alloy.cc",
"libcef/browser/alloy/browser_platform_delegate_alloy.h", "libcef/browser/alloy/browser_platform_delegate_alloy.h",
"libcef/browser/alloy/chrome_browser_process_alloy.cc", "libcef/browser/alloy/chrome_browser_process_alloy.cc",
@ -416,8 +422,6 @@ static_library("libcef_static") {
"libcef/browser/alloy/chrome_profile_manager_alloy.h", "libcef/browser/alloy/chrome_profile_manager_alloy.h",
"libcef/browser/alloy/chrome_profile_alloy.cc", "libcef/browser/alloy/chrome_profile_alloy.cc",
"libcef/browser/alloy/chrome_profile_alloy.h", "libcef/browser/alloy/chrome_profile_alloy.h",
"libcef/browser/alloy/alloy_content_browser_client.cc",
"libcef/browser/alloy/alloy_content_browser_client.h",
"libcef/browser/audio_capturer.cc", "libcef/browser/audio_capturer.cc",
"libcef/browser/audio_capturer.h", "libcef/browser/audio_capturer.h",
"libcef/browser/audio_loopback_stream_creator.cc", "libcef/browser/audio_loopback_stream_creator.cc",
@ -795,10 +799,6 @@ static_library("libcef_static") {
# For Chrome runtime support. # For Chrome runtime support.
"//chrome/app/chrome_main_delegate.cc", "//chrome/app/chrome_main_delegate.cc",
"//chrome/app/chrome_main_delegate.h", "//chrome/app/chrome_main_delegate.h",
# Part of //content//test::test_support which is testingonly.
"//content/public/test/scoped_web_ui_controller_factory_registration.cc",
"//content/public/test/scoped_web_ui_controller_factory_registration.h",
] ]
configs += [ configs += [
@ -868,7 +868,6 @@ static_library("libcef_static") {
"//components/printing/common", "//components/printing/common",
"//components/printing/renderer", "//components/printing/renderer",
"//components/proxy_config", "//components/proxy_config",
"//components/safe_browsing/core/db:test_database_manager",
"//components/services/print_compositor/public/cpp", "//components/services/print_compositor/public/cpp",
"//components/services/print_compositor/public/mojom", "//components/services/print_compositor/public/mojom",
"//components/update_client", "//components/update_client",
@ -898,7 +897,6 @@ static_library("libcef_static") {
"//gpu", "//gpu",
"//ipc", "//ipc",
"//media", "//media",
"//media/blink",
"//net", "//net",
"//pdf", "//pdf",
"//ppapi/buildflags", "//ppapi/buildflags",
@ -2004,6 +2002,7 @@ if (is_mac) {
gypi_paths2.shared_sources_mac_helper + gypi_paths2.shared_sources_mac_helper +
gypi_paths2.ceftests_sources_mac_helper gypi_paths2.ceftests_sources_mac_helper
helper_deps = [ helper_deps = [
":gtest_teamcity",
"//testing/gtest", "//testing/gtest",
] ]
helper_defines = [ helper_defines = [

View File

@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{ {
'chromium_checkout': 'refs/tags/92.0.4515.0' 'chromium_checkout': 'refs/tags/93.0.4577.0'
} }

View File

@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal // way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash // hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected. // values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "7fb6a7510f39c359767b3a893c9ebfb5fb5973d7" #define CEF_API_HASH_UNIVERSAL "6498b029e847331e85f7fa7a8fe82434e016e316"
#if defined(OS_WIN) #if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "0a848e5b676ddc931dbb5b174a64eb7be7f7dfbf" #define CEF_API_HASH_PLATFORM "5beb166d25cb4aa70e15ff565a0268c60cab3e0c"
#elif defined(OS_MAC) #elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "4c666fab20ab43dddf2f7ac6543197a1fecee389" #define CEF_API_HASH_PLATFORM "5fa684079bfafa70cc920a1ad4e694e38c46d737"
#elif defined(OS_LINUX) #elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "5f756efd08c6e10629fe1f81e9266c7af71aa5ce" #define CEF_API_HASH_PLATFORM "1e0cc77dabf9058f0fc118b4605fbcccda14466f"
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -1114,9 +1114,10 @@ content::WebContents* AlloyBrowserHostImpl::OpenURLFromTab(
return nullptr; return nullptr;
} }
bool AlloyBrowserHostImpl::ShouldTransferNavigation( bool AlloyBrowserHostImpl::ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) { bool is_main_frame_navigation) {
return platform_delegate_->ShouldTransferNavigation(is_main_frame_navigation); return platform_delegate_->ShouldAllowRendererInitiatedCrossProcessNavigation(
is_main_frame_navigation);
} }
void AlloyBrowserHostImpl::AddNewContents( void AlloyBrowserHostImpl::AddNewContents(

View File

@ -207,7 +207,8 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
content::WebContents* OpenURLFromTab( content::WebContents* OpenURLFromTab(
content::WebContents* source, content::WebContents* source,
const content::OpenURLParams& params) override; const content::OpenURLParams& params) override;
bool ShouldTransferNavigation(bool is_main_frame_navigation) override; bool ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) override;
void AddNewContents(content::WebContents* source, void AddNewContents(content::WebContents* source,
std::unique_ptr<content::WebContents> new_contents, std::unique_ptr<content::WebContents> new_contents,
const GURL& target_url, const GURL& target_url,

View File

@ -121,7 +121,6 @@
#include "services/service_manager/public/mojom/connector.mojom.h" #include "services/service_manager/public/mojom/connector.mojom.h"
#include "storage/browser/quota/quota_settings.h" #include "storage/browser/quota/quota_settings.h"
#include "third_party/blink/public/common/web_preferences/web_preferences.h" #include "third_party/blink/public/common/web_preferences/web_preferences.h"
#include "third_party/blink/public/mojom/insecure_input/insecure_input_service.mojom.h"
#include "third_party/blink/public/mojom/prerender/prerender.mojom.h" #include "third_party/blink/public/mojom/prerender/prerender.mojom.h"
#include "third_party/blink/public/web/web_window_features.h" #include "third_party/blink/public/web/web_window_features.h"
#include "third_party/widevine/cdm/buildflags.h" #include "third_party/widevine/cdm/buildflags.h"
@ -465,23 +464,6 @@ base::FilePath GetRootCachePath() {
CefString(&CefContext::Get()->settings().root_cache_path)); CefString(&CefContext::Get()->settings().root_cache_path));
} }
// Register BrowserInterfaceBroker's GetInterface() handler callbacks for
// chrome-specific document-scoped interfaces.
// Stub implementations to silence "Empty binder for interface
// blink.mojom.[Name] for the frame/document scope" errors.
// Based on chrome/browser/chrome_browser_interface_binders.cc.
void PopulateChromeFrameBinders(
mojo::BinderMapWithContext<content::RenderFrameHost*>* map) {
map->Add<blink::mojom::InsecureInputService>(base::BindRepeating(
[](content::RenderFrameHost* frame_host,
mojo::PendingReceiver<blink::mojom::InsecureInputService> receiver) {
}));
map->Add<blink::mojom::PrerenderProcessor>(base::BindRepeating(
[](content::RenderFrameHost* frame_host,
mojo::PendingReceiver<blink::mojom::PrerenderProcessor> receiver) {}));
}
} // namespace } // namespace
AlloyContentBrowserClient::AlloyContentBrowserClient() { AlloyContentBrowserClient::AlloyContentBrowserClient() {
@ -957,11 +939,13 @@ void AlloyContentBrowserClient::OverrideWebkitPrefs(
// Using RVH instead of RFH here because rvh->GetMainFrame() may be nullptr // Using RVH instead of RFH here because rvh->GetMainFrame() may be nullptr
// when this method is called. // when this method is called.
renderer_prefs::PopulateWebPreferences(rvh, *prefs); SkColor base_background_color;
renderer_prefs::PopulateWebPreferences(rvh, *prefs, base_background_color);
web_contents->SetPageBaseBackgroundColor(base_background_color);
if (rvh->GetWidget()->GetView()) { if (rvh->GetWidget()->GetView()) {
rvh->GetWidget()->GetView()->SetBackgroundColor( rvh->GetWidget()->GetView()->SetBackgroundColor(base_background_color);
prefs->base_background_color);
} }
} }
@ -1250,7 +1234,7 @@ AlloyContentBrowserClient::GetNetworkContextsParentDirectory() {
bool AlloyContentBrowserClient::HandleExternalProtocol( bool AlloyContentBrowserClient::HandleExternalProtocol(
const GURL& url, const GURL& url,
content::WebContents::OnceGetter web_contents_getter, content::WebContents::Getter web_contents_getter,
int child_id, int child_id,
int frame_tree_node_id, int frame_tree_node_id,
content::NavigationUIData* navigation_data, content::NavigationUIData* navigation_data,
@ -1299,7 +1283,6 @@ AlloyContentBrowserClient::CreateWindowForPictureInPicture(
void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForFrame( void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForFrame(
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,
mojo::BinderMapWithContext<content::RenderFrameHost*>* map) { mojo::BinderMapWithContext<content::RenderFrameHost*>* map) {
PopulateChromeFrameBinders(map);
CefBrowserFrame::RegisterBrowserInterfaceBindersForFrame(render_frame_host, CefBrowserFrame::RegisterBrowserInterfaceBindersForFrame(render_frame_host,
map); map);
@ -1377,7 +1360,7 @@ bool AlloyContentBrowserClient::ArePersistentMediaDeviceIDsAllowed(
// Persistent MediaDevice IDs are allowed if cookies are allowed. // Persistent MediaDevice IDs are allowed if cookies are allowed.
return CookieSettingsFactory::GetForProfile( return CookieSettingsFactory::GetForProfile(
Profile::FromBrowserContext(browser_context)) Profile::FromBrowserContext(browser_context))
->IsCookieAccessAllowed(url, site_for_cookies, top_frame_origin); ->IsFullCookieAccessAllowed(url, site_for_cookies, top_frame_origin);
} }
bool AlloyContentBrowserClient::ShouldAllowPluginCreation( bool AlloyContentBrowserClient::ShouldAllowPluginCreation(

View File

@ -178,7 +178,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
std::vector<base::FilePath> GetNetworkContextsParentDirectory() override; std::vector<base::FilePath> GetNetworkContextsParentDirectory() override;
bool HandleExternalProtocol( bool HandleExternalProtocol(
const GURL& url, const GURL& url,
content::WebContents::OnceGetter web_contents_getter, content::WebContents::Getter web_contents_getter,
int child_id, int child_id,
int frame_tree_node_id, int frame_tree_node_id,
content::NavigationUIData* navigation_data, content::NavigationUIData* navigation_data,

View File

@ -0,0 +1,44 @@
// Copyright 2021 The Chromium Embedded Framework Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
#include "libcef/browser/alloy/alloy_dialog_util.h"
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "base/strings/utf_string_conversions.h"
namespace alloy {
void RunFileChooser(content::WebContents* web_contents,
const blink::mojom::FileChooserParams& params,
RunFileChooserCallback callback) {
CefRefPtr<AlloyBrowserHostImpl> browser =
AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
if (!browser) {
std::move(callback).Run(-1, {});
return;
}
CefFileDialogRunner::FileChooserParams cef_params;
cef_params.mode = params.mode;
cef_params.default_file_name = params.default_file_name;
cef_params.accept_types = params.accept_types;
browser->RunFileChooser(cef_params, std::move(callback));
}
// Based on net/base/filename_util_internal.cc FilePathToString16().
std::u16string FilePathTypeToString16(const base::FilePath::StringType& str) {
std::u16string result;
#if defined(OS_WIN)
result.assign(str.begin(), str.end());
#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
if (!str.empty()) {
base::UTF8ToUTF16(str.c_str(), str.size(), &result);
}
#endif
return result;
}
} // namespace alloy

View File

@ -0,0 +1,37 @@
// Copyright 2021 The Chromium Embedded Framework Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DIALOG_UTIL_H_
#define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DIALOG_UTIL_H_
#pragma once
#include <string>
#include <vector>
#include "base/callback.h"
#include "base/files/file_path.h"
#include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h"
namespace content {
class WebContents;
}
namespace alloy {
// The argument vector will be empty if the dialog was canceled.
using RunFileChooserCallback =
base::OnceCallback<void(int /*selected_accept_filter*/,
const std::vector<base::FilePath>& /*file_paths*/)>;
// Display the file chooser dialog. Execute |callback| on completion.
// Called from patched chrome/ files.
void RunFileChooser(content::WebContents* web_contents,
const blink::mojom::FileChooserParams& params,
RunFileChooserCallback callback);
std::u16string FilePathTypeToString16(const base::FilePath::StringType& str);
} // namespace alloy
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DIALOG_UTIL_H_

View File

@ -0,0 +1,16 @@
// Copyright 2021 The Chromium Embedded Framework Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
#include "libcef/browser/alloy/alloy_download_util.h"
#include "libcef/browser/alloy/alloy_browser_context.h"
namespace alloy {
DownloadPrefs* GetDownloadPrefsFromBrowserContext(
content::BrowserContext* context) {
return static_cast<AlloyBrowserContext*>(context)->GetDownloadPrefs();
}
} // namespace alloy

View File

@ -0,0 +1,23 @@
// Copyright 2021 The Chromium Embedded Framework Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DOWNLOAD_UTIL_H_
#define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DOWNLOAD_UTIL_H_
#pragma once
class DownloadPrefs;
namespace content {
class BrowserContext;
} // namespace content
namespace alloy {
// Called from DownloadPrefs::FromBrowserContext.
DownloadPrefs* GetDownloadPrefsFromBrowserContext(
content::BrowserContext* context);
} // namespace alloy
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DOWNLOAD_UTIL_H_

View File

@ -24,6 +24,7 @@
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h" #include "content/public/browser/render_widget_host.h"
#include "extensions/browser/process_manager.h" #include "extensions/browser/process_manager.h"
#include "printing/mojom/print.mojom.h"
#include "third_party/blink/public/mojom/frame/find_in_page.mojom.h" #include "third_party/blink/public/mojom/frame/find_in_page.mojom.h"
namespace { namespace {
@ -141,10 +142,12 @@ void CefBrowserPlatformDelegateAlloy::AddNewContents(
} }
} }
bool CefBrowserPlatformDelegateAlloy::ShouldTransferNavigation( bool CefBrowserPlatformDelegateAlloy::
ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) { bool is_main_frame_navigation) {
if (extension_host_) { if (extension_host_) {
return extension_host_->ShouldTransferNavigation(is_main_frame_navigation); return extension_host_->ShouldAllowRendererInitiatedCrossProcessNavigation(
is_main_frame_navigation);
} }
return true; return true;
} }

View File

@ -27,7 +27,8 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
const gfx::Rect& initial_rect, const gfx::Rect& initial_rect,
bool user_gesture, bool user_gesture,
bool* was_blocked) override; bool* was_blocked) override;
bool ShouldTransferNavigation(bool is_main_frame_navigation) override; bool ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) override;
void RenderViewCreated(content::RenderViewHost* render_view_host) override; void RenderViewCreated(content::RenderViewHost* render_view_host) override;
void RenderViewReady() override; void RenderViewReady() override;
void BrowserCreated(CefBrowserHostBase* browser) override; void BrowserCreated(CefBrowserHostBase* browser) override;

View File

@ -372,3 +372,9 @@ BuildState* ChromeBrowserProcessAlloy::GetBuildState() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
SerialPolicyAllowedPorts*
ChromeBrowserProcessAlloy::serial_policy_allowed_ports() {
NOTREACHED();
return nullptr;
}

View File

@ -98,6 +98,7 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
resource_coordinator::ResourceCoordinatorParts* resource_coordinator_parts() resource_coordinator::ResourceCoordinatorParts* resource_coordinator_parts()
override; override;
BuildState* GetBuildState() override; BuildState* GetBuildState() override;
SerialPolicyAllowedPorts* serial_policy_allowed_ports() override;
private: private:
bool initialized_; bool initialized_;

View File

@ -110,7 +110,9 @@ void CefAudioCapturer::Capture(const media::AudioBus* source,
pts.InMilliseconds()); pts.InMilliseconds());
} }
void CefAudioCapturer::OnCaptureError(const std::string& message) { void CefAudioCapturer::OnCaptureError(
media::AudioCapturerSource::ErrorCode code,
const std::string& message) {
audio_handler_->OnAudioStreamError(browser_, message); audio_handler_->OnAudioStreamError(browser_, message);
StopStream(); StopStream();
} }

View File

@ -33,7 +33,8 @@ class CefAudioCapturer : public media::AudioCapturerSource::CaptureCallback {
base::TimeTicks audio_capture_time, base::TimeTicks audio_capture_time,
double volume, double volume,
bool key_pressed) override; bool key_pressed) override;
void OnCaptureError(const std::string& message) override; void OnCaptureError(media::AudioCapturerSource::ErrorCode code,
const std::string& message) override;
void OnCaptureMuted(bool is_muted) override {} void OnCaptureMuted(bool is_muted) override {}
void StopStream(); void StopStream();

View File

@ -473,9 +473,7 @@ void CefBrowserContentsDelegate::Observe(
DCHECK_EQ(type, content::NOTIFICATION_LOAD_STOP); DCHECK_EQ(type, content::NOTIFICATION_LOAD_STOP);
if (type == content::NOTIFICATION_LOAD_STOP) { if (type == content::NOTIFICATION_LOAD_STOP) {
content::NavigationController* controller = OnTitleChange(web_contents()->GetTitle());
content::Source<content::NavigationController>(source).ptr();
OnTitleChange(controller->GetWebContents()->GetTitle());
} }
} }

View File

@ -164,7 +164,7 @@ CefBrowserContext::CookieableSchemes MakeSupportedSchemes(
all_schemes.push_back("wss"); all_schemes.push_back("wss");
} }
return base::make_optional(all_schemes); return absl::make_optional(all_schemes);
} }
} // namespace } // namespace

View File

@ -16,7 +16,7 @@
CefBrowserFrame::CefBrowserFrame( CefBrowserFrame::CefBrowserFrame(
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,
mojo::PendingReceiver<cef::mojom::BrowserFrame> receiver) mojo::PendingReceiver<cef::mojom::BrowserFrame> receiver)
: FrameServiceBase(render_frame_host, std::move(receiver)) {} : DocumentServiceBase(render_frame_host, std::move(receiver)) {}
CefBrowserFrame::~CefBrowserFrame() = default; CefBrowserFrame::~CefBrowserFrame() = default;
@ -28,7 +28,7 @@ void CefBrowserFrame::RegisterBrowserInterfaceBindersForFrame(
[](content::RenderFrameHost* frame_host, [](content::RenderFrameHost* frame_host,
mojo::PendingReceiver<cef::mojom::BrowserFrame> receiver) { mojo::PendingReceiver<cef::mojom::BrowserFrame> receiver) {
// This object is bound to the lifetime of |frame_host| and the mojo // This object is bound to the lifetime of |frame_host| and the mojo
// connection. See FrameServiceBase for details. // connection. See DocumentServiceBase for details.
new CefBrowserFrame(frame_host, std::move(receiver)); new CefBrowserFrame(frame_host, std::move(receiver));
})); }));
} }

View File

@ -9,16 +9,16 @@
#include "libcef/browser/frame_host_impl.h" #include "libcef/browser/frame_host_impl.h"
#include "cef/libcef/common/mojom/cef.mojom.h" #include "cef/libcef/common/mojom/cef.mojom.h"
#include "content/public/browser/frame_service_base.h" #include "content/public/browser/document_service_base.h"
#include "mojo/public/cpp/bindings/binder_map.h" #include "mojo/public/cpp/bindings/binder_map.h"
// Implementation of the BrowserFrame mojo interface. // Implementation of the BrowserFrame mojo interface.
// This is implemented separately from CefFrameHostImpl to better manage the // This is implemented separately from CefFrameHostImpl to better manage the
// association with the RenderFrameHost (which may be speculative, etc.), and so // association with the RenderFrameHost (which may be speculative, etc.), and so
// that messages are always routed to the most appropriate CefFrameHostImpl // that messages are always routed to the most appropriate CefFrameHostImpl
// instance. Lifespan is tied to the RFH via FrameServiceBase. // instance. Lifespan is tied to the RFH via DocumentServiceBase.
class CefBrowserFrame class CefBrowserFrame
: public content::FrameServiceBase<cef::mojom::BrowserFrame> { : public content::DocumentServiceBase<cef::mojom::BrowserFrame> {
public: public:
CefBrowserFrame(content::RenderFrameHost* render_frame_host, CefBrowserFrame(content::RenderFrameHost* render_frame_host,
mojo::PendingReceiver<cef::mojom::BrowserFrame> receiver); mojo::PendingReceiver<cef::mojom::BrowserFrame> receiver);
@ -39,7 +39,7 @@ class CefBrowserFrame
absl::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>> regions) absl::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>> regions)
override; override;
// FrameServiceBase methods: // DocumentServiceBase methods:
bool ShouldCloseOnFinishNavigation() const override { return false; } bool ShouldCloseOnFinishNavigation() const override { return false; }
CefRefPtr<CefFrameHostImpl> GetFrameHost( CefRefPtr<CefFrameHostImpl> GetFrameHost(

View File

@ -54,7 +54,8 @@ void CefBrowserPlatformDelegate::WebContentsDestroyed(
web_contents_ = nullptr; web_contents_ = nullptr;
} }
bool CefBrowserPlatformDelegate::ShouldTransferNavigation( bool CefBrowserPlatformDelegate::
ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) { bool is_main_frame_navigation) {
return true; return true;
} }

View File

@ -118,7 +118,8 @@ class CefBrowserPlatformDelegate {
virtual void WebContentsDestroyed(content::WebContents* web_contents); virtual void WebContentsDestroyed(content::WebContents* web_contents);
// See WebContentsDelegate documentation. // See WebContentsDelegate documentation.
virtual bool ShouldTransferNavigation(bool is_main_frame_navigation); virtual bool ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation);
// Called after the RenderViewHost is created. // Called after the RenderViewHost is created.
virtual void RenderViewCreated(content::RenderViewHost* render_view_host); virtual void RenderViewCreated(content::RenderViewHost* render_view_host);

View File

@ -41,14 +41,14 @@ namespace {
void HandleExternalProtocolHelper( void HandleExternalProtocolHelper(
ChromeContentBrowserClientCef* self, ChromeContentBrowserClientCef* self,
content::WebContents::OnceGetter web_contents_getter, content::WebContents::Getter web_contents_getter,
int frame_tree_node_id, int frame_tree_node_id,
content::NavigationUIData* navigation_data, content::NavigationUIData* navigation_data,
const network::ResourceRequest& resource_request) { const network::ResourceRequest& resource_request) {
// Match the logic of the original call in // Match the logic of the original call in
// NavigationURLLoaderImpl::PrepareForNonInterceptedRequest. // NavigationURLLoaderImpl::PrepareForNonInterceptedRequest.
self->HandleExternalProtocol( self->HandleExternalProtocol(
resource_request.url, std::move(web_contents_getter), resource_request.url, web_contents_getter,
content::ChildProcessHost::kInvalidUniqueID, frame_tree_node_id, content::ChildProcessHost::kInvalidUniqueID, frame_tree_node_id,
navigation_data, navigation_data,
resource_request.resource_type == resource_request.resource_type ==
@ -173,23 +173,25 @@ void ChromeContentBrowserClientCef::OverrideWebkitPrefs(
ChromeContentBrowserClient::OverrideWebkitPrefs(web_contents, prefs); ChromeContentBrowserClient::OverrideWebkitPrefs(web_contents, prefs);
SkColor base_background_color;
auto browser = ChromeBrowserHostImpl::GetBrowserForContents(web_contents); auto browser = ChromeBrowserHostImpl::GetBrowserForContents(web_contents);
if (browser) { if (browser) {
renderer_prefs::SetCefPrefs(browser->settings(), *prefs); renderer_prefs::SetCefPrefs(browser->settings(), *prefs);
// Set the background color for the WebView. // Set the background color for the WebView.
prefs->base_background_color = browser->GetBackgroundColor(); base_background_color = browser->GetBackgroundColor();
} else { } else {
// We don't know for sure that the browser will be windowless but assume // We don't know for sure that the browser will be windowless but assume
// that the global windowless state is likely to be accurate. // that the global windowless state is likely to be accurate.
prefs->base_background_color = base_background_color =
CefContext::Get()->GetBackgroundColor(nullptr, STATE_DEFAULT); CefContext::Get()->GetBackgroundColor(nullptr, STATE_DEFAULT);
} }
web_contents->SetPageBaseBackgroundColor(base_background_color);
auto rvh = web_contents->GetRenderViewHost(); auto rvh = web_contents->GetRenderViewHost();
if (rvh->GetWidget()->GetView()) { if (rvh->GetWidget()->GetView()) {
rvh->GetWidget()->GetView()->SetBackgroundColor( rvh->GetWidget()->GetView()->SetBackgroundColor(base_background_color);
prefs->base_background_color);
} }
} }
@ -236,7 +238,7 @@ bool ChromeContentBrowserClientCef::WillCreateURLLoaderFactory(
bool ChromeContentBrowserClientCef::HandleExternalProtocol( bool ChromeContentBrowserClientCef::HandleExternalProtocol(
const GURL& url, const GURL& url,
content::WebContents::OnceGetter web_contents_getter, content::WebContents::Getter web_contents_getter,
int child_id, int child_id,
int frame_tree_node_id, int frame_tree_node_id,
content::NavigationUIData* navigation_data, content::NavigationUIData* navigation_data,
@ -256,9 +258,9 @@ bool ChromeContentBrowserClientCef::HandleExternalProtocol(
// HandleExternalProtocolHelper. Forward to the chrome layer for default // HandleExternalProtocolHelper. Forward to the chrome layer for default
// handling. // handling.
return ChromeContentBrowserClient::HandleExternalProtocol( return ChromeContentBrowserClient::HandleExternalProtocol(
url, std::move(web_contents_getter), child_id, frame_tree_node_id, url, web_contents_getter, child_id, frame_tree_node_id, navigation_data,
navigation_data, is_main_frame, page_transition, has_user_gesture, is_main_frame, page_transition, has_user_gesture, initiating_origin,
initiating_origin, nullptr); nullptr);
} }
bool ChromeContentBrowserClientCef::HandleExternalProtocol( bool ChromeContentBrowserClientCef::HandleExternalProtocol(

View File

@ -58,7 +58,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient {
network::mojom::URLLoaderFactoryOverridePtr* factory_override) override; network::mojom::URLLoaderFactoryOverridePtr* factory_override) override;
bool HandleExternalProtocol( bool HandleExternalProtocol(
const GURL& url, const GURL& url,
content::WebContents::OnceGetter web_contents_getter, content::WebContents::Getter web_contents_getter,
int child_id, int child_id,
int frame_tree_node_id, int frame_tree_node_id,
content::NavigationUIData* navigation_data, content::NavigationUIData* navigation_data,

View File

@ -8,6 +8,7 @@
#include "base/notreached.h" #include "base/notreached.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/extensions/api/tabs/tabs_constants.h" #include "chrome/browser/extensions/api/tabs/tabs_constants.h"
#include "chrome/browser/extensions/extension_tab_util.h" #include "chrome/browser/extensions/extension_tab_util.h"
#include "components/zoom/zoom_controller.h" #include "components/zoom/zoom_controller.h"
@ -381,8 +382,16 @@ bool ExecuteCodeInTabFunction::LoadFile(const std::string& file,
void ExecuteCodeInTabFunction::LoadFileComplete( void ExecuteCodeInTabFunction::LoadFileComplete(
const std::string& file, const std::string& file,
std::unique_ptr<std::string> data) { std::unique_ptr<std::string> data) {
std::vector<std::unique_ptr<std::string>> data_list;
absl::optional<std::string> error;
const bool success = !!data.get(); const bool success = !!data.get();
DidLoadAndLocalizeFile(file, success, std::move(data)); if (success) {
DCHECK(data);
data_list.push_back(std::move(data));
} else {
error = base::StringPrintf("Failed to load file '%s'.", file.c_str());
}
DidLoadAndLocalizeFile(file, std::move(data_list), std::move(error));
} }
bool TabsInsertCSSFunction::ShouldInsertCSS() const { bool TabsInsertCSSFunction::ShouldInsertCSS() const {

View File

@ -4,6 +4,7 @@
#include "libcef/browser/extensions/component_extension_resource_manager.h" #include "libcef/browser/extensions/component_extension_resource_manager.h"
#include "base/containers/contains.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/values.h" #include "base/values.h"

View File

@ -35,7 +35,8 @@ CefExtensionBackgroundHost::~CefExtensionBackgroundHost() {
std::move(deleted_callback_).Run(); std::move(deleted_callback_).Run();
} }
bool CefExtensionBackgroundHost::ShouldTransferNavigation( bool CefExtensionBackgroundHost::
ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) { bool is_main_frame_navigation) {
// Block navigations that cause the main frame to navigate to non-extension // Block navigations that cause the main frame to navigate to non-extension
// content (i.e. to web content). // content (i.e. to web content).

View File

@ -33,7 +33,8 @@ class CefExtensionBackgroundHost : public ExtensionHost {
~CefExtensionBackgroundHost() override; ~CefExtensionBackgroundHost() override;
// content::WebContentsDelegate methods: // content::WebContentsDelegate methods:
bool ShouldTransferNavigation(bool is_main_frame_navigation) override; bool ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) override;
private: private:
// Callback that will be executed on host deletion. // Callback that will be executed on host deletion.

View File

@ -61,7 +61,7 @@ bool CefExtensionViewHost::IsBackgroundPage() const {
return false; return false;
} }
bool CefExtensionViewHost::ShouldTransferNavigation( bool CefExtensionViewHost::ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) { bool is_main_frame_navigation) {
// Block navigations that cause the main frame to navigate to non-extension // Block navigations that cause the main frame to navigate to non-extension
// content (i.e. to web content). // content (i.e. to web content).

View File

@ -40,7 +40,8 @@ class CefExtensionViewHost : public ExtensionHost,
bool IsBackgroundPage() const override; bool IsBackgroundPage() const override;
// content::WebContentsDelegate methods: // content::WebContentsDelegate methods:
bool ShouldTransferNavigation(bool is_main_frame_navigation) override; bool ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) override;
bool PreHandleGestureEvent(content::WebContents* source, bool PreHandleGestureEvent(content::WebContents* source,
const blink::WebGestureEvent& event) override; const blink::WebGestureEvent& event) override;

View File

@ -18,6 +18,7 @@
#include "components/pdf/browser/pdf_web_contents_helper.h" #include "components/pdf/browser/pdf_web_contents_helper.h"
#include "components/zoom/zoom_controller.h" #include "components/zoom/zoom_controller.h"
#include "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h" #include "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h"
#include "printing/mojom/print.mojom.h"
namespace extensions { namespace extensions {

View File

@ -173,12 +173,11 @@ void CefExtensionsBrowserClient::LoadResourceFromResourceBundle(
mojo::PendingReceiver<network::mojom::URLLoader> loader, mojo::PendingReceiver<network::mojom::URLLoader> loader,
const base::FilePath& resource_relative_path, const base::FilePath& resource_relative_path,
const int resource_id, const int resource_id,
const std::string& content_security_policy, scoped_refptr<net::HttpResponseHeaders> headers,
mojo::PendingRemote<network::mojom::URLLoaderClient> client, mojo::PendingRemote<network::mojom::URLLoaderClient> client) {
bool send_cors_header) {
chrome_url_request_util::LoadResourceFromResourceBundle( chrome_url_request_util::LoadResourceFromResourceBundle(
request, std::move(loader), resource_relative_path, resource_id, request, std::move(loader), resource_relative_path, resource_id,
content_security_policy, std::move(client), send_cors_header); std::move(headers), std::move(client));
} }
bool CefExtensionsBrowserClient::AllowCrossRendererResourceLoad( bool CefExtensionsBrowserClient::AllowCrossRendererResourceLoad(

View File

@ -51,9 +51,8 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
mojo::PendingReceiver<network::mojom::URLLoader> loader, mojo::PendingReceiver<network::mojom::URLLoader> loader,
const base::FilePath& resource_relative_path, const base::FilePath& resource_relative_path,
const int resource_id, const int resource_id,
const std::string& content_security_policy, scoped_refptr<net::HttpResponseHeaders> headers,
mojo::PendingRemote<network::mojom::URLLoaderClient> client, mojo::PendingRemote<network::mojom::URLLoaderClient> client) override;
bool send_cors_header) override;
bool AllowCrossRendererResourceLoad( bool AllowCrossRendererResourceLoad(
const network::ResourceRequest& request, const network::ResourceRequest& request,
network::mojom::RequestDestination destination, network::mojom::RequestDestination destination,

View File

@ -60,11 +60,10 @@ ValueStore::ReadResult CefValueStore::Get(
return ReadResult(CreateStatusCopy(status_)); return ReadResult(CreateStatusCopy(status_));
auto settings = std::make_unique<base::DictionaryValue>(); auto settings = std::make_unique<base::DictionaryValue>();
for (std::vector<std::string>::const_iterator it = keys.begin(); for (const auto& key : keys) {
it != keys.end(); ++it) { base::Value* value = storage_.FindKey(key);
base::Value* value = nullptr; if (value) {
if (storage_.GetWithoutPathExpansion(*it, &value)) { settings->SetKey(key, value->Clone());
settings->SetWithoutPathExpansion(*it, value->CreateDeepCopy());
} }
} }
return ReadResult(std::move(settings), CreateStatusCopy(status_)); return ReadResult(std::move(settings), CreateStatusCopy(status_));
@ -95,15 +94,14 @@ ValueStore::WriteResult CefValueStore::Set(
ValueStoreChangeList changes; ValueStoreChangeList changes;
for (base::DictionaryValue::Iterator it(settings); !it.IsAtEnd(); for (base::DictionaryValue::Iterator it(settings); !it.IsAtEnd();
it.Advance()) { it.Advance()) {
base::Value* old_value = NULL; base::Value* old_value = storage_.FindKey(it.key());
if (!storage_.GetWithoutPathExpansion(it.key(), &old_value) || if (!old_value || *old_value != it.value()) {
!old_value->Equals(&it.value())) {
changes.emplace_back(it.key(), changes.emplace_back(it.key(),
old_value old_value
? absl::optional<base::Value>(old_value->Clone()) ? absl::optional<base::Value>(old_value->Clone())
: absl::nullopt, : absl::nullopt,
it.value().Clone()); it.value().Clone());
storage_.SetWithoutPathExpansion(it.key(), it.value().CreateDeepCopy()); storage_.SetKey(it.key(), it.value().Clone());
} }
} }
return WriteResult(std::move(changes), CreateStatusCopy(status_)); return WriteResult(std::move(changes), CreateStatusCopy(status_));
@ -120,10 +118,10 @@ ValueStore::WriteResult CefValueStore::Remove(
return WriteResult(CreateStatusCopy(status_)); return WriteResult(CreateStatusCopy(status_));
ValueStoreChangeList changes; ValueStoreChangeList changes;
for (auto it = keys.cbegin(); it != keys.cend(); ++it) { for (auto const& key : keys) {
std::unique_ptr<base::Value> old_value; absl::optional<base::Value> old_value = storage_.ExtractKey(key);
if (storage_.RemoveWithoutPathExpansion(*it, &old_value)) { if (old_value.has_value()) {
changes.emplace_back(*it, std::move(*old_value), absl::nullopt); changes.emplace_back(key, std::move(*old_value), absl::nullopt);
} }
} }
return WriteResult(std::move(changes), CreateStatusCopy(status_)); return WriteResult(std::move(changes), CreateStatusCopy(status_));

View File

@ -38,7 +38,11 @@ CefRefPtr<CefMediaSource> CefMediaRouteImpl::GetSource() {
} }
CefRefPtr<CefMediaSink> CefMediaRouteImpl::GetSink() { CefRefPtr<CefMediaSink> CefMediaRouteImpl::GetSink() {
return new CefMediaSinkImpl(route_.media_sink_id(), route_.media_sink_name()); return new CefMediaSinkImpl(
route_.media_sink_id(), route_.media_sink_name(),
route_.media_source().IsDialSource()
? media_router::mojom::MediaRouteProviderId::DIAL
: media_router::mojom::MediaRouteProviderId::CAST);
} }
void CefMediaRouteImpl::SendRouteMessage(const void* message, void CefMediaRouteImpl::SendRouteMessage(const void* message,

View File

@ -85,9 +85,14 @@ void GetDeviceInfo(const media_router::MediaSink::Id& sink_id,
CefMediaSinkImpl::CefMediaSinkImpl(const media_router::MediaSink& sink) CefMediaSinkImpl::CefMediaSinkImpl(const media_router::MediaSink& sink)
: sink_(sink) {} : sink_(sink) {}
CefMediaSinkImpl::CefMediaSinkImpl(const media_router::MediaSink::Id& sink_id, CefMediaSinkImpl::CefMediaSinkImpl(
const std::string& sink_name) const media_router::MediaSink::Id& sink_id,
: sink_(sink_id, sink_name, media_router::SinkIconType::GENERIC) {} const std::string& sink_name,
media_router::mojom::MediaRouteProviderId provider_id)
: sink_(sink_id,
sink_name,
media_router::SinkIconType::GENERIC,
provider_id) {}
CefString CefMediaSinkImpl::GetId() { CefString CefMediaSinkImpl::GetId() {
return sink_.id(); return sink_.id();
@ -116,11 +121,11 @@ void CefMediaSinkImpl::GetDeviceInfo(
} }
bool CefMediaSinkImpl::IsCastSink() { bool CefMediaSinkImpl::IsCastSink() {
return sink_.provider_id() == media_router::CAST; return sink_.provider_id() == media_router::mojom::MediaRouteProviderId::CAST;
} }
bool CefMediaSinkImpl::IsDialSink() { bool CefMediaSinkImpl::IsDialSink() {
return sink_.provider_id() == media_router::DIAL; return sink_.provider_id() == media_router::mojom::MediaRouteProviderId::DIAL;
} }
bool CefMediaSinkImpl::IsCompatibleWith(CefRefPtr<CefMediaSource> source) { bool CefMediaSinkImpl::IsCompatibleWith(CefRefPtr<CefMediaSource> source) {

View File

@ -15,7 +15,8 @@ class CefMediaSinkImpl : public CefMediaSink {
public: public:
explicit CefMediaSinkImpl(const media_router::MediaSink& sink); explicit CefMediaSinkImpl(const media_router::MediaSink& sink);
CefMediaSinkImpl(const media_router::MediaSink::Id& sink_id, CefMediaSinkImpl(const media_router::MediaSink::Id& sink_id,
const std::string& sink_name); const std::string& sink_name,
media_router::mojom::MediaRouteProviderId provider_id);
// CefMediaSink methods. // CefMediaSink methods.
CefString GetId() override; CefString GetId() override;

View File

@ -101,14 +101,14 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() {
prefs->inactive_selection_fg_color = SkColorSetRGB(50, 50, 50); prefs->inactive_selection_fg_color = SkColorSetRGB(50, 50, 50);
// Set font-related attributes. // Set font-related attributes.
static const base::NoDestructor<gfx::FontRenderParams> params( static const gfx::FontRenderParams params(
gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr)); gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr));
prefs->should_antialias_text = params->antialiasing; prefs->should_antialias_text = params.antialiasing;
prefs->use_subpixel_positioning = params->subpixel_positioning; prefs->use_subpixel_positioning = params.subpixel_positioning;
prefs->hinting = params->hinting; prefs->hinting = params.hinting;
prefs->use_autohinter = params->autohinter; prefs->use_autohinter = params.autohinter;
prefs->use_bitmaps = params->use_bitmaps; prefs->use_bitmaps = params.use_bitmaps;
prefs->subpixel_rendering = params->subpixel_rendering; prefs->subpixel_rendering = params.subpixel_rendering;
web_contents_->SyncRendererPrefs(); web_contents_->SyncRendererPrefs();

View File

@ -166,14 +166,18 @@ bool CefBrowserPlatformDelegateNativeMac::CreateHostWindow() {
NSView* parentView = NSView* parentView =
CAST_CEF_WINDOW_HANDLE_TO_NSVIEW(window_info_.parent_view); CAST_CEF_WINDOW_HANDLE_TO_NSVIEW(window_info_.parent_view);
NSRect contentRect = {{window_info_.x, window_info_.y}, NSRect contentRect = {{static_cast<CGFloat>(window_info_.x),
{window_info_.width, window_info_.height}}; static_cast<CGFloat>(window_info_.y)},
{static_cast<CGFloat>(window_info_.width),
static_cast<CGFloat>(window_info_.height)}};
if (parentView == nil) { if (parentView == nil) {
// Create a new window. // Create a new window.
NSRect screen_rect = [[NSScreen mainScreen] visibleFrame]; NSRect screen_rect = [[NSScreen mainScreen] visibleFrame];
NSRect window_rect = { NSRect window_rect = {
{window_info_.x, screen_rect.size.height - window_info_.y}, {static_cast<CGFloat>(window_info_.x),
{window_info_.width, window_info_.height}}; screen_rect.size.height - static_cast<CGFloat>(window_info_.y)},
{static_cast<CGFloat>(window_info_.width),
static_cast<CGFloat>(window_info_.height)}};
if (window_rect.size.width == 0) if (window_rect.size.width == 0)
window_rect.size.width = 750; window_rect.size.width = 750;
if (window_rect.size.height == 0) if (window_rect.size.height == 0)
@ -328,7 +332,8 @@ gfx::Point CefBrowserPlatformDelegateNativeMac::GetScreenPoint(
NSView* nsview = CAST_CEF_WINDOW_HANDLE_TO_NSVIEW(window_info_.parent_view); NSView* nsview = CAST_CEF_WINDOW_HANDLE_TO_NSVIEW(window_info_.parent_view);
if (nsview) { if (nsview) {
NSRect bounds = [nsview bounds]; NSRect bounds = [nsview bounds];
NSPoint view_pt = {view.x(), bounds.size.height - view.y()}; NSPoint view_pt = {static_cast<CGFloat>(view.x()),
bounds.size.height - static_cast<CGFloat>(view.y())};
NSPoint window_pt = [nsview convertPoint:view_pt toView:nil]; NSPoint window_pt = [nsview convertPoint:view_pt toView:nil];
NSPoint screen_pt = NSPoint screen_pt =
ui::ConvertPointFromWindowToScreen([nsview window], window_pt); ui::ConvertPointFromWindowToScreen([nsview window], window_pt);

View File

@ -29,6 +29,8 @@ void CefWindowDelegateView::Init(gfx::AcceleratedWidget parent_widget,
web_view_->SetWebContents(web_contents); web_view_->SetWebContents(web_contents);
web_view_->SetPreferredSize(bounds.size()); web_view_->SetPreferredSize(bounds.size());
SetCanResize(true);
views::Widget* widget = new views::Widget; views::Widget* widget = new views::Widget;
// See CalculateWindowStylesFromInitParams in // See CalculateWindowStylesFromInitParams in

View File

@ -34,7 +34,6 @@ class CefWindowDelegateView : public views::WidgetDelegateView {
void InitContent(); void InitContent();
// WidgetDelegateView methods: // WidgetDelegateView methods:
bool CanResize() const override { return true; }
bool CanMaximize() const override { return true; } bool CanMaximize() const override { return true; }
View* GetContentsView() override { return this; } View* GetContentsView() override { return this; }

View File

@ -91,10 +91,10 @@ CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostBase> browser,
.depth = depth, .depth = depth,
.wid = xwindow_, .wid = xwindow_,
.parent = parent_xwindow_, .parent = parent_xwindow_,
.x = bounds.x(), .x = static_cast<int16_t>(bounds.x()),
.y = bounds.y(), .y = static_cast<int16_t>(bounds.y()),
.width = bounds.width(), .width = static_cast<uint16_t>(bounds.width()),
.height = bounds.height(), .height = static_cast<uint16_t>(bounds.height()),
.c_class = x11::WindowClass::InputOutput, .c_class = x11::WindowClass::InputOutput,
.visual = visual, .visual = visual,
.background_pixel = 0, .background_pixel = 0,

View File

@ -44,7 +44,6 @@
#include "content/public/common/url_constants.h" #include "content/public/common/url_constants.h"
#include "content/public/common/url_utils.h" #include "content/public/common/url_utils.h"
#include "content/public/common/user_agent.h" #include "content/public/common/user_agent.h"
#include "content/public/test/scoped_web_ui_controller_factory_registration.h"
#include "ipc/ipc_channel.h" #include "ipc/ipc_channel.h"
#include "third_party/blink/public/common/chrome_debug_urls.h" #include "third_party/blink/public/common/chrome_debug_urls.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
@ -641,9 +640,7 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory {
static CefWebUIControllerFactory* GetInstance(); static CefWebUIControllerFactory* GetInstance();
protected: protected:
CefWebUIControllerFactory() CefWebUIControllerFactory() {}
: remove_content_registration_(
content::ContentWebUIControllerFactory::GetInstance()) {}
~CefWebUIControllerFactory() override {} ~CefWebUIControllerFactory() override {}
private: private:
@ -666,9 +663,6 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory {
return false; return false;
} }
content::ScopedWebUIControllerFactoryRegistration
remove_content_registration_;
DISALLOW_COPY_AND_ASSIGN(CefWebUIControllerFactory); DISALLOW_COPY_AND_ASSIGN(CefWebUIControllerFactory);
}; };
@ -684,6 +678,9 @@ CefWebUIControllerFactory* CefWebUIControllerFactory::GetInstance() {
void RegisterWebUIControllerFactory() { void RegisterWebUIControllerFactory() {
// Channel all WebUI handling through CefWebUIControllerFactory. // Channel all WebUI handling through CefWebUIControllerFactory.
content::WebUIControllerFactory::UnregisterFactoryForTesting(
content::ContentWebUIControllerFactory::GetInstance());
content::WebUIControllerFactory::RegisterFactory( content::WebUIControllerFactory::RegisterFactory(
CefWebUIControllerFactory::GetInstance()); CefWebUIControllerFactory::GetInstance());
} }

View File

@ -237,7 +237,7 @@ void SaveCookies(content::BrowserContext* browser_context,
net::CookieInclusionStatus returned_status; net::CookieInclusionStatus returned_status;
std::unique_ptr<net::CanonicalCookie> cookie = net::CanonicalCookie::Create( std::unique_ptr<net::CanonicalCookie> cookie = net::CanonicalCookie::Create(
request.url, cookie_string, base::Time::Now(), request.url, cookie_string, base::Time::Now(),
base::make_optional(response_date), &returned_status); absl::make_optional(response_date), &returned_status);
if (!returned_status.IsInclude()) { if (!returned_status.IsInclude()) {
continue; continue;
} }

View File

@ -27,6 +27,7 @@
#include "net/url_request/url_request.h" #include "net/url_request/url_request.h"
#include "services/network/public/cpp/cors/cors.h" #include "services/network/public/cpp/cors/cors.h"
#include "services/network/public/cpp/features.h" #include "services/network/public/cpp/features.h"
#include "services/network/public/mojom/early_hints.mojom.h"
namespace net_service { namespace net_service {
@ -963,7 +964,7 @@ void InterceptedRequest::ContinueToBeforeRedirect(
bool should_clear_upload; bool should_clear_upload;
net::RedirectUtil::UpdateHttpRequest(original_url, original_method, net::RedirectUtil::UpdateHttpRequest(original_url, original_method,
new_redirect_info, new_redirect_info,
base::make_optional(remove_headers), absl::make_optional(remove_headers),
/*modified_headers=*/absl::nullopt, /*modified_headers=*/absl::nullopt,
&request_.headers, &should_clear_upload); &request_.headers, &should_clear_upload);

View File

@ -45,6 +45,7 @@
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_view_host.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "media/base/video_frame.h" #include "media/base/video_frame.h"
#include "media/capture/mojom/video_capture_buffer.mojom.h"
#include "ui/compositor/compositor.h" #include "ui/compositor/compositor.h"
#include "ui/events/blink/blink_event_util.h" #include "ui/events/blink/blink_event_util.h"
#include "ui/events/gesture_detection/gesture_provider_config_helper.h" #include "ui/events/gesture_detection/gesture_provider_config_helper.h"
@ -60,8 +61,8 @@ const size_t kMaxDamageRects = 10;
const float kDefaultScaleFactor = 1.0; const float kDefaultScaleFactor = 1.0;
blink::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) { display::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) {
blink::ScreenInfo screenInfo; display::ScreenInfo screenInfo;
screenInfo.device_scale_factor = src.device_scale_factor; screenInfo.device_scale_factor = src.device_scale_factor;
screenInfo.depth = src.depth; screenInfo.depth = src.depth;
screenInfo.depth_per_component = src.depth_per_component; screenInfo.depth_per_component = src.depth_per_component;
@ -684,7 +685,7 @@ void CefRenderWidgetHostViewOSR::CopyFromSurface(
} }
} }
void CefRenderWidgetHostViewOSR::GetScreenInfo(blink::ScreenInfo* results) { void CefRenderWidgetHostViewOSR::GetScreenInfo(display::ScreenInfo* results) {
if (!browser_impl_.get()) if (!browser_impl_.get())
return; return;

View File

@ -157,7 +157,7 @@ class CefRenderWidgetHostViewOSR
const gfx::Rect& src_rect, const gfx::Rect& src_rect,
const gfx::Size& output_size, const gfx::Size& output_size,
base::OnceCallback<void(const SkBitmap&)> callback) override; base::OnceCallback<void(const SkBitmap&)> callback) override;
void GetScreenInfo(blink::ScreenInfo* results) override; void GetScreenInfo(display::ScreenInfo* results) override;
void TransformPointToRootSurface(gfx::PointF* point) override; void TransformPointToRootSurface(gfx::PointF* point) override;
gfx::Rect GetBoundsInRootWindow() override; gfx::Rect GetBoundsInRootWindow() override;

View File

@ -7,6 +7,7 @@
#include "libcef/browser/osr/render_widget_host_view_osr.h" #include "libcef/browser/osr/render_widget_host_view_osr.h"
#include "media/base/video_frame_metadata.h" #include "media/base/video_frame_metadata.h"
#include "media/capture/mojom/video_capture_buffer.mojom.h"
#include "media/capture/mojom/video_capture_types.mojom.h" #include "media/capture/mojom/video_capture_types.mojom.h"
#include "ui/gfx/skbitmap_operations.h" #include "ui/gfx/skbitmap_operations.h"

View File

@ -298,6 +298,9 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
registry->RegisterFilePathPref(prefs::kDiskCacheDir, cache_path); registry->RegisterFilePathPref(prefs::kDiskCacheDir, cache_path);
registry->RegisterIntegerPref(prefs::kDiskCacheSize, 0); registry->RegisterIntegerPref(prefs::kDiskCacheSize, 0);
// Based on Profile::RegisterProfilePrefs.
registry->RegisterBooleanPref(prefs::kSearchSuggestEnabled, false);
// Spell checking preferences. // Spell checking preferences.
// Modify defaults from SpellcheckServiceFactory::RegisterProfilePrefs. // Modify defaults from SpellcheckServiceFactory::RegisterProfilePrefs.
std::string spellcheck_lang = std::string spellcheck_lang =

View File

@ -107,6 +107,12 @@ void CefPrefStore::CommitPendingWrite(
std::move(synchronous_done_callback)); std::move(synchronous_done_callback));
} }
void CefPrefStore::CommitPendingWriteSynchronously() {
// This method was added for one very specific use case and is intentionally
// not implemented for other pref stores.
NOTREACHED();
}
void CefPrefStore::SchedulePendingLossyWrites() {} void CefPrefStore::SchedulePendingLossyWrites() {}
void CefPrefStore::ClearMutableValues() { void CefPrefStore::ClearMutableValues() {
@ -155,7 +161,11 @@ bool CefPrefStore::GetString(const std::string& key, std::string* value) const {
if (!prefs_.GetValue(key, &stored_value) || !stored_value) if (!prefs_.GetValue(key, &stored_value) || !stored_value)
return false; return false;
return stored_value->GetAsString(value); if (value && stored_value->is_string()) {
*value = stored_value->GetString();
return true;
}
return stored_value->is_string();
} }
bool CefPrefStore::GetInteger(const std::string& key, int* value) const { bool CefPrefStore::GetInteger(const std::string& key, int* value) const {
@ -163,7 +173,11 @@ bool CefPrefStore::GetInteger(const std::string& key, int* value) const {
if (!prefs_.GetValue(key, &stored_value) || !stored_value) if (!prefs_.GetValue(key, &stored_value) || !stored_value)
return false; return false;
return stored_value->GetAsInteger(value); if (value && stored_value->is_int()) {
*value = stored_value->GetInt();
return true;
}
return stored_value->is_int();
} }
bool CefPrefStore::GetBoolean(const std::string& key, bool* value) const { bool CefPrefStore::GetBoolean(const std::string& key, bool* value) const {
@ -171,7 +185,11 @@ bool CefPrefStore::GetBoolean(const std::string& key, bool* value) const {
if (!prefs_.GetValue(key, &stored_value) || !stored_value) if (!prefs_.GetValue(key, &stored_value) || !stored_value)
return false; return false;
return stored_value->GetAsBoolean(value); if (value && stored_value->is_bool()) {
*value = stored_value->GetBool();
return true;
}
return stored_value->is_bool();
} }
void CefPrefStore::SetBlockAsyncRead(bool block_async_read) { void CefPrefStore::SetBlockAsyncRead(bool block_async_read) {

View File

@ -49,6 +49,7 @@ class CefPrefStore : public PersistentPrefStore {
virtual void CommitPendingWrite( virtual void CommitPendingWrite(
base::OnceClosure done_callback, base::OnceClosure done_callback,
base::OnceClosure synchronous_done_callback) override; base::OnceClosure synchronous_done_callback) override;
void CommitPendingWriteSynchronously() override;
void SchedulePendingLossyWrites() override; void SchedulePendingLossyWrites() override;
void ClearMutableValues() override; void ClearMutableValues() override;
void OnStoreDeletionFromDisk() override; void OnStoreDeletionFromDisk() override;

View File

@ -371,7 +371,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
} }
void PopulateWebPreferences(content::RenderViewHost* rvh, void PopulateWebPreferences(content::RenderViewHost* rvh,
blink::web_pref::WebPreferences& web) { blink::web_pref::WebPreferences& web,
SkColor& base_background_color) {
REQUIRE_ALLOY_RUNTIME(); REQUIRE_ALLOY_RUNTIME();
CefRefPtr<AlloyBrowserHostImpl> browser = static_cast<AlloyBrowserHostImpl*>( CefRefPtr<AlloyBrowserHostImpl> browser = static_cast<AlloyBrowserHostImpl*>(
extensions::GetOwnerBrowserForHost(rvh, nullptr).get()); extensions::GetOwnerBrowserForHost(rvh, nullptr).get());
@ -421,11 +422,11 @@ void PopulateWebPreferences(content::RenderViewHost* rvh,
web.picture_in_picture_enabled = browser->IsPictureInPictureSupported(); web.picture_in_picture_enabled = browser->IsPictureInPictureSupported();
// Set the background color for the WebView. // Set the background color for the WebView.
web.base_background_color = browser->GetBackgroundColor(); base_background_color = browser->GetBackgroundColor();
} else { } else {
// We don't know for sure that the browser will be windowless but assume // We don't know for sure that the browser will be windowless but assume
// that the global windowless state is likely to be accurate. // that the global windowless state is likely to be accurate.
web.base_background_color = base_background_color =
CefContext::Get()->GetBackgroundColor(nullptr, STATE_DEFAULT); CefContext::Get()->GetBackgroundColor(nullptr, STATE_DEFAULT);
} }
} }

View File

@ -8,6 +8,8 @@
#include "include/internal/cef_types_wrappers.h" #include "include/internal/cef_types_wrappers.h"
#include "third_party/skia/include/core/SkColor.h"
class CommandLinePrefStore; class CommandLinePrefStore;
namespace blink { namespace blink {
@ -48,7 +50,8 @@ void SetCefPrefs(const CefBrowserSettings& cef,
// Populate WebPreferences based on a combination of command-line values, // Populate WebPreferences based on a combination of command-line values,
// PrefService and CefBrowserSettings. // PrefService and CefBrowserSettings.
void PopulateWebPreferences(content::RenderViewHost* rvh, void PopulateWebPreferences(content::RenderViewHost* rvh,
blink::web_pref::WebPreferences& web); blink::web_pref::WebPreferences& web,
SkColor& base_background_color);
bool PopulateWebPreferencesAfterNavigation( bool PopulateWebPreferencesAfterNavigation(
content::WebContents* web_contents, content::WebContents* web_contents,
blink::web_pref::WebPreferences& web); blink::web_pref::WebPreferences& web);

View File

@ -59,7 +59,7 @@ void FillInDictionaryFromPdfPrintSettings(
base::DictionaryValue& print_settings) { base::DictionaryValue& print_settings) {
// Fixed settings. // Fixed settings.
print_settings.SetIntKey(kSettingPrinterType, print_settings.SetIntKey(kSettingPrinterType,
static_cast<int>(PrinterType::kPdf)); static_cast<int>(mojom::PrinterType::kPdf));
print_settings.SetInteger(kSettingColor, print_settings.SetInteger(kSettingColor,
static_cast<int>(mojom::ColorModel::kGray)); static_cast<int>(mojom::ColorModel::kGray));
print_settings.SetInteger(kSettingDuplexMode, print_settings.SetInteger(kSettingDuplexMode,

View File

@ -522,7 +522,7 @@ void CefServerImpl::StartOnUIThread(const std::string& address,
new base::Thread(base::StringPrintf("%s:%d", address.c_str(), port))); new base::Thread(base::StringPrintf("%s:%d", address.c_str(), port)));
base::Thread::Options options; base::Thread::Options options;
options.message_pump_type = base::MessagePumpType::IO; options.message_pump_type = base::MessagePumpType::IO;
if (thread->StartWithOptions(options)) { if (thread->StartWithOptions(std::move(options))) {
// Add a reference that will be released in ShutdownOnUIThread(). // Add a reference that will be released in ShutdownOnUIThread().
AddRef(); AddRef();

View File

@ -55,6 +55,16 @@ bool CefSSLHostStateDelegate::DidHostRunInsecureContent(
return false; return false;
} }
void CefSSLHostStateDelegate::AllowHttpForHost(const std::string& host) {
// Intentional no-op.
}
bool CefSSLHostStateDelegate::IsHttpAllowedForHost(const std::string& host) {
// Intentional no-op. Return value does not matter as HTTPS-Only Mode is not
// enabled.
return false;
}
void CefSSLHostStateDelegate::AllowCert(const std::string& host, void CefSSLHostStateDelegate::AllowCert(const std::string& host,
const net::X509Certificate& cert, const net::X509Certificate& cert,
int error, int error,

View File

@ -64,6 +64,8 @@ class CefSSLHostStateDelegate : public content::SSLHostStateDelegate {
bool DidHostRunInsecureContent(const std::string& host, bool DidHostRunInsecureContent(const std::string& host,
int child_id, int child_id,
InsecureContentType content_type) override; InsecureContentType content_type) override;
void AllowHttpForHost(const std::string& host) override;
bool IsHttpAllowedForHost(const std::string& host) override;
void RevokeUserAllowExceptions(const std::string& host) override; void RevokeUserAllowExceptions(const std::string& host) override;
bool HasAllowException(const std::string& host, bool HasAllowException(const std::string& host,
content::WebContents* web_contents) override; content::WebContents* web_contents) override;

View File

@ -13,6 +13,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "ui/gfx/color_utils.h" #include "ui/gfx/color_utils.h"
#include "ui/views/animation/ink_drop.h"
#include "ui/views/controls/button/button.h" #include "ui/views/controls/button/button.h"
// Helpers for template boiler-plate. // Helpers for template boiler-plate.
@ -53,7 +54,7 @@ CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetState(cef_button_state_t state) {
views::Button::ButtonState new_state = views::Button::ButtonState new_state =
static_cast<views::Button::ButtonState>(state); static_cast<views::Button::ButtonState>(state);
if (ParentClass::root_view()->ink_drop()->ink_drop_mode() != if (views::InkDrop::Get(ParentClass::root_view())->ink_drop_mode() !=
views::InkDropHost::InkDropMode::OFF && views::InkDropHost::InkDropMode::OFF &&
!ParentClass::root_view()->IsFocusable()) { !ParentClass::root_view()->IsFocusable()) {
// Ink drop state does not get set properly on state change when the button // Ink drop state does not get set properly on state change when the button
@ -64,7 +65,8 @@ CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetState(cef_button_state_t state) {
} else if (old_state == views::Button::STATE_PRESSED) { } else if (old_state == views::Button::STATE_PRESSED) {
ink_state = views::InkDropState::DEACTIVATED; ink_state = views::InkDropState::DEACTIVATED;
} }
ParentClass::root_view()->ink_drop()->AnimateToState(ink_state, nullptr); views::InkDrop::Get(ParentClass::root_view())
->AnimateToState(ink_state, nullptr);
} }
ParentClass::root_view()->SetState(new_state); ParentClass::root_view()->SetState(new_state);
@ -77,12 +79,12 @@ CEF_BUTTON_IMPL_T cef_button_state_t CEF_BUTTON_IMPL_D::GetState() {
CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetInkDropEnabled(bool enabled) { CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetInkDropEnabled(bool enabled) {
CEF_REQUIRE_VALID_RETURN_VOID(); CEF_REQUIRE_VALID_RETURN_VOID();
ParentClass::root_view()->ink_drop()->SetMode( views::InkDrop::Get(ParentClass::root_view())
enabled ? views::InkDropHost::InkDropMode::ON ->SetMode(enabled ? views::InkDropHost::InkDropMode::ON
: views::InkDropHost::InkDropMode::OFF); : views::InkDropHost::InkDropMode::OFF);
if (enabled) { if (enabled) {
ParentClass::root_view()->ink_drop()->SetBaseColor( views::InkDrop::Get(ParentClass::root_view())
color_utils::BlendTowardMaxContrast( ->SetBaseColor(color_utils::BlendTowardMaxContrast(
ParentClass::root_view()->background()->get_color(), 0x61)); ParentClass::root_view()->background()->get_color(), 0x61));
} }
} }

View File

@ -12,6 +12,7 @@
#include "libcef/browser/views/view_view.h" #include "libcef/browser/views/view_view.h"
#include "base/logging.h" #include "base/logging.h"
#include "ui/views/animation/ink_drop.h"
#include "ui/views/controls/button/button.h" #include "ui/views/controls/button/button.h"
// Helpers for template boiler-plate. // Helpers for template boiler-plate.
@ -59,7 +60,7 @@ CEF_BUTTON_VIEW_T void CEF_BUTTON_VIEW_D::ButtonPressed(
// Callback may trigger new animation state. // Callback may trigger new animation state.
if (ParentClass::cef_delegate()) if (ParentClass::cef_delegate())
ParentClass::cef_delegate()->OnButtonPressed(GetCefButton()); ParentClass::cef_delegate()->OnButtonPressed(GetCefButton());
if (ParentClass::ink_drop()->ink_drop_mode() != if (views::InkDrop::Get(this)->ink_drop_mode() !=
views::InkDropHost::InkDropMode::OFF && views::InkDropHost::InkDropMode::OFF &&
!ParentClass::IsFocusable() && !ParentClass::IsFocusable() &&
ParentClass::GetState() != views::Button::STATE_PRESSED) { ParentClass::GetState() != views::Button::STATE_PRESSED) {
@ -67,7 +68,7 @@ CEF_BUTTON_VIEW_T void CEF_BUTTON_VIEW_D::ButtonPressed(
// non-focusable. Reset the ink drop state here if the state has not been // non-focusable. Reset the ink drop state here if the state has not been
// explicitly set to pressed by the OnButtonPressed callback calling // explicitly set to pressed by the OnButtonPressed callback calling
// SetState (which also sets the ink drop state). // SetState (which also sets the ink drop state).
ParentClass::ink_drop()->AnimateToState( views::InkDrop::Get(this)->AnimateToState(
views::InkDropState::HIDDEN, ui::LocatedEvent::FromIfValid(&event)); views::InkDropState::HIDDEN, ui::LocatedEvent::FromIfValid(&event));
} }
} }

View File

@ -138,7 +138,7 @@ class CaptionlessFrameView : public views::NonClientFrameView {
// fullscreen, as it can't be resized in those states. // fullscreen, as it can't be resized in those states.
int resize_border_thickness = ResizeBorderThickness(); int resize_border_thickness = ResizeBorderThickness();
int frame_component = GetHTComponentForFrame( int frame_component = GetHTComponentForFrame(
point, resize_border_thickness, resize_border_thickness, point, gfx::Insets(resize_border_thickness, resize_border_thickness),
kResizeAreaCornerSize, kResizeAreaCornerSize, can_ever_resize); kResizeAreaCornerSize, kResizeAreaCornerSize, can_ever_resize);
if (frame_component != HTNOWHERE) if (frame_component != HTNOWHERE)
return frame_component; return frame_component;
@ -260,6 +260,12 @@ void CefWindowView::CreateWidget() {
params.type = views::Widget::InitParams::TYPE_WINDOW; params.type = views::Widget::InitParams::TYPE_WINDOW;
bool can_activate = true; bool can_activate = true;
// WidgetDelegate::DeleteDelegate() will delete |this| after executing the
// registered callback.
SetOwnedByWidget(true);
RegisterDeleteDelegateCallback(
base::BindOnce(&CefWindowView::DeleteDelegate, base::Unretained(this)));
if (cef_delegate()) { if (cef_delegate()) {
CefRefPtr<CefWindow> cef_window = GetCefWindow(); CefRefPtr<CefWindow> cef_window = GetCefWindow();
is_frameless_ = cef_delegate()->IsFrameless(cef_window); is_frameless_ = cef_delegate()->IsFrameless(cef_window);
@ -267,6 +273,8 @@ void CefWindowView::CreateWidget() {
auto bounds = cef_delegate()->GetInitialBounds(cef_window); auto bounds = cef_delegate()->GetInitialBounds(cef_window);
params.bounds = gfx::Rect(bounds.x, bounds.y, bounds.width, bounds.height); params.bounds = gfx::Rect(bounds.x, bounds.y, bounds.width, bounds.height);
SetCanResize(cef_delegate()->CanResize(cef_window));
bool is_menu = false; bool is_menu = false;
bool can_activate_menu = true; bool can_activate_menu = true;
CefRefPtr<CefWindow> parent_window = cef_delegate()->GetParentWindow( CefRefPtr<CefWindow> parent_window = cef_delegate()->GetParentWindow(
@ -335,15 +343,6 @@ void CefWindowView::DeleteDelegate() {
RemoveAllChildViews(true); RemoveAllChildViews(true);
window_delegate_->OnWindowViewDeleted(); window_delegate_->OnWindowViewDeleted();
// Deletes |this|.
views::WidgetDelegateView::DeleteDelegate();
}
bool CefWindowView::CanResize() const {
if (!cef_delegate())
return true;
return cef_delegate()->CanResize(GetCefWindow());
} }
bool CefWindowView::CanMinimize() const { bool CefWindowView::CanMinimize() const {
@ -362,18 +361,22 @@ std::u16string CefWindowView::GetWindowTitle() const {
return title_; return title_;
} }
gfx::ImageSkia CefWindowView::GetWindowIcon() { ui::ImageModel CefWindowView::GetWindowIcon() {
if (!window_icon_) if (!window_icon_)
return ParentClass::GetWindowIcon(); return ParentClass::GetWindowIcon();
return static_cast<CefImageImpl*>(window_icon_.get()) auto image_skia =
static_cast<CefImageImpl*>(window_icon_.get())
->GetForced1xScaleRepresentation(GetDisplay().device_scale_factor()); ->GetForced1xScaleRepresentation(GetDisplay().device_scale_factor());
return ui::ImageModel::FromImageSkia(image_skia);
} }
gfx::ImageSkia CefWindowView::GetWindowAppIcon() { ui::ImageModel CefWindowView::GetWindowAppIcon() {
if (!window_app_icon_) if (!window_app_icon_)
return ParentClass::GetWindowAppIcon(); return ParentClass::GetWindowAppIcon();
return static_cast<CefImageImpl*>(window_app_icon_.get()) auto image_skia =
static_cast<CefImageImpl*>(window_app_icon_.get())
->GetForced1xScaleRepresentation(GetDisplay().device_scale_factor()); ->GetForced1xScaleRepresentation(GetDisplay().device_scale_factor());
return ui::ImageModel::FromImageSkia(image_skia);
} }
void CefWindowView::WindowClosing() { void CefWindowView::WindowClosing() {

View File

@ -49,16 +49,12 @@ class CefWindowView
// CefViewView::GetCefView. // CefViewView::GetCefView.
CefRefPtr<CefWindow> GetCefWindow() const; CefRefPtr<CefWindow> GetCefWindow() const;
// views::WidgetDelegateView methods:
void DeleteDelegate() override;
// views::WidgetDelegate methods: // views::WidgetDelegate methods:
bool CanResize() const override;
bool CanMinimize() const override; bool CanMinimize() const override;
bool CanMaximize() const override; bool CanMaximize() const override;
std::u16string GetWindowTitle() const override; std::u16string GetWindowTitle() const override;
gfx::ImageSkia GetWindowIcon() override; ui::ImageModel GetWindowIcon() override;
gfx::ImageSkia GetWindowAppIcon() override; ui::ImageModel GetWindowAppIcon() override;
void WindowClosing() override; void WindowClosing() override;
views::View* GetContentsView() override; views::View* GetContentsView() override;
views::ClientView* CreateClientView(views::Widget* widget) override; views::ClientView* CreateClientView(views::Widget* widget) override;
@ -101,6 +97,9 @@ class CefWindowView
views::NonClientFrameView* GetNonClientFrameView() const; views::NonClientFrameView* GetNonClientFrameView() const;
private: private:
// Called when removed from the Widget and before |this| is deleted.
void DeleteDelegate();
// Not owned by this object. // Not owned by this object.
Delegate* window_delegate_; Delegate* window_delegate_;

View File

@ -8,7 +8,7 @@
#include "libcef/common/net/scheme_info.h" #include "libcef/common/net/scheme_info.h"
#include "libcef/features/runtime.h" #include "libcef/features/runtime.h"
#include "base/stl_util.h" #include "base/containers/contains.h"
#include "content/public/common/url_constants.h" #include "content/public/common/url_constants.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
#include "net/net_buildflags.h" #include "net/net_buildflags.h"

View File

@ -102,9 +102,9 @@ int GetCacheControlHeaderPolicy(CefRequest::HeaderMap headerMap) {
// Convert cef_urlrequest_flags_t to blink::WebCachePolicy. // Convert cef_urlrequest_flags_t to blink::WebCachePolicy.
blink::mojom::FetchCacheMode GetFetchCacheMode(int ur_flags) { blink::mojom::FetchCacheMode GetFetchCacheMode(int ur_flags) {
const bool skip_cache{ur_flags & UR_FLAG_SKIP_CACHE}; const bool skip_cache{!!(ur_flags & UR_FLAG_SKIP_CACHE)};
const bool only_from_cache{ur_flags & UR_FLAG_ONLY_FROM_CACHE}; const bool only_from_cache{!!(ur_flags & UR_FLAG_ONLY_FROM_CACHE)};
const bool disable_cache{ur_flags & UR_FLAG_DISABLE_CACHE}; const bool disable_cache{!!(ur_flags & UR_FLAG_DISABLE_CACHE)};
if (only_from_cache && (skip_cache || disable_cache)) { if (only_from_cache && (skip_cache || disable_cache)) {
// The request will always fail because only_from_cache and // The request will always fail because only_from_cache and
// skip_cache/disable_cache are mutually exclusive. // skip_cache/disable_cache are mutually exclusive.

View File

@ -105,7 +105,7 @@ bool CefThreadImpl::Create(const CefString& display_name,
} }
#endif #endif
if (!thread_->StartWithOptions(options)) { if (!thread_->StartWithOptions(std::move(options))) {
thread_.reset(); thread_.reset();
return false; return false;
} }

View File

@ -243,8 +243,8 @@ bool CefValueImpl::GetBool() {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
bool ret_value = false; bool ret_value = false;
if (value_) if (value_ && value_->is_bool())
value_->GetAsBoolean(&ret_value); ret_value = value_->GetBool();
return ret_value; return ret_value;
} }
@ -252,8 +252,8 @@ int CefValueImpl::GetInt() {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
int ret_value = 0; int ret_value = 0;
if (value_) if (value_ && value_->is_int())
value_->GetAsInteger(&ret_value); ret_value = value_->GetInt();
return ret_value; return ret_value;
} }
@ -261,8 +261,8 @@ double CefValueImpl::GetDouble() {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
double ret_value = 0; double ret_value = 0;
if (value_) if (value_ && value_->is_double())
value_->GetAsDouble(&ret_value); ret_value = value_->GetDouble();
return ret_value; return ret_value;
} }
@ -270,8 +270,8 @@ CefString CefValueImpl::GetString() {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
std::string ret_value; std::string ret_value;
if (value_) if (value_ && value_->is_string())
value_->GetAsString(&ret_value); ret_value = value_->GetString();
return ret_value; return ret_value;
} }
@ -691,7 +691,7 @@ CefRefPtr<CefDictionaryValue> CefDictionaryValueImpl::Copy(
size_t CefDictionaryValueImpl::GetSize() { size_t CefDictionaryValueImpl::GetSize() {
CEF_VALUE_VERIFY_RETURN(false, 0); CEF_VALUE_VERIFY_RETURN(false, 0);
return const_value().size(); return const_value().DictSize();
} }
bool CefDictionaryValueImpl::Clear() { bool CefDictionaryValueImpl::Clear() {
@ -700,7 +700,7 @@ bool CefDictionaryValueImpl::Clear() {
// Detach any dependent values. // Detach any dependent values.
controller()->RemoveDependencies(mutable_value()); controller()->RemoveDependencies(mutable_value());
mutable_value()->Clear(); mutable_value()->DictClear();
return true; return true;
} }
@ -728,10 +728,9 @@ bool CefDictionaryValueImpl::Remove(const CefString& key) {
CefValueType CefDictionaryValueImpl::GetType(const CefString& key) { CefValueType CefDictionaryValueImpl::GetType(const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, VTYPE_INVALID); CEF_VALUE_VERIFY_RETURN(false, VTYPE_INVALID);
const base::Value* out_value = nullptr; const base::Value* value = const_value().FindKey(base::StringPiece(key));
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), if (value) {
&out_value)) { switch (value->type()) {
switch (out_value->type()) {
case base::Value::Type::NONE: case base::Value::Type::NONE:
return VTYPE_NULL; return VTYPE_NULL;
case base::Value::Type::BOOLEAN: case base::Value::Type::BOOLEAN:
@ -757,11 +756,10 @@ CefValueType CefDictionaryValueImpl::GetType(const CefString& key) {
CefRefPtr<CefValue> CefDictionaryValueImpl::GetValue(const CefString& key) { CefRefPtr<CefValue> CefDictionaryValueImpl::GetValue(const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, nullptr); CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = nullptr; const base::Value* value = const_value().FindKey(base::StringPiece(key));
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), if (value) {
&out_value)) {
return CefValueImpl::GetOrCreateRefOrCopy( return CefValueImpl::GetOrCreateRefOrCopy(
const_cast<base::Value*>(out_value), const_cast<base::Value*>(value),
const_cast<base::DictionaryValue*>(&const_value()), read_only(), const_cast<base::DictionaryValue*>(&const_value()), read_only(),
controller()); controller());
} }
@ -772,11 +770,12 @@ CefRefPtr<CefValue> CefDictionaryValueImpl::GetValue(const CefString& key) {
bool CefDictionaryValueImpl::GetBool(const CefString& key) { bool CefDictionaryValueImpl::GetBool(const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, false); CEF_VALUE_VERIFY_RETURN(false, false);
const base::Value* out_value = nullptr;
bool ret_value = false; bool ret_value = false;
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value)) const base::Value* value = const_value().FindKey(base::StringPiece(key));
out_value->GetAsBoolean(&ret_value); if (value && value->is_bool()) {
ret_value = value->GetBool();
}
return ret_value; return ret_value;
} }
@ -784,11 +783,12 @@ bool CefDictionaryValueImpl::GetBool(const CefString& key) {
int CefDictionaryValueImpl::GetInt(const CefString& key) { int CefDictionaryValueImpl::GetInt(const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, 0); CEF_VALUE_VERIFY_RETURN(false, 0);
const base::Value* out_value = nullptr;
int ret_value = 0; int ret_value = 0;
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value)) const base::Value* value = const_value().FindKey(base::StringPiece(key));
out_value->GetAsInteger(&ret_value); if (value && value->is_int()) {
ret_value = value->GetInt();
}
return ret_value; return ret_value;
} }
@ -796,11 +796,12 @@ int CefDictionaryValueImpl::GetInt(const CefString& key) {
double CefDictionaryValueImpl::GetDouble(const CefString& key) { double CefDictionaryValueImpl::GetDouble(const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, 0); CEF_VALUE_VERIFY_RETURN(false, 0);
const base::Value* out_value = nullptr;
double ret_value = 0; double ret_value = 0;
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value)) const base::Value* value = const_value().FindKey(base::StringPiece(key));
out_value->GetAsDouble(&ret_value); if (value && value->is_double()) {
ret_value = value->GetDouble();
}
return ret_value; return ret_value;
} }
@ -808,11 +809,12 @@ double CefDictionaryValueImpl::GetDouble(const CefString& key) {
CefString CefDictionaryValueImpl::GetString(const CefString& key) { CefString CefDictionaryValueImpl::GetString(const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, CefString()); CEF_VALUE_VERIFY_RETURN(false, CefString());
const base::Value* out_value = nullptr;
std::string ret_value; std::string ret_value;
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value)) const base::Value* value = const_value().FindKey(base::StringPiece(key));
out_value->GetAsString(&ret_value); if (value && value->is_string()) {
ret_value = value->GetString();
}
return ret_value; return ret_value;
} }
@ -821,12 +823,9 @@ CefRefPtr<CefBinaryValue> CefDictionaryValueImpl::GetBinary(
const CefString& key) { const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, nullptr); CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = nullptr; const base::Value* value = const_value().FindKey(base::StringPiece(key));
if (value && value->is_blob()) {
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), base::Value* binary_value = const_cast<base::Value*>(value);
&out_value) &&
out_value->is_blob()) {
base::Value* binary_value = const_cast<base::Value*>(out_value);
return CefBinaryValueImpl::GetOrCreateRef( return CefBinaryValueImpl::GetOrCreateRef(
binary_value, const_cast<base::DictionaryValue*>(&const_value()), binary_value, const_cast<base::DictionaryValue*>(&const_value()),
controller()); controller());
@ -839,13 +838,10 @@ CefRefPtr<CefDictionaryValue> CefDictionaryValueImpl::GetDictionary(
const CefString& key) { const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, nullptr); CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = nullptr; const base::Value* value = const_value().FindKey(base::StringPiece(key));
if (value && value->is_dict()) {
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), base::DictionaryValue* dict_value =
&out_value) && static_cast<base::DictionaryValue*>(const_cast<base::Value*>(value));
out_value->is_dict()) {
base::DictionaryValue* dict_value = static_cast<base::DictionaryValue*>(
const_cast<base::Value*>(out_value));
return CefDictionaryValueImpl::GetOrCreateRef( return CefDictionaryValueImpl::GetOrCreateRef(
dict_value, const_cast<base::DictionaryValue*>(&const_value()), dict_value, const_cast<base::DictionaryValue*>(&const_value()),
read_only(), controller()); read_only(), controller());
@ -857,13 +853,10 @@ CefRefPtr<CefDictionaryValue> CefDictionaryValueImpl::GetDictionary(
CefRefPtr<CefListValue> CefDictionaryValueImpl::GetList(const CefString& key) { CefRefPtr<CefListValue> CefDictionaryValueImpl::GetList(const CefString& key) {
CEF_VALUE_VERIFY_RETURN(false, nullptr); CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = nullptr; const base::Value* value = const_value().FindKey(base::StringPiece(key));
if (value && value->is_list()) {
if (const_value().GetWithoutPathExpansion(base::StringPiece(key),
&out_value) &&
out_value->is_list()) {
base::ListValue* list_value = base::ListValue* list_value =
static_cast<base::ListValue*>(const_cast<base::Value*>(out_value)); static_cast<base::ListValue*>(const_cast<base::Value*>(value));
return CefListValueImpl::GetOrCreateRef( return CefListValueImpl::GetOrCreateRef(
list_value, const_cast<base::DictionaryValue*>(&const_value()), list_value, const_cast<base::DictionaryValue*>(&const_value()),
read_only(), controller()); read_only(), controller());
@ -952,18 +945,29 @@ bool CefDictionaryValueImpl::SetList(const CefString& key,
} }
bool CefDictionaryValueImpl::RemoveInternal(const CefString& key) { bool CefDictionaryValueImpl::RemoveInternal(const CefString& key) {
std::unique_ptr<base::Value> out_value; // The ExtractKey() call below which removes the Value from the dictionary
if (!mutable_value()->RemoveWithoutPathExpansion(base::StringPiece(key), // will return a new Value object with the moved contents of the Value that
&out_value)) { // exists in the implementation std::map. Consequently we use FindKey() to
// retrieve the actual Value pointer as it current exists first, for later
// comparison purposes.
const base::Value* actual_value =
const_value().FindKey(base::StringPiece(key));
if (!actual_value)
return false;
// |actual_value| is no longer valid after this call.
absl::optional<base::Value> out_value =
mutable_value()->ExtractKey(base::StringPiece(key));
if (!out_value.has_value()) {
return false; return false;
} }
// Remove the value. // Remove the value.
controller()->Remove(out_value.get(), true); controller()->Remove(const_cast<base::Value*>(actual_value), true);
// Only list and dictionary types may have dependencies. // Only list and dictionary types may have dependencies.
if (out_value->is_list() || out_value->is_dict()) { if (out_value->is_list() || out_value->is_dict()) {
controller()->RemoveDependencies(out_value.get()); controller()->RemoveDependencies(const_cast<base::Value*>(actual_value));
} }
return true; return true;
@ -1126,7 +1130,7 @@ bool CefListValueImpl::Clear() {
// Detach any dependent values. // Detach any dependent values.
controller()->RemoveDependencies(mutable_value()); controller()->RemoveDependencies(mutable_value());
mutable_value()->Clear(); mutable_value()->ClearList();
return true; return true;
} }
@ -1183,8 +1187,9 @@ bool CefListValueImpl::GetBool(size_t index) {
const base::Value* out_value = nullptr; const base::Value* out_value = nullptr;
bool ret_value = false; bool ret_value = false;
if (const_value().Get(index, &out_value)) if (const_value().Get(index, &out_value) && out_value->is_bool()) {
out_value->GetAsBoolean(&ret_value); ret_value = out_value->GetBool();
}
return ret_value; return ret_value;
} }
@ -1195,8 +1200,9 @@ int CefListValueImpl::GetInt(size_t index) {
const base::Value* out_value = nullptr; const base::Value* out_value = nullptr;
int ret_value = 0; int ret_value = 0;
if (const_value().Get(index, &out_value)) if (const_value().Get(index, &out_value) && out_value->is_int()) {
out_value->GetAsInteger(&ret_value); ret_value = out_value->GetInt();
}
return ret_value; return ret_value;
} }
@ -1207,8 +1213,9 @@ double CefListValueImpl::GetDouble(size_t index) {
const base::Value* out_value = nullptr; const base::Value* out_value = nullptr;
double ret_value = 0; double ret_value = 0;
if (const_value().Get(index, &out_value)) if (const_value().Get(index, &out_value) && out_value->is_double()) {
out_value->GetAsDouble(&ret_value); ret_value = out_value->GetDouble();
}
return ret_value; return ret_value;
} }
@ -1219,8 +1226,9 @@ CefString CefListValueImpl::GetString(size_t index) {
const base::Value* out_value = nullptr; const base::Value* out_value = nullptr;
std::string ret_value; std::string ret_value;
if (const_value().Get(index, &out_value)) if (const_value().Get(index, &out_value) && out_value->is_string()) {
out_value->GetAsString(&ret_value); ret_value = out_value->GetString();
}
return ret_value; return ret_value;
} }
@ -1348,24 +1356,28 @@ bool CefListValueImpl::SetList(size_t index, CefRefPtr<CefListValue> value) {
} }
bool CefListValueImpl::RemoveInternal(size_t index) { bool CefListValueImpl::RemoveInternal(size_t index) {
// base::Value now uses move semantics which means that Remove() will return auto list = mutable_value()->GetList();
// a new base::Value object with the moved contents of the base::Value that if (index >= list.size())
// exists in the implementation std::vector. Consequently we use Get() to
// retrieve the actual base::Value pointer as it exists in the std::vector.
const base::Value* actual_value = nullptr;
if (!const_value().Get(index, &actual_value))
return false; return false;
DCHECK(actual_value);
std::unique_ptr<base::Value> out_value; // The std::move() call below which removes the Value from the list will
if (!mutable_value()->Remove(index, &out_value)) // return a new Value object with the moved contents of the Value that exists
// in the implementation std::vector. Consequently we use Get() to retrieve
// the actual Value pointer as it current exists first, for later comparison
// purposes.
const base::Value* actual_value = nullptr;
if (!const_value().Get(index, &actual_value) || !actual_value)
return false; return false;
// |actual_value| is no longer valid after this call.
auto out_value = std::move(list[index]);
mutable_value()->EraseListIter(list.begin() + index);
// Remove the value. // Remove the value.
controller()->Remove(const_cast<base::Value*>(actual_value), true); controller()->Remove(const_cast<base::Value*>(actual_value), true);
// Only list and dictionary types may have dependencies. // Only list and dictionary types may have dependencies.
if (out_value->is_list() || out_value->is_dict()) { if (out_value.is_list() || out_value.is_dict()) {
controller()->RemoveDependencies(const_cast<base::Value*>(actual_value)); controller()->RemoveDependencies(const_cast<base::Value*>(actual_value));
} }
@ -1375,10 +1387,13 @@ bool CefListValueImpl::RemoveInternal(size_t index) {
base::Value* CefListValueImpl::SetInternal(size_t index, base::Value* value) { base::Value* CefListValueImpl::SetInternal(size_t index, base::Value* value) {
DCHECK(value); DCHECK(value);
if (RemoveInternal(index)) if (RemoveInternal(index)) {
mutable_value()->Insert(index, base::WrapUnique(value)); auto list = mutable_value()->GetList();
else CHECK_LE(index, list.size());
mutable_value()->Insert(list.begin() + index, std::move(*value));
} else {
mutable_value()->Set(index, base::WrapUnique(value)); mutable_value()->Set(index, base::WrapUnique(value));
}
// base::Value now uses move semantics which means that Insert()/Set() will // base::Value now uses move semantics which means that Insert()/Set() will
// move the contents of the passed-in base::Value instead of keeping the same // move the contents of the passed-in base::Value instead of keeping the same

View File

@ -93,6 +93,7 @@ const char kCdmSupportedEncryptionSchemesName[] =
// parameter |kCdmCodecsListName|. // parameter |kCdmCodecsListName|.
const char kCdmSupportedCodecVp8[] = "vp8"; const char kCdmSupportedCodecVp8[] = "vp8";
const char kCdmSupportedCodecVp9[] = "vp09"; const char kCdmSupportedCodecVp9[] = "vp09";
const char kCdmSupportedCodecAv1[] = "av01";
#if BUILDFLAG(USE_PROPRIETARY_CODECS) #if BUILDFLAG(USE_PROPRIETARY_CODECS)
const char kCdmSupportedCodecAvc1[] = "avc1"; const char kCdmSupportedCodecAvc1[] = "avc1";
#endif #endif
@ -197,7 +198,7 @@ bool IsCompatibleWithChrome(const base::DictionaryValue& manifest,
// valid. Returns false and does not modify |video_codecs| if the manifest entry // valid. Returns false and does not modify |video_codecs| if the manifest entry
// is incorrectly formatted. // is incorrectly formatted.
bool GetCodecs(const base::DictionaryValue& manifest, bool GetCodecs(const base::DictionaryValue& manifest,
std::vector<media::VideoCodec>* video_codecs, media::CdmCapability::VideoCodecMap* video_codecs,
std::string* error_message) { std::string* error_message) {
DCHECK(video_codecs); DCHECK(video_codecs);
@ -224,19 +225,22 @@ bool GetCodecs(const base::DictionaryValue& manifest,
return true; return true;
} }
std::vector<media::VideoCodec> result; media::CdmCapability::VideoCodecMap result;
const std::vector<media::VideoCodecProfile> kAllProfiles = {};
const std::vector<base::StringPiece> supported_codecs = const std::vector<base::StringPiece> supported_codecs =
base::SplitStringPiece(codecs, kCdmValueDelimiter, base::TRIM_WHITESPACE, base::SplitStringPiece(codecs, kCdmValueDelimiter, base::TRIM_WHITESPACE,
base::SPLIT_WANT_NONEMPTY); base::SPLIT_WANT_NONEMPTY);
for (const auto& codec : supported_codecs) { for (const auto& codec : supported_codecs) {
if (codec == kCdmSupportedCodecVp8) if (codec == kCdmSupportedCodecVp8)
result.push_back(media::VideoCodec::kCodecVP8); result.emplace(media::VideoCodec::kCodecVP8, kAllProfiles);
else if (codec == kCdmSupportedCodecVp9) else if (codec == kCdmSupportedCodecVp9)
result.push_back(media::VideoCodec::kCodecVP9); result.emplace(media::VideoCodec::kCodecVP9, kAllProfiles);
else if (codec == kCdmSupportedCodecAv1)
result.emplace(media::VideoCodec::kCodecAV1, kAllProfiles);
#if BUILDFLAG(USE_PROPRIETARY_CODECS) #if BUILDFLAG(USE_PROPRIETARY_CODECS)
else if (codec == kCdmSupportedCodecAvc1) else if (codec == kCdmSupportedCodecAvc1)
result.push_back(media::VideoCodec::kCodecH264); result.emplace(media::VideoCodec::kCodecH264, kAllProfiles);
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS) #endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
} }

View File

@ -64,7 +64,6 @@
#include "components/spellcheck/renderer/spellcheck_provider.h" #include "components/spellcheck/renderer/spellcheck_provider.h"
#include "components/visitedlink/renderer/visitedlink_reader.h" #include "components/visitedlink/renderer/visitedlink_reader.h"
#include "components/web_cache/renderer/web_cache_impl.h" #include "components/web_cache/renderer/web_cache_impl.h"
#include "content/common/frame_messages.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h" #include "content/public/browser/render_process_host.h"
@ -309,13 +308,13 @@ void AlloyContentRendererClient::RenderFrameCreated(
} }
} }
void AlloyContentRendererClient::RenderViewCreated( void AlloyContentRendererClient::WebViewCreated(blink::WebView* web_view) {
content::RenderView* render_view) {
bool browser_created; bool browser_created;
absl::optional<bool> is_windowless; absl::optional<bool> is_windowless;
render_manager_->RenderViewCreated(render_view, browser_created, render_manager_->WebViewCreated(web_view, browser_created, is_windowless);
is_windowless);
if (browser_created) { if (browser_created) {
auto render_view = content::RenderView::FromWebView(web_view);
CHECK(render_view);
OnBrowserCreated(render_view, is_windowless); OnBrowserCreated(render_view, is_windowless);
} }
} }

View File

@ -79,7 +79,7 @@ class AlloyContentRendererClient
void ExposeInterfacesToBrowser(mojo::BinderMap* binders) override; void ExposeInterfacesToBrowser(mojo::BinderMap* binders) override;
void RenderThreadConnected() override; void RenderThreadConnected() override;
void RenderFrameCreated(content::RenderFrame* render_frame) override; void RenderFrameCreated(content::RenderFrame* render_frame) override;
void RenderViewCreated(content::RenderView* render_view) override; void WebViewCreated(blink::WebView* web_view) override;
bool IsPluginHandledExternally(content::RenderFrame* render_frame, bool IsPluginHandledExternally(content::RenderFrame* render_frame,
const blink::WebElement& plugin_element, const blink::WebElement& plugin_element,
const GURL& original_url, const GURL& original_url,

View File

@ -53,14 +53,12 @@ void ChromeContentRendererClientCef::RenderFrameCreated(
} }
} }
void ChromeContentRendererClientCef::RenderViewCreated( void ChromeContentRendererClientCef::WebViewCreated(blink::WebView* web_view) {
content::RenderView* render_view) { ChromeContentRendererClient::WebViewCreated(web_view);
ChromeContentRendererClient::RenderViewCreated(render_view);
bool browser_created; bool browser_created;
absl::optional<bool> is_windowless; absl::optional<bool> is_windowless;
render_manager_->RenderViewCreated(render_view, browser_created, render_manager_->WebViewCreated(web_view, browser_created, is_windowless);
is_windowless);
if (is_windowless.has_value() && *is_windowless) { if (is_windowless.has_value() && *is_windowless) {
LOG(ERROR) << "The chrome runtime does not support windowless browsers"; LOG(ERROR) << "The chrome runtime does not support windowless browsers";
} }

View File

@ -34,7 +34,7 @@ class ChromeContentRendererClientCef : public ChromeContentRendererClient {
void RenderThreadStarted() override; void RenderThreadStarted() override;
void RenderThreadConnected() override; void RenderThreadConnected() override;
void RenderFrameCreated(content::RenderFrame* render_frame) override; void RenderFrameCreated(content::RenderFrame* render_frame) override;
void RenderViewCreated(content::RenderView* render_view) override; void WebViewCreated(blink::WebView* web_view) override;
void DevToolsAgentAttached() override; void DevToolsAgentAttached() override;
void DevToolsAgentDetached() override; void DevToolsAgentDetached() override;
void ExposeInterfacesToBrowser(mojo::BinderMap* binders) override; void ExposeInterfacesToBrowser(mojo::BinderMap* binders) override;

View File

@ -8,6 +8,7 @@
#include "libcef/renderer/extensions/extensions_dispatcher_delegate.h" #include "libcef/renderer/extensions/extensions_dispatcher_delegate.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/stl_util.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "chrome/renderer/extensions/extension_process_policy.h" #include "chrome/renderer/extensions/extension_process_policy.h"
#include "chrome/renderer/extensions/resource_request_policy.h" #include "chrome/renderer/extensions/resource_request_policy.h"

View File

@ -279,15 +279,12 @@ std::unique_ptr<blink::WebURLLoader> CefFrameImpl::CreateURLLoader() {
if (!url_loader_factory_) if (!url_loader_factory_)
return nullptr; return nullptr;
// KeepAlive is not supported.
mojo::PendingRemote<blink::mojom::KeepAliveHandle> keep_alive_handle =
mojo::NullRemote();
return url_loader_factory_->CreateURLLoader( return url_loader_factory_->CreateURLLoader(
blink::WebURLRequest(), blink::WebURLRequest(),
blink_glue::CreateResourceLoadingTaskRunnerHandle(frame_), blink_glue::CreateResourceLoadingTaskRunnerHandle(frame_),
blink_glue::CreateResourceLoadingMaybeUnfreezableTaskRunnerHandle(frame_), blink_glue::CreateResourceLoadingMaybeUnfreezableTaskRunnerHandle(frame_),
std::move(keep_alive_handle), blink::WebBackForwardCacheLoaderHelper()); /*keep_alive_handle=*/mojo::NullRemote(),
blink::WebBackForwardCacheLoaderHelper());
} }
std::unique_ptr<blink::ResourceLoadInfoNotifierWrapper> std::unique_ptr<blink::ResourceLoadInfoNotifierWrapper>
@ -357,7 +354,7 @@ void CefFrameImpl::OnDraggableRegionsChanged() {
if (browser_frame) { if (browser_frame) {
browser_frame->UpdateDraggableRegions( browser_frame->UpdateDraggableRegions(
regions.empty() ? absl::nullopt regions.empty() ? absl::nullopt
: base::make_optional(std::move(regions))); : absl::make_optional(std::move(regions)));
} }
} }

View File

@ -110,11 +110,19 @@ void CefRenderManager::RenderFrameCreated(
} }
} }
void CefRenderManager::RenderViewCreated(content::RenderView* render_view, void CefRenderManager::WebViewCreated(blink::WebView* web_view,
bool& browser_created, bool& browser_created,
absl::optional<bool>& is_windowless) { absl::optional<bool>& is_windowless) {
MaybeCreateBrowser(render_view, render_view->GetMainRenderFrame(), auto render_view = content::RenderView::FromWebView(web_view);
&browser_created, &is_windowless); CHECK(render_view);
content::RenderFrame* render_frame = nullptr;
if (web_view->MainFrame()->IsWebLocalFrame()) {
render_frame = content::RenderFrame::FromWebFrame(
web_view->MainFrame()->ToWebLocalFrame());
}
MaybeCreateBrowser(render_view, render_frame, &browser_created,
&is_windowless);
} }
void CefRenderManager::DevToolsAgentAttached() { void CefRenderManager::DevToolsAgentAttached() {

View File

@ -19,7 +19,8 @@
namespace blink { namespace blink {
class WebFrame; class WebFrame;
} class WebView;
} // namespace blink
namespace content { namespace content {
class RenderFrame; class RenderFrame;
@ -50,7 +51,7 @@ class CefRenderManager : public cef::mojom::RenderManager {
CefRenderFrameObserver* render_frame_observer, CefRenderFrameObserver* render_frame_observer,
bool& browser_created, bool& browser_created,
absl::optional<bool>& is_windowless); absl::optional<bool>& is_windowless);
void RenderViewCreated(content::RenderView* render_view, void WebViewCreated(blink::WebView* web_view,
bool& browser_created, bool& browser_created,
absl::optional<bool>& is_windowless); absl::optional<bool>& is_windowless);
void DevToolsAgentAttached(); void DevToolsAgentAttached();

View File

@ -64,11 +64,8 @@ patches = [
'name': 'trace_event', 'name': 'trace_event',
}, },
{ {
# Enable popups in offscreen rendering on OS X. # Enable popups in offscreen rendering on MacOS.
# 'name': 'webkit_popups',
# Allow customization of the WebView background color.
# https://bitbucket.org/chromiumembedded/cef/issues/2345
'name': 'webkit_popups_and_background',
}, },
{ {
# Give AlloyContentRendererClient access to protected # Give AlloyContentRendererClient access to protected
@ -76,7 +73,7 @@ patches = [
'name': 'webkit_runtime_enabled_features', 'name': 'webkit_runtime_enabled_features',
}, },
{ {
# Fix export of UnderlayOpenGLHostingWindow for 64-bit OS X builds. # Fix export of UnderlayOpenGLHostingWindow for 64-bit MacOS builds.
# https://bitbucket.org/chromiumembedded/cef/issues/1051 # https://bitbucket.org/chromiumembedded/cef/issues/1051
'name': 'underlay_1051', 'name': 'underlay_1051',
}, },
@ -449,6 +446,13 @@ patches = [
# This crash was introduced by https://crrev.com/5f6212babf. # This crash was introduced by https://crrev.com/5f6212babf.
'name': 'browser_scheduler', 'name': 'browser_scheduler',
}, },
{
# Restore access to WebUIControllerFactory::UnregisterFactoryForTesting
# which was removed in https://crrev.com/5f183d6636. We can't use
# ScopedWebUIControllerFactoryRegistration because it pulls in GTest
# dependencies.
'name': 'browser_web_ui_controller_factory',
},
{ {
# Avoid a shutdown crash caused by PrefWatcher holding a reference to # Avoid a shutdown crash caused by PrefWatcher holding a reference to
# |g_browser_process->local_state()|, and the local_state being deleted # |g_browser_process->local_state()|, and the local_state being deleted
@ -533,20 +537,14 @@ patches = [
# https://bugs.chromium.org/p/chromium/issues/detail?id=1049498#c14 # https://bugs.chromium.org/p/chromium/issues/detail?id=1049498#c14
'name': 'base_string_piece_1049498', 'name': 'base_string_piece_1049498',
}, },
{
# Linux: Fix Sharesheet undefined symbol error.
# https://bugs.chromium.org/p/chromium/issues/detail?id=1123388
'name': 'chrome_browser_sharesheet_1123388',
},
{ {
# Linux: Fix ATK assertion error when generating ARM build config. # Linux: Fix ATK assertion error when generating ARM build config.
# https://bugs.chromium.org/p/chromium/issues/detail?id=1123214 # https://bugs.chromium.org/p/chromium/issues/detail?id=1123214
'name': 'linux_atk_1123214', 'name': 'linux_atk_1123214',
}, },
{ {
# Linux: Fix unknown type name 'uffdio_writeprotect' when building with # Linux: Fix undefined symbol from ChromeSettingsProto.
# use_sysroot=false on Ubuntu 18.04 (kernel version < 5.8). # https://bugs.chromium.org/p/chromium/issues/detail?id=1119417#c24
# https://bugs.chromium.org/p/chromium/issues/detail?id=1206047#c8 'name': 'chrome_browser_privacy_1119417',
'name': 'linux_allocator_uffd_1206047',
} }
] ]

View File

@ -1,5 +1,5 @@
diff --git base/BUILD.gn base/BUILD.gn diff --git base/BUILD.gn base/BUILD.gn
index 6f993be10f692..bce42da34941f 100644 index 576bd49a6198f..d5872f293f7cc 100644
--- base/BUILD.gn --- base/BUILD.gn
+++ base/BUILD.gn +++ base/BUILD.gn
@@ -34,6 +34,7 @@ import("//build/config/ui.gni") @@ -34,6 +34,7 @@ import("//build/config/ui.gni")
@ -10,7 +10,7 @@ index 6f993be10f692..bce42da34941f 100644
import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni") import("//testing/test.gni")
import("//third_party/icu/config.gni") import("//third_party/icu/config.gni")
@@ -1769,7 +1770,11 @@ component("base") { @@ -1731,7 +1732,11 @@ component("base") {
"hash/md5_constexpr_internal.h", "hash/md5_constexpr_internal.h",
"hash/sha1.h", "hash/sha1.h",
] ]
@ -23,7 +23,7 @@ index 6f993be10f692..bce42da34941f 100644
sources += [ sources += [
"hash/md5_nacl.cc", "hash/md5_nacl.cc",
"hash/md5_nacl.h", "hash/md5_nacl.h",
@@ -2010,6 +2015,12 @@ component("base") { @@ -1978,6 +1983,12 @@ component("base") {
defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ] defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ]
} }

View File

@ -1,5 +1,5 @@
diff --git base/strings/string_piece.h base/strings/string_piece.h diff --git base/strings/string_piece.h base/strings/string_piece.h
index 85a63d103a7f7..c17412d9c191a 100644 index 5ceb3a40eb01b..89476bfa41e9b 100644
--- base/strings/string_piece.h --- base/strings/string_piece.h
+++ base/strings/string_piece.h +++ base/strings/string_piece.h
@@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
@ -9,4 +9,4 @@ index 85a63d103a7f7..c17412d9c191a 100644
+#include <algorithm> +#include <algorithm>
#include <iosfwd> #include <iosfwd>
#include <limits> #include <limits>
#include <ostream> #include <string>

View File

@ -1,8 +1,8 @@
diff --git content/browser/scheduler/browser_task_executor.cc content/browser/scheduler/browser_task_executor.cc diff --git content/browser/scheduler/browser_task_executor.cc content/browser/scheduler/browser_task_executor.cc
index cf85dd542a27a..d663df4fa92af 100644 index c04efa1296318..8c8515cb74a2b 100644
--- content/browser/scheduler/browser_task_executor.cc --- content/browser/scheduler/browser_task_executor.cc
+++ content/browser/scheduler/browser_task_executor.cc +++ content/browser/scheduler/browser_task_executor.cc
@@ -240,7 +240,7 @@ void BrowserTaskExecutor::PostFeatureListSetup() { @@ -269,7 +269,7 @@ BrowserTaskExecutor::OnUserInputStart() {
// static // static
void BrowserTaskExecutor::Shutdown() { void BrowserTaskExecutor::Shutdown() {

View File

@ -1,8 +1,8 @@
diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc
index d548b3d7e0a0a..cb93301271cda 100644 index eefad1a677606..7318d223a63d0 100644
--- content/browser/child_process_security_policy_impl.cc --- content/browser/child_process_security_policy_impl.cc
+++ content/browser/child_process_security_policy_impl.cc +++ content/browser/child_process_security_policy_impl.cc
@@ -1719,6 +1719,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin( @@ -1721,6 +1721,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin(
// DeclarativeApiTest.PersistRules. // DeclarativeApiTest.PersistRules.
if (actual_process_lock.matches_scheme(url::kDataScheme)) if (actual_process_lock.matches_scheme(url::kDataScheme))
return true; return true;
@ -20,11 +20,11 @@ index d548b3d7e0a0a..cb93301271cda 100644
// TODO(wjmaclean): We should update the ProcessLock comparison API // TODO(wjmaclean): We should update the ProcessLock comparison API
diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc
index 751ee13227ae6..d4676b47955f8 100644 index 5b830ecbb4a47..39b32f681233e 100644
--- content/browser/renderer_host/navigation_request.cc --- content/browser/renderer_host/navigation_request.cc
+++ content/browser/renderer_host/navigation_request.cc +++ content/browser/renderer_host/navigation_request.cc
@@ -5314,6 +5314,12 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactory() { @@ -5606,6 +5606,12 @@ url::Origin
NavigationRequest::GetOriginForURLLoaderFactoryWithoutFinalFrameHost() {
// Calculate an approximation of the origin. The sandbox/csp are ignored. // Calculate an approximation of the origin. The sandbox/csp are ignored.
url::Origin origin = GetOriginForURLLoaderFactoryUnchecked(this); url::Origin origin = GetOriginForURLLoaderFactoryUnchecked(this);
+ if (!origin.GetURL().IsStandard()) { + if (!origin.GetURL().IsStandard()) {
@ -36,3 +36,19 @@ index 751ee13227ae6..d4676b47955f8 100644
// Apply sandbox flags. // Apply sandbox flags.
// See https://html.spec.whatwg.org/#sandboxed-origin-browsing-context-flag // See https://html.spec.whatwg.org/#sandboxed-origin-browsing-context-flag
@@ -5639,6 +5645,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryWithFinalFrameHost() {
if (IsSameDocument() || IsPageActivation())
return GetRenderFrameHost()->GetLastCommittedOrigin();
+ // Calculate an approximation of the origin. The sandbox/csp are ignored.
+ url::Origin unchecked_origin = GetOriginForURLLoaderFactoryUnchecked(this);
+ if (!unchecked_origin.GetURL().IsStandard()) {
+ // Always return an opaque origin for non-standard URLs. Otherwise, the
+ // below CanAccessDataForOrigin() check may fail for unregistered custom
+ // scheme requests in CEF.
+ return unchecked_origin.DeriveNewOpaqueOrigin();
+ }
+
url::Origin origin = GetOriginForURLLoaderFactoryWithoutFinalFrameHost();
// MHTML documents should commit as an opaque origin. They should not be able

View File

@ -0,0 +1,14 @@
diff --git content/public/browser/web_ui_controller_factory.h content/public/browser/web_ui_controller_factory.h
index eb068fb9bb42c..4e8e6a1a7abf4 100644
--- content/public/browser/web_ui_controller_factory.h
+++ content/public/browser/web_ui_controller_factory.h
@@ -47,9 +47,6 @@ class CONTENT_EXPORT WebUIControllerFactory {
virtual bool UseWebUIForURL(BrowserContext* browser_context,
const GURL& url) = 0;
- private:
- friend class ScopedWebUIControllerFactoryRegistration;
-
static void UnregisterFactoryForTesting(WebUIControllerFactory* factory);
};

View File

@ -1,10 +1,10 @@
diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn
index 96545ed8a9e5b..6987659bff52b 100644 index 13ed917c81281..5f7bf7cbf5ae9 100644
--- build/config/compiler/BUILD.gn --- build/config/compiler/BUILD.gn
+++ build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn
@@ -1849,8 +1849,6 @@ config("thin_archive") { @@ -1855,8 +1855,6 @@ config("thin_archive") {
# archives. # confuses lldb.
if ((is_posix && !is_nacl && (!is_apple || use_lld)) || is_fuchsia) { if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) {
arflags = [ "-T" ] arflags = [ "-T" ]
- } else if (is_win && use_lld) { - } else if (is_win && use_lld) {
- arflags = [ "/llvmlibthin" ] - arflags = [ "/llvmlibthin" ]

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
index e0409fb795f27..8a3023ae62e82 100644 index 0d81f08e66b1e..eba77d4116945 100644
--- chrome/browser/BUILD.gn --- chrome/browser/BUILD.gn
+++ chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn
@@ -13,6 +13,7 @@ import("//build/config/features.gni") @@ -13,6 +13,7 @@ import("//build/config/features.gni")
@ -10,7 +10,7 @@ index e0409fb795f27..8a3023ae62e82 100644
import("//chrome/browser/buildflags.gni") import("//chrome/browser/buildflags.gni")
import("//chrome/browser/downgrade/buildflags.gni") import("//chrome/browser/downgrade/buildflags.gni")
import("//chrome/common/features.gni") import("//chrome/common/features.gni")
@@ -1923,6 +1924,7 @@ static_library("browser") { @@ -1904,6 +1905,7 @@ static_library("browser") {
"//build:chromeos_buildflags", "//build:chromeos_buildflags",
"//build/config/compiler:compiler_buildflags", "//build/config/compiler:compiler_buildflags",
"//cc", "//cc",
@ -18,7 +18,7 @@ index e0409fb795f27..8a3023ae62e82 100644
"//chrome:extra_resources", "//chrome:extra_resources",
"//chrome:resources", "//chrome:resources",
"//chrome:strings", "//chrome:strings",
@@ -2480,6 +2482,10 @@ static_library("browser") { @@ -2471,6 +2473,10 @@ static_library("browser") {
] ]
} }

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/app_controller_mac.mm chrome/browser/app_controller_mac.mm diff --git chrome/browser/app_controller_mac.mm chrome/browser/app_controller_mac.mm
index c7780ede01c83..6b856949d3c0a 100644 index dd4c916b7581a..c27d72bf53c9b 100644
--- chrome/browser/app_controller_mac.mm --- chrome/browser/app_controller_mac.mm
+++ chrome/browser/app_controller_mac.mm +++ chrome/browser/app_controller_mac.mm
@@ -31,6 +31,7 @@ @@ -31,6 +31,7 @@
@ -10,7 +10,7 @@ index c7780ede01c83..6b856949d3c0a 100644
#include "chrome/app/chrome_command_ids.h" #include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/apps/app_shim/app_shim_manager_mac.h" #include "chrome/browser/apps/app_shim/app_shim_manager_mac.h"
#include "chrome/browser/apps/app_shim/app_shim_termination_manager.h" #include "chrome/browser/apps/app_shim/app_shim_termination_manager.h"
@@ -1290,6 +1291,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; @@ -1339,6 +1340,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
// Run a (background) application in a new tab. // Run a (background) application in a new tab.
- (void)executeApplication:(id)sender { - (void)executeApplication:(id)sender {
@ -18,7 +18,7 @@ index c7780ede01c83..6b856949d3c0a 100644
NSInteger tag = [sender tag]; NSInteger tag = [sender tag];
Profile* profile = [self lastProfile]; Profile* profile = [self lastProfile];
DCHECK(profile); DCHECK(profile);
@@ -1298,6 +1300,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; @@ -1347,6 +1349,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
tag < static_cast<int>(applications.size())); tag < static_cast<int>(applications.size()));
const extensions::Extension* extension = applications.GetExtension(tag); const extensions::Extension* extension = applications.GetExtension(tag);
BackgroundModeManager::LaunchBackgroundApplication(profile, extension); BackgroundModeManager::LaunchBackgroundApplication(profile, extension);
@ -26,23 +26,23 @@ index c7780ede01c83..6b856949d3c0a 100644
} }
// Same as |-commandDispatch:|, but executes commands using a disposition // Same as |-commandDispatch:|, but executes commands using a disposition
@@ -1693,6 +1696,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; @@ -1702,6 +1705,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
// TODO(rickcam): Mock out BackgroundApplicationListModel, then add unit [dockMenu addItem:item];
// tests which use the mock in place of the profile-initialized model. }
+#if BUILDFLAG(ENABLE_BACKGROUND_MODE) +#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
// Avoid breaking unit tests which have no profile. // TODO(rickcam): Mock out BackgroundApplicationListModel, then add unit tests
if (profile) { // which use the mock in place of the profile-initialized model.
BackgroundApplicationListModel applications(profile); BackgroundApplicationListModel applications(profile);
@@ -1719,6 +1723,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; @@ -1726,6 +1730,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
} [appMenu addItem:appItem];
} }
} }
+#endif // BUILDFLAG(ENABLE_BACKGROUND_MODE) +#endif // BUILDFLAG(ENABLE_BACKGROUND_MODE)
return dockMenu; return dockMenu;
} }
@@ -1948,11 +1953,13 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; @@ -1963,11 +1968,13 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
namespace { namespace {
void UpdateProfileInUse(Profile* profile, Profile::CreateStatus status) { void UpdateProfileInUse(Profile* profile, Profile::CreateStatus status) {
@ -55,12 +55,12 @@ index c7780ede01c83..6b856949d3c0a 100644
+#endif // !BUILDFLAG(ENABLE_CEF) +#endif // !BUILDFLAG(ENABLE_CEF)
} }
} // namespace void OpenUrlsInBrowserWithProfile(const std::vector<GURL>& urls,
diff --git chrome/browser/browser_process.h chrome/browser/browser_process.h diff --git chrome/browser/browser_process.h chrome/browser/browser_process.h
index 3d634db18900a..96e44ad48e5e5 100644 index a7657cb6e5d5e..d6c6f3225fcb6 100644
--- chrome/browser/browser_process.h --- chrome/browser/browser_process.h
+++ chrome/browser/browser_process.h +++ chrome/browser/browser_process.h
@@ -197,9 +197,9 @@ class BrowserProcess { @@ -198,9 +198,9 @@ class BrowserProcess {
virtual DownloadStatusUpdater* download_status_updater() = 0; virtual DownloadStatusUpdater* download_status_updater() = 0;
virtual DownloadRequestLimiter* download_request_limiter() = 0; virtual DownloadRequestLimiter* download_request_limiter() = 0;
@ -72,10 +72,10 @@ index 3d634db18900a..96e44ad48e5e5 100644
std::unique_ptr<BackgroundModeManager> manager) = 0; std::unique_ptr<BackgroundModeManager> manager) = 0;
#endif #endif
diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc
index cce917cdc65db..5da3a16aef1c7 100644 index 1149818336011..0e454299e2622 100644
--- chrome/browser/browser_process_impl.cc --- chrome/browser/browser_process_impl.cc
+++ chrome/browser/browser_process_impl.cc +++ chrome/browser/browser_process_impl.cc
@@ -952,18 +952,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { @@ -970,18 +970,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() {
return download_request_limiter_.get(); return download_request_limiter_.get();
} }
@ -96,10 +96,10 @@ index cce917cdc65db..5da3a16aef1c7 100644
std::unique_ptr<BackgroundModeManager> manager) { std::unique_ptr<BackgroundModeManager> manager) {
background_mode_manager_ = std::move(manager); background_mode_manager_ = std::move(manager);
diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h
index b4ceefbccd083..7d60206c83b13 100644 index 2bb0b1ec912b0..2235c7b56a456 100644
--- chrome/browser/browser_process_impl.h --- chrome/browser/browser_process_impl.h
+++ chrome/browser/browser_process_impl.h +++ chrome/browser/browser_process_impl.h
@@ -169,8 +169,8 @@ class BrowserProcessImpl : public BrowserProcess, @@ -174,8 +174,8 @@ class BrowserProcessImpl : public BrowserProcess,
void SetApplicationLocale(const std::string& actual_locale) override; void SetApplicationLocale(const std::string& actual_locale) override;
DownloadStatusUpdater* download_status_updater() override; DownloadStatusUpdater* download_status_updater() override;
DownloadRequestLimiter* download_request_limiter() override; DownloadRequestLimiter* download_request_limiter() override;
@ -110,10 +110,10 @@ index b4ceefbccd083..7d60206c83b13 100644
std::unique_ptr<BackgroundModeManager> manager) override; std::unique_ptr<BackgroundModeManager> manager) override;
#endif #endif
diff --git chrome/browser/lifetime/browser_close_manager.cc chrome/browser/lifetime/browser_close_manager.cc diff --git chrome/browser/lifetime/browser_close_manager.cc chrome/browser/lifetime/browser_close_manager.cc
index e0cafee5eedd6..06ded156be3cc 100644 index fb05f448cb250..e94c28d492e7a 100644
--- chrome/browser/lifetime/browser_close_manager.cc --- chrome/browser/lifetime/browser_close_manager.cc
+++ chrome/browser/lifetime/browser_close_manager.cc +++ chrome/browser/lifetime/browser_close_manager.cc
@@ -148,12 +148,14 @@ void BrowserCloseManager::CloseBrowsers() { @@ -151,12 +151,14 @@ void BrowserCloseManager::CloseBrowsers() {
// exit can restore all browsers open before exiting. // exit can restore all browsers open before exiting.
ProfileManager::ShutdownSessionServices(); ProfileManager::ShutdownSessionServices();
#endif #endif

View File

@ -13,10 +13,10 @@ index ba0c5c3fc0446..b4df9af95ecd1 100644
return false; return false;
} }
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
index 268f6547ff84b..29e1b4b1b4dba 100644 index 8fdddbadf5e9a..4c5ea3c875db2 100644
--- chrome/browser/ui/browser.cc --- chrome/browser/ui/browser.cc
+++ chrome/browser/ui/browser.cc +++ chrome/browser/ui/browser.cc
@@ -263,6 +263,20 @@ @@ -262,6 +262,20 @@
#include "components/captive_portal/content/captive_portal_tab_helper.h" #include "components/captive_portal/content/captive_portal_tab_helper.h"
#endif #endif
@ -37,7 +37,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644
#if BUILDFLAG(ENABLE_EXTENSIONS) #if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_browser_window_helper.h" #include "chrome/browser/extensions/extension_browser_window_helper.h"
#endif #endif
@@ -492,6 +506,13 @@ Browser::Browser(const CreateParams& params) @@ -491,6 +505,13 @@ Browser::Browser(const CreateParams& params)
tab_strip_model_->AddObserver(this); tab_strip_model_->AddObserver(this);
@ -51,7 +51,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644
location_bar_model_ = std::make_unique<LocationBarModelImpl>( location_bar_model_ = std::make_unique<LocationBarModelImpl>(
location_bar_model_delegate_.get(), content::kMaxURLDisplayChars); location_bar_model_delegate_.get(), content::kMaxURLDisplayChars);
@@ -1336,6 +1357,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( @@ -1325,6 +1346,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
if (exclusive_access_manager_->HandleUserKeyEvent(event)) if (exclusive_access_manager_->HandleUserKeyEvent(event))
return content::KeyboardEventProcessingResult::HANDLED; return content::KeyboardEventProcessingResult::HANDLED;
@ -66,7 +66,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644
return window()->PreHandleKeyboardEvent(event); return window()->PreHandleKeyboardEvent(event);
} }
@@ -1343,8 +1372,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, @@ -1332,8 +1361,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
const NativeWebKeyboardEvent& event) { const NativeWebKeyboardEvent& event) {
DevToolsWindow* devtools_window = DevToolsWindow* devtools_window =
DevToolsWindow::GetInstanceForInspectedWebContents(source); DevToolsWindow::GetInstanceForInspectedWebContents(source);
@ -87,7 +87,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644
} }
bool Browser::TabsNeedBeforeUnloadFired() { bool Browser::TabsNeedBeforeUnloadFired() {
@@ -1569,6 +1608,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, @@ -1558,6 +1597,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source,
return window->OpenURLFromTab(source, params); return window->OpenURLFromTab(source, params);
} }
@ -102,7 +102,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644
NavigateParams nav_params(this, params.url, params.transition); NavigateParams nav_params(this, params.url, params.transition);
nav_params.FillNavigateParamsFromOpenURLParams(params); nav_params.FillNavigateParamsFromOpenURLParams(params);
nav_params.source_contents = source; nav_params.source_contents = source;
@@ -1668,6 +1715,15 @@ void Browser::AddNewContents(WebContents* source, @@ -1657,6 +1704,15 @@ void Browser::AddNewContents(WebContents* source,
source, disposition); source, disposition);
} }
@ -118,7 +118,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644
chrome::AddWebContents(this, source, std::move(new_contents), target_url, chrome::AddWebContents(this, source, std::move(new_contents), target_url,
disposition, initial_rect); disposition, initial_rect);
} }
@@ -1686,6 +1742,8 @@ void Browser::LoadingStateChanged(WebContents* source, @@ -1675,6 +1731,8 @@ void Browser::LoadingStateChanged(WebContents* source,
bool to_different_document) { bool to_different_document) {
ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD); ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD);
UpdateWindowForLoadingStateChanged(source, to_different_document); UpdateWindowForLoadingStateChanged(source, to_different_document);
@ -127,7 +127,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644
} }
void Browser::CloseContents(WebContents* source) { void Browser::CloseContents(WebContents* source) {
@@ -1713,6 +1771,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { @@ -1702,6 +1760,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
} }
void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
@ -136,7 +136,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644
if (!GetStatusBubble()) if (!GetStatusBubble())
return; return;
@@ -1720,6 +1780,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { @@ -1709,6 +1769,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
GetStatusBubble()->SetURL(url); GetStatusBubble()->SetURL(url);
} }
@ -154,7 +154,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644
void Browser::ContentsMouseEvent(WebContents* source, void Browser::ContentsMouseEvent(WebContents* source,
bool motion, bool motion,
bool exited) { bool exited) {
@@ -1836,6 +1907,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, @@ -1825,6 +1896,10 @@ void Browser::WebContentsCreated(WebContents* source_contents,
// Make the tab show up in the task manager. // Make the tab show up in the task manager.
task_manager::WebContentsTags::CreateForTabContents(new_contents); task_manager::WebContentsTags::CreateForTabContents(new_contents);
@ -165,7 +165,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644
} }
void Browser::PortalWebContentsCreated(WebContents* portal_web_contents) { void Browser::PortalWebContentsCreated(WebContents* portal_web_contents) {
@@ -1872,6 +1947,8 @@ void Browser::RendererResponsive( @@ -1861,6 +1936,8 @@ void Browser::RendererResponsive(
void Browser::DidNavigateMainFramePostCommit(WebContents* web_contents) { void Browser::DidNavigateMainFramePostCommit(WebContents* web_contents) {
if (web_contents == tab_strip_model_->GetActiveWebContents()) if (web_contents == tab_strip_model_->GetActiveWebContents())
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE);
@ -174,7 +174,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644
} }
content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager( content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager(
@@ -1918,11 +1995,15 @@ void Browser::EnterFullscreenModeForTab( @@ -1907,11 +1984,15 @@ void Browser::EnterFullscreenModeForTab(
const blink::mojom::FullscreenOptions& options) { const blink::mojom::FullscreenOptions& options) {
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab( exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
requesting_frame, options.display_id); requesting_frame, options.display_id);
@ -190,7 +190,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644
} }
bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) { bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) {
@@ -2767,6 +2848,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { @@ -2756,6 +2837,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
content_translate_driver->RemoveTranslationObserver(this); content_translate_driver->RemoveTranslationObserver(this);
BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this); BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this);
} }
@ -200,7 +200,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644
void Browser::TabDetachedAtImpl(content::WebContents* contents, void Browser::TabDetachedAtImpl(content::WebContents* contents,
diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h
index 946c447afbde1..cce4aaade2ea3 100644 index 2908b4b70815d..9eb3be7b231ad 100644
--- chrome/browser/ui/browser.h --- chrome/browser/ui/browser.h
+++ chrome/browser/ui/browser.h +++ chrome/browser/ui/browser.h
@@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
@ -222,7 +222,7 @@ index 946c447afbde1..cce4aaade2ea3 100644
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
#error This file should only be included on desktop. #error This file should only be included on desktop.
#endif #endif
@@ -274,6 +279,11 @@ class Browser : public TabStripModelObserver, @@ -283,6 +288,11 @@ class Browser : public TabStripModelObserver,
// maximizable. // maximizable.
bool can_maximize = true; bool can_maximize = true;
@ -234,9 +234,9 @@ index 946c447afbde1..cce4aaade2ea3 100644
private: private:
friend class Browser; friend class Browser;
friend class WindowSizerChromeOSTest; friend class WindowSizerChromeOSTest;
@@ -338,6 +348,13 @@ class Browser : public TabStripModelObserver, @@ -347,6 +357,13 @@ class Browser : public TabStripModelObserver,
return creation_source_ == CreationSource::kSessionRestore;
bool is_focus_mode() const { return is_focus_mode_; } }
+ // Return true if CEF will expose the toolbar to the client. This value is + // Return true if CEF will expose the toolbar to the client. This value is
+ // used to selectively enable toolbar behaviors such as command processing + // used to selectively enable toolbar behaviors such as command processing
@ -248,7 +248,7 @@ index 946c447afbde1..cce4aaade2ea3 100644
// Accessors //////////////////////////////////////////////////////////////// // Accessors ////////////////////////////////////////////////////////////////
const CreateParams& create_params() const { return create_params_; } const CreateParams& create_params() const { return create_params_; }
@@ -396,6 +413,12 @@ class Browser : public TabStripModelObserver, @@ -407,6 +424,12 @@ class Browser : public TabStripModelObserver,
base::WeakPtr<Browser> AsWeakPtr(); base::WeakPtr<Browser> AsWeakPtr();
@ -261,7 +261,7 @@ index 946c447afbde1..cce4aaade2ea3 100644
// Get the FindBarController for this browser, creating it if it does not // Get the FindBarController for this browser, creating it if it does not
// yet exist. // yet exist.
FindBarController* GetFindBarController(); FindBarController* GetFindBarController();
@@ -777,6 +800,11 @@ class Browser : public TabStripModelObserver, @@ -789,6 +812,11 @@ class Browser : public TabStripModelObserver,
void SetContentsBounds(content::WebContents* source, void SetContentsBounds(content::WebContents* source,
const gfx::Rect& bounds) override; const gfx::Rect& bounds) override;
void UpdateTargetURL(content::WebContents* source, const GURL& url) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
@ -273,16 +273,16 @@ index 946c447afbde1..cce4aaade2ea3 100644
void ContentsMouseEvent(content::WebContents* source, void ContentsMouseEvent(content::WebContents* source,
bool motion, bool motion,
bool exited) override; bool exited) override;
@@ -1167,6 +1195,8 @@ class Browser : public TabStripModelObserver, @@ -1180,6 +1208,8 @@ class Browser : public TabStripModelObserver,
const std::string initial_workspace_; const std::string initial_workspace_;
bool initial_visible_on_all_workspaces_state_; bool initial_visible_on_all_workspaces_state_;
+ bool toolbar_overridden_ = false; + bool toolbar_overridden_ = false;
+ +
// Tracks when this browser is being created by session restore. CreationSource creation_source_ = CreationSource::kUnknown;
bool is_session_restore_;
@@ -1227,6 +1257,10 @@ class Browser : public TabStripModelObserver, UnloadController unload_controller_;
@@ -1237,6 +1267,10 @@ class Browser : public TabStripModelObserver,
extension_browser_window_helper_; extension_browser_window_helper_;
#endif #endif
@ -294,7 +294,7 @@ index 946c447afbde1..cce4aaade2ea3 100644
// The following factory is used for chrome update coalescing. // The following factory is used for chrome update coalescing.
diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc
index 29890d8b342a4..514affa254df4 100644 index a4af0836da1aa..bdf26e401d563 100644
--- chrome/browser/ui/browser_navigator.cc --- chrome/browser/ui/browser_navigator.cc
+++ chrome/browser/ui/browser_navigator.cc +++ chrome/browser/ui/browser_navigator.cc
@@ -456,6 +456,13 @@ std::unique_ptr<content::WebContents> CreateTargetContents( @@ -456,6 +456,13 @@ std::unique_ptr<content::WebContents> CreateTargetContents(

View File

@ -54,10 +54,10 @@ index 173582c7c4904..bbf57904b6de9 100644
#if BUILDFLAG(ENABLE_SUPERVISED_USERS) #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
SupervisedUserSettingsService* supervised_service = SupervisedUserSettingsService* supervised_service =
diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc
index ab24e00ee02aa..818fb4e7d1841 100644 index 610f6d942998c..f822df04ff07d 100644
--- components/content_settings/renderer/content_settings_agent_impl.cc --- components/content_settings/renderer/content_settings_agent_impl.cc
+++ components/content_settings/renderer/content_settings_agent_impl.cc +++ components/content_settings/renderer/content_settings_agent_impl.cc
@@ -172,7 +172,7 @@ ContentSetting GetContentSettingFromRulesImpl( @@ -170,7 +170,7 @@ ContentSetting GetContentSettingFromRulesImpl(
return rule.GetContentSetting(); return rule.GetContentSetting();
} }
} }

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/renderer_context_menu/render_view_context_menu.cc chrome/browser/renderer_context_menu/render_view_context_menu.cc diff --git chrome/browser/renderer_context_menu/render_view_context_menu.cc chrome/browser/renderer_context_menu/render_view_context_menu.cc
index 41b804eef6426..b1e54d8e95008 100644 index 408566907e832..1266687ccd665 100644
--- chrome/browser/renderer_context_menu/render_view_context_menu.cc --- chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -264,6 +264,13 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() { @@ -273,6 +273,13 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() {
return callback.get(); return callback.get();
} }
@ -16,7 +16,7 @@ index 41b804eef6426..b1e54d8e95008 100644
enum class UmaEnumIdLookupType { enum class UmaEnumIdLookupType {
GeneralEnumId, GeneralEnumId,
ContextSpecificEnumId, ContextSpecificEnumId,
@@ -473,6 +480,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { @@ -484,6 +491,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) {
if (ContextMenuMatcher::IsExtensionsCustomCommandId(id)) if (ContextMenuMatcher::IsExtensionsCustomCommandId(id))
return 1; return 1;
@ -27,10 +27,10 @@ index 41b804eef6426..b1e54d8e95008 100644
id = CollapseCommandsForUMA(id); id = CollapseCommandsForUMA(id);
const auto& map = GetIdcToUmaMap(type); const auto& map = GetIdcToUmaMap(type);
auto it = map.find(id); auto it = map.find(id);
@@ -628,6 +639,14 @@ RenderViewContextMenu::RenderViewContextMenu( @@ -656,6 +667,14 @@ RenderViewContextMenu::RenderViewContextMenu(
} system_app_type_ = GetBrowser() && GetBrowser()->app_controller()
set_content_type( ? GetBrowser()->app_controller()->system_app_type()
ContextMenuContentTypeFactory::Create(source_web_contents_, params)); : absl::nullopt;
+ +
+ auto* cb = GetMenuCreatedCallback(); + auto* cb = GetMenuCreatedCallback();
+ if (!cb->is_null()) { + if (!cb->is_null()) {
@ -42,7 +42,7 @@ index 41b804eef6426..b1e54d8e95008 100644
} }
RenderViewContextMenu::~RenderViewContextMenu() = default; RenderViewContextMenu::~RenderViewContextMenu() = default;
@@ -983,6 +1002,12 @@ void RenderViewContextMenu::InitMenu() { @@ -1022,6 +1041,12 @@ void RenderViewContextMenu::InitMenu() {
// menu, meaning that each menu item added/removed in this function will cause // menu, meaning that each menu item added/removed in this function will cause
// it to visibly jump on the screen (see b/173569669). // it to visibly jump on the screen (see b/173569669).
AppendQuickAnswersItems(); AppendQuickAnswersItems();
@ -55,7 +55,7 @@ index 41b804eef6426..b1e54d8e95008 100644
} }
Profile* RenderViewContextMenu::GetProfile() const { Profile* RenderViewContextMenu::GetProfile() const {
@@ -2636,6 +2661,12 @@ void RenderViewContextMenu::RegisterMenuShownCallbackForTesting( @@ -2742,6 +2767,12 @@ void RenderViewContextMenu::RegisterMenuShownCallbackForTesting(
*GetMenuShownCallback() = std::move(cb); *GetMenuShownCallback() = std::move(cb);
} }
@ -69,10 +69,10 @@ index 41b804eef6426..b1e54d8e95008 100644
RenderViewContextMenu::GetHandlersForLinkUrl() { RenderViewContextMenu::GetHandlersForLinkUrl() {
ProtocolHandlerRegistry::ProtocolHandlerList handlers = ProtocolHandlerRegistry::ProtocolHandlerList handlers =
diff --git chrome/browser/renderer_context_menu/render_view_context_menu.h chrome/browser/renderer_context_menu/render_view_context_menu.h diff --git chrome/browser/renderer_context_menu/render_view_context_menu.h chrome/browser/renderer_context_menu/render_view_context_menu.h
index b6d55e7322c45..014d89c4c7bfe 100644 index 34b6152a222ec..b03c81bd076b8 100644
--- chrome/browser/renderer_context_menu/render_view_context_menu.h --- chrome/browser/renderer_context_menu/render_view_context_menu.h
+++ chrome/browser/renderer_context_menu/render_view_context_menu.h +++ chrome/browser/renderer_context_menu/render_view_context_menu.h
@@ -92,6 +92,12 @@ class RenderViewContextMenu : public RenderViewContextMenuBase { @@ -101,6 +101,12 @@ class RenderViewContextMenu : public RenderViewContextMenuBase,
static void RegisterMenuShownCallbackForTesting( static void RegisterMenuShownCallbackForTesting(
base::OnceCallback<void(RenderViewContextMenu*)> cb); base::OnceCallback<void(RenderViewContextMenu*)> cb);
@ -85,9 +85,9 @@ index b6d55e7322c45..014d89c4c7bfe 100644
protected: protected:
Profile* GetProfile() const; Profile* GetProfile() const;
@@ -266,6 +272,9 @@ class RenderViewContextMenu : public RenderViewContextMenuBase { @@ -296,6 +302,9 @@ class RenderViewContextMenu : public RenderViewContextMenuBase,
ui::SimpleMenuModel protocol_handler_submenu_model_; // built.
ProtocolHandlerRegistry* protocol_handler_registry_; bool is_protocol_submenu_valid_ = false;
+ // An observer returned via MenuCreatedCallback that will be called first. + // An observer returned via MenuCreatedCallback that will be called first.
+ std::unique_ptr<RenderViewContextMenuObserver> first_observer_; + std::unique_ptr<RenderViewContextMenuObserver> first_observer_;
@ -96,7 +96,7 @@ index b6d55e7322c45..014d89c4c7bfe 100644
// "Use enhanced spell check" items. // "Use enhanced spell check" items.
std::unique_ptr<SpellingMenuObserver> spelling_suggestions_menu_observer_; std::unique_ptr<SpellingMenuObserver> spelling_suggestions_menu_observer_;
diff --git chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc diff --git chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc
index 0271d19c5c33b..40d2063e4ed98 100644 index 13a65de79e185..0901c4cade4f1 100644
--- chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc --- chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc
+++ chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc +++ chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc
@@ -136,6 +136,9 @@ void RenderViewContextMenuViews::RunMenuAt(views::Widget* parent, @@ -136,6 +136,9 @@ void RenderViewContextMenuViews::RunMenuAt(views::Widget* parent,
@ -110,7 +110,7 @@ index 0271d19c5c33b..40d2063e4ed98 100644
// that Ctrl+C, Ctrl+V, Ctrl+X, Ctrl-A, etc do what they normally do. // that Ctrl+C, Ctrl+V, Ctrl+X, Ctrl-A, etc do what they normally do.
switch (command_id) { switch (command_id) {
diff --git components/renderer_context_menu/render_view_context_menu_base.cc components/renderer_context_menu/render_view_context_menu_base.cc diff --git components/renderer_context_menu/render_view_context_menu_base.cc components/renderer_context_menu/render_view_context_menu_base.cc
index 6585ac1d01907..d2e939fce0df6 100644 index b2513d5ca3ead..f1894f4e05385 100644
--- components/renderer_context_menu/render_view_context_menu_base.cc --- components/renderer_context_menu/render_view_context_menu_base.cc
+++ components/renderer_context_menu/render_view_context_menu_base.cc +++ components/renderer_context_menu/render_view_context_menu_base.cc
@@ -376,6 +376,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const { @@ -376,6 +376,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const {

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
index adadb4264e6b7..b7c910f035fe6 100644 index ac4bc7b9021ee..fefdb822c5b71 100644
--- chrome/browser/ui/BUILD.gn --- chrome/browser/ui/BUILD.gn
+++ chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn
@@ -12,6 +12,7 @@ import("//build/config/features.gni") @@ -11,6 +11,7 @@ import("//build/config/features.gni")
import("//build/config/linux/gtk/gtk.gni") import("//build/config/linux/gtk/gtk.gni")
import("//build/config/ozone.gni") import("//build/config/ozone.gni")
import("//build/config/ui.gni") import("//build/config/ui.gni")
@ -10,7 +10,7 @@ index adadb4264e6b7..b7c910f035fe6 100644
import("//chrome/browser/buildflags.gni") import("//chrome/browser/buildflags.gni")
import("//chrome/common/features.gni") import("//chrome/common/features.gni")
import("//chromeos/assistant/assistant.gni") import("//chromeos/assistant/assistant.gni")
@@ -329,6 +330,10 @@ static_library("ui") { @@ -344,6 +345,10 @@ static_library("ui") {
"//build/config/compiler:wexit_time_destructors", "//build/config/compiler:wexit_time_destructors",
] ]
@ -21,7 +21,7 @@ index adadb4264e6b7..b7c910f035fe6 100644
# Since browser and browser_ui actually depend on each other, # Since browser and browser_ui actually depend on each other,
# we must omit the dependency from browser_ui to browser. # we must omit the dependency from browser_ui to browser.
# However, this means browser_ui and browser should more or less # However, this means browser_ui and browser should more or less
@@ -351,6 +356,7 @@ static_library("ui") { @@ -366,6 +371,7 @@ static_library("ui") {
"//build:branding_buildflags", "//build:branding_buildflags",
"//build:chromeos_buildflags", "//build:chromeos_buildflags",
"//cc/paint", "//cc/paint",
@ -29,7 +29,7 @@ index adadb4264e6b7..b7c910f035fe6 100644
"//chrome:extra_resources", "//chrome:extra_resources",
"//chrome:resources", "//chrome:resources",
"//chrome:strings", "//chrome:strings",
@@ -4774,6 +4780,7 @@ static_library("ui") { @@ -4878,6 +4884,7 @@ static_library("ui") {
if (enable_basic_printing) { if (enable_basic_printing) {
deps += [ deps += [
"//components/printing/browser", "//components/printing/browser",
@ -38,7 +38,7 @@ index adadb4264e6b7..b7c910f035fe6 100644
] ]
if (use_cups) { if (use_cups) {
diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc
index fcd1f66b3a7a4..4f135460de918 100644 index fcd1f66b3a7a4..70ded321f5498 100644
--- chrome/browser/ui/webui/net_export_ui.cc --- chrome/browser/ui/webui/net_export_ui.cc
+++ chrome/browser/ui/webui/net_export_ui.cc +++ chrome/browser/ui/webui/net_export_ui.cc
@@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
@ -54,7 +54,7 @@ index fcd1f66b3a7a4..4f135460de918 100644
#include "ui/shell_dialogs/select_file_dialog.h" #include "ui/shell_dialogs/select_file_dialog.h"
+#if BUILDFLAG(ENABLE_CEF) +#if BUILDFLAG(ENABLE_CEF)
+#include "cef/libcef/browser/alloy/alloy_browser_host_impl.h" +#include "cef/libcef/browser/alloy/alloy_dialog_util.h"
+#endif +#endif
+ +
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
@ -104,7 +104,7 @@ index fcd1f66b3a7a4..4f135460de918 100644
file_writer_->StopNetLog(std::move(ui_thread_polled_data)); file_writer_->StopNetLog(std::move(ui_thread_polled_data));
} }
@@ -373,6 +394,42 @@ void NetExportMessageHandler::ShowSelectFileDialog( @@ -373,6 +394,38 @@ void NetExportMessageHandler::ShowSelectFileDialog(
&file_type_info, 0, base::FilePath::StringType(), owning_window, nullptr); &file_type_info, 0, base::FilePath::StringType(), owning_window, nullptr);
} }
@ -112,24 +112,20 @@ index fcd1f66b3a7a4..4f135460de918 100644
+ +
+void NetExportMessageHandler::ShowCefSaveAsDialog( +void NetExportMessageHandler::ShowCefSaveAsDialog(
+ content::WebContents* web_contents) { + content::WebContents* web_contents) {
+ CefRefPtr<AlloyBrowserHostImpl> cef_browser =
+ AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
+ if (!cef_browser)
+ return;
+
+ base::FilePath initial_dir; + base::FilePath initial_dir;
+ if (!last_save_dir.Pointer()->empty()) + if (!last_save_dir.Pointer()->empty())
+ initial_dir = *last_save_dir.Pointer(); + initial_dir = *last_save_dir.Pointer();
+ base::FilePath initial_path = + base::FilePath initial_path =
+ initial_dir.Append(FILE_PATH_LITERAL("chrome-net-export-log.json")); + initial_dir.Append(FILE_PATH_LITERAL("chrome-net-export-log.json"));
+ +
+ CefFileDialogRunner::FileChooserParams params; + blink::mojom::FileChooserParams params;
+ params.mode = blink::mojom::FileChooserParams::Mode::kSave; + params.mode = blink::mojom::FileChooserParams::Mode::kSave;
+ params.default_file_name = initial_path; + params.default_file_name = initial_path;
+ params.accept_types.push_back(CefString(initial_path.Extension())); + params.accept_types.push_back(
+ alloy::FilePathTypeToString16(initial_path.Extension()));
+ +
+ cef_browser->RunFileChooser( + alloy::RunFileChooser(web_contents, params,
+ params, base::BindOnce(&NetExportMessageHandler::SaveAsDialogDismissed, + base::BindOnce(&NetExportMessageHandler::SaveAsDialogDismissed,
+ weak_ptr_factory_.GetWeakPtr())); + weak_ptr_factory_.GetWeakPtr()));
+} +}
+ +

View File

@ -0,0 +1,59 @@
diff --git chrome/browser/privacy/BUILD.gn chrome/browser/privacy/BUILD.gn
index cd1f57e009f50..f93721e39e559 100644
--- chrome/browser/privacy/BUILD.gn
+++ chrome/browser/privacy/BUILD.gn
@@ -93,11 +93,15 @@ if (is_win || is_linux) {
]
proto_deps = [ "//components/policy:full_runtime_code_generate" ]
proto_out_dir = "/chrome/browser/privacy"
+ generate_cc = false
+ generate_library = false
}
proto_library("traffic_annotation_proto") {
sources = [ "traffic_annotation.proto" ]
proto_deps = [ ":chrome_settings_full_runtime" ]
import_dirs = [ "$root_gen_dir" + "/components/policy/proto" ]
+ generate_cc = false
+ generate_library = false
}
}
diff --git third_party/protobuf/proto_library.gni third_party/protobuf/proto_library.gni
index a6943f5896cba..1561a868ccef9 100644
--- third_party/protobuf/proto_library.gni
+++ third_party/protobuf/proto_library.gni
@@ -28,6 +28,9 @@
# generate_javascript (optional, default false)
# Generate Javascript protobuf stubs.
#
+# generate_library (optional, default true)
+# Generate a "static_library" target for linking with the generated code.
+#
# cc_generator_options (optional)
# List of extra flags passed to the protocol compiler. If you need to
# add an EXPORT macro to a protobuf's C++ header, set the
@@ -266,14 +269,21 @@ template("proto_library") {
protogens_cc = []
protogens_js = []
+ # Whether source code bindings should be generated.
+ generate_sources = generate_cc || generate_python || generate_with_plugin ||
+ generate_javascript
+
# Whether library should be generated.
# Library is not needed when proto_library is used to generate binary descriptor, in which case
# corresponding library target should be omitted entirely.
- generate_library = generate_cc || generate_python || generate_with_plugin ||
- generate_javascript
+ if (defined(invoker.generate_library)) {
+ generate_library = invoker.generate_library
+ } else {
+ generate_library = generate_sources
+ }
# List output files.
- if (generate_library) {
+ if (generate_sources) {
foreach(proto, protos) {
proto_dir = get_path_info(proto, "dir")
proto_name = get_path_info(proto, "name")

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/profiles/profile_window.cc chrome/browser/profiles/profile_window.cc diff --git chrome/browser/profiles/profile_window.cc chrome/browser/profiles/profile_window.cc
index e0010fdd55000..f89c622c6fd96 100644 index c00884e06f960..858fdb75529f8 100644
--- chrome/browser/profiles/profile_window.cc --- chrome/browser/profiles/profile_window.cc
+++ chrome/browser/profiles/profile_window.cc +++ chrome/browser/profiles/profile_window.cc
@@ -273,7 +273,9 @@ void BubbleViewModeFromAvatarBubbleMode(BrowserWindow::AvatarBubbleMode mode, @@ -272,7 +272,9 @@ void BubbleViewModeFromAvatarBubbleMode(BrowserWindow::AvatarBubbleMode mode,
*bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER;
return; return;
case BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT: case BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT:
@ -14,7 +14,7 @@ index e0010fdd55000..f89c622c6fd96 100644
: profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; : profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER;
} }
diff --git chrome/browser/ui/views/profiles/incognito_menu_view.cc chrome/browser/ui/views/profiles/incognito_menu_view.cc diff --git chrome/browser/ui/views/profiles/incognito_menu_view.cc chrome/browser/ui/views/profiles/incognito_menu_view.cc
index ae41e1031c95e..16ee4f7766a78 100644 index 8a93e597977b0..4d0faa950a2af 100644
--- chrome/browser/ui/views/profiles/incognito_menu_view.cc --- chrome/browser/ui/views/profiles/incognito_menu_view.cc
+++ chrome/browser/ui/views/profiles/incognito_menu_view.cc +++ chrome/browser/ui/views/profiles/incognito_menu_view.cc
@@ -37,7 +37,9 @@ @@ -37,7 +37,9 @@
@ -29,10 +29,10 @@ index ae41e1031c95e..16ee4f7766a78 100644
chrome::RecordDialogCreation( chrome::RecordDialogCreation(
diff --git chrome/browser/ui/views/profiles/profile_menu_view_base.cc chrome/browser/ui/views/profiles/profile_menu_view_base.cc diff --git chrome/browser/ui/views/profiles/profile_menu_view_base.cc chrome/browser/ui/views/profiles/profile_menu_view_base.cc
index 905c775ba0471..b1cf9288f4975 100644 index e8273f40a6d09..b5b21c30ba780 100644
--- chrome/browser/ui/views/profiles/profile_menu_view_base.cc --- chrome/browser/ui/views/profiles/profile_menu_view_base.cc
+++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc +++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc
@@ -511,7 +511,9 @@ void ProfileMenuViewBase::ShowBubble( @@ -511,7 +511,9 @@ void ProfileMenuViewBase::ShowBubble(profiles::BubbleViewMode view_mode,
ProfileMenuViewBase* bubble = nullptr; ProfileMenuViewBase* bubble = nullptr;
if (view_mode == profiles::BUBBLE_VIEW_MODE_INCOGNITO) { if (view_mode == profiles::BUBBLE_VIEW_MODE_INCOGNITO) {

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/profiles/off_the_record_profile_impl.cc chrome/browser/profiles/off_the_record_profile_impl.cc diff --git chrome/browser/profiles/off_the_record_profile_impl.cc chrome/browser/profiles/off_the_record_profile_impl.cc
index 0fbe58dcd4d28..57fab623ec276 100644 index d4654752a2132..5829ddeaa91a7 100644
--- chrome/browser/profiles/off_the_record_profile_impl.cc --- chrome/browser/profiles/off_the_record_profile_impl.cc
+++ chrome/browser/profiles/off_the_record_profile_impl.cc +++ chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -633,7 +633,9 @@ std::unique_ptr<Profile> Profile::CreateOffTheRecordProfile( @@ -628,7 +628,9 @@ std::unique_ptr<Profile> Profile::CreateOffTheRecordProfile(
#endif #endif
if (!profile) if (!profile)
profile = std::make_unique<OffTheRecordProfileImpl>(parent, otr_profile_id); profile = std::make_unique<OffTheRecordProfileImpl>(parent, otr_profile_id);
@ -14,10 +14,10 @@ index 0fbe58dcd4d28..57fab623ec276 100644
} }
diff --git chrome/browser/profiles/profile.cc chrome/browser/profiles/profile.cc diff --git chrome/browser/profiles/profile.cc chrome/browser/profiles/profile.cc
index 7ee045c66e37b..65cb34a7a7e1c 100644 index 01f72891d3035..050f4aa94c6d0 100644
--- chrome/browser/profiles/profile.cc --- chrome/browser/profiles/profile.cc
+++ chrome/browser/profiles/profile.cc +++ chrome/browser/profiles/profile.cc
@@ -85,6 +85,7 @@ base::LazyInstance<std::set<content::BrowserContext*>>::Leaky @@ -86,6 +86,7 @@ base::LazyInstance<std::set<content::BrowserContext*>>::Leaky
namespace { namespace {
@ -25,7 +25,7 @@ index 7ee045c66e37b..65cb34a7a7e1c 100644
const char kDevToolsOTRProfileIDPrefix[] = "Devtools::BrowserContext"; const char kDevToolsOTRProfileIDPrefix[] = "Devtools::BrowserContext";
const char kMediaRouterOTRProfileIDPrefix[] = "MediaRouter::Presentation"; const char kMediaRouterOTRProfileIDPrefix[] = "MediaRouter::Presentation";
const char kTestOTRProfileIDPrefix[] = "Test::OTR"; const char kTestOTRProfileIDPrefix[] = "Test::OTR";
@@ -99,6 +100,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { @@ -100,6 +101,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const {
// DevTools::BrowserContext and MediaRouter::Presentation are an // DevTools::BrowserContext and MediaRouter::Presentation are an
// exception to this ban. // exception to this ban.
return *this == PrimaryID() || return *this == PrimaryID() ||
@ -34,7 +34,7 @@ index 7ee045c66e37b..65cb34a7a7e1c 100644
base::StartsWith(profile_id_, kDevToolsOTRProfileIDPrefix, base::StartsWith(profile_id_, kDevToolsOTRProfileIDPrefix,
base::CompareCase::SENSITIVE) || base::CompareCase::SENSITIVE) ||
base::StartsWith(profile_id_, kMediaRouterOTRProfileIDPrefix, base::StartsWith(profile_id_, kMediaRouterOTRProfileIDPrefix,
@@ -120,6 +123,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique( @@ -121,6 +124,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique(
base::GUID::GenerateRandomV4().AsLowercaseString().c_str())); base::GUID::GenerateRandomV4().AsLowercaseString().c_str()));
} }
@ -52,7 +52,7 @@ index 7ee045c66e37b..65cb34a7a7e1c 100644
Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() { Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() {
return CreateUnique(kDevToolsOTRProfileIDPrefix); return CreateUnique(kDevToolsOTRProfileIDPrefix);
diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h
index 92baa51c80944..9726edaea9c4d 100644 index e3e819d9ecd87..ef8c6ebd1cf2e 100644
--- chrome/browser/profiles/profile.h --- chrome/browser/profiles/profile.h
+++ chrome/browser/profiles/profile.h +++ chrome/browser/profiles/profile.h
@@ -119,6 +119,10 @@ class Profile : public content::BrowserContext { @@ -119,6 +119,10 @@ class Profile : public content::BrowserContext {
@ -66,7 +66,7 @@ index 92baa51c80944..9726edaea9c4d 100644
// Creates a unique OTR profile id to be used for DevTools browser contexts. // Creates a unique OTR profile id to be used for DevTools browser contexts.
static OTRProfileID CreateUniqueForDevTools(); static OTRProfileID CreateUniqueForDevTools();
@@ -528,6 +532,8 @@ class Profile : public content::BrowserContext { @@ -522,6 +526,8 @@ class Profile : public content::BrowserContext {
virtual void RecordMainFrameNavigation() = 0; virtual void RecordMainFrameNavigation() = 0;
@ -75,7 +75,7 @@ index 92baa51c80944..9726edaea9c4d 100644
protected: protected:
// Creates an OffTheRecordProfile which points to this Profile. // Creates an OffTheRecordProfile which points to this Profile.
static std::unique_ptr<Profile> CreateOffTheRecordProfile( static std::unique_ptr<Profile> CreateOffTheRecordProfile(
@@ -539,8 +545,6 @@ class Profile : public content::BrowserContext { @@ -533,8 +539,6 @@ class Profile : public content::BrowserContext {
static PrefStore* CreateExtensionPrefStore(Profile*, static PrefStore* CreateExtensionPrefStore(Profile*,
bool incognito_pref_store); bool incognito_pref_store);
@ -85,10 +85,10 @@ index 92baa51c80944..9726edaea9c4d 100644
virtual bool IsSignedIn() = 0; virtual bool IsSignedIn() = 0;
diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc
index 0f051ffa90eb2..7def9e1f948e3 100644 index 5d87d4fff37ab..61d00177e036e 100644
--- chrome/browser/profiles/profile_impl.cc --- chrome/browser/profiles/profile_impl.cc
+++ chrome/browser/profiles/profile_impl.cc +++ chrome/browser/profiles/profile_impl.cc
@@ -982,7 +982,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, @@ -929,7 +929,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id,
otr_profiles_[otr_profile_id] = std::move(otr_profile); otr_profiles_[otr_profile_id] = std::move(otr_profile);
@ -100,10 +100,10 @@ index 0f051ffa90eb2..7def9e1f948e3 100644
return raw_otr_profile; return raw_otr_profile;
} }
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
index e5227bb58f532..e9620f11a256a 100644 index aef8964db423d..e15bc0dc20285 100644
--- chrome/browser/profiles/profile_manager.cc --- chrome/browser/profiles/profile_manager.cc
+++ chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc
@@ -511,7 +511,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) @@ -495,7 +495,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
base::Unretained(this))); base::Unretained(this)));
#endif #endif
@ -113,10 +113,10 @@ index e5227bb58f532..e9620f11a256a 100644
} }
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
index cd6fdbba9b435..0fbc56702d7a3 100644 index 915a95e287c58..0424e8bdd7d84 100644
--- chrome/browser/profiles/profile_manager.h --- chrome/browser/profiles/profile_manager.h
+++ chrome/browser/profiles/profile_manager.h +++ chrome/browser/profiles/profile_manager.h
@@ -118,7 +118,7 @@ class ProfileManager : public Profile::Delegate { @@ -119,7 +119,7 @@ class ProfileManager : public Profile::Delegate {
// acceptable. Returns null if creation of the new profile fails. // acceptable. Returns null if creation of the new profile fails.
// TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then // TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then
// make this method private. // make this method private.
@ -125,7 +125,7 @@ index cd6fdbba9b435..0fbc56702d7a3 100644
// Returns regular or off-the-record profile given its profile key. // Returns regular or off-the-record profile given its profile key.
static Profile* GetProfileFromProfileKey(ProfileKey* profile_key); static Profile* GetProfileFromProfileKey(ProfileKey* profile_key);
@@ -150,7 +150,7 @@ class ProfileManager : public Profile::Delegate { @@ -151,7 +151,7 @@ class ProfileManager : public Profile::Delegate {
// Returns true if the profile pointer is known to point to an existing // Returns true if the profile pointer is known to point to an existing
// profile. // profile.

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn
index 4d46dbb1c0a44..022b7021fd245 100644 index 102a18a81e424..c530945922b1d 100644
--- chrome/browser/safe_browsing/BUILD.gn --- chrome/browser/safe_browsing/BUILD.gn
+++ chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn
@@ -27,6 +27,7 @@ static_library("safe_browsing") { @@ -27,6 +27,7 @@ static_library("safe_browsing") {

View File

@ -1,66 +0,0 @@
diff --git chrome/browser/sharesheet/sharesheet_service_delegate.cc chrome/browser/sharesheet/sharesheet_service_delegate.cc
index f250b1b444de0..d0b7efeadbe18 100644
--- chrome/browser/sharesheet/sharesheet_service_delegate.cc
+++ chrome/browser/sharesheet/sharesheet_service_delegate.cc
@@ -19,8 +19,10 @@ SharesheetServiceDelegate::SharesheetServiceDelegate(
gfx::NativeWindow native_window,
SharesheetService* sharesheet_service)
: native_window_(native_window),
+#if BUILDFLAG(IS_CHROMEOS_ASH)
sharesheet_bubble_view_(
new ash::sharesheet::SharesheetBubbleView(native_window, this)),
+#endif
sharesheet_service_(sharesheet_service) {}
SharesheetServiceDelegate::~SharesheetServiceDelegate() = default;
@@ -36,8 +38,10 @@ void SharesheetServiceDelegate::ShowBubble(
}
return;
}
+#if BUILDFLAG(IS_CHROMEOS_ASH)
sharesheet_bubble_view_->ShowBubble(std::move(targets), std::move(intent),
std::move(delivered_callback));
+#endif
is_bubble_open_ = true;
}
@@ -81,7 +85,9 @@ bool SharesheetServiceDelegate::OnAcceleratorPressed(
}
void SharesheetServiceDelegate::OnActionLaunched() {
+#if BUILDFLAG(IS_CHROMEOS_ASH)
sharesheet_bubble_view_->ShowActionView();
+#endif
}
const gfx::VectorIcon* SharesheetServiceDelegate::GetVectorIcon(
@@ -101,11 +107,15 @@ void SharesheetServiceDelegate::SetSharesheetSize(const int& width,
const int& height) {
DCHECK_GT(width, 0);
DCHECK_GT(height, 0);
+#if BUILDFLAG(IS_CHROMEOS_ASH)
sharesheet_bubble_view_->ResizeBubble(width, height);
+#endif
}
void SharesheetServiceDelegate::CloseSharesheet() {
+#if BUILDFLAG(IS_CHROMEOS_ASH)
sharesheet_bubble_view_->CloseBubble();
+#endif
}
} // namespace sharesheet
diff --git chrome/browser/sharesheet/sharesheet_service_delegate.h chrome/browser/sharesheet/sharesheet_service_delegate.h
index 24dc55adca062..236eb65db6a45 100644
--- chrome/browser/sharesheet/sharesheet_service_delegate.h
+++ chrome/browser/sharesheet/sharesheet_service_delegate.h
@@ -77,7 +77,9 @@ class SharesheetServiceDelegate : public SharesheetController {
std::u16string active_action_;
// Owned by views.
+#if BUILDFLAG(IS_CHROMEOS_ASH)
ash::sharesheet::SharesheetBubbleView* sharesheet_bubble_view_;
+#endif
SharesheetService* sharesheet_service_;
};

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc
index 168f980572c10..ffdc06beb2b77 100644 index 4cb831441aed4..ed0092720b63f 100644
--- chrome/browser/plugins/plugin_info_host_impl.cc --- chrome/browser/plugins/plugin_info_host_impl.cc
+++ chrome/browser/plugins/plugin_info_host_impl.cc +++ chrome/browser/plugins/plugin_info_host_impl.cc
@@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
@ -151,7 +151,7 @@ index a0b3175223f3e..a1117001ad1fc 100644
Profile* profile = Profile::FromBrowserContext(browser_context); Profile* profile = Profile::FromBrowserContext(browser_context);
const std::vector<std::string>& allowlist = const std::vector<std::string>& allowlist =
diff --git chrome/common/google_url_loader_throttle.cc chrome/common/google_url_loader_throttle.cc diff --git chrome/common/google_url_loader_throttle.cc chrome/common/google_url_loader_throttle.cc
index e42b4e7dbdec2..a2bebe0128a04 100644 index 88a87fd4d74bb..2815c9897d636 100644
--- chrome/common/google_url_loader_throttle.cc --- chrome/common/google_url_loader_throttle.cc
+++ chrome/common/google_url_loader_throttle.cc +++ chrome/common/google_url_loader_throttle.cc
@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
@ -186,10 +186,10 @@ index e42b4e7dbdec2..a2bebe0128a04 100644
// that the X-Frame-Options protection mechanism is set to either DENY or // that the X-Frame-Options protection mechanism is set to either DENY or
// SAMEORIGIN. // SAMEORIGIN.
diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc
index 21bc479c64b31..ce00212ed4f86 100644 index a6e34d86aa11c..1141f02719e9b 100644
--- chrome/renderer/chrome_content_renderer_client.cc --- chrome/renderer/chrome_content_renderer_client.cc
+++ chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc
@@ -895,6 +895,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( @@ -919,6 +919,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
if ((status == chrome::mojom::PluginStatus::kUnauthorized || if ((status == chrome::mojom::PluginStatus::kUnauthorized ||
status == chrome::mojom::PluginStatus::kBlocked) && status == chrome::mojom::PluginStatus::kBlocked) &&
@ -197,7 +197,7 @@ index 21bc479c64b31..ce00212ed4f86 100644
content_settings_agent_delegate->IsPluginTemporarilyAllowed( content_settings_agent_delegate->IsPluginTemporarilyAllowed(
identifier)) { identifier)) {
status = chrome::mojom::PluginStatus::kAllowed; status = chrome::mojom::PluginStatus::kAllowed;
@@ -1100,7 +1101,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( @@ -1122,7 +1123,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
render_frame->GetRemoteAssociatedInterfaces()->GetInterface( render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
plugin_auth_host.BindNewEndpointAndPassReceiver()); plugin_auth_host.BindNewEndpointAndPassReceiver());
plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier);
@ -207,7 +207,7 @@ index 21bc479c64b31..ce00212ed4f86 100644
break; break;
} }
case chrome::mojom::PluginStatus::kBlocked: { case chrome::mojom::PluginStatus::kBlocked: {
@@ -1109,7 +1111,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( @@ -1131,7 +1133,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
placeholder->AllowLoading(); placeholder->AllowLoading();
RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked"));
@ -217,7 +217,7 @@ index 21bc479c64b31..ce00212ed4f86 100644
break; break;
} }
case chrome::mojom::PluginStatus::kBlockedByPolicy: { case chrome::mojom::PluginStatus::kBlockedByPolicy: {
@@ -1119,7 +1122,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( @@ -1141,7 +1144,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
group_name)); group_name));
RenderThread::Get()->RecordAction( RenderThread::Get()->RecordAction(
UserMetricsAction("Plugin_BlockedByPolicy")); UserMetricsAction("Plugin_BlockedByPolicy"));
@ -227,7 +227,7 @@ index 21bc479c64b31..ce00212ed4f86 100644
break; break;
} }
case chrome::mojom::PluginStatus::kBlockedNoLoading: { case chrome::mojom::PluginStatus::kBlockedNoLoading: {
@@ -1127,7 +1131,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( @@ -1149,7 +1153,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
IDR_BLOCKED_PLUGIN_HTML, IDR_BLOCKED_PLUGIN_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING,
group_name)); group_name));

View File

@ -1,5 +1,5 @@
diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn
index 5f60593886e37..34d8abbc0acbd 100644 index 02cdf42567745..74fff92e5b6e1 100644
--- chrome/renderer/BUILD.gn --- chrome/renderer/BUILD.gn
+++ chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
@ -10,7 +10,7 @@ index 5f60593886e37..34d8abbc0acbd 100644
import("//chrome/common/features.gni") import("//chrome/common/features.gni")
import("//components/nacl/features.gni") import("//components/nacl/features.gni")
import("//components/offline_pages/buildflags/features.gni") import("//components/offline_pages/buildflags/features.gni")
@@ -148,6 +149,7 @@ static_library("renderer") { @@ -149,6 +150,7 @@ static_library("renderer") {
deps = [ deps = [
"//base/allocator:buildflags", "//base/allocator:buildflags",
"//build:chromeos_buildflags", "//build:chromeos_buildflags",
@ -18,7 +18,7 @@ index 5f60593886e37..34d8abbc0acbd 100644
"//chrome:resources", "//chrome:resources",
"//chrome:strings", "//chrome:strings",
"//chrome/common", "//chrome/common",
@@ -238,6 +240,10 @@ static_library("renderer") { @@ -239,6 +241,10 @@ static_library("renderer") {
configs += [ "//build/config/compiler:wexit_time_destructors" ] configs += [ "//build/config/compiler:wexit_time_destructors" ]

View File

@ -1,5 +1,5 @@
diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc
index c64f406ba5b8f..75453789a6052 100644 index 495893eec9704..e967494683f19 100644
--- chrome/app/chrome_main_delegate.cc --- chrome/app/chrome_main_delegate.cc
+++ chrome/app/chrome_main_delegate.cc +++ chrome/app/chrome_main_delegate.cc
@@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
@ -10,7 +10,7 @@ index c64f406ba5b8f..75453789a6052 100644
#include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/chrome_resource_bundle_helper.h" #include "chrome/browser/chrome_resource_bundle_helper.h"
#include "chrome/browser/defaults.h" #include "chrome/browser/defaults.h"
@@ -380,6 +381,8 @@ struct MainFunction { @@ -384,6 +385,8 @@ struct MainFunction {
// Initializes the user data dir. Must be called before InitializeLocalState(). // Initializes the user data dir. Must be called before InitializeLocalState().
void InitializeUserDataDir(base::CommandLine* command_line) { void InitializeUserDataDir(base::CommandLine* command_line) {
@ -19,7 +19,7 @@ index c64f406ba5b8f..75453789a6052 100644
#if defined(OS_WIN) #if defined(OS_WIN)
// Reach out to chrome_elf for the truth on the user data directory. // Reach out to chrome_elf for the truth on the user data directory.
// Note that in tests, this links to chrome_elf_test_stubs. // Note that in tests, this links to chrome_elf_test_stubs.
@@ -666,7 +669,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() { @@ -675,7 +678,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() {
} }
#if defined(OS_WIN) #if defined(OS_WIN)
@ -29,7 +29,7 @@ index c64f406ba5b8f..75453789a6052 100644
base::sequence_manager::internal::ThreadControllerPowerMonitor:: base::sequence_manager::internal::ThreadControllerPowerMonitor::
InitializeOnMainThread(); InitializeOnMainThread();
#endif #endif
@@ -959,6 +964,7 @@ void ChromeMainDelegate::PreSandboxStartup() { @@ -970,6 +975,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
std::string process_type = std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType); command_line.GetSwitchValueASCII(switches::kProcessType);
@ -37,7 +37,7 @@ index c64f406ba5b8f..75453789a6052 100644
crash_reporter::InitializeCrashKeys(); crash_reporter::InitializeCrashKeys();
#if defined(OS_POSIX) #if defined(OS_POSIX)
@@ -969,6 +975,7 @@ void ChromeMainDelegate::PreSandboxStartup() { @@ -980,6 +986,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
InitMacCrashReporter(command_line, process_type); InitMacCrashReporter(command_line, process_type);
SetUpInstallerPreferences(command_line); SetUpInstallerPreferences(command_line);
#endif #endif
@ -45,7 +45,7 @@ index c64f406ba5b8f..75453789a6052 100644
#if defined(OS_WIN) #if defined(OS_WIN)
child_process_logging::Init(); child_process_logging::Init();
@@ -1092,6 +1099,7 @@ void ChromeMainDelegate::PreSandboxStartup() { @@ -1103,6 +1110,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
locale; locale;
} }
@ -53,7 +53,7 @@ index c64f406ba5b8f..75453789a6052 100644
#if defined(OS_POSIX) && !defined(OS_MAC) #if defined(OS_POSIX) && !defined(OS_MAC)
// Zygote needs to call InitCrashReporter() in RunZygote(). // Zygote needs to call InitCrashReporter() in RunZygote().
if (process_type != switches::kZygoteProcess) { if (process_type != switches::kZygoteProcess) {
@@ -1124,6 +1132,7 @@ void ChromeMainDelegate::PreSandboxStartup() { @@ -1135,6 +1143,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
// After all the platform Breakpads have been initialized, store the command // After all the platform Breakpads have been initialized, store the command
// line for crash reporting. // line for crash reporting.
crash_keys::SetCrashKeysFromCommandLine(command_line); crash_keys::SetCrashKeysFromCommandLine(command_line);
@ -61,7 +61,7 @@ index c64f406ba5b8f..75453789a6052 100644
#if BUILDFLAG(ENABLE_PDF) #if BUILDFLAG(ENABLE_PDF)
MaybeInitializeGDI(); MaybeInitializeGDI();
@@ -1222,6 +1231,7 @@ void ChromeMainDelegate::ZygoteForked() { @@ -1233,6 +1242,7 @@ void ChromeMainDelegate::ZygoteForked() {
SetUpProfilingShutdownHandler(); SetUpProfilingShutdownHandler();
} }
@ -69,7 +69,7 @@ index c64f406ba5b8f..75453789a6052 100644
// Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets
// this up for the browser process in a different manner. // this up for the browser process in a different manner.
const base::CommandLine* command_line = const base::CommandLine* command_line =
@@ -1238,6 +1248,7 @@ void ChromeMainDelegate::ZygoteForked() { @@ -1249,6 +1259,7 @@ void ChromeMainDelegate::ZygoteForked() {
// Reset the command line for the newly spawned process. // Reset the command line for the newly spawned process.
crash_keys::SetCrashKeysFromCommandLine(*command_line); crash_keys::SetCrashKeysFromCommandLine(*command_line);
@ -78,7 +78,7 @@ index c64f406ba5b8f..75453789a6052 100644
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) #endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc
index cf7f295bf92f6..1a7859d698a8c 100644 index dff0a32062f0e..9378b2a0be47f 100644
--- chrome/browser/chrome_browser_main.cc --- chrome/browser/chrome_browser_main.cc
+++ chrome/browser/chrome_browser_main.cc +++ chrome/browser/chrome_browser_main.cc
@@ -49,6 +49,7 @@ @@ -49,6 +49,7 @@
@ -89,7 +89,7 @@ index cf7f295bf92f6..1a7859d698a8c 100644
#include "chrome/browser/about_flags.h" #include "chrome/browser/about_flags.h"
#include "chrome/browser/active_use_util.h" #include "chrome/browser/active_use_util.h"
#include "chrome/browser/after_startup_task_utils.h" #include "chrome/browser/after_startup_task_utils.h"
@@ -906,8 +907,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { @@ -915,8 +916,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
// Create the RunLoop for MainMessageLoopRun() to use, and pass a copy of // Create the RunLoop for MainMessageLoopRun() to use, and pass a copy of
// its QuitClosure to the BrowserProcessImpl to call when it is time to exit. // its QuitClosure to the BrowserProcessImpl to call when it is time to exit.
@ -101,7 +101,7 @@ index cf7f295bf92f6..1a7859d698a8c 100644
// These members must be initialized before returning from this function. // These members must be initialized before returning from this function.
// Android doesn't use StartupBrowserCreator. // Android doesn't use StartupBrowserCreator.
@@ -1665,11 +1668,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { @@ -1689,11 +1692,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
// This step is costly and is already measured in // This step is costly and is already measured in
// Startup.StartupBrowserCreator_Start. // Startup.StartupBrowserCreator_Start.
// See the comment above for an explanation of |process_command_line|. // See the comment above for an explanation of |process_command_line|.
@ -156,10 +156,10 @@ index 95d1ebc190910..13cdfa52db108 100644
+#endif +#endif
} }
diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc
index af089ae5fa35a..b7498d1a2ee79 100644 index 8650dd04f9c44..45ab4913bbe04 100644
--- chrome/browser/chrome_content_browser_client.cc --- chrome/browser/chrome_content_browser_client.cc
+++ chrome/browser/chrome_content_browser_client.cc +++ chrome/browser/chrome_content_browser_client.cc
@@ -37,6 +37,7 @@ @@ -38,6 +38,7 @@
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "build/chromeos_buildflags.h" #include "build/chromeos_buildflags.h"
@ -167,7 +167,7 @@ index af089ae5fa35a..b7498d1a2ee79 100644
#include "chrome/browser/accessibility/accessibility_labels_service.h" #include "chrome/browser/accessibility/accessibility_labels_service.h"
#include "chrome/browser/accessibility/accessibility_labels_service_factory.h" #include "chrome/browser/accessibility/accessibility_labels_service_factory.h"
#include "chrome/browser/after_startup_task_utils.h" #include "chrome/browser/after_startup_task_utils.h"
@@ -3590,9 +3591,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( @@ -3562,9 +3563,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
&search::HandleNewTabURLReverseRewrite); &search::HandleNewTabURLReverseRewrite);
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
@ -205,7 +205,7 @@ index ab4c2b03755d3..8e813496f9df6 100644
base::mac::ScopedMachSendRight exceptionPort( base::mac::ScopedMachSendRight exceptionPort(
crash_reporter::GetCrashpadClient().GetHandlerMachPort()); crash_reporter::GetCrashpadClient().GetHandlerMachPort());
diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc
index b18cc56bb82b0..4760db368c6e0 100644 index 3de6df64935e3..78a2bf3896e72 100644
--- chrome/browser/prefs/browser_prefs.cc --- chrome/browser/prefs/browser_prefs.cc
+++ chrome/browser/prefs/browser_prefs.cc +++ chrome/browser/prefs/browser_prefs.cc
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
@ -216,7 +216,7 @@ index b18cc56bb82b0..4760db368c6e0 100644
#include "chrome/browser/about_flags.h" #include "chrome/browser/about_flags.h"
#include "chrome/browser/accessibility/accessibility_labels_service.h" #include "chrome/browser/accessibility/accessibility_labels_service.h"
#include "chrome/browser/accessibility/accessibility_ui.h" #include "chrome/browser/accessibility/accessibility_ui.h"
@@ -161,6 +162,10 @@ @@ -164,6 +165,10 @@
#include "chrome/browser/background/background_mode_manager.h" #include "chrome/browser/background/background_mode_manager.h"
#endif #endif
@ -227,7 +227,7 @@ index b18cc56bb82b0..4760db368c6e0 100644
#if BUILDFLAG(ENABLE_EXTENSIONS) #if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/accessibility/animation_policy_prefs.h" #include "chrome/browser/accessibility/animation_policy_prefs.h"
#include "chrome/browser/apps/platform_apps/shortcut_manager.h" #include "chrome/browser/apps/platform_apps/shortcut_manager.h"
@@ -1019,6 +1024,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, @@ -1134,6 +1139,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
SessionDataService::RegisterProfilePrefs(registry); SessionDataService::RegisterProfilePrefs(registry);
#endif #endif

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc
index cfefe1f227283..402d848368269 100644 index 57ef822f46944..06cef42aab9ed 100644
--- chrome/browser/ui/browser_command_controller.cc --- chrome/browser/ui/browser_command_controller.cc
+++ chrome/browser/ui/browser_command_controller.cc +++ chrome/browser/ui/browser_command_controller.cc
@@ -351,8 +351,10 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( @@ -351,8 +351,10 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
@ -14,7 +14,7 @@ index cfefe1f227283..402d848368269 100644
// No commands are enabled if there is not yet any selected tab. // No commands are enabled if there is not yet any selected tab.
// TODO(pkasting): It seems like we should not need this, because either // TODO(pkasting): It seems like we should not need this, because either
@@ -942,11 +944,13 @@ void BrowserCommandController::TabRestoreServiceLoaded( @@ -959,11 +961,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
// BrowserCommandController, private: // BrowserCommandController, private:
bool BrowserCommandController::IsShowingMainUI() { bool BrowserCommandController::IsShowingMainUI() {
@ -120,10 +120,10 @@ index 0ce7abdeb7d9f..8197a6bb7da98 100644
// Initialize the frame (creates the underlying native window). // Initialize the frame (creates the underlying native window).
diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc
index e852eb7d20ed6..bb73d3055936d 100644 index f3239963d569a..2bee32af5a8dd 100644
--- chrome/browser/ui/views/frame/browser_view.cc --- chrome/browser/ui/views/frame/browser_view.cc
+++ chrome/browser/ui/views/frame/browser_view.cc +++ chrome/browser/ui/views/frame/browser_view.cc
@@ -586,11 +586,22 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { @@ -589,11 +589,22 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// BrowserView, public: // BrowserView, public:
@ -147,7 +147,7 @@ index e852eb7d20ed6..bb73d3055936d 100644
SetShowIcon(::ShouldShowWindowIcon(browser_.get())); SetShowIcon(::ShouldShowWindowIcon(browser_.get()));
// In forced app mode, all size controls are always disabled. Otherwise, use // In forced app mode, all size controls are always disabled. Otherwise, use
@@ -604,7 +615,6 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser) @@ -607,7 +618,6 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
} }
browser_->tab_strip_model()->AddObserver(this); browser_->tab_strip_model()->AddObserver(this);
@ -155,7 +155,7 @@ index e852eb7d20ed6..bb73d3055936d 100644
// Top container holds tab strip region and toolbar and lives at the front of // Top container holds tab strip region and toolbar and lives at the front of
// the view hierarchy. // the view hierarchy.
@@ -648,8 +658,15 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser) @@ -651,8 +661,15 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
contents_container->SetLayoutManager(std::make_unique<ContentsLayoutManager>( contents_container->SetLayoutManager(std::make_unique<ContentsLayoutManager>(
devtools_web_view_, contents_web_view_)); devtools_web_view_, contents_web_view_));
@ -163,7 +163,7 @@ index e852eb7d20ed6..bb73d3055936d 100644
- std::make_unique<ToolbarView>(browser_.get(), this)); - std::make_unique<ToolbarView>(browser_.get(), this));
+ toolbar_ = OverrideCreateToolbar(browser_.get(), this); + toolbar_ = OverrideCreateToolbar(browser_.get(), this);
+ if (!toolbar_) { + if (!toolbar_) {
+ toolbar_ = new ToolbarView(browser_.get(), this, base::nullopt); + toolbar_ = new ToolbarView(browser_.get(), this, absl::nullopt);
+ } else { + } else {
+ browser_->set_toolbar_overridden(true); + browser_->set_toolbar_overridden(true);
+ // Update state that depends on the above flag. + // Update state that depends on the above flag.
@ -173,7 +173,7 @@ index e852eb7d20ed6..bb73d3055936d 100644
contents_separator_ = contents_separator_ =
top_container_->AddChildView(std::make_unique<ContentsSeparator>()); top_container_->AddChildView(std::make_unique<ContentsSeparator>());
@@ -1430,6 +1447,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const { @@ -1436,6 +1453,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const {
if (immersive_mode_controller_->IsEnabled()) if (immersive_mode_controller_->IsEnabled())
return false; return false;
@ -182,7 +182,7 @@ index e852eb7d20ed6..bb73d3055936d 100644
return frame_->GetFrameView()->ShouldHideTopUIForFullscreen(); return frame_->GetFrameView()->ShouldHideTopUIForFullscreen();
} }
@@ -2423,7 +2442,8 @@ BrowserView::GetNativeViewHostsForTopControlsSlide() const { @@ -2462,7 +2481,8 @@ BrowserView::GetNativeViewHostsForTopControlsSlide() const {
} }
void BrowserView::ReparentTopContainerForEndOfImmersive() { void BrowserView::ReparentTopContainerForEndOfImmersive() {
@ -192,7 +192,7 @@ index e852eb7d20ed6..bb73d3055936d 100644
top_container()->DestroyLayer(); top_container()->DestroyLayer();
AddChildViewAt(top_container(), 0); AddChildViewAt(top_container(), 0);
EnsureFocusOrder(); EnsureFocusOrder();
@@ -2878,8 +2898,10 @@ void BrowserView::Layout() { @@ -2914,8 +2934,10 @@ void BrowserView::Layout() {
// TODO(jamescook): Why was this in the middle of layout code? // TODO(jamescook): Why was this in the middle of layout code?
toolbar_->location_bar()->omnibox_view()->SetFocusBehavior( toolbar_->location_bar()->omnibox_view()->SetFocusBehavior(
@ -205,7 +205,7 @@ index e852eb7d20ed6..bb73d3055936d 100644
// Some of the situations when the BrowserView is laid out are: // Some of the situations when the BrowserView is laid out are:
// - Enter/exit immersive fullscreen mode. // - Enter/exit immersive fullscreen mode.
@@ -2942,6 +2964,11 @@ void BrowserView::AddedToWidget() { @@ -2978,6 +3000,11 @@ void BrowserView::AddedToWidget() {
SetThemeProfileForWindow(GetNativeWindow(), browser_->profile()); SetThemeProfileForWindow(GetNativeWindow(), browser_->profile());
#endif #endif
@ -217,7 +217,7 @@ index e852eb7d20ed6..bb73d3055936d 100644
toolbar_->Init(); toolbar_->Init();
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
@@ -2977,13 +3004,9 @@ void BrowserView::AddedToWidget() { @@ -3013,13 +3040,9 @@ void BrowserView::AddedToWidget() {
EnsureFocusOrder(); EnsureFocusOrder();
@ -234,7 +234,7 @@ index e852eb7d20ed6..bb73d3055936d 100644
MaybeInitializeWebUITabStrip(); MaybeInitializeWebUITabStrip();
diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h
index f6db8a6928831..a5302d7f73ba6 100644 index 02f0019d7d324..2bcf69c2098ae 100644
--- chrome/browser/ui/views/frame/browser_view.h --- chrome/browser/ui/views/frame/browser_view.h
+++ chrome/browser/ui/views/frame/browser_view.h +++ chrome/browser/ui/views/frame/browser_view.h
@@ -114,7 +114,9 @@ class BrowserView : public BrowserWindow, @@ -114,7 +114,9 @@ class BrowserView : public BrowserWindow,
@ -247,7 +247,7 @@ index f6db8a6928831..a5302d7f73ba6 100644
BrowserView(const BrowserView&) = delete; BrowserView(const BrowserView&) = delete;
BrowserView& operator=(const BrowserView&) = delete; BrowserView& operator=(const BrowserView&) = delete;
~BrowserView() override; ~BrowserView() override;
@@ -642,6 +644,12 @@ class BrowserView : public BrowserWindow, @@ -661,6 +663,12 @@ class BrowserView : public BrowserWindow,
return accessibility_focus_highlight_.get(); return accessibility_focus_highlight_.get();
} }
@ -261,10 +261,10 @@ index f6db8a6928831..a5302d7f73ba6 100644
// Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate // Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate
// interface to keep these two classes decoupled and testable. // interface to keep these two classes decoupled and testable.
diff --git chrome/browser/ui/views/frame/browser_view_layout.cc chrome/browser/ui/views/frame/browser_view_layout.cc diff --git chrome/browser/ui/views/frame/browser_view_layout.cc chrome/browser/ui/views/frame/browser_view_layout.cc
index 0e810789a99d7..14d69bd755fa2 100644 index 18a85f436bd97..0d6e4c9f916e7 100644
--- chrome/browser/ui/views/frame/browser_view_layout.cc --- chrome/browser/ui/views/frame/browser_view_layout.cc
+++ chrome/browser/ui/views/frame/browser_view_layout.cc +++ chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -420,6 +420,12 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) { @@ -441,6 +441,12 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) {
int BrowserViewLayout::LayoutToolbar(int top) { int BrowserViewLayout::LayoutToolbar(int top) {
TRACE_EVENT0("ui", "BrowserViewLayout::LayoutToolbar"); TRACE_EVENT0("ui", "BrowserViewLayout::LayoutToolbar");
@ -278,10 +278,10 @@ index 0e810789a99d7..14d69bd755fa2 100644
bool toolbar_visible = delegate_->IsToolbarVisible(); bool toolbar_visible = delegate_->IsToolbarVisible();
int height = toolbar_visible ? toolbar_->GetPreferredSize().height() : 0; int height = toolbar_visible ? toolbar_->GetPreferredSize().height() : 0;
diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index 50c10d73b9102..46f375b11d82c 100644 index bb4f5ff05c72e..2cd5634bc96b6 100644
--- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc --- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -582,37 +582,53 @@ gfx::Range BrowserTabStripController::ListTabsInGroup( @@ -586,37 +586,53 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
} }
bool BrowserTabStripController::IsFrameCondensed() const { bool BrowserTabStripController::IsFrameCondensed() const {
@ -336,16 +336,16 @@ index 50c10d73b9102..46f375b11d82c 100644
} }
diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc
index 650fb98f63b0b..fd3d28bd70aac 100644 index 9fe383741657c..39b7adae6cfaf 100644
--- chrome/browser/ui/views/toolbar/toolbar_view.cc --- chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ chrome/browser/ui/views/toolbar/toolbar_view.cc +++ chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -160,12 +160,13 @@ auto& GetViewCommandMap() { @@ -161,12 +161,13 @@ auto& GetViewCommandMap() {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// ToolbarView, public: // ToolbarView, public:
-ToolbarView::ToolbarView(Browser* browser, BrowserView* browser_view) -ToolbarView::ToolbarView(Browser* browser, BrowserView* browser_view)
+ToolbarView::ToolbarView(Browser* browser, BrowserView* browser_view, +ToolbarView::ToolbarView(Browser* browser, BrowserView* browser_view,
+ base::Optional<DisplayMode> display_mode) + absl::optional<DisplayMode> display_mode)
: AnimationDelegateViews(this), : AnimationDelegateViews(this),
browser_(browser), browser_(browser),
browser_view_(browser_view), browser_view_(browser_view),
@ -355,7 +355,7 @@ index 650fb98f63b0b..fd3d28bd70aac 100644
SetID(VIEW_ID_TOOLBAR); SetID(VIEW_ID_TOOLBAR);
UpgradeDetector::GetInstance()->AddObserver(this); UpgradeDetector::GetInstance()->AddObserver(this);
@@ -198,7 +199,7 @@ void ToolbarView::Init() { @@ -201,7 +202,7 @@ void ToolbarView::Init() {
#endif #endif
auto location_bar = std::make_unique<LocationBarView>( auto location_bar = std::make_unique<LocationBarView>(
browser_, browser_->profile(), browser_->command_controller(), this, browser_, browser_->profile(), browser_->command_controller(), this,
@ -365,16 +365,16 @@ index 650fb98f63b0b..fd3d28bd70aac 100644
size_animation_.Reset(1); size_animation_.Reset(1);
diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h
index c232c1c703500..d3b1593be5496 100644 index 8346b612cfbe6..d7fc5440af829 100644
--- chrome/browser/ui/views/toolbar/toolbar_view.h --- chrome/browser/ui/views/toolbar/toolbar_view.h
+++ chrome/browser/ui/views/toolbar/toolbar_view.h +++ chrome/browser/ui/views/toolbar/toolbar_view.h
@@ -91,7 +91,8 @@ class ToolbarView : public views::AccessiblePaneView, @@ -90,7 +90,8 @@ class ToolbarView : public views::AccessiblePaneView,
// needs to be displayed. // needs to be displayed.
}; };
- ToolbarView(Browser* browser, BrowserView* browser_view); - ToolbarView(Browser* browser, BrowserView* browser_view);
+ ToolbarView(Browser* browser, BrowserView* browser_view, + ToolbarView(Browser* browser, BrowserView* browser_view,
+ base::Optional<DisplayMode> display_mode); + absl::optional<DisplayMode> display_mode);
ToolbarView(const ToolbarView&) = delete; ToolbarView(const ToolbarView&) = delete;
ToolbarView& operator=(const ToolbarView&) = delete; ToolbarView& operator=(const ToolbarView&) = delete;
~ToolbarView() override; ~ToolbarView() override;

View File

@ -1,11 +1,11 @@
diff --git third_party/widevine/cdm/BUILD.gn third_party/widevine/cdm/BUILD.gn diff --git third_party/widevine/cdm/BUILD.gn third_party/widevine/cdm/BUILD.gn
index 24668a4acf22d..ac1f02c0779e4 100644 index 91bcefa2f0698..9a5759239e590 100644
--- third_party/widevine/cdm/BUILD.gn --- third_party/widevine/cdm/BUILD.gn
+++ third_party/widevine/cdm/BUILD.gn +++ third_party/widevine/cdm/BUILD.gn
@@ -7,6 +7,7 @@ import("//build/config/chrome_build.gni") @@ -8,6 +8,7 @@ import("//build/config/chromeos/ui_mode.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/chromeos/ui_mode.gni") import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni") import("//build/config/features.gni")
import("//build/toolchain/toolchain.gni")
+import("//cef/libcef/features/features.gni") +import("//cef/libcef/features/features.gni")
import("//media/cdm/library_cdm/cdm_paths.gni") import("//media/cdm/library_cdm/cdm_paths.gni")
import("//media/media_options.gni") import("//media/media_options.gni")

View File

@ -1,16 +1,8 @@
diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h
index 7edfd5dd9c140..f018b8f085e65 100644 index eec7a23a657a4..982efc615ab06 100644
--- content/browser/devtools/devtools_instrumentation.h --- content/browser/devtools/devtools_instrumentation.h
+++ content/browser/devtools/devtools_instrumentation.h +++ content/browser/devtools/devtools_instrumentation.h
@@ -11,6 +11,7 @@ @@ -87,7 +87,7 @@ bool ApplyUserAgentMetadataOverrides(
#include <vector>
+#include "content/common/content_export.h"
#include "content/common/navigation_params.mojom.h"
#include "content/public/browser/certificate_request_result_type.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
@@ -81,7 +82,7 @@ bool ApplyUserAgentMetadataOverrides(
FrameTreeNode* frame_tree_node, FrameTreeNode* frame_tree_node,
absl::optional<blink::UserAgentMetadata>* override_out); absl::optional<blink::UserAgentMetadata>* override_out);

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc
index 181732fa49c2d..29eeb60091ce6 100644 index 1891a950448c9..cf6cdb676edc9 100644
--- chrome/browser/download/download_target_determiner.cc --- chrome/browser/download/download_target_determiner.cc
+++ chrome/browser/download/download_target_determiner.cc +++ chrome/browser/download/download_target_determiner.cc
@@ -677,7 +677,7 @@ void IsHandledBySafePlugin(int render_process_id, @@ -677,7 +677,7 @@ void IsHandledBySafePlugin(int render_process_id,
@ -49,10 +49,10 @@ index d0a5a12620bd3..a02e13bbd8154 100644
false /* allow_wildcard */, is_stale, &plugin_info, false /* allow_wildcard */, is_stale, &plugin_info,
nullptr /* actual_mime_type */); nullptr /* actual_mime_type */);
diff --git chrome/browser/ui/views/frame/browser_root_view.cc chrome/browser/ui/views/frame/browser_root_view.cc diff --git chrome/browser/ui/views/frame/browser_root_view.cc chrome/browser/ui/views/frame/browser_root_view.cc
index 92dced6c08aa4..73cdaf388123b 100644 index 6e2d09885b457..da23a0211754b 100644
--- chrome/browser/ui/views/frame/browser_root_view.cc --- chrome/browser/ui/views/frame/browser_root_view.cc
+++ chrome/browser/ui/views/frame/browser_root_view.cc +++ chrome/browser/ui/views/frame/browser_root_view.cc
@@ -82,7 +82,7 @@ void OnFindURLMimeType(const GURL& url, @@ -85,7 +85,7 @@ void OnFindURLMimeType(const GURL& url,
#if BUILDFLAG(ENABLE_PLUGINS) #if BUILDFLAG(ENABLE_PLUGINS)
content::WebPluginInfo plugin; content::WebPluginInfo plugin;
result = result || content::PluginService::GetInstance()->GetPluginInfo( result = result || content::PluginService::GetInstance()->GetPluginInfo(
@ -62,10 +62,10 @@ index 92dced6c08aa4..73cdaf388123b 100644
#endif #endif
diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc
index 30267bc6d214e..c01f4ff040c05 100644 index 38f24359a5a25..3c724e29facbd 100644
--- content/browser/devtools/devtools_http_handler.cc --- content/browser/devtools/devtools_http_handler.cc
+++ content/browser/devtools/devtools_http_handler.cc +++ content/browser/devtools/devtools_http_handler.cc
@@ -574,7 +574,7 @@ void DevToolsHttpHandler::OnJsonRequest( @@ -575,7 +575,7 @@ void DevToolsHttpHandler::OnJsonRequest(
version.SetString("Protocol-Version", version.SetString("Protocol-Version",
DevToolsAgentHost::GetProtocolVersion()); DevToolsAgentHost::GetProtocolVersion());
version.SetString("WebKit-Version", GetWebKitVersion()); version.SetString("WebKit-Version", GetWebKitVersion());
@ -75,10 +75,10 @@ index 30267bc6d214e..c01f4ff040c05 100644
GetContentClient()->browser()->GetUserAgent()); GetContentClient()->browser()->GetUserAgent());
version.SetString("V8-Version", V8_VERSION_STRING); version.SetString("V8-Version", V8_VERSION_STRING);
diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc
index 178a234311337..51555a02e2409 100644 index 4d0c1a27449d5..34bb0372c7f8f 100644
--- content/browser/loader/navigation_url_loader_impl.cc --- content/browser/loader/navigation_url_loader_impl.cc
+++ content/browser/loader/navigation_url_loader_impl.cc +++ content/browser/loader/navigation_url_loader_impl.cc
@@ -633,6 +633,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest( @@ -631,6 +631,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest(
resource_request_->has_user_gesture, resource_request_->has_user_gesture,
resource_request_->request_initiator, &loader_factory); resource_request_->request_initiator, &loader_factory);
@ -92,7 +92,7 @@ index 178a234311337..51555a02e2409 100644
if (loader_factory) { if (loader_factory) {
factory = base::MakeRefCounted<network::WrapperSharedURLLoaderFactory>( factory = base::MakeRefCounted<network::WrapperSharedURLLoaderFactory>(
std::move(loader_factory)); std::move(loader_factory));
@@ -853,7 +860,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse( @@ -863,7 +870,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse(
frame_tree_node->current_frame_host()->GetProcess()->GetID(); frame_tree_node->current_frame_host()->GetProcess()->GetID();
int routing_id = frame_tree_node->current_frame_host()->GetRoutingID(); int routing_id = frame_tree_node->current_frame_host()->GetRoutingID();
bool has_plugin = PluginService::GetInstance()->GetPluginInfo( bool has_plugin = PluginService::GetInstance()->GetPluginInfo(
@ -188,10 +188,10 @@ index 632ae86c6fd69..55b749ec12421 100644
const std::vector<WebPluginInfo>& all_plugins); const std::vector<WebPluginInfo>& all_plugins);
diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc
index b4c2b23799188..3bdc6327c2c18 100644 index d3401f43eadaf..582486dad6500 100644
--- content/browser/renderer_host/render_frame_host_impl.cc --- content/browser/renderer_host/render_frame_host_impl.cc
+++ content/browser/renderer_host/render_frame_host_impl.cc +++ content/browser/renderer_host/render_frame_host_impl.cc
@@ -11216,6 +11216,7 @@ void RenderFrameHostImpl::BindHungDetectorHost( @@ -11827,6 +11827,7 @@ void RenderFrameHostImpl::BindHungDetectorHost(
} }
void RenderFrameHostImpl::GetPluginInfo(const GURL& url, void RenderFrameHostImpl::GetPluginInfo(const GURL& url,
@ -199,7 +199,7 @@ index b4c2b23799188..3bdc6327c2c18 100644
const url::Origin& main_frame_origin, const url::Origin& main_frame_origin,
const std::string& mime_type, const std::string& mime_type,
GetPluginInfoCallback callback) { GetPluginInfoCallback callback) {
@@ -11223,7 +11224,8 @@ void RenderFrameHostImpl::GetPluginInfo(const GURL& url, @@ -11834,7 +11835,8 @@ void RenderFrameHostImpl::GetPluginInfo(const GURL& url,
WebPluginInfo info; WebPluginInfo info;
std::string actual_mime_type; std::string actual_mime_type;
bool found = PluginServiceImpl::GetInstance()->GetPluginInfo( bool found = PluginServiceImpl::GetInstance()->GetPluginInfo(
@ -210,10 +210,10 @@ index b4c2b23799188..3bdc6327c2c18 100644
std::move(callback).Run(found, info, actual_mime_type); std::move(callback).Run(found, info, actual_mime_type);
} }
diff --git content/browser/renderer_host/render_frame_host_impl.h content/browser/renderer_host/render_frame_host_impl.h diff --git content/browser/renderer_host/render_frame_host_impl.h content/browser/renderer_host/render_frame_host_impl.h
index a2eb6268b937d..625518ccf5971 100644 index 275239e659e11..514bfa186c70b 100644
--- content/browser/renderer_host/render_frame_host_impl.h --- content/browser/renderer_host/render_frame_host_impl.h
+++ content/browser/renderer_host/render_frame_host_impl.h +++ content/browser/renderer_host/render_frame_host_impl.h
@@ -2383,6 +2383,7 @@ class CONTENT_EXPORT RenderFrameHostImpl @@ -2530,6 +2530,7 @@ class CONTENT_EXPORT RenderFrameHostImpl
int32_t plugin_child_id, int32_t plugin_child_id,
const base::FilePath& path) override; const base::FilePath& path) override;
void GetPluginInfo(const GURL& url, void GetPluginInfo(const GURL& url,
@ -234,7 +234,7 @@ index a544bfed7ed85..60aad01350c2f 100644
string mime_type) => string mime_type) =>
(bool found, (bool found,
diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc
index 0a22650086512..847cea49a484d 100644 index b5022114e4e19..7d8f17f9e39ac 100644
--- content/public/browser/content_browser_client.cc --- content/public/browser/content_browser_client.cc
+++ content/public/browser/content_browser_client.cc +++ content/public/browser/content_browser_client.cc
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
@ -247,7 +247,7 @@ index 0a22650086512..847cea49a484d 100644
#include <utility> #include <utility>
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
index 71d40028ce3ea..440305180e643 100644 index 799490ac3f7c0..fe921248a0818 100644
--- content/public/browser/content_browser_client.h --- content/public/browser/content_browser_client.h
+++ content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h
@@ -32,6 +32,7 @@ @@ -32,6 +32,7 @@
@ -258,7 +258,7 @@ index 71d40028ce3ea..440305180e643 100644
#include "content/public/common/page_visibility_state.h" #include "content/public/common/page_visibility_state.h"
#include "content/public/common/window_container_type.mojom-forward.h" #include "content/public/common/window_container_type.mojom-forward.h"
#include "device/vr/buildflags/buildflags.h" #include "device/vr/buildflags/buildflags.h"
@@ -1763,6 +1764,14 @@ class CONTENT_EXPORT ContentBrowserClient { @@ -1762,6 +1763,14 @@ class CONTENT_EXPORT ContentBrowserClient {
const absl::optional<url::Origin>& initiating_origin, const absl::optional<url::Origin>& initiating_origin,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory); mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory);
@ -273,7 +273,7 @@ index 71d40028ce3ea..440305180e643 100644
// Creates an OverlayWindow to be used for Picture-in-Picture. This window // Creates an OverlayWindow to be used for Picture-in-Picture. This window
// will house the content shown when in Picture-in-Picture mode. This will // will house the content shown when in Picture-in-Picture mode. This will
// return a new OverlayWindow. // return a new OverlayWindow.
@@ -1836,6 +1845,10 @@ class CONTENT_EXPORT ContentBrowserClient { @@ -1835,6 +1844,10 @@ class CONTENT_EXPORT ContentBrowserClient {
// Used as part of the user agent string. // Used as part of the user agent string.
virtual std::string GetProduct(); virtual std::string GetProduct();
@ -285,10 +285,10 @@ index 71d40028ce3ea..440305180e643 100644
virtual std::string GetUserAgent(); virtual std::string GetUserAgent();
diff --git content/public/browser/plugin_service.h content/public/browser/plugin_service.h diff --git content/public/browser/plugin_service.h content/public/browser/plugin_service.h
index 90fb0fcfa822b..d48e64b1573ca 100644 index edcc4c1747123..29eea000a9100 100644
--- content/public/browser/plugin_service.h --- content/public/browser/plugin_service.h
+++ content/public/browser/plugin_service.h +++ content/public/browser/plugin_service.h
@@ -73,6 +73,7 @@ class CONTENT_EXPORT PluginService { @@ -78,6 +78,7 @@ class CONTENT_EXPORT PluginService {
virtual bool GetPluginInfo(int render_process_id, virtual bool GetPluginInfo(int render_process_id,
int render_frame_id, int render_frame_id,
const GURL& url, const GURL& url,
@ -309,10 +309,10 @@ index 570b5a4738b94..923a5f7195c53 100644
WebPluginInfo* plugin) = 0; WebPluginInfo* plugin) = 0;
diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h
index 601633452b5f9..03bc3f8e5f70a 100644 index 7ec0901cf6ba2..db5b5529a4cda 100644
--- content/public/renderer/content_renderer_client.h --- content/public/renderer/content_renderer_client.h
+++ content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h
@@ -81,6 +81,9 @@ class CONTENT_EXPORT ContentRendererClient { @@ -82,6 +82,9 @@ class CONTENT_EXPORT ContentRendererClient {
// binding requests from RenderProcessHost::BindReceiver(). // binding requests from RenderProcessHost::BindReceiver().
virtual void ExposeInterfacesToBrowser(mojo::BinderMap* binders) {} virtual void ExposeInterfacesToBrowser(mojo::BinderMap* binders) {}
@ -322,7 +322,7 @@ index 601633452b5f9..03bc3f8e5f70a 100644
// Notifies that a new RenderFrame has been created. // Notifies that a new RenderFrame has been created.
virtual void RenderFrameCreated(RenderFrame* render_frame) {} virtual void RenderFrameCreated(RenderFrame* render_frame) {}
@@ -292,6 +295,10 @@ class CONTENT_EXPORT ContentRendererClient { @@ -293,6 +296,10 @@ class CONTENT_EXPORT ContentRendererClient {
// This method may invalidate the frame. // This method may invalidate the frame.
virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {} virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {}
@ -334,10 +334,10 @@ index 601633452b5f9..03bc3f8e5f70a 100644
// started. // started.
virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {}
diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
index aa5503a16409a..b1da8198722e2 100644 index 21a03f22e32f6..e550d97161ee4 100644
--- content/renderer/render_frame_impl.cc --- content/renderer/render_frame_impl.cc
+++ content/renderer/render_frame_impl.cc +++ content/renderer/render_frame_impl.cc
@@ -3177,7 +3177,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( @@ -3304,7 +3304,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
WebPluginInfo info; WebPluginInfo info;
std::string mime_type; std::string mime_type;
bool found = false; bool found = false;
@ -348,10 +348,10 @@ index aa5503a16409a..b1da8198722e2 100644
&mime_type); &mime_type);
if (!found) if (!found)
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
index 5bb7fec55d93e..634ccfc09889a 100644 index d372704f462dc..29fc97bd3e48b 100644
--- content/renderer/render_thread_impl.cc --- content/renderer/render_thread_impl.cc
+++ content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc
@@ -599,6 +599,8 @@ void RenderThreadImpl::Init() { @@ -607,6 +607,8 @@ void RenderThreadImpl::Init() {
GetContentClient()->renderer()->CreateURLLoaderThrottleProvider( GetContentClient()->renderer()->CreateURLLoaderThrottleProvider(
blink::URLLoaderThrottleProviderType::kFrame); blink::URLLoaderThrottleProviderType::kFrame);
@ -361,10 +361,10 @@ index 5bb7fec55d93e..634ccfc09889a 100644
&RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this))); &RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this)));
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
index 1ee1fdf477745..74e3ddf4d19dc 100644 index 2ca27e17e9e10..e4b443d28af38 100644
--- content/renderer/renderer_blink_platform_impl.cc --- content/renderer/renderer_blink_platform_impl.cc
+++ content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc
@@ -1110,6 +1110,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { @@ -1107,6 +1107,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -381,12 +381,12 @@ index 1ee1fdf477745..74e3ddf4d19dc 100644
if (!code_cache_host_) { if (!code_cache_host_) {
code_cache_host_ = mojo::SharedRemote<blink::mojom::CodeCacheHost>( code_cache_host_ = mojo::SharedRemote<blink::mojom::CodeCacheHost>(
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
index faa1d91bf74a9..81e367bfb9b10 100644 index cb8770a47a808..34df834f31b83 100644
--- content/renderer/renderer_blink_platform_impl.h --- content/renderer/renderer_blink_platform_impl.h
+++ content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h
@@ -255,6 +255,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { @@ -258,6 +258,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
std::unique_ptr<blink::WebV8ValueConverter> CreateWebV8ValueConverter() const blink::WebURL& url,
override; blink::WebVector<blink::WebContentSecurityPolicyHeader>* csp) override;
+ void DevToolsAgentAttached() override; + void DevToolsAgentAttached() override;
+ void DevToolsAgentDetached() override; + void DevToolsAgentDetached() override;
@ -418,27 +418,3 @@ index 337b4b0653fe2..107ab4c9d8a85 100644
const url::Origin& main_frame_origin, const url::Origin& main_frame_origin,
WebPluginInfo* plugin) override; WebPluginInfo* plugin) override;
diff --git content/test/fake_plugin_service.cc content/test/fake_plugin_service.cc
index f816fe5382c7e..7846e2b908675 100644
--- content/test/fake_plugin_service.cc
+++ content/test/fake_plugin_service.cc
@@ -28,6 +28,7 @@ bool FakePluginService::GetPluginInfoArray(
bool FakePluginService::GetPluginInfo(int render_process_id,
int render_frame_id,
const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
const std::string& mime_type,
bool allow_wildcard,
diff --git content/test/fake_plugin_service.h content/test/fake_plugin_service.h
index e5f53ee41161e..b9d73ebee4ec8 100644
--- content/test/fake_plugin_service.h
+++ content/test/fake_plugin_service.h
@@ -29,6 +29,7 @@ class FakePluginService : public PluginService {
bool GetPluginInfo(int render_process_id,
int render_frame_id,
const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
const std::string& mime_type,
bool allow_wildcard,

Some files were not shown because too many files have changed in this diff Show More