chore: bump chromium to 118.0.5975.0 (main) (#39531)

* chore: bump chromium in DEPS to 118.0.5951.0

* chore: update printing.patch

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4727894

No logic changes, but patch needed to be manually re-applied due to upstream code shear

* chore: update port_autofill_colors_to_the_color_pipeline.patch

No manual changes; patch applied with fuzz

* chore: update patches

* chore: bump chromium in DEPS to 118.0.5953.0

* chore: update patches

* chore: bump chromium in DEPS to 118.0.5955.0

* chore: update patches

* chore: bump chromium in DEPS to 118.0.5957.0

* chore: update patches

* chore: include path of native_web_keyboard_event.h

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4758689

* chore: remove reference to eextensions/browser/notification-types.h

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4771627

* chore: update references to renamed upstream field NativeWebKeyboardEvent.skip_if_unhandled (formerly known as skip_in_browser

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4758689

Need a second pair of eyes on this commit. In particular the reference in content_converter.cc, skipInBrowser, seems to not be set or documented anywhere? Is this unused/vestigal code?

* chore: sync signature of ElectronExtensionsBrowserClient::IsValidContext() to upstream change

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4784198

* chore: add auto_pip_setting_helper.[cc,h] to chromium_src build

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4688277

Exiting upstream code used by chromium_src now depends on this new upstream class

* chore: bump chromium in DEPS to 118.0.5959.0

* chore: update add_maximized_parameter_to_linuxui_getwindowframeprovider.patch

Xref: add_maximized_parameter_to_linuxui_getwindowframeprovider.patch

manually adjust patch to minor upstream chagnes

* chore: update patches

* chore: bump chromium in DEPS to 118.0.5961.0

* chore: bump chromium in DEPS to 118.0.5963.0

* chore: update patches

* 4780994: Rename various base files to "apple" since iOS uses them too
https://chromium-review.googlesource.com/c/chromium/src/+/4780994

* Many files moved from `mac` -> `apple`

This commit follows a handful of CLs that simply rename files/symbols to change `mac`
to `apple`
to signify their use across both macOS and iOS:
- 4784010: Move scoped_nsautorelease_pool to base/apple, leave a forwarding header
- 4790744: Move foundation_util to base/apple, leave a forwarding header
- 4790741: Move scoped_cftypreref to base/apple, leave a forwarding header
- 4787627: Move and rename macOS+iOS base/ files in PA to "apple"
- 4780399: Move OSStatus logging to base/apple
- 4787387: Remove forwarding headers
- 4781113: Rename message_pump_mac to "apple" because iOS uses it too

* fixup minor patch update error

A function param got dropped from this patch somewhere earlier

* chore: bump chromium in DEPS to 118.0.5965.2

* chore: update patches

* 4799213: Move ScopedTypeRef and ScopedCFTypeRef into base::apple::
https://chromium-review.googlesource.com/c/chromium/src/+/4799213

* Fix removed include to BrowserContext

In crrev.com/c/4767962 an include to BrowserContext was removed,
which was necessary for compilation. This broke only for us because
"chrome/browser/profiles/profile.h" includes that class, but we remove
all references to profiles.

* chore: bump chromium in DEPS to 118.0.5967.0

* chore: update patches

* chore: bump chromium in DEPS to 118.0.5969.0

* chore: update patches

* chore: bump chromium in DEPS to 118.0.5971.0

* chore: bump chromium in DEPS to 118.0.5973.0

* chore: update patches

* 4772121: [OOPIF PDF] Replace PDFWebContentsHelper with PDFDocumentHelper
https://chromium-review.googlesource.com/c/chromium/src/+/4772121

* 4811164: [Extensions] Do some cleanup in ChromeManagementAPIDelegate.
https://chromium-review.googlesource.com/c/chromium/src/+/4811164

* 4809488: Remove duplicate dnd functionality between Web and Renderer prefs
https://chromium-review.googlesource.com/c/chromium/src/+/4809488

Given that this is no longer an option of web preferences, we should
consider deprecating this option and then removing it.

* chore: bump chromium in DEPS to 118.0.5975.0

* chore: update patches

* fixup! chore: add auto_pip_settings_helper.{cc|h} to chromium_src build

* Reland "[windows] Remove RegKey::DeleteEmptyKey"

Refs https://chromium-review.googlesource.com/c/chromium/src/+/4813255

* Ensure StrCat means StrCat

Refs https://chromium-review.googlesource.com/c/chromium/src/+/1117180

* fixup! Remove RegKey::DeleteEmptyKey

* Consistently reject large p and large q in DH

Refs https://boringssl-review.googlesource.com/c/boringssl/+/62226

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
This commit is contained in:
electron-roller[bot]
2023-09-01 15:54:59 +09:00
committed by GitHub
parent 0b0707145b
commit 89117fdd99
112 changed files with 652 additions and 519 deletions

View File

@@ -7,9 +7,9 @@
#include "shell/app/electron_library_main.h"
#include "base/apple/bundle_locations.h"
#include "base/apple/scoped_nsautorelease_pool.h"
#include "base/at_exit.h"
#include "base/i18n/icu_util.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "content/public/app/content_main.h"
#include "electron/fuses.h"
#include "shell/app/electron_main_delegate.h"
@@ -33,7 +33,7 @@ int ElectronInitializeICUandStartNode(int argc, char* argv[]) {
}
base::AtExitManager atexit_manager;
base::mac::ScopedNSAutoreleasePool pool;
base::apple::ScopedNSAutoreleasePool pool;
base::apple::SetOverrideFrameworkBundlePath(
electron::MainApplicationBundlePath()
.Append("Contents")

View File

@@ -7,9 +7,9 @@
#include <string>
#include "base/apple/bundle_locations.h"
#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/mac/foundation_util.h"
#include "base/path_service.h"
#include "base/strings/sys_string_conversions.h"
#include "content/browser/mac_helpers.h"
@@ -78,7 +78,7 @@ void ElectronMainDelegate::SetUpBundleOverrides() {
NSString* team_id = [bundle objectForInfoDictionaryKey:@"ElectronTeamID"];
if (team_id)
base_bundle_id = base::SysNSStringToUTF8(team_id) + "." + base_bundle_id;
base::mac::SetBaseBundleID(base_bundle_id.c_str());
base::apple::SetBaseBundleID(base_bundle_id.c_str());
}
}

View File

@@ -5,7 +5,7 @@
#include <cstdlib>
#include <memory>
#include "base/allocator/early_zone_registration_mac.h"
#include "base/allocator/early_zone_registration_apple.h"
#include "electron/buildflags/buildflags.h"
#include "electron/fuses.h"
#include "shell/app/electron_library_main.h"

View File

@@ -13,7 +13,7 @@
#import <LocalAuthentication/LocalAuthentication.h>
#import <Security/Security.h>
#include "base/mac/scoped_cftyperef.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
@@ -423,8 +423,8 @@ v8::Local<v8::Promise> SystemPreferences::PromptTouchID(
v8::Local<v8::Promise> handle = promise.GetHandle();
LAContext* context = [[LAContext alloc] init];
base::ScopedCFTypeRef<SecAccessControlRef> access_control =
base::ScopedCFTypeRef<SecAccessControlRef>(
base::apple::ScopedCFTypeRef<SecAccessControlRef> access_control =
base::apple::ScopedCFTypeRef<SecAccessControlRef>(
SecAccessControlCreateWithFlags(
kCFAllocatorDefault, kSecAttrAccessibleWhenUnlockedThisDeviceOnly,
kSecAccessControlPrivateKeyUsage | kSecAccessControlUserPresence,

View File

@@ -43,7 +43,6 @@
#include "content/public/browser/download_request_utils.h"
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/file_select_listener.h"
#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/navigation_handle.h"
@@ -56,6 +55,7 @@
#include "content/public/browser/site_instance.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/input/native_web_keyboard_event.h"
#include "content/public/common/referrer_type_converters.h"
#include "content/public/common/result_codes.h"
#include "content/public/common/webplugininfo.h"
@@ -183,8 +183,8 @@
#endif // BUILDFLAG(ENABLE_PRINTING)
#if BUILDFLAG(ENABLE_PDF_VIEWER)
#include "components/pdf/browser/pdf_web_contents_helper.h" // nogncheck
#include "shell/browser/electron_pdf_web_contents_helper_client.h"
#include "components/pdf/browser/pdf_document_helper.h" // nogncheck
#include "shell/browser/electron_pdf_document_helper_client.h"
#endif
#if BUILDFLAG(ENABLE_PLUGINS)
@@ -499,7 +499,7 @@ absl::optional<base::TimeDelta> GetCursorBlinkInterval() {
// sanity checking of device_name validity and so will crash on invalid names.
bool IsDeviceNameValid(const std::u16string& device_name) {
#if BUILDFLAG(IS_MAC)
base::ScopedCFTypeRef<CFStringRef> new_printer_id(
base::apple::ScopedCFTypeRef<CFStringRef> new_printer_id(
base::SysUTF16ToCFStringRef(device_name));
PMPrinter new_printer = PMPrinterCreateFromPrinterID(new_printer_id.get());
bool printer_exists = new_printer != nullptr;
@@ -1018,12 +1018,6 @@ void WebContents::InitWithWebContents(
PrintViewManagerElectron::CreateForWebContents(web_contents.get());
#endif
#if BUILDFLAG(ENABLE_PDF_VIEWER)
pdf::PDFWebContentsHelper::CreateForWebContentsWithClient(
web_contents.get(),
std::make_unique<ElectronPDFWebContentsHelperClient>());
#endif
// Determine whether the WebContents is offscreen.
auto* web_preferences = WebContentsPreferences::From(web_contents.get());
offscreen_ = web_preferences && web_preferences->IsOffscreen();

View File

@@ -38,7 +38,7 @@ bool WebContents::IsFocused() const {
bool WebContents::PlatformHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) {
if (event.skip_in_browser ||
if (event.skip_if_unhandled ||
event.GetType() == content::NativeWebKeyboardEvent::Type::kChar)
return false;

View File

@@ -10,10 +10,10 @@
#include "base/apple/bridging.h"
#include "base/apple/bundle_locations.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/i18n/rtl.h"
#include "base/mac/mac_util.h"
#include "base/mac/mac_util.mm"
#include "base/mac/scoped_cftyperef.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/browser/browser_process.h"
@@ -50,9 +50,9 @@ bool IsAppRTL() {
NSString* GetAppPathForProtocol(const GURL& url) {
NSURL* ns_url = [NSURL
URLWithString:base::SysUTF8ToNSString(url.possibly_invalid_spec())];
base::ScopedCFTypeRef<CFErrorRef> out_err;
base::apple::ScopedCFTypeRef<CFErrorRef> out_err;
base::ScopedCFTypeRef<CFURLRef> openingApp(
base::apple::ScopedCFTypeRef<CFURLRef> openingApp(
LSCopyDefaultApplicationURLForURL(base::apple::NSToCFPtrCast(ns_url),
kLSRolesAll, out_err.InitializeInto()));
@@ -82,7 +82,7 @@ bool CheckLoginItemStatus(bool* is_hidden) {
if (!login_items.Initialize())
return false;
base::ScopedCFTypeRef<LSSharedFileListItemRef> item(
base::apple::ScopedCFTypeRef<LSSharedFileListItemRef> item(
login_items.GetLoginItemForMainApp());
if (!item.get())
return false;
@@ -156,7 +156,7 @@ void Browser::Show() {
}
void Browser::AddRecentDocument(const base::FilePath& path) {
NSString* path_string = base::mac::FilePathToNSString(path);
NSString* path_string = base::apple::FilePathToNSString(path);
if (!path_string)
return;
NSURL* u = [NSURL fileURLWithPath:path_string];
@@ -193,7 +193,7 @@ bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol,
CFStringRef other = nil;
for (CFIndex i = 0; i < CFArrayGetCount(bundleList); ++i) {
other =
base::mac::CFCast<CFStringRef>(CFArrayGetValueAtIndex(bundleList, i));
base::apple::CFCast<CFStringRef>(CFArrayGetValueAtIndex(bundleList, i));
if (![identifier isEqualToString:(__bridge NSString*)other]) {
break;
}
@@ -238,8 +238,9 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol,
// TODO(codebytere): Use -[NSWorkspace URLForApplicationToOpenURL:] instead
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
base::ScopedCFTypeRef<CFStringRef> bundleId(LSCopyDefaultHandlerForURLScheme(
base::apple::NSToCFPtrCast(protocol_ns)));
base::apple::ScopedCFTypeRef<CFStringRef> bundleId(
LSCopyDefaultHandlerForURLScheme(
base::apple::NSToCFPtrCast(protocol_ns)));
#pragma clang diagnostic pop
if (!bundleId)
return false;

View File

@@ -410,7 +410,10 @@ bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol,
}
// If now empty, delete the whole key
classesKey.DeleteEmptyKey(wprotocol.c_str());
if (protocolKey.GetValueCount().value_or(1) == 0) {
classesKey.DeleteKey(wprotocol.c_str(),
base::win::RegKey::RecursiveDelete(false));
}
return true;
} else {

View File

@@ -115,6 +115,7 @@
#include "shell/common/platform_util.h"
#include "shell/common/thread_restrictions.h"
#include "third_party/blink/public/common/loader/url_loader_throttle.h"
#include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h"
#include "third_party/blink/public/common/tokens/tokens.h"
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
#include "third_party/blink/public/mojom/badging/badging.mojom.h"
@@ -205,10 +206,11 @@
#if BUILDFLAG(ENABLE_PDF_VIEWER)
#include "chrome/browser/pdf/chrome_pdf_stream_delegate.h"
#include "chrome/browser/plugins/pdf_iframe_navigation_throttle.h" // nogncheck
#include "components/pdf/browser/pdf_document_helper.h" // nogncheck
#include "components/pdf/browser/pdf_navigation_throttle.h"
#include "components/pdf/browser/pdf_url_loader_request_interceptor.h"
#include "components/pdf/browser/pdf_web_contents_helper.h" // nogncheck
#include "components/pdf/common/internal_plugin_helpers.h"
#include "shell/browser/electron_pdf_document_helper_client.h"
#endif
using content::BrowserThread;
@@ -424,7 +426,10 @@ void ElectronBrowserClient::OverrideWebkitPrefs(
prefs->allow_running_insecure_content = false;
prefs->default_minimum_page_scale_factor = 1.f;
prefs->default_maximum_page_scale_factor = 1.f;
prefs->navigate_on_drag_drop = false;
blink::RendererPreferences* renderer_prefs =
web_contents->GetMutableRendererPrefs();
renderer_prefs->can_accept_load_drops = false;
ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi();
prefs->preferred_color_scheme =
@@ -437,7 +442,7 @@ void ElectronBrowserClient::OverrideWebkitPrefs(
// Custom preferences of guest page.
auto* web_preferences = WebContentsPreferences::From(web_contents);
if (web_preferences) {
web_preferences->OverrideWebkitPrefs(prefs);
web_preferences->OverrideWebkitPrefs(prefs, renderer_prefs);
}
}
@@ -1483,8 +1488,9 @@ void ElectronBrowserClient::
associated_registry.AddInterface<pdf::mojom::PdfService>(base::BindRepeating(
[](content::RenderFrameHost* render_frame_host,
mojo::PendingAssociatedReceiver<pdf::mojom::PdfService> receiver) {
pdf::PDFWebContentsHelper::BindPdfService(std::move(receiver),
render_frame_host);
pdf::PDFDocumentHelper::BindPdfService(
std::move(receiver), render_frame_host,
std::make_unique<ElectronPDFDocumentHelperClient>());
},
&render_frame_host));
#endif

View File

@@ -7,7 +7,7 @@
#include <string>
#include "base/apple/bundle_locations.h"
#include "base/mac/foundation_util.h"
#include "base/apple/foundation_util.h"
#include "base/path_service.h"
#include "services/device/public/cpp/geolocation/geolocation_manager.h"
#include "services/device/public/cpp/geolocation/system_geolocation_source_mac.h"

View File

@@ -2,17 +2,15 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "shell/browser/electron_pdf_web_contents_helper_client.h"
#include "shell/browser/electron_pdf_document_helper_client.h"
#include "chrome/browser/pdf/pdf_frame_util.h"
#include "content/public/browser/web_contents.h"
ElectronPDFWebContentsHelperClient::ElectronPDFWebContentsHelperClient() =
default;
ElectronPDFWebContentsHelperClient::~ElectronPDFWebContentsHelperClient() =
default;
ElectronPDFDocumentHelperClient::ElectronPDFDocumentHelperClient() = default;
ElectronPDFDocumentHelperClient::~ElectronPDFDocumentHelperClient() = default;
content::RenderFrameHost* ElectronPDFWebContentsHelperClient::FindPdfFrame(
content::RenderFrameHost* ElectronPDFDocumentHelperClient::FindPdfFrame(
content::WebContents* contents) {
content::RenderFrameHost* main_frame = contents->GetPrimaryMainFrame();
content::RenderFrameHost* pdf_frame =
@@ -20,13 +18,13 @@ content::RenderFrameHost* ElectronPDFWebContentsHelperClient::FindPdfFrame(
return pdf_frame ? pdf_frame : main_frame;
}
void ElectronPDFWebContentsHelperClient::UpdateContentRestrictions(
void ElectronPDFDocumentHelperClient::UpdateContentRestrictions(
content::RenderFrameHost* render_frame_host,
int content_restrictions) {}
void ElectronPDFWebContentsHelperClient::OnPDFHasUnsupportedFeature(
void ElectronPDFDocumentHelperClient::OnPDFHasUnsupportedFeature(
content::WebContents* contents) {}
void ElectronPDFWebContentsHelperClient::OnSaveURL(
void ElectronPDFDocumentHelperClient::OnSaveURL(
content::WebContents* contents) {}
void ElectronPDFWebContentsHelperClient::SetPluginCanSave(
void ElectronPDFDocumentHelperClient::SetPluginCanSave(
content::RenderFrameHost* render_frame_host,
bool can_save) {}

View File

@@ -1,23 +1,22 @@
// Copyright (c) 2015 Slack Technologies, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ELECTRON_SHELL_BROWSER_ELECTRON_PDF_WEB_CONTENTS_HELPER_CLIENT_H_
#define ELECTRON_SHELL_BROWSER_ELECTRON_PDF_WEB_CONTENTS_HELPER_CLIENT_H_
#ifndef ELECTRON_SHELL_BROWSER_ELECTRON_PDF_DOCUMENT_HELPER_CLIENT_H_
#define ELECTRON_SHELL_BROWSER_ELECTRON_PDF_DOCUMENT_HELPER_CLIENT_H_
#include "components/pdf/browser/pdf_web_contents_helper_client.h"
#include "components/pdf/browser/pdf_document_helper_client.h"
namespace content {
class WebContents;
}
class ElectronPDFWebContentsHelperClient
: public pdf::PDFWebContentsHelperClient {
class ElectronPDFDocumentHelperClient : public pdf::PDFDocumentHelperClient {
public:
ElectronPDFWebContentsHelperClient();
~ElectronPDFWebContentsHelperClient() override;
ElectronPDFDocumentHelperClient();
~ElectronPDFDocumentHelperClient() override;
private:
// pdf::PDFWebContentsHelperClient
// pdf::PDFDocumentHelperClient
content::RenderFrameHost* FindPdfFrame(
content::WebContents* contents) override;
void UpdateContentRestrictions(content::RenderFrameHost* render_frame_host,
@@ -28,4 +27,4 @@ class ElectronPDFWebContentsHelperClient
bool can_save) override;
};
#endif // ELECTRON_SHELL_BROWSER_ELECTRON_PDF_WEB_CONTENTS_HELPER_CLIENT_H_
#endif // ELECTRON_SHELL_BROWSER_ELECTRON_PDF_DOCUMENT_HELPER_CLIENT_H_

View File

@@ -103,18 +103,6 @@ extensions::LaunchType ElectronManagementAPIDelegate::GetLaunchType(
return extensions::LAUNCH_TYPE_DEFAULT;
}
void ElectronManagementAPIDelegate::
GetPermissionWarningsByManifestFunctionDelegate(
extensions::ManagementGetPermissionWarningsByManifestFunction* function,
const std::string& manifest_str) const {
data_decoder::DataDecoder::ParseJsonIsolated(
manifest_str,
base::BindOnce(
&extensions::ManagementGetPermissionWarningsByManifestFunction::
OnParse,
function));
}
std::unique_ptr<extensions::InstallPromptDelegate>
ElectronManagementAPIDelegate::SetEnabledFunctionDelegate(
content::WebContents* web_contents,

View File

@@ -24,9 +24,6 @@ class ElectronManagementAPIDelegate : public extensions::ManagementAPIDelegate {
extensions::LaunchType GetLaunchType(
const extensions::ExtensionPrefs* prefs,
const extensions::Extension* extension) const override;
void GetPermissionWarningsByManifestFunctionDelegate(
extensions::ManagementGetPermissionWarningsByManifestFunction* function,
const std::string& manifest_str) const override;
std::unique_ptr<extensions::InstallPromptDelegate> SetEnabledFunctionDelegate(
content::WebContents* web_contents,
content::BrowserContext* browser_context,

View File

@@ -27,7 +27,6 @@
#include "extensions/browser/api/app_runtime/app_runtime_api.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/management_policy.h"
#include "extensions/browser/notification_types.h"
#include "extensions/browser/null_app_sorting.h"
#include "extensions/browser/quota_service.h"
#include "extensions/browser/service_worker_manager.h"

View File

@@ -23,8 +23,8 @@
#endif
#if BUILDFLAG(ENABLE_PDF_VIEWER)
#include "components/pdf/browser/pdf_web_contents_helper.h" // nogncheck
#include "shell/browser/electron_pdf_web_contents_helper_client.h"
#include "components/pdf/browser/pdf_document_helper.h" // nogncheck
#include "shell/browser/electron_pdf_document_helper_client.h"
#endif
namespace extensions {
@@ -96,11 +96,6 @@ void ElectronExtensionsAPIClient::AttachWebContentsHelpers(
electron::PrintViewManagerElectron::CreateForWebContents(web_contents);
#endif
#if BUILDFLAG(ENABLE_PDF_VIEWER)
pdf::PDFWebContentsHelper::CreateForWebContentsWithClient(
web_contents, std::make_unique<ElectronPDFWebContentsHelperClient>());
#endif
extensions::ElectronExtensionWebContentsObserver::CreateForWebContents(
web_contents);
}

View File

@@ -85,7 +85,7 @@ bool ElectronExtensionsBrowserClient::AreExtensionsDisabled(
return false;
}
bool ElectronExtensionsBrowserClient::IsValidContext(BrowserContext* context) {
bool ElectronExtensionsBrowserClient::IsValidContext(void* context) {
auto& context_map = ElectronBrowserContext::browser_context_map();
for (auto const& entry : context_map) {
if (entry.second && entry.second.get() == context)

View File

@@ -48,7 +48,7 @@ class ElectronExtensionsBrowserClient
bool IsShuttingDown() override;
bool AreExtensionsDisabled(const base::CommandLine& command_line,
content::BrowserContext* context) override;
bool IsValidContext(content::BrowserContext* context) override;
bool IsValidContext(void* context) override;
bool IsSameContext(content::BrowserContext* first,
content::BrowserContext* second) override;
bool HasOffTheRecordContext(content::BrowserContext* context) override;

View File

@@ -9,11 +9,11 @@
#include <vector>
#include "base/apple/foundation_util.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/mac/foundation_util.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "third_party/zlib/google/zip.h"
@@ -102,7 +102,7 @@ void FileSelectHelper::ProcessSelectedFilesMac(
std::vector<base::FilePath> temporary_files;
for (auto& file_info : files_out) {
NSString* filename = base::mac::FilePathToNSString(file_info.local_path);
NSString* filename = base::apple::FilePathToNSString(file_info.local_path);
BOOL isPackage =
[[NSWorkspace sharedWorkspace] isFilePackageAtPath:filename];
if (isPackage && base::DirectoryExists(file_info.local_path)) {

View File

@@ -13,8 +13,8 @@
#include <utility>
#include <vector>
#include "base/apple/scoped_cftyperef.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/strings/sys_string_conversions.h"
#include "components/remote_cocoa/app_shim/native_widget_ns_window_bridge.h"
#include "components/remote_cocoa/browser/scoped_cg_window_id.h"
@@ -1152,7 +1152,7 @@ bool NativeWindowMac::IsKiosk() {
}
void NativeWindowMac::SetBackgroundColor(SkColor color) {
base::ScopedCFTypeRef<CGColorRef> cgcolor(
base::apple::ScopedCFTypeRef<CGColorRef> cgcolor(
skia::CGColorCreateFromSkColor(color));
[[[window_ contentView] layer] setBackgroundColor:cgcolor];
}

View File

@@ -11,7 +11,7 @@ namespace electron {
void OffScreenHostDisplayClient::OnDisplayReceivedCALayerParams(
const gfx::CALayerParams& ca_layer_params) {
if (!ca_layer_params.is_empty) {
base::ScopedCFTypeRef<IOSurfaceRef> io_surface(
base::apple::ScopedCFTypeRef<IOSurfaceRef> io_surface(
IOSurfaceLookupFromMachPort(ca_layer_params.io_surface_mach_port));
gfx::Size pixel_size_ = ca_layer_params.pixel_size;
@@ -19,7 +19,7 @@ void OffScreenHostDisplayClient::OnDisplayReceivedCALayerParams(
size_t stride = IOSurfaceGetBytesPerRow(io_surface);
struct IOSurfacePinner {
base::ScopedCFTypeRef<IOSurfaceRef> io_surface;
base::apple::ScopedCFTypeRef<IOSurfaceRef> io_surface;
};
SkBitmap bitmap;

View File

@@ -9,9 +9,9 @@
#include <sys/types.h>
#include <unistd.h>
#include "base/apple/osstatus_logging.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/mac/mac_logging.h"
#include "base/posix/eintr_wrapper.h"
#include "base/process/launch.h"
#include "base/strings/sys_string_conversions.h"

View File

@@ -5,7 +5,7 @@
#ifndef ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_BUNDLE_MOVER_H_
#define ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_BUNDLE_MOVER_H_
#include "base/mac/foundation_util.h"
#include "base/apple/foundation_util.h"
#include "shell/common/gin_helper/error_thrower.h"
namespace gin {

View File

@@ -8,8 +8,8 @@
#include <string>
#include <utility>
#include "base/apple/foundation_util.h"
#include "base/logging.h"
#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/browser_task_traits.h"
@@ -104,7 +104,7 @@ NSArray* ConvertSharingItemToNS(const SharingItem& item) {
}
if (item.file_paths) {
for (const base::FilePath& path : *item.file_paths)
[result addObject:base::mac::FilePathToNSURL(path)];
[result addObject:base::apple::FilePathToNSURL(path)];
}
if (item.urls) {
for (const GURL& url : *item.urls)
@@ -134,9 +134,8 @@ NSArray* ConvertSharingItemToNS(const SharingItem& item) {
}
+ (electron::ElectronMenuModel*)getFrom:(id)instance {
return
[base::mac::ObjCCastStrict<WeakPtrToElectronMenuModelAsNSObject>(instance)
menuModel];
return [base::apple::ObjCCastStrict<WeakPtrToElectronMenuModelAsNSObject>(
instance) menuModel];
}
- (instancetype)initWithModel:(electron::ElectronMenuModel*)model {
@@ -482,10 +481,10 @@ NSArray* ConvertSharingItemToNS(const SharingItem& item) {
// Performs the share action using the sharing service represented by |sender|.
- (void)performShare:(NSMenuItem*)sender {
NSDictionary* object =
base::mac::ObjCCastStrict<NSDictionary>([sender representedObject]);
base::apple::ObjCCastStrict<NSDictionary>([sender representedObject]);
NSSharingService* service =
base::mac::ObjCCastStrict<NSSharingService>(object[@"service"]);
NSArray* items = base::mac::ObjCCastStrict<NSArray>(object[@"items"]);
base::apple::ObjCCastStrict<NSSharingService>(object[@"service"]);
NSArray* items = base::apple::ObjCCastStrict<NSArray>(object[@"items"]);
[service setDelegate:self];
[service performWithItems:items];
}

View File

@@ -8,8 +8,8 @@
#include <vector>
#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/mac/foundation_util.h"
// Contents largely copied from
// chrome/browser/download/drag_download_item_mac.mm.
@@ -53,7 +53,7 @@ void DragFileItems(const std::vector<base::FilePath>& files,
NSMutableArray* file_items = [NSMutableArray array];
for (auto const& file : files) {
NSURL* file_url = base::mac::FilePathToNSURL(file);
NSURL* file_url = base::apple::FilePathToNSURL(file);
NSDraggingItem* file_item =
[[NSDraggingItem alloc] initWithPasteboardWriter:file_url];
NSImage* file_image = icon.ToNSImage();

View File

@@ -11,10 +11,10 @@
#import <Cocoa/Cocoa.h>
#import <CoreServices/CoreServices.h>
#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_util.h"
#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/strings/sys_string_conversions.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"

View File

@@ -8,7 +8,7 @@
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/message_loop/message_pump_mac.h"
#include "base/message_loop/message_pump_apple.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/current_thread.h"
#include "content/public/browser/browser_task_traits.h"

View File

@@ -10,8 +10,8 @@
#include "shell/browser/ui/autofill_popup.h"
#include "base/memory/raw_ptr.h"
#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/common/input/native_web_keyboard_event.h"
#include "electron/buildflags/buildflags.h"
#include "shell/browser/osr/osr_view_proxy.h"
#include "third_party/abseil-cpp/absl/types/optional.h"

View File

@@ -6,7 +6,7 @@
#include <memory>
#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/common/input/native_web_keyboard_event.h"
#include "shell/browser/native_window.h"
#include "shell/browser/ui/views/menu_bar.h"

View File

@@ -29,6 +29,7 @@
#include "content/public/browser/ax_event_notification_details.h"
#include "content/public/browser/ax_inspect_factory.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/navigation_entry.h"

View File

@@ -396,14 +396,19 @@ void WebContentsPreferences::SaveLastPreferences() {
}
void WebContentsPreferences::OverrideWebkitPrefs(
blink::web_pref::WebPreferences* prefs) {
blink::web_pref::WebPreferences* prefs,
blink::RendererPreferences* renderer_prefs) {
prefs->javascript_enabled = javascript_;
prefs->images_enabled = images_;
prefs->animation_policy = image_animation_policy_;
prefs->text_areas_are_resizable = text_areas_are_resizable_;
prefs->navigate_on_drag_drop = navigate_on_drag_drop_;
prefs->autoplay_policy = autoplay_policy_;
// TODO: navigate_on_drag_drop was removed from web prefs in favor of the
// equivalent option in renderer prefs. this option should be deprecated from
// our API and then removed here.
renderer_prefs->can_accept_load_drops = navigate_on_drag_drop_;
// Check if webgl should be enabled.
prefs->webgl1_enabled = webgl_;
prefs->webgl2_enabled = webgl_;

View File

@@ -13,6 +13,7 @@
#include "base/values.h"
#include "content/public/browser/web_contents_user_data.h"
#include "electron/buildflags/buildflags.h"
#include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h"
#include "third_party/blink/public/mojom/v8_cache_options.mojom-forward.h"
#include "third_party/blink/public/mojom/webpreferences/web_preferences.mojom-forward.h"
@@ -48,7 +49,8 @@ class WebContentsPreferences
bool is_subframe);
// Modify the WebPreferences according to preferences.
void OverrideWebkitPrefs(blink::web_pref::WebPreferences* prefs);
void OverrideWebkitPrefs(blink::web_pref::WebPreferences* prefs,
blink::RendererPreferences* renderer_prefs);
base::Value* last_preference() { return &last_web_preferences_; }

View File

@@ -12,7 +12,7 @@
#import <QuickLook/QuickLook.h>
#import <QuickLookThumbnailing/QuickLookThumbnailing.h>
#include "base/mac/foundation_util.h"
#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "gin/arguments.h"
#include "shell/common/gin_converters/image_converter.h"
@@ -53,7 +53,7 @@ v8::Local<v8::Promise> NativeImage::CreateThumbnailFromPath(
CGSize cg_size = size.ToCGSize();
NSURL* nsurl = base::mac::FilePathToNSURL(path);
NSURL* nsurl = base::apple::FilePathToNSURL(path);
// We need to explicitly check if the user has passed an invalid path
// because QLThumbnailGenerationRequest will generate a stock file icon

View File

@@ -6,7 +6,7 @@
#include <string>
#include "base/mac/foundation_util.h"
#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "shell/common/mac/main_application_bundle.h"

View File

@@ -12,10 +12,10 @@
#include <string>
#include "base/apple/bundle_locations.h"
#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/strings/sys_string_conversions.h"
#include "shell/common/asar/asar_util.h"
@@ -45,7 +45,7 @@ absl::optional<IntegrityPayload> Archive::HeaderIntegrity() const {
return absl::nullopt;
NSString* ns_relative_path =
base::mac::FilePathToNSString(relative_path.value());
base::apple::FilePathToNSString(relative_path.value());
NSDictionary* integrity_payload = [integrity objectForKey:ns_relative_path];

View File

@@ -8,8 +8,8 @@
#include "base/containers/fixed_flat_map.h"
#include "content/public/browser/context_menu_params.h"
#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/input/native_web_keyboard_event.h"
#include "shell/browser/api/electron_api_web_contents.h"
#include "shell/browser/web_contents_permission_helper.h"
#include "shell/common/gin_converters/blink_converter.h"
@@ -342,7 +342,7 @@ bool Converter<content::NativeWebKeyboardEvent>::FromV8(
return false;
if (!ConvertFromV8(isolate, val, static_cast<blink::WebKeyboardEvent*>(out)))
return false;
dict.Get("skipInBrowser", &out->skip_in_browser);
dict.Get("skipIfUnhandled", &out->skip_if_unhandled);
return true;
}

View File

@@ -6,8 +6,8 @@
#include "shell/common/mac/main_application_bundle.h"
#include "base/apple/bundle_locations.h"
#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/mac/foundation_util.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "content/browser/mac_helpers.h"
@@ -56,7 +56,7 @@ base::FilePath MainApplicationBundlePath() {
}
NSBundle* MainApplicationBundle() {
return [NSBundle bundleWithPath:base::mac::FilePathToNSString(
return [NSBundle bundleWithPath:base::apple::FilePathToNSString(
MainApplicationBundlePath())];
}

View File

@@ -11,12 +11,12 @@
#import <Cocoa/Cocoa.h>
#import <ServiceManagement/ServiceManagement.h>
#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/callback.h"
#include "base/logging.h"
#include "base/mac/foundation_util.h"
#include "base/mac/mac_logging.h"
#include "base/mac/scoped_aedesc.h"
#include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.h"

View File

@@ -6,6 +6,8 @@
#include <windows.h> // windows.h must be included first
#include "base/win/shlwapi.h" // NOLINT(build/include_order)
#include <atlbase.h>
#include <comdef.h>
#include <commdlg.h>