Update to Chromium version 112.0.5615.0

- Windows: VS2022 and Win11 SDK 10.0.22621.0 are now required.
This commit is contained in:
Marshall Greenblatt
2023-02-27 13:52:38 -05:00
parent 3c85154faf
commit 584b19967a
82 changed files with 622 additions and 549 deletions

View File

@@ -52,7 +52,6 @@
#include "base/stl_util.h"
#include "base/threading/thread_restrictions.h"
#include "cef/grit/cef_resources.h"
#include "chrome/browser/accessibility/live_caption_unavailability_notifier.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h"
@@ -82,6 +81,7 @@
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/services/printing/printing_service.h"
#include "chrome/services/speech/buildflags/buildflags.h"
#include "components/content_settings/core/browser/cookie_settings.h"
#include "components/embedder_support/switches.h"
#include "components/embedder_support/user_agent_utils.h"
@@ -157,9 +157,12 @@
#endif
#if BUILDFLAG(IS_WIN)
#if BUILDFLAG(ENABLE_SPEECH_SERVICE)
#include "media/mojo/mojom/renderer_extensions.mojom.h"
#endif
#include "net/ssl/client_cert_store_win.h"
#include "sandbox/win/src/sandbox_policy.h"
#endif
#endif // BUILDFLAG(IS_WIN)
#if BUILDFLAG(USE_NSS_CERTS)
#include "net/ssl/client_cert_store_nss.h"
@@ -284,10 +287,12 @@ void BindBadgeServiceForServiceWorker(
const content::ServiceWorkerVersionBaseInfo& info,
mojo::PendingReceiver<blink::mojom::BadgeService> receiver) {}
#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_SPEECH_SERVICE)
void BindMediaFoundationRendererNotifierHandler(
content::RenderFrameHost* frame_host,
mojo::PendingReceiver<media::mojom::MediaFoundationRendererNotifier>
receiver) {}
#endif
void BindNetworkHintsHandler(
content::RenderFrameHost* frame_host,
@@ -1250,8 +1255,10 @@ void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForFrame(
map);
map->Add<blink::mojom::BadgeService>(base::BindRepeating(&BindBadgeService));
#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_SPEECH_SERVICE)
map->Add<media::mojom::MediaFoundationRendererNotifier>(
base::BindRepeating(&BindMediaFoundationRendererNotifierHandler));
#endif
map->Add<network_hints::mojom::NetworkHintsHandler>(
base::BindRepeating(&BindNetworkHintsHandler));
@@ -1358,10 +1365,8 @@ bool AlloyContentBrowserClient::ArePersistentMediaDeviceIDsAllowed(
// Persistent MediaDevice IDs are allowed if cookies are allowed.
return CookieSettingsFactory::GetForProfile(
Profile::FromBrowserContext(browser_context))
->IsFullCookieAccessAllowed(
url, site_for_cookies, top_frame_origin,
net::CookieSettingOverrides(),
content_settings::CookieSettings::QueryReason::kSiteStorage);
->IsFullCookieAccessAllowed(url, site_for_cookies, top_frame_origin,
net::CookieSettingOverrides());
}
void AlloyContentBrowserClient::OnWebContentsCreated(

View File

@@ -30,6 +30,7 @@
#include "base/path_service.h"
#include "chrome/browser/chrome_browser_main.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "content/public/browser/navigation_throttle.h"

View File

@@ -195,8 +195,12 @@ bool TabsUpdateFunction::UpdateURL(const std::string& url_string,
int tab_id,
std::string* error) {
GURL url;
if (!ExtensionTabUtil::PrepareURLForNavigation(url_string, extension(), &url,
error)) {
auto url_expected =
ExtensionTabUtil::PrepareURLForNavigation(url_string, extension());
if (url_expected.has_value()) {
url = *url_expected;
} else {
*error = std::move(url_expected.error());
return false;
}

View File

@@ -43,6 +43,7 @@ const char* const kSupportedAPIs[] = {
ContentSettingsContentSettingGetResourceIdentifiersFunction),
"pdfViewerPrivate",
EXTENSION_FUNCTION_NAME(PdfViewerPrivateIsAllowedLocalFileAccessFunction),
EXTENSION_FUNCTION_NAME(PdfViewerPrivateIsPdfOcrAlwaysActiveFunction),
"resourcesPrivate",
EXTENSION_FUNCTION_NAME(ResourcesPrivateGetStringsFunction),
"storage",
@@ -91,6 +92,7 @@ void ChromeFunctionRegistry::RegisterAll(ExtensionFunctionRegistry* registry) {
ContentSettingsContentSettingGetResourceIdentifiersFunction>();
registry
->RegisterFunction<PdfViewerPrivateIsAllowedLocalFileAccessFunction>();
registry->RegisterFunction<PdfViewerPrivateIsPdfOcrAlwaysActiveFunction>();
registry->RegisterFunction<ResourcesPrivateGetStringsFunction>();
registry->RegisterFunction<StorageStorageAreaGetFunction>();
registry->RegisterFunction<StorageStorageAreaSetFunction>();

View File

@@ -324,9 +324,12 @@ std::unique_ptr<api::tabs::Tab> CefExtensionFunctionDetails::OpenTab(
GURL url;
if (params.url.has_value()) {
std::string url_string = *params.url;
if (!ExtensionTabUtil::PrepareURLForNavigation(
url_string, function()->extension(), &url, error_message)) {
auto url_expected = ExtensionTabUtil::PrepareURLForNavigation(
*params.url, function()->extension());
if (url_expected.has_value()) {
url = *url_expected;
} else {
*error_message = std::move(url_expected.error());
return nullptr;
}
}

View File

@@ -34,7 +34,7 @@ void CefExtensionHostDelegate::CreateTab(
std::unique_ptr<content::WebContents> web_contents,
const std::string& extension_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_rect,
const blink::mojom::WindowFeatures& window_features,
bool user_gesture) {
// TODO(cef): Add support for extensions opening popup windows.
NOTIMPLEMENTED();

View File

@@ -27,7 +27,7 @@ class CefExtensionHostDelegate : public ExtensionHostDelegate {
void CreateTab(std::unique_ptr<content::WebContents> web_contents,
const std::string& extension_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_rect,
const blink::mojom::WindowFeatures& window_features,
bool user_gesture) override;
void ProcessMediaAccessRequest(content::WebContents* web_contents,
const content::MediaStreamRequest& request,

View File

@@ -12,6 +12,7 @@
#include "libcef/browser/context.h"
#include "libcef/browser/thread_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/file_select_helper.h"
#include "content/public/browser/file_select_listener.h"
#include "content/public/browser/render_frame_host.h"

View File

@@ -251,16 +251,14 @@ bool CefBrowserPlatformDelegateNativeWin::CreateHostWindow() {
// Add a reference that will later be released in DestroyBrowser().
browser_->AddRef();
if (!called_enable_non_client_dpi_scaling_ && has_frame_ &&
base::win::IsProcessPerMonitorDpiAware()) {
if (!called_enable_non_client_dpi_scaling_ && has_frame_) {
// This call gets Windows to scale the non-client area when WM_DPICHANGED
// is fired on Windows versions < 10.0.14393.0.
// Derived signature; not available in headers.
static auto enable_child_window_dpi_message_func = []() {
using EnableChildWindowDpiMessagePtr = LRESULT(WINAPI*)(HWND, BOOL);
return reinterpret_cast<EnableChildWindowDpiMessagePtr>(GetProcAddress(
GetModuleHandle(L"user32.dll"), "EnableChildWindowDpiMessage"));
}();
using EnableChildWindowDpiMessagePtr = LRESULT(WINAPI*)(HWND, BOOL);
static const auto enable_child_window_dpi_message_func =
reinterpret_cast<EnableChildWindowDpiMessagePtr>(
base::win::GetUser32FunctionPointer("EnableChildWindowDpiMessage"));
if (enable_child_window_dpi_message_func) {
enable_child_window_dpi_message_func(window_info_.window, TRUE);
}
@@ -622,15 +620,15 @@ LRESULT CALLBACK CefBrowserPlatformDelegateNativeWin::WndProc(HWND hwnd,
gfx::SetWindowUserData(hwnd, platform_delegate);
platform_delegate->window_info_.window = hwnd;
if (platform_delegate->has_frame_ &&
base::win::IsProcessPerMonitorDpiAware()) {
if (platform_delegate->has_frame_) {
// This call gets Windows to scale the non-client area when
// WM_DPICHANGED is fired on Windows versions >= 10.0.14393.0.
static auto enable_non_client_dpi_scaling_func = []() {
return reinterpret_cast<decltype(::EnableNonClientDpiScaling)*>(
GetProcAddress(GetModuleHandle(L"user32.dll"),
"EnableNonClientDpiScaling"));
}();
using EnableNonClientDpiScalingPtr =
decltype(::EnableNonClientDpiScaling)*;
static const auto enable_non_client_dpi_scaling_func =
reinterpret_cast<EnableNonClientDpiScalingPtr>(
base::win::GetUser32FunctionPointer(
"EnableNonClientDpiScaling"));
platform_delegate->called_enable_non_client_dpi_scaling_ =
!!(enable_non_client_dpi_scaling_func &&
enable_non_client_dpi_scaling_func(hwnd));

View File

@@ -433,7 +433,8 @@ class CefBrowserURLRequest::Context
}
}
void OnRedirect(const net::RedirectInfo& redirect_info,
void OnRedirect(const GURL& url_before_redirect,
const net::RedirectInfo& redirect_info,
const network::mojom::URLResponseHead& response_head,
std::vector<std::string>* removed_headers) {
DCHECK(CalledOnValidThread());

View File

@@ -111,8 +111,10 @@ struct PopulateAxNodeAttributes {
case ax::mojom::IntAttribute::kDropeffect:
case ax::mojom::IntAttribute::kMemberOfId:
case ax::mojom::IntAttribute::kNextFocusId:
case ax::mojom::IntAttribute::kNextWindowFocusId:
case ax::mojom::IntAttribute::kNextOnLineId:
case ax::mojom::IntAttribute::kPreviousFocusId:
case ax::mojom::IntAttribute::kPreviousWindowFocusId:
case ax::mojom::IntAttribute::kPreviousOnLineId:
case ax::mojom::IntAttribute::kSetSize:
case ax::mojom::IntAttribute::kPosInSet:

View File

@@ -908,15 +908,17 @@ void CefRenderWidgetHostViewOSR::NotifyHostAndDelegateOnWasShown(
NOTREACHED();
}
void CefRenderWidgetHostViewOSR::RequestPresentationTimeFromHostOrDelegate(
blink::mojom::RecordContentToVisibleTimeRequestPtr visible_time_request) {
void CefRenderWidgetHostViewOSR::
RequestSuccessfulPresentationTimeFromHostOrDelegate(
blink::mojom::RecordContentToVisibleTimeRequestPtr
visible_time_request) {
// We don't call RenderWidgetHostViewBase::OnShowWithPageVisibility, so this
// method should not be called.
NOTREACHED();
}
void CefRenderWidgetHostViewOSR::
CancelPresentationTimeRequestForHostAndDelegate() {
CancelSuccessfulPresentationTimeRequestForHostAndDelegate() {
// We don't call RenderWidgetHostViewBase::OnShowWithPageVisibility, so this
// method should not be called.
NOTREACHED();

View File

@@ -198,10 +198,10 @@ class CefRenderWidgetHostViewOSR
void NotifyHostAndDelegateOnWasShown(
blink::mojom::RecordContentToVisibleTimeRequestPtr visible_time_request)
override;
void RequestPresentationTimeFromHostOrDelegate(
void RequestSuccessfulPresentationTimeFromHostOrDelegate(
blink::mojom::RecordContentToVisibleTimeRequestPtr visible_time_request)
override;
void CancelPresentationTimeRequestForHostAndDelegate() override;
void CancelSuccessfulPresentationTimeRequestForHostAndDelegate() override;
void OnFrameComplete(const viz::BeginFrameAck& ack);

View File

@@ -26,7 +26,6 @@
#include "chrome/browser/media/webrtc/permission_bubble_media_access_handler.h"
#include "chrome/browser/net/profile_network_context_service.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/plugins/plugin_info_host_impl.h"
#include "chrome/browser/prefetch/prefetch_prefs.h"
#include "chrome/browser/prefs/chrome_command_line_pref_store.h"
#include "chrome/browser/printing/print_preview_sticky_settings.h"
@@ -74,9 +73,10 @@
#endif
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
#include "chrome/browser/profiles/profile_key.h"
#include "chrome/browser/supervised_user/supervised_user_pref_store.h"
#include "chrome/browser/supervised_user/supervised_user_settings_service.h"
#include "chrome/browser/supervised_user/supervised_user_settings_service_factory.h"
#include "components/supervised_user/core/browser/supervised_user_settings_service.h"
#endif
namespace browser_prefs {
@@ -176,7 +176,7 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
if (profile) {
// Used to store supervised user preferences.
SupervisedUserSettingsService* supervised_user_settings =
auto* supervised_user_settings =
SupervisedUserSettingsServiceFactory::GetForKey(
profile->GetProfileKey());
@@ -223,7 +223,6 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
certificate_transparency::prefs::RegisterPrefs(registry.get());
flags_ui::PrefServiceFlagsStorage::RegisterPrefs(registry.get());
media_router::RegisterLocalStatePrefs(registry.get());
PluginInfoHostImpl::RegisterUserPrefs(registry.get());
PrefProxyConfigTrackerImpl::RegisterPrefs(registry.get());
ProfileNetworkContextService::RegisterLocalStatePrefs(registry.get());
SSLConfigServiceManager::RegisterPrefs(registry.get());
@@ -310,6 +309,10 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
registry->RegisterBooleanPref(
prefs::kAccessControlAllowMethodsInCORSPreflightSpecConformant, true);
// Based on browser_prefs::RegisterProfilePrefs.
registry->RegisterBooleanPref(prefs::kAccessibilityPdfOcrAlwaysActive,
false);
// Spell checking preferences.
// Modify defaults from SpellcheckServiceFactory::RegisterProfilePrefs.
std::string spellcheck_lang =

View File

@@ -29,7 +29,7 @@ const char* GetTypeString(base::Value::Type type) {
return "STRING";
case base::Value::Type::BINARY:
return "BINARY";
case base::Value::Type::DICTIONARY:
case base::Value::Type::DICT:
return "DICTIONARY";
case base::Value::Type::LIST:
return "LIST";
@@ -57,7 +57,7 @@ CefRefPtr<CefValue> GetPreference(PrefService* pref_service,
CefRefPtr<CefDictionaryValue> GetAllPreferences(PrefService* pref_service,
bool include_defaults) {
// Returns a DeepCopy of the value.
base::Value values = pref_service->GetPreferenceValues(
auto values = pref_service->GetPreferenceValues(
include_defaults ? PrefService::INCLUDE_DEFAULTS
: PrefService::EXCLUDE_DEFAULTS);

View File

@@ -23,9 +23,6 @@
#include "ui/aura/test/ui_controls_factory_aura.h"
#include "ui/aura/window.h"
#include "ui/base/test/ui_controls_aura.h"
#if BUILDFLAG(IS_OZONE)
#include "ui/views/test/ui_controls_factory_desktop_aura_ozone.h"
#endif
#endif // defined(USE_AURA)
#if BUILDFLAG(IS_WIN)
@@ -45,8 +42,7 @@ void InitializeUITesting() {
ui_controls::InstallUIControlsAura(
aura::test::CreateUIControlsAura(nullptr));
#elif BUILDFLAG(IS_OZONE)
ui_controls::InstallUIControlsAura(
views::test::CreateUIControlsDesktopAuraOzone());
ui_controls::EnableUIControls();
#endif
#endif // defined(USE_AURA)

View File

@@ -33,7 +33,6 @@
#include "components/component_updater/component_updater_paths.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/embedder_support/switches.h"
#include "components/spellcheck/common/spellcheck_features.h"
#include "components/viz/common/features.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
@@ -260,12 +259,6 @@ absl::optional<int> AlloyMainDelegate::BasicStartupComplete() {
// parent windows (see issue #2805).
disable_features.push_back(features::kCalculateNativeWinOcclusion.name);
}
if (spellcheck::kWinUseBrowserSpellChecker.default_state ==
base::FEATURE_ENABLED_BY_DEFAULT) {
// TODO: Add support for windows spellcheck service (see issue #3055).
disable_features.push_back(spellcheck::kWinUseBrowserSpellChecker.name);
}
#endif // BUILDFLAG(IS_WIN)
if (features::kBackForwardCache.default_state ==

View File

@@ -17,6 +17,10 @@
#include "content/public/app/content_main_delegate.h"
#if BUILDFLAG(IS_WIN)
#include "components/spellcheck/common/spellcheck_features.h"
#endif
namespace base {
class CommandLine;
}
@@ -90,6 +94,12 @@ class AlloyMainDelegate : public content::ContentMainDelegate,
AlloyContentClient content_client_;
CefResourceBundleDelegate resource_bundle_delegate_;
#if BUILDFLAG(IS_WIN)
// TODO: Add support for windows spellcheck service (see issue #3055).
spellcheck::ScopedDisableBrowserSpellCheckerForTesting
disable_browser_spellchecker_;
#endif
};
#endif // CEF_LIBCEF_COMMON_ALLOY_ALLOY_MAIN_DELEGATE_H_

View File

@@ -418,7 +418,7 @@ void CefValueImpl::SetValueInternal(absl::optional<base::Value> value) {
case base::Value::Type::BINARY:
binary_value_ = new CefBinaryValueImpl(std::move(*value));
break;
case base::Value::Type::DICTIONARY:
case base::Value::Type::DICT:
dictionary_value_ =
new CefDictionaryValueImpl(std::move(*value), /*read_only=*/false);
break;
@@ -828,7 +828,7 @@ CefValueType CefDictionaryValueImpl::GetType(const CefString& key) {
return VTYPE_STRING;
case base::Value::Type::BINARY:
return VTYPE_BINARY;
case base::Value::Type::DICTIONARY:
case base::Value::Type::DICT:
return VTYPE_DICTIONARY;
case base::Value::Type::LIST:
return VTYPE_LIST;
@@ -1275,7 +1275,7 @@ CefValueType CefListValueImpl::GetType(size_t index) {
return VTYPE_STRING;
case base::Value::Type::BINARY:
return VTYPE_BINARY;
case base::Value::Type::DICTIONARY:
case base::Value::Type::DICT:
return VTYPE_DICTIONARY;
case base::Value::Type::LIST:
return VTYPE_LIST;

View File

@@ -72,6 +72,7 @@
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "content/public/renderer/render_frame.h"
#include "extensions/common/manifest_handlers/csp_info.h"
#include "extensions/common/switches.h"
#include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container_manager.h"