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

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

View File

@@ -207,7 +207,8 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
content::WebContents* OpenURLFromTab(
content::WebContents* source,
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,
std::unique_ptr<content::WebContents> new_contents,
const GURL& target_url,

View File

@@ -121,7 +121,6 @@
#include "services/service_manager/public/mojom/connector.mojom.h"
#include "storage/browser/quota/quota_settings.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/web/web_window_features.h"
#include "third_party/widevine/cdm/buildflags.h"
@@ -465,23 +464,6 @@ base::FilePath GetRootCachePath() {
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
AlloyContentBrowserClient::AlloyContentBrowserClient() {
@@ -957,11 +939,13 @@ void AlloyContentBrowserClient::OverrideWebkitPrefs(
// Using RVH instead of RFH here because rvh->GetMainFrame() may be nullptr
// 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()) {
rvh->GetWidget()->GetView()->SetBackgroundColor(
prefs->base_background_color);
rvh->GetWidget()->GetView()->SetBackgroundColor(base_background_color);
}
}
@@ -1250,7 +1234,7 @@ AlloyContentBrowserClient::GetNetworkContextsParentDirectory() {
bool AlloyContentBrowserClient::HandleExternalProtocol(
const GURL& url,
content::WebContents::OnceGetter web_contents_getter,
content::WebContents::Getter web_contents_getter,
int child_id,
int frame_tree_node_id,
content::NavigationUIData* navigation_data,
@@ -1299,7 +1283,6 @@ AlloyContentBrowserClient::CreateWindowForPictureInPicture(
void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForFrame(
content::RenderFrameHost* render_frame_host,
mojo::BinderMapWithContext<content::RenderFrameHost*>* map) {
PopulateChromeFrameBinders(map);
CefBrowserFrame::RegisterBrowserInterfaceBindersForFrame(render_frame_host,
map);
@@ -1377,7 +1360,7 @@ bool AlloyContentBrowserClient::ArePersistentMediaDeviceIDsAllowed(
// Persistent MediaDevice IDs are allowed if cookies are allowed.
return CookieSettingsFactory::GetForProfile(
Profile::FromBrowserContext(browser_context))
->IsCookieAccessAllowed(url, site_for_cookies, top_frame_origin);
->IsFullCookieAccessAllowed(url, site_for_cookies, top_frame_origin);
}
bool AlloyContentBrowserClient::ShouldAllowPluginCreation(

View File

@@ -178,7 +178,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
std::vector<base::FilePath> GetNetworkContextsParentDirectory() override;
bool HandleExternalProtocol(
const GURL& url,
content::WebContents::OnceGetter web_contents_getter,
content::WebContents::Getter web_contents_getter,
int child_id,
int frame_tree_node_id,
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_widget_host.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"
namespace {
@@ -141,10 +142,12 @@ void CefBrowserPlatformDelegateAlloy::AddNewContents(
}
}
bool CefBrowserPlatformDelegateAlloy::ShouldTransferNavigation(
bool is_main_frame_navigation) {
bool CefBrowserPlatformDelegateAlloy::
ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) {
if (extension_host_) {
return extension_host_->ShouldTransferNavigation(is_main_frame_navigation);
return extension_host_->ShouldAllowRendererInitiatedCrossProcessNavigation(
is_main_frame_navigation);
}
return true;
}

View File

@@ -27,7 +27,8 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
const gfx::Rect& initial_rect,
bool user_gesture,
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 RenderViewReady() override;
void BrowserCreated(CefBrowserHostBase* browser) override;

View File

@@ -372,3 +372,9 @@ BuildState* ChromeBrowserProcessAlloy::GetBuildState() {
NOTREACHED();
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()
override;
BuildState* GetBuildState() override;
SerialPolicyAllowedPorts* serial_policy_allowed_ports() override;
private:
bool initialized_;