chore: bump chromium to 0e4ca9c0a63d7a39bd910997ad4c6 (master) (#24687)
* chore: bump chromium in DEPS to 1f1c4d91f6eaa4a033ec8f499d63a0717f79a42a * viz: Do not apply white level scaling for RGBA fp16 HDR video2296006
* Move WebPreferences to WebContents2263635
* Fix missing WeakPtr check in PreconnectManager2309029
* Fixup swiftshader roll revision * Update patch indices * Move WebDeviceEmulationParams into common.2303356
* Move EnableDisableDeviceEmulation to blink mojom messages2303367
* PDF Viewer: Remove flag for two-up view2311130
* Add mojom definition for DeviceEmulationParams.2303491
* Remove ServiceWorkerContextWatcher from PaymentAppInstaller2291186
* Loader: Move transferrable_url_loader.mojom into blink's mojom directory2306123
* chore: bump chromium in DEPS to 4974f436479739025a90ebc2cc2e36d67ee1ac46 * mac: Work around Xcode 12b3 SDK bug2315078
* Reland Update core items for macOS Big Sur.2315162
* Update Swiftshader revision * mac/arm64: When cross-building the snapshot, use page size of the target ISA instead of the host.2310575
* Update patch indices * Rename {,Non}ClientView::CanClose() to OnWindowCloseRequested()2247838
* chore: bump chromium in DEPS to e9465d70d1dea539400f0fddad43358ea3c31d71 * chore: bump chromium in DEPS to bd5b71c5f20288eb26068a39ae6e0579566a51c5 * chore: bump chromium in DEPS to 786ee543048bd07d07c5ac50b7dbbdd6bdd8dcce * chore: bump chromium in DEPS to 34eb6ecbf2c5894b648900bf771a2a29de204798 * chore: bump chromium in DEPS to 567ff038d68e3adb8116a01eec863cdf34d775f5 * chore: bump chromium in DEPS to 340b45c8d4ceb2dd61969fc34e1928d3c46db48c * chore: update patches * chore: base::DeleteFile with two params is removed Should use base::DeleteFile and base::DeletePathRecursively when appropriate Refs:2313376
* chore: add patch for NodePlatform::PostJob impl * chore: update patches * chore: extension file access is now instrumented Refs:2209995
* chore: implement SetWindowFrameInScreen in OSR RWHV Refs:2321409
* chore: NotifyUserActivation requires a type now This is just for a histogram thing and therefore it does not matter what we pass in Refs:2281303
* chore: update patches * chore: bump chromium in DEPS to cd570e6dd3dcb84463ac252b04e92ceb02d8400c * chore: update patches * chore: bump chromium in DEPS to 0187908a31866992b90c59719ac1d016328f6ee0 * chore: bump chromium in DEPS to 3c9df38c508f3dba26a75248beed4882ddfb98e9 * chore: bump chromium in DEPS to 1a47d3b9cee710bd3c958c4f2d8b205710df9d50 * chore: bump chromium in DEPS to baac93040d96abdab72d46dd034c60f86e108702 * chore: bump chromium in DEPS to 13836145f97299e636491de38064b78861c4fb2e * update patches * change OS_MACOSX -> OS_MAC Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=1105907 * patch: add header for ToExecutionContext in WebMessagePortConverter * chore: bump chromium in DEPS to 91ab9b6ac5d04dc034a03ad847fbfa8261328c2b * update patches * NeedToFireBeforeUnloadOrUnload -> NeedToFireBeforeUnloadOrUnloadEvents Refs:2288711
* chore: bump chromium in DEPS to 290deb11f0e30cb1382fd8f8793d340560283c23 * update patches * add dragdrop header for autofill popup * int -> x11::Time * patch out accessibility private API use Refs:2330812
* remove usage of XEvent Refs:2317767
* trigger recalculation of WebPreferences before renderer initialization Refs:2263635
* chore: bump chromium in DEPS to 6bdb484583b99c96ef3388d0c2184326581b2d5a * chore: bump chromium in DEPS to 1eb2a79cde04fd5c8ae51b4d813e6521635269e5 * chore: bump chromium in DEPS to 3dc8e3c0f400e4ca9c0a63d7a39bd910997ad4c6 * chore: update patches * fixup! trigger recalculation of WebPreferences before renderer initialization * views: Make MenuButton and RadioButton default constructible2339586
* chore: fix code style Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Samuel Attard <sattard@slack-corp.com> Co-authored-by: Andy Locascio <andy@slack-corp.com> Co-authored-by: deepak1556 <hop2deep@gmail.com>
This commit is contained in:
parent
3d2afa45c3
commit
8798571a77
169 changed files with 759 additions and 1018 deletions
|
@ -26,7 +26,7 @@
|
|||
#include "services/service_manager/embedder/switches.h"
|
||||
#include "shell/common/electron_paths.h"
|
||||
|
||||
#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
||||
#if defined(OS_POSIX) && !defined(OS_MAC)
|
||||
#include "components/version_info/version_info_values.h"
|
||||
#endif
|
||||
|
||||
|
@ -159,12 +159,12 @@ bool ElectronCrashReporterClient::GetCrashDumpLocation(
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX) || defined(OS_LINUX)
|
||||
#if defined(OS_MAC) || defined(OS_LINUX)
|
||||
bool ElectronCrashReporterClient::GetCrashMetricsLocation(
|
||||
base::FilePath* metrics_dir) {
|
||||
return base::PathService::Get(electron::DIR_USER_DATA, metrics_dir);
|
||||
}
|
||||
#endif // OS_MACOSX || OS_LINUX
|
||||
#endif // OS_MAC || OS_LINUX
|
||||
|
||||
bool ElectronCrashReporterClient::IsRunningUnattended() {
|
||||
return !collect_stats_consent_;
|
||||
|
@ -174,7 +174,7 @@ bool ElectronCrashReporterClient::GetCollectStatsConsent() {
|
|||
return collect_stats_consent_;
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
bool ElectronCrashReporterClient::ReportingIsEnforcedByPolicy(
|
||||
bool* breakpad_enabled) {
|
||||
return false;
|
||||
|
@ -196,7 +196,7 @@ void ElectronCrashReporterClient::GetProcessSimpleAnnotations(
|
|||
(*annotations)["ver"] = ELECTRON_VERSION_STRING;
|
||||
}
|
||||
|
||||
#if defined(OS_LINUX) || defined(OS_MACOSX)
|
||||
#if defined(OS_LINUX) || defined(OS_MAC)
|
||||
bool ElectronCrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ class ElectronCrashReporterClient : public crash_reporter::CrashReporterClient {
|
|||
bool GetCrashDumpLocation(base::FilePath* crash_dir) override;
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX) || defined(OS_LINUX)
|
||||
#if defined(OS_MAC) || defined(OS_LINUX)
|
||||
bool GetCrashMetricsLocation(base::FilePath* metrics_dir) override;
|
||||
#endif
|
||||
|
||||
|
@ -66,11 +66,11 @@ class ElectronCrashReporterClient : public crash_reporter::CrashReporterClient {
|
|||
void GetProcessSimpleAnnotations(
|
||||
std::map<std::string, std::string>* annotations) override;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
bool ReportingIsEnforcedByPolicy(bool* breakpad_enabled) override;
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX) || defined(OS_LINUX)
|
||||
#if defined(OS_MAC) || defined(OS_LINUX)
|
||||
bool ShouldMonitorCrashHandlerExpensively() override;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "build/build_config.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
extern "C" {
|
||||
__attribute__((visibility("default"))) int ElectronMain(int argc, char* argv[]);
|
||||
|
||||
|
@ -18,6 +18,6 @@ __attribute__((visibility("default"))) int ElectronInitializeICUandStartNode(
|
|||
char* argv[]);
|
||||
#endif
|
||||
}
|
||||
#endif // OS_MACOSX
|
||||
#endif // OS_MAC
|
||||
|
||||
#endif // SHELL_APP_ELECTRON_LIBRARY_MAIN_H_
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include <unistd.h>
|
||||
#include <cstdio>
|
||||
#include "shell/app/electron_library_main.h"
|
||||
#endif // defined(OS_MACOSX)
|
||||
#endif // defined(OS_MAC)
|
||||
|
||||
#include "base/at_exit.h"
|
||||
#include "base/i18n/icu_util.h"
|
||||
|
@ -274,4 +274,4 @@ int main(int argc, char* argv[]) {
|
|||
return ElectronMain(argc, argv);
|
||||
}
|
||||
|
||||
#endif // defined(OS_MACOSX)
|
||||
#endif // defined(OS_MAC)
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include "ui/base/resource/resource_bundle.h"
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
#include "shell/app/electron_main_delegate_mac.h"
|
||||
#endif
|
||||
|
||||
|
@ -91,7 +91,7 @@ bool SubprocessNeedsResourceBundle(const std::string& process_type) {
|
|||
// The zygote process opens the resources for the renderers.
|
||||
process_type == service_manager::switches::kZygoteProcess ||
|
||||
#endif
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
// Mac needs them too for scrollbar related images and for sandbox
|
||||
// profiles.
|
||||
process_type == ::switches::kPpapiPluginProcess ||
|
||||
|
@ -122,7 +122,7 @@ bool GetDefaultCrashDumpsPath(base::FilePath* path) {
|
|||
base::FilePath cur;
|
||||
if (!base::PathService::Get(DIR_USER_DATA, &cur))
|
||||
return false;
|
||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
||||
#if defined(OS_MAC) || defined(OS_WIN)
|
||||
cur = cur.Append(FILE_PATH_LITERAL("Crashpad"));
|
||||
#else
|
||||
cur = cur.Append(FILE_PATH_LITERAL("Crash Reports"));
|
||||
|
@ -156,7 +156,7 @@ void LoadResourceBundle(const std::string& locale) {
|
|||
|
||||
// Load other resource files.
|
||||
base::FilePath pak_dir;
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
pak_dir =
|
||||
base::mac::FrameworkBundlePath().Append(FILE_PATH_LITERAL("Resources"));
|
||||
#else
|
||||
|
@ -241,7 +241,7 @@ bool ElectronMainDelegate::BasicStartupComplete(int* exit_code) {
|
|||
kNonWildcardDomainNonPortSchemes, kNonWildcardDomainNonPortSchemesSize);
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
OverrideChildProcessPath();
|
||||
OverrideFrameworkBundlePath();
|
||||
SetUpBundleOverrides();
|
||||
|
@ -306,7 +306,7 @@ void ElectronMainDelegate::PostEarlyInitialization(bool is_running_tests) {
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
if (custom_locale.empty())
|
||||
l10n_util::OverrideLocaleWithCocoaLocale();
|
||||
#endif
|
||||
|
@ -335,7 +335,7 @@ void ElectronMainDelegate::PreSandboxStartup() {
|
|||
LoadResourceBundle(locale);
|
||||
}
|
||||
|
||||
#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(MAS_BUILD))
|
||||
#if defined(OS_WIN) || (defined(OS_MAC) && !defined(MAS_BUILD))
|
||||
// In the main process, we wait for JS to call crashReporter.start() before
|
||||
// initializing crashpad. If we're in the renderer, we want to initialize it
|
||||
// immediately at boot.
|
||||
|
@ -364,7 +364,7 @@ void ElectronMainDelegate::PreSandboxStartup() {
|
|||
// Allow file:// URIs to read other file:// URIs by default.
|
||||
command_line->AppendSwitch(::switches::kAllowFileAccessFromFiles);
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
// Enable AVFoundation.
|
||||
command_line->AppendSwitch("enable-avfoundation");
|
||||
#endif
|
||||
|
@ -376,7 +376,7 @@ void ElectronMainDelegate::PreCreateMainMessageLoop() {
|
|||
// flags and we need to make sure the feature list is initialized before the
|
||||
// service manager reads the features.
|
||||
InitializeFeatureList();
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
RegisterAtomCrApp();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ class ElectronMainDelegate : public content::ContentMainDelegate {
|
|||
#endif
|
||||
|
||||
private:
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void OverrideChildProcessPath();
|
||||
void OverrideFrameworkBundlePath();
|
||||
void SetUpBundleOverrides();
|
||||
|
|
|
@ -144,7 +144,7 @@ int NodeMain(int argc, char* argv[]) {
|
|||
ElectronCrashReporterClient::Create();
|
||||
#endif
|
||||
|
||||
#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(MAS_BUILD))
|
||||
#if defined(OS_WIN) || (defined(OS_MAC) && !defined(MAS_BUILD))
|
||||
crash_reporter::InitializeCrashpad(false, "node");
|
||||
#endif
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
#include "shell/browser/ui/win/jump_list.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include "shell/browser/ui/cocoa/electron_bundle_mover.h"
|
||||
#endif
|
||||
|
@ -690,7 +690,7 @@ void App::OnAccessibilitySupportChanged() {
|
|||
Emit("accessibility-support-changed", IsAccessibilitySupportEnabled());
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void App::OnWillContinueUserActivity(bool* prevent_default,
|
||||
const std::string& type) {
|
||||
if (Emit("will-continue-activity", type)) {
|
||||
|
@ -899,7 +899,7 @@ void App::ChildProcessLaunched(int process_type,
|
|||
const std::string& name) {
|
||||
auto pid = base::GetProcId(handle);
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
auto metrics = base::ProcessMetrics::CreateProcessMetrics(
|
||||
handle, content::BrowserChildProcessHost::GetPortProvider());
|
||||
#else
|
||||
|
@ -921,7 +921,7 @@ void App::SetAppPath(const base::FilePath& app_path) {
|
|||
app_path_ = app_path;
|
||||
}
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
void App::SetAppLogsPath(gin_helper::ErrorThrower thrower,
|
||||
base::Optional<base::FilePath> custom_path) {
|
||||
if (custom_path.has_value()) {
|
||||
|
@ -1027,7 +1027,7 @@ std::string App::GetLocaleCountryCode() {
|
|||
sizeof(locale_name) / sizeof(WCHAR))) {
|
||||
base::WideToUTF8(locale_name, wcslen(locale_name), ®ion);
|
||||
}
|
||||
#elif defined(OS_MACOSX)
|
||||
#elif defined(OS_MAC)
|
||||
CFLocaleRef locale = CFLocaleCopyCurrent();
|
||||
CFStringRef value = CFStringRef(
|
||||
static_cast<CFTypeRef>(CFLocaleGetValue(locale, kCFLocaleCountryCode)));
|
||||
|
@ -1374,7 +1374,7 @@ std::vector<gin_helper::Dictionary> App::GetAppMetrics(v8::Isolate* isolate) {
|
|||
pid_dict.Set("memory", memory_dict);
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
pid_dict.Set("sandboxed", process_metric.second->IsSandboxed());
|
||||
#elif defined(OS_WIN)
|
||||
auto integrity_level = process_metric.second->GetIntegrityLevel();
|
||||
|
@ -1413,7 +1413,7 @@ v8::Local<v8::Promise> App::GetGPUInfo(v8::Isolate* isolate,
|
|||
|
||||
auto* const info_mgr = GPUInfoManager::GetInstance();
|
||||
if (info_type == "complete") {
|
||||
#if defined(OS_WIN) || defined(OS_MACOSX)
|
||||
#if defined(OS_WIN) || defined(OS_MAC)
|
||||
info_mgr->FetchCompleteInfo(std::move(promise));
|
||||
#else
|
||||
info_mgr->FetchBasicInfo(std::move(promise));
|
||||
|
@ -1466,7 +1466,7 @@ bool App::CanBrowserClientUseCustomSiteInstance() {
|
|||
return ElectronBrowserClient::Get()->CanUseCustomSiteInstance();
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
bool App::MoveToApplicationsFolder(gin_helper::ErrorThrower thrower,
|
||||
gin::Arguments* args) {
|
||||
return ElectronBundleMover::Move(thrower, args);
|
||||
|
@ -1582,7 +1582,7 @@ gin::ObjectTemplateBuilder App::GetObjectTemplateBuilder(v8::Isolate* isolate) {
|
|||
base::BindRepeating(&Browser::SetLoginItemSettings, browser))
|
||||
.SetMethod("isEmojiPanelSupported",
|
||||
base::BindRepeating(&Browser::IsEmojiPanelSupported, browser))
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
.SetMethod("hide", base::BindRepeating(&Browser::Hide, browser))
|
||||
.SetMethod("show", base::BindRepeating(&Browser::Show, browser))
|
||||
.SetMethod("setUserActivity",
|
||||
|
@ -1604,7 +1604,7 @@ gin::ObjectTemplateBuilder App::GetObjectTemplateBuilder(v8::Isolate* isolate) {
|
|||
base::BindRepeating(&Browser::SetAboutPanelOptions, browser))
|
||||
.SetMethod("showAboutPanel",
|
||||
base::BindRepeating(&Browser::ShowAboutPanel, browser))
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
.SetMethod(
|
||||
"isSecureKeyboardEntryEnabled",
|
||||
base::BindRepeating(&Browser::IsSecureKeyboardEntryEnabled, browser))
|
||||
|
@ -1612,7 +1612,7 @@ gin::ObjectTemplateBuilder App::GetObjectTemplateBuilder(v8::Isolate* isolate) {
|
|||
"setSecureKeyboardEntryEnabled",
|
||||
base::BindRepeating(&Browser::SetSecureKeyboardEntryEnabled, browser))
|
||||
#endif
|
||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
||||
#if defined(OS_MAC) || defined(OS_WIN)
|
||||
.SetMethod("showEmojiPanel",
|
||||
base::BindRepeating(&Browser::ShowEmojiPanel, browser))
|
||||
#endif
|
||||
|
@ -1657,7 +1657,7 @@ gin::ObjectTemplateBuilder App::GetObjectTemplateBuilder(v8::Isolate* isolate) {
|
|||
.SetMethod("startAccessingSecurityScopedResource",
|
||||
&App::StartAccessingSecurityScopedResource)
|
||||
#endif
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
.SetProperty("dock", &App::GetDockAPI)
|
||||
#endif
|
||||
.SetProperty("userAgentFallback", &App::GetUserAgentFallback,
|
||||
|
|
|
@ -94,7 +94,7 @@ class App : public ElectronBrowserClient::Delegate,
|
|||
void OnAccessibilitySupportChanged() override;
|
||||
void OnPreMainMessageLoopRun() override;
|
||||
void OnPreCreateThreads() override;
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void OnWillContinueUserActivity(bool* prevent_default,
|
||||
const std::string& type) override;
|
||||
void OnDidFailToContinueUserActivity(const std::string& type,
|
||||
|
@ -214,7 +214,7 @@ class App : public ElectronBrowserClient::Delegate,
|
|||
void SetBrowserClientCanUseCustomSiteInstance(bool should_disable);
|
||||
bool CanBrowserClientUseCustomSiteInstance();
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void SetActivationPolicy(gin_helper::ErrorThrower thrower,
|
||||
const std::string& policy);
|
||||
bool MoveToApplicationsFolder(gin_helper::ErrorThrower, gin::Arguments* args);
|
||||
|
|
|
@ -818,7 +818,7 @@ void BaseWindow::SetVibrancy(v8::Isolate* isolate, v8::Local<v8::Value> value) {
|
|||
window_->SetVibrancy(type);
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void BaseWindow::SetTrafficLightPosition(const gfx::Point& position) {
|
||||
window_->SetTrafficLightPosition(position);
|
||||
}
|
||||
|
@ -1174,11 +1174,11 @@ void BaseWindow::BuildPrototype(v8::Isolate* isolate,
|
|||
&BaseWindow::SetVisibleOnAllWorkspaces)
|
||||
.SetMethod("isVisibleOnAllWorkspaces",
|
||||
&BaseWindow::IsVisibleOnAllWorkspaces)
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
.SetMethod("setAutoHideCursor", &BaseWindow::SetAutoHideCursor)
|
||||
#endif
|
||||
.SetMethod("setVibrancy", &BaseWindow::SetVibrancy)
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
.SetMethod("setTrafficLightPosition",
|
||||
&BaseWindow::SetTrafficLightPosition)
|
||||
.SetMethod("getTrafficLightPosition",
|
||||
|
@ -1187,7 +1187,7 @@ void BaseWindow::BuildPrototype(v8::Isolate* isolate,
|
|||
.SetMethod("_setTouchBarItems", &BaseWindow::SetTouchBar)
|
||||
.SetMethod("_refreshTouchBarItem", &BaseWindow::RefreshTouchBarItem)
|
||||
.SetMethod("_setEscapeTouchBarItem", &BaseWindow::SetEscapeTouchBarItem)
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
.SetMethod("selectPreviousTab", &BaseWindow::SelectPreviousTab)
|
||||
.SetMethod("selectNextTab", &BaseWindow::SelectNextTab)
|
||||
.SetMethod("mergeAllWindows", &BaseWindow::MergeAllWindows)
|
||||
|
|
|
@ -184,7 +184,7 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
|
|||
void SetAutoHideCursor(bool auto_hide);
|
||||
virtual void SetVibrancy(v8::Isolate* isolate, v8::Local<v8::Value> value);
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void SetTrafficLightPosition(const gfx::Point& position);
|
||||
gfx::Point GetTrafficLightPosition() const;
|
||||
#endif
|
||||
|
|
|
@ -93,7 +93,7 @@ BrowserWindow::BrowserWindow(gin::Arguments* args,
|
|||
// Install the content view after BaseWindow's JS code is initialized.
|
||||
SetContentView(gin::CreateHandle<View>(isolate, web_contents_view.get()));
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
OverrideNSWindowContentView(web_contents->managed_web_contents());
|
||||
#endif
|
||||
|
||||
|
@ -228,7 +228,7 @@ void BrowserWindow::OnSetContentBounds(const gfx::Rect& rect) {
|
|||
|
||||
void BrowserWindow::OnActivateContents() {
|
||||
// Hide the auto-hide menu when webContents is focused.
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
if (IsMenuBarAutoHide() && IsMenuBarVisible())
|
||||
window()->SetMenuBarVisibility(false);
|
||||
#endif
|
||||
|
@ -269,7 +269,7 @@ void BrowserWindow::OnCloseButtonClicked(bool* prevent_default) {
|
|||
// Required to make beforeunload handler work.
|
||||
api_web_contents_->NotifyUserActivation();
|
||||
|
||||
if (web_contents()->NeedToFireBeforeUnloadOrUnload())
|
||||
if (web_contents()->NeedToFireBeforeUnloadOrUnloadEvents())
|
||||
web_contents()->DispatchBeforeUnload(false /* auto_cancel */);
|
||||
else
|
||||
web_contents()->Close();
|
||||
|
@ -295,7 +295,7 @@ void BrowserWindow::OnWindowBlur() {
|
|||
void BrowserWindow::OnWindowFocus() {
|
||||
web_contents()->RestoreFocus();
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
if (!api_web_contents_->IsDevToolsOpened())
|
||||
web_contents()->Focus();
|
||||
#endif
|
||||
|
@ -304,7 +304,7 @@ void BrowserWindow::OnWindowFocus() {
|
|||
}
|
||||
|
||||
void BrowserWindow::OnWindowIsKeyChanged(bool is_key) {
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
auto* rwhv = web_contents()->GetRenderWidgetHostView();
|
||||
if (rwhv)
|
||||
rwhv->SetActive(is_key);
|
||||
|
@ -312,7 +312,7 @@ void BrowserWindow::OnWindowIsKeyChanged(bool is_key) {
|
|||
}
|
||||
|
||||
void BrowserWindow::OnWindowResize() {
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
if (!draggable_regions_.empty())
|
||||
UpdateDraggableRegions(draggable_regions_);
|
||||
#endif
|
||||
|
@ -321,7 +321,7 @@ void BrowserWindow::OnWindowResize() {
|
|||
|
||||
void BrowserWindow::OnWindowLeaveFullScreen() {
|
||||
BaseWindow::OnWindowLeaveFullScreen();
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
if (web_contents()->IsFullscreen())
|
||||
web_contents()->ExitFullscreen(true);
|
||||
#endif
|
||||
|
@ -361,28 +361,28 @@ void BrowserWindow::SetBackgroundColor(const std::string& color_name) {
|
|||
void BrowserWindow::SetBrowserView(v8::Local<v8::Value> value) {
|
||||
BaseWindow::ResetBrowserViews();
|
||||
BaseWindow::AddBrowserView(value);
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
UpdateDraggableRegions(draggable_regions_);
|
||||
#endif
|
||||
}
|
||||
|
||||
void BrowserWindow::AddBrowserView(v8::Local<v8::Value> value) {
|
||||
BaseWindow::AddBrowserView(value);
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
UpdateDraggableRegions(draggable_regions_);
|
||||
#endif
|
||||
}
|
||||
|
||||
void BrowserWindow::RemoveBrowserView(v8::Local<v8::Value> value) {
|
||||
BaseWindow::RemoveBrowserView(value);
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
UpdateDraggableRegions(draggable_regions_);
|
||||
#endif
|
||||
}
|
||||
|
||||
void BrowserWindow::ResetBrowserViews() {
|
||||
BaseWindow::ResetBrowserViews();
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
UpdateDraggableRegions(draggable_regions_);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ class BrowserWindow : public BaseWindow,
|
|||
v8::Local<v8::Value> GetWebContents(v8::Isolate* isolate);
|
||||
|
||||
private:
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void OverrideNSWindowContentView(InspectableWebContents* iwc);
|
||||
#endif
|
||||
|
||||
|
@ -119,7 +119,7 @@ class BrowserWindow : public BaseWindow,
|
|||
// it should be cancelled when we can prove that the window is responsive.
|
||||
base::CancelableClosure window_unresponsive_closure_;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
std::vector<mojom::DraggableRegionPtr> draggable_regions_;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -155,7 +155,7 @@ void Start(const std::string& submit_url,
|
|||
for (const auto& pair : global_extra)
|
||||
electron::crash_keys::SetCrashKey(pair.first, pair.second);
|
||||
breakpad::InitCrashReporter(process_type);
|
||||
#elif defined(OS_MACOSX)
|
||||
#elif defined(OS_MAC)
|
||||
for (const auto& pair : extra)
|
||||
electron::crash_keys::SetCrashKey(pair.first, pair.second);
|
||||
::crash_reporter::InitializeCrashpad(process_type.empty(), process_type);
|
||||
|
@ -190,7 +190,7 @@ void GetUploadedReports(
|
|||
}
|
||||
#else
|
||||
scoped_refptr<UploadList> CreateCrashUploadList() {
|
||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
||||
#if defined(OS_MAC) || defined(OS_WIN)
|
||||
return new CrashUploadListCrashpad();
|
||||
#else
|
||||
base::FilePath crash_dir_path;
|
||||
|
@ -198,7 +198,7 @@ scoped_refptr<UploadList> CreateCrashUploadList() {
|
|||
base::FilePath upload_log_path =
|
||||
crash_dir_path.AppendASCII(CrashUploadList::kReporterLogFilename);
|
||||
return new TextLogUploadList(upload_log_path);
|
||||
#endif // defined(OS_MACOSX) || defined(OS_WIN)
|
||||
#endif // defined(OS_MAC) || defined(OS_WIN)
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> GetUploadedReports(v8::Isolate* isolate) {
|
||||
|
|
|
@ -182,7 +182,7 @@ void DesktopCapturer::UpdateSourcesList(DesktopMediaList* list) {
|
|||
source.display_id = base::NumberToString(device_id);
|
||||
}
|
||||
}
|
||||
#elif defined(OS_MACOSX)
|
||||
#elif defined(OS_MAC)
|
||||
// On Mac, the IDs across the APIs match.
|
||||
for (auto& source : screen_sources) {
|
||||
source.display_id = base::NumberToString(source.media_list_source.id.id);
|
||||
|
|
|
@ -97,7 +97,7 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
dict.SetMethod("showOpenDialog", &ShowOpenDialog);
|
||||
dict.SetMethod("showSaveDialogSync", &ShowSaveDialogSync);
|
||||
dict.SetMethod("showSaveDialog", &ShowSaveDialog);
|
||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
||||
#if defined(OS_MAC) || defined(OS_WIN)
|
||||
dict.SetMethod("showCertificateTrustDialog",
|
||||
&certificate_trust::ShowCertificateTrust);
|
||||
#endif
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "shell/common/gin_converters/callback_converter.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
#include "base/mac/mac_util.h"
|
||||
#endif
|
||||
|
||||
|
@ -24,7 +24,7 @@ using extensions::GlobalShortcutListener;
|
|||
|
||||
namespace {
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
bool RegisteringMediaKeyForUntrustedClient(const ui::Accelerator& accelerator) {
|
||||
if (base::mac::IsAtLeastOS10_14()) {
|
||||
constexpr ui::KeyboardCode mediaKeys[] = {
|
||||
|
@ -89,7 +89,7 @@ bool GlobalShortcut::RegisterAll(
|
|||
|
||||
bool GlobalShortcut::Register(const ui::Accelerator& accelerator,
|
||||
const base::Closure& callback) {
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
if (RegisteringMediaKeyForUntrustedClient(accelerator))
|
||||
return false;
|
||||
#endif
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace api {
|
|||
|
||||
gin::WrapperInfo InAppPurchase::kWrapperInfo = {gin::kEmbedderNativeGin};
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
// static
|
||||
gin::Handle<InAppPurchase> InAppPurchase::Create(v8::Isolate* isolate) {
|
||||
return gin::CreateHandle(isolate, new InAppPurchase());
|
||||
|
@ -158,7 +158,7 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
v8::Isolate* isolate = context->GetIsolate();
|
||||
gin_helper::Dictionary dict(isolate, exports);
|
||||
dict.Set("inAppPurchase", InAppPurchase::Create(isolate));
|
||||
|
|
|
@ -266,7 +266,7 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
|
||||
gin_helper::Dictionary dict(isolate, exports);
|
||||
dict.Set("Menu", Menu::GetConstructor(context));
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
dict.SetMethod("setApplicationMenu", &Menu::SetApplicationMenu);
|
||||
dict.SetMethod("sendActionToFirstResponder",
|
||||
&Menu::SendActionToFirstResponder);
|
||||
|
|
|
@ -36,7 +36,7 @@ class Menu : public gin::Wrappable<Menu>,
|
|||
// gin::Wrappable
|
||||
static gin::WrapperInfo kWrapperInfo;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
// Set the global menubar.
|
||||
static void SetApplicationMenu(Menu* menu);
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ void NativeTheme::OnNativeThemeUpdated(ui::NativeTheme* theme) {
|
|||
void NativeTheme::SetThemeSource(ui::NativeTheme::ThemeSource override) {
|
||||
ui_theme_->set_theme_source(override);
|
||||
web_theme_->set_theme_source(override);
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
// Update the macOS appearance setting for this new override value
|
||||
UpdateMacOSAppearanceForOverrideValue(override);
|
||||
#endif
|
||||
|
@ -74,14 +74,14 @@ bool NativeTheme::ShouldUseHighContrastColors() {
|
|||
return ui_theme_->UsesHighContrastColors();
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
const CFStringRef WhiteOnBlack = CFSTR("whiteOnBlack");
|
||||
const CFStringRef UniversalAccessDomain = CFSTR("com.apple.universalaccess");
|
||||
#endif
|
||||
|
||||
// TODO(MarshallOfSound): Implement for Linux
|
||||
bool NativeTheme::ShouldUseInvertedColorScheme() {
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
CFPreferencesAppSynchronize(UniversalAccessDomain);
|
||||
Boolean keyExistsAndHasValidFormat = false;
|
||||
Boolean is_inverted = CFPreferencesGetAppBooleanValue(
|
||||
|
|
|
@ -34,7 +34,7 @@ class NativeTheme : public gin::Wrappable<NativeTheme>,
|
|||
~NativeTheme() override;
|
||||
|
||||
void SetThemeSource(ui::NativeTheme::ThemeSource override);
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void UpdateMacOSAppearanceForOverrideValue(
|
||||
ui::NativeTheme::ThemeSource override);
|
||||
#endif
|
||||
|
|
|
@ -42,14 +42,14 @@ namespace api {
|
|||
gin::WrapperInfo PowerMonitor::kWrapperInfo = {gin::kEmbedderNativeGin};
|
||||
|
||||
PowerMonitor::PowerMonitor(v8::Isolate* isolate) {
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
Browser::Get()->SetShutdownHandler(base::BindRepeating(
|
||||
&PowerMonitor::ShouldShutdown, base::Unretained(this)));
|
||||
#endif
|
||||
|
||||
base::PowerMonitor::AddObserver(this);
|
||||
|
||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
||||
#if defined(OS_MAC) || defined(OS_WIN)
|
||||
InitPlatformSpecificMonitors();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ class PowerMonitor : public gin::Wrappable<PowerMonitor>,
|
|||
// Called by native calles.
|
||||
bool ShouldShutdown();
|
||||
|
||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
||||
#if defined(OS_MAC) || defined(OS_WIN)
|
||||
void InitPlatformSpecificMonitors();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -87,9 +87,10 @@ ServiceWorkerContext::~ServiceWorkerContext() {
|
|||
|
||||
void ServiceWorkerContext::OnReportConsoleMessage(
|
||||
int64_t version_id,
|
||||
const GURL& scope,
|
||||
const content::ConsoleMessage& message) {
|
||||
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
||||
v8::HandleScope scope(isolate);
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
Emit("console-message",
|
||||
gin::DataObjectBuilder(isolate)
|
||||
.Set("versionId", version_id)
|
||||
|
|
|
@ -32,6 +32,7 @@ class ServiceWorkerContext
|
|||
|
||||
// content::ServiceWorkerContextObserver
|
||||
void OnReportConsoleMessage(int64_t version_id,
|
||||
const GURL& scope,
|
||||
const content::ConsoleMessage& message) override;
|
||||
void OnDestruct(content::ServiceWorkerContext* context) override;
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ SystemPreferences::~SystemPreferences() {
|
|||
#endif
|
||||
}
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
bool SystemPreferences::IsDarkMode() {
|
||||
return ui::NativeTheme::GetInstanceForNativeUi()->ShouldUseDarkColors();
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ gin::ObjectTemplateBuilder SystemPreferences::GetObjectTemplateBuilder(
|
|||
v8::Isolate* isolate) {
|
||||
return gin_helper::EventEmitterMixin<
|
||||
SystemPreferences>::GetObjectTemplateBuilder(isolate)
|
||||
#if defined(OS_WIN) || defined(OS_MACOSX)
|
||||
#if defined(OS_WIN) || defined(OS_MAC)
|
||||
.SetMethod("getColor", &SystemPreferences::GetColor)
|
||||
.SetMethod("getAccentColor", &SystemPreferences::GetAccentColor)
|
||||
.SetMethod("getMediaAccessStatus",
|
||||
|
@ -78,7 +78,7 @@ gin::ObjectTemplateBuilder SystemPreferences::GetObjectTemplateBuilder(
|
|||
|
||||
#if defined(OS_WIN)
|
||||
.SetMethod("isAeroGlassEnabled", &SystemPreferences::IsAeroGlassEnabled)
|
||||
#elif defined(OS_MACOSX)
|
||||
#elif defined(OS_MAC)
|
||||
.SetMethod("postNotification", &SystemPreferences::PostNotification)
|
||||
.SetMethod("subscribeNotification",
|
||||
&SystemPreferences::SubscribeNotification)
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace electron {
|
|||
|
||||
namespace api {
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
enum NotificationCenterKind {
|
||||
kNSDistributedNotificationCenter = 0,
|
||||
kNSNotificationCenter,
|
||||
|
@ -51,7 +51,7 @@ class SystemPreferences
|
|||
v8::Isolate* isolate) override;
|
||||
const char* GetTypeName() override;
|
||||
|
||||
#if defined(OS_WIN) || defined(OS_MACOSX)
|
||||
#if defined(OS_WIN) || defined(OS_MAC)
|
||||
std::string GetAccentColor();
|
||||
std::string GetColor(gin_helper::ErrorThrower thrower,
|
||||
const std::string& color);
|
||||
|
@ -69,7 +69,7 @@ class SystemPreferences
|
|||
// BrowserObserver:
|
||||
void OnFinishLaunching(const base::DictionaryValue& launch_info) override;
|
||||
|
||||
#elif defined(OS_MACOSX)
|
||||
#elif defined(OS_MAC)
|
||||
using NotificationCallback = base::RepeatingCallback<
|
||||
void(const std::string&, base::DictionaryValue, const std::string&)>;
|
||||
|
||||
|
@ -126,7 +126,7 @@ class SystemPreferences
|
|||
SystemPreferences();
|
||||
~SystemPreferences() override;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
int DoSubscribeNotification(const std::string& name,
|
||||
const NotificationCallback& callback,
|
||||
NotificationCenterKind kind);
|
||||
|
|
|
@ -215,7 +215,7 @@ void Tray::SetToolTip(const std::string& tool_tip) {
|
|||
void Tray::SetTitle(const std::string& title) {
|
||||
if (!CheckAlive())
|
||||
return;
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
tray_icon_->SetTitle(title);
|
||||
#endif
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ void Tray::SetTitle(const std::string& title) {
|
|||
std::string Tray::GetTitle() {
|
||||
if (!CheckAlive())
|
||||
return std::string();
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
return tray_icon_->GetTitle();
|
||||
#else
|
||||
return "";
|
||||
|
@ -233,7 +233,7 @@ std::string Tray::GetTitle() {
|
|||
void Tray::SetIgnoreDoubleClickEvents(bool ignore) {
|
||||
if (!CheckAlive())
|
||||
return;
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
tray_icon_->SetIgnoreDoubleClickEvents(ignore);
|
||||
#endif
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ void Tray::SetIgnoreDoubleClickEvents(bool ignore) {
|
|||
bool Tray::GetIgnoreDoubleClickEvents() {
|
||||
if (!CheckAlive())
|
||||
return false;
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
return tray_icon_->GetIgnoreDoubleClickEvents();
|
||||
#else
|
||||
return false;
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
#include "shell/browser/osr/osr_web_contents_view.h"
|
||||
#endif
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
#include "ui/aura/window.h"
|
||||
#else
|
||||
#include "ui/base/cocoa/defaults_utils.h"
|
||||
|
@ -346,7 +346,7 @@ void OnCapturePageDone(gin_helper::Promise<gfx::Image> promise,
|
|||
}
|
||||
|
||||
base::Optional<base::TimeDelta> GetCursorBlinkInterval() {
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
base::TimeDelta interval;
|
||||
if (ui::TextInsertionCaretBlinkPeriod(&interval))
|
||||
return interval;
|
||||
|
@ -369,7 +369,7 @@ base::Optional<base::TimeDelta> GetCursorBlinkInterval() {
|
|||
// found on the network. We need to check this because Chromium does not do
|
||||
// sanity checking of device_name validity and so will crash on invalid names.
|
||||
bool IsDeviceNameValid(const base::string16& device_name) {
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
base::ScopedCFTypeRef<CFStringRef> new_printer_id(
|
||||
base::SysUTF16ToCFStringRef(device_name));
|
||||
PMPrinter new_printer = PMPrinterCreateFromPrinterID(new_printer_id.get());
|
||||
|
@ -593,6 +593,8 @@ void WebContents::InitWithSessionAndOptions(
|
|||
|
||||
// Save the preferences in C++.
|
||||
new WebContentsPreferences(web_contents(), options);
|
||||
// Trigger re-calculation of webkit prefs.
|
||||
web_contents()->NotifyPreferencesChanged();
|
||||
|
||||
WebContentsPermissionHelper::CreateForWebContents(web_contents());
|
||||
SecurityStateTabHelper::CreateForWebContents(web_contents());
|
||||
|
@ -1755,18 +1757,20 @@ bool WebContents::IsDevToolsFocused() {
|
|||
}
|
||||
|
||||
void WebContents::EnableDeviceEmulation(
|
||||
const blink::WebDeviceEmulationParams& params) {
|
||||
const blink::DeviceEmulationParams& params) {
|
||||
if (type_ == Type::REMOTE)
|
||||
return;
|
||||
|
||||
auto* frame_host = web_contents()->GetMainFrame();
|
||||
if (frame_host) {
|
||||
auto* widget_host =
|
||||
frame_host ? frame_host->GetView()->GetRenderWidgetHost() : nullptr;
|
||||
if (!widget_host)
|
||||
return;
|
||||
widget_host->Send(new WidgetMsg_EnableDeviceEmulation(
|
||||
widget_host->GetRoutingID(), params));
|
||||
auto* widget_host_impl =
|
||||
frame_host ? static_cast<content::RenderWidgetHostImpl*>(
|
||||
frame_host->GetView()->GetRenderWidgetHost())
|
||||
: nullptr;
|
||||
if (widget_host_impl) {
|
||||
auto& frame_widget = widget_host_impl->GetAssociatedFrameWidget();
|
||||
frame_widget->EnableDeviceEmulation(params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1776,12 +1780,14 @@ void WebContents::DisableDeviceEmulation() {
|
|||
|
||||
auto* frame_host = web_contents()->GetMainFrame();
|
||||
if (frame_host) {
|
||||
auto* widget_host =
|
||||
frame_host ? frame_host->GetView()->GetRenderWidgetHost() : nullptr;
|
||||
if (!widget_host)
|
||||
return;
|
||||
widget_host->Send(
|
||||
new WidgetMsg_DisableDeviceEmulation(widget_host->GetRoutingID()));
|
||||
auto* widget_host_impl =
|
||||
frame_host ? static_cast<content::RenderWidgetHostImpl*>(
|
||||
frame_host->GetView()->GetRenderWidgetHost())
|
||||
: nullptr;
|
||||
if (widget_host_impl) {
|
||||
auto& frame_widget = widget_host_impl->GetAssociatedFrameWidget();
|
||||
frame_widget->DisableDeviceEmulation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2220,7 +2226,7 @@ void WebContents::StopFindInPage(content::StopFindAction action) {
|
|||
}
|
||||
|
||||
void WebContents::ShowDefinitionForSelection() {
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
auto* const view = web_contents()->GetRenderWidgetHostView();
|
||||
if (view)
|
||||
view->ShowDefinitionForSelection();
|
||||
|
@ -2236,14 +2242,14 @@ void WebContents::CopyImageAt(int x, int y) {
|
|||
void WebContents::Focus() {
|
||||
// Focusing on WebContents does not automatically focus the window on macOS
|
||||
// and Linux, do it manually to match the behavior on Windows.
|
||||
#if defined(OS_MACOSX) || defined(OS_LINUX)
|
||||
#if defined(OS_MAC) || defined(OS_LINUX)
|
||||
if (owner_window())
|
||||
owner_window()->Focus(true);
|
||||
#endif
|
||||
web_contents()->Focus();
|
||||
}
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
bool WebContents::IsFocused() const {
|
||||
auto* view = web_contents()->GetRenderWidgetHostView();
|
||||
if (!view)
|
||||
|
|
|
@ -54,7 +54,7 @@ class ScriptExecutor;
|
|||
#endif
|
||||
|
||||
namespace blink {
|
||||
struct WebDeviceEmulationParams;
|
||||
struct DeviceEmulationParams;
|
||||
}
|
||||
|
||||
namespace gin_helper {
|
||||
|
@ -236,7 +236,7 @@ class WebContents : public gin::Wrappable<WebContents>,
|
|||
bool IsDevToolsOpened();
|
||||
bool IsDevToolsFocused();
|
||||
void ToggleDevTools();
|
||||
void EnableDeviceEmulation(const blink::WebDeviceEmulationParams& params);
|
||||
void EnableDeviceEmulation(const blink::DeviceEmulationParams& params);
|
||||
void DisableDeviceEmulation();
|
||||
void InspectElement(int x, int y);
|
||||
void InspectSharedWorker();
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include "shell/common/gin_helper/object_template_builder.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
#include "shell/browser/ui/cocoa/delayed_native_view_host.h"
|
||||
#endif
|
||||
|
||||
|
@ -25,7 +25,7 @@ namespace api {
|
|||
|
||||
WebContentsView::WebContentsView(v8::Isolate* isolate,
|
||||
gin::Handle<WebContents> web_contents)
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
: View(new DelayedNativeViewHost(
|
||||
web_contents->managed_web_contents()->GetView()->GetNativeView())),
|
||||
#else
|
||||
|
@ -33,7 +33,7 @@ WebContentsView::WebContentsView(v8::Isolate* isolate,
|
|||
#endif
|
||||
web_contents_(isolate, web_contents.ToV8()),
|
||||
api_web_contents_(web_contents.get()) {
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
// On macOS the View is a newly-created |DelayedNativeViewHost| and it is our
|
||||
// responsibility to delete it. On other platforms the View is created and
|
||||
// managed by InspectableWebContents.
|
||||
|
|
|
@ -33,6 +33,8 @@ void AddGuest(int guest_instance_id,
|
|||
}
|
||||
|
||||
WebContentsPreferences::From(guest_web_contents)->Merge(options);
|
||||
// Trigger re-calculation of webkit prefs.
|
||||
guest_web_contents->NotifyPreferencesChanged();
|
||||
}
|
||||
|
||||
void RemoveGuest(content::WebContents* embedder, int guest_instance_id) {
|
||||
|
|
|
@ -31,7 +31,7 @@ GPUInfoManager::~GPUInfoManager() {
|
|||
// Based on
|
||||
// https://chromium.googlesource.com/chromium/src.git/+/69.0.3497.106/content/browser/gpu/gpu_data_manager_impl_private.cc#838
|
||||
bool GPUInfoManager::NeedsCompleteGpuInfoCollection() const {
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
return gpu_data_manager_->GetGPUInfo().gl_vendor.empty();
|
||||
#elif defined(OS_WIN)
|
||||
return gpu_data_manager_->DxdiagDx12VulkanRequested() &&
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "base/win/win_util.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
#include <mach/mach.h>
|
||||
#include "base/process/port_provider_mac.h"
|
||||
#include "content/public/browser/browser_child_process_host.h"
|
||||
|
@ -46,7 +46,7 @@ base::Optional<mach_task_basic_info_data_t> GetTaskInfo(mach_port_t task) {
|
|||
|
||||
} // namespace
|
||||
|
||||
#endif // defined(OS_MACOSX)
|
||||
#endif // defined(OS_MAC)
|
||||
|
||||
namespace electron {
|
||||
|
||||
|
@ -144,7 +144,7 @@ bool ProcessMetric::IsSandboxed(ProcessIntegrityLevel integrity_level) {
|
|||
integrity_level < ProcessIntegrityLevel::Medium;
|
||||
}
|
||||
|
||||
#elif defined(OS_MACOSX)
|
||||
#elif defined(OS_MAC)
|
||||
|
||||
ProcessMemoryInfo ProcessMetric::GetMemoryInfo() const {
|
||||
ProcessMemoryInfo result;
|
||||
|
@ -165,6 +165,6 @@ bool ProcessMetric::IsSandboxed() const {
|
|||
#endif
|
||||
}
|
||||
|
||||
#endif // defined(OS_MACOSX)
|
||||
#endif // defined(OS_MAC)
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -53,7 +53,7 @@ struct ProcessMetric {
|
|||
#if defined(OS_WIN)
|
||||
ProcessIntegrityLevel GetIntegrityLevel() const;
|
||||
static bool IsSandboxed(ProcessIntegrityLevel integrity_level);
|
||||
#elif defined(OS_MACOSX)
|
||||
#elif defined(OS_MAC)
|
||||
bool IsSandboxed() const;
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -16,7 +16,7 @@ void AutoUpdater::SetDelegate(Delegate* delegate) {
|
|||
delegate_ = delegate;
|
||||
}
|
||||
|
||||
#if !defined(OS_MACOSX) || defined(MAS_BUILD)
|
||||
#if !defined(OS_MAC) || defined(MAS_BUILD)
|
||||
std::string AutoUpdater::GetFeedURL() {
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -262,7 +262,7 @@ void Browser::OnWindowAllClosed() {
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void Browser::NewWindowForTab() {
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnNewWindowForTab();
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "base/files/file_path.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
#include "ui/base/cocoa/secure_password_input.h"
|
||||
#endif
|
||||
|
||||
|
@ -151,7 +151,7 @@ class Browser : public WindowListObserver {
|
|||
void SetLoginItemSettings(LoginItemSettings settings);
|
||||
LoginItemSettings GetLoginItemSettings(const LoginItemSettings& options);
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
// Set the handler which decides whether to shutdown.
|
||||
void SetShutdownHandler(base::Callback<bool()> handler);
|
||||
|
||||
|
@ -225,12 +225,12 @@ class Browser : public WindowListObserver {
|
|||
// Set docks' icon.
|
||||
void DockSetIcon(const gfx::Image& image);
|
||||
|
||||
#endif // defined(OS_MACOSX)
|
||||
#endif // defined(OS_MAC)
|
||||
|
||||
void ShowAboutPanel();
|
||||
void SetAboutPanelOptions(base::DictionaryValue options);
|
||||
|
||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
||||
#if defined(OS_MAC) || defined(OS_WIN)
|
||||
void ShowEmojiPanel();
|
||||
#endif
|
||||
|
||||
|
@ -269,13 +269,13 @@ class Browser : public WindowListObserver {
|
|||
// Tell the application to open a url.
|
||||
void OpenURL(const std::string& url);
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
// Tell the application to create a new window for a tab.
|
||||
void NewWindowForTab();
|
||||
|
||||
// Tell the application that application did become active
|
||||
void DidBecomeActive();
|
||||
#endif // defined(OS_MACOSX)
|
||||
#endif // defined(OS_MAC)
|
||||
|
||||
// Tell the application that application is activated with visible/invisible
|
||||
// windows.
|
||||
|
@ -300,7 +300,7 @@ class Browser : public WindowListObserver {
|
|||
|
||||
void RemoveObserver(BrowserObserver* obs) { observers_.RemoveObserver(obs); }
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
// Returns whether secure input is enabled
|
||||
bool IsSecureKeyboardEntryEnabled();
|
||||
void SetSecureKeyboardEntryEnabled(bool enabled);
|
||||
|
@ -353,13 +353,13 @@ class Browser : public WindowListObserver {
|
|||
|
||||
std::unique_ptr<gin_helper::Promise<void>> ready_promise_;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
std::unique_ptr<ui::ScopedPasswordInputEnabler> password_input_enabler_;
|
||||
#endif
|
||||
|
||||
#if defined(OS_LINUX) || defined(OS_WIN)
|
||||
base::Value about_panel_options_;
|
||||
#elif defined(OS_MACOSX)
|
||||
#elif defined(OS_MAC)
|
||||
base::DictionaryValue about_panel_options_;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ class BrowserObserver : public base::CheckedObserver {
|
|||
// Refer https://chromium-review.googlesource.com/c/chromium/src/+/2134864
|
||||
virtual void OnPreCreateThreads() {}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
// The browser wants to report that an user activity will resume. (macOS only)
|
||||
virtual void OnWillContinueUserActivity(bool* prevent_default,
|
||||
const std::string& type) {}
|
||||
|
|
|
@ -127,7 +127,7 @@ class CommonWebContentsDelegate : public content::WebContentsDelegate,
|
|||
const std::string& query) override;
|
||||
|
||||
// InspectableWebContentsViewDelegate:
|
||||
#if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
|
||||
#if defined(TOOLKIT_VIEWS) && !defined(OS_MAC)
|
||||
gfx::ImageSkia GetDevToolsWindowIcon() override;
|
||||
#endif
|
||||
#if defined(USE_X11)
|
||||
|
|
|
@ -109,7 +109,7 @@
|
|||
#include "net/ssl/client_cert_store_nss.h"
|
||||
#elif defined(OS_WIN)
|
||||
#include "net/ssl/client_cert_store_win.h"
|
||||
#elif defined(OS_MACOSX)
|
||||
#elif defined(OS_MAC)
|
||||
#include "net/ssl/client_cert_store_mac.h"
|
||||
#elif defined(USE_OPENSSL)
|
||||
#include "net/ssl/client_cert_store.h"
|
||||
|
@ -166,7 +166,7 @@
|
|||
#include "shell/browser/plugins/plugin_utils.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
#include "content/common/mac_helpers.h"
|
||||
#include "content/public/common/child_process_host.h"
|
||||
#endif
|
||||
|
@ -695,7 +695,7 @@ void ElectronBrowserClient::AppendExtraCommandLineSwitches(
|
|||
base::FilePath child_path;
|
||||
base::FilePath program =
|
||||
base::MakeAbsoluteFilePath(command_line->GetProgram());
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
auto renderer_child_path = content::ChildProcessHost::GetChildPath(
|
||||
content::ChildProcessHost::CHILD_RENDERER);
|
||||
auto gpu_child_path = content::ChildProcessHost::GetChildPath(
|
||||
|
@ -1025,7 +1025,7 @@ ElectronBrowserClient::CreateClientCertStore(
|
|||
net::ClientCertStoreNSS::PasswordDelegateFactory());
|
||||
#elif defined(OS_WIN)
|
||||
return std::make_unique<net::ClientCertStoreWin>();
|
||||
#elif defined(OS_MACOSX)
|
||||
#elif defined(OS_MAC)
|
||||
return std::make_unique<net::ClientCertStoreMac>();
|
||||
#elif defined(USE_OPENSSL)
|
||||
return std::unique_ptr<net::ClientCertStore>();
|
||||
|
@ -1254,6 +1254,7 @@ void ElectronBrowserClient::SetUserAgent(const std::string& user_agent) {
|
|||
|
||||
void ElectronBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
|
||||
int frame_tree_node_id,
|
||||
base::UkmSourceId ukm_source_id,
|
||||
NonNetworkURLLoaderFactoryMap* factories) {
|
||||
content::WebContents* web_contents =
|
||||
content::WebContents::FromFrameTreeNodeId(frame_tree_node_id);
|
||||
|
@ -1262,7 +1263,8 @@ void ElectronBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
|
|||
factories->emplace(
|
||||
extensions::kExtensionScheme,
|
||||
extensions::CreateExtensionNavigationURLLoaderFactory(
|
||||
context, false /* we don't support extensions::WebViewGuest */));
|
||||
context, ukm_source_id,
|
||||
false /* we don't support extensions::WebViewGuest */));
|
||||
#endif
|
||||
auto* protocol_registry = ProtocolRegistry::FromBrowserContext(context);
|
||||
protocol_registry->RegisterURLLoaderFactories(
|
||||
|
|
|
@ -177,6 +177,7 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
|
|||
std::string GetProduct() override;
|
||||
void RegisterNonNetworkNavigationURLLoaderFactories(
|
||||
int frame_tree_node_id,
|
||||
base::UkmSourceId ukm_source_id,
|
||||
NonNetworkURLLoaderFactoryMap* factories) override;
|
||||
void RegisterNonNetworkWorkerMainResourceURLLoaderFactories(
|
||||
content::BrowserContext* browser_context,
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
#include "ui/strings/grit/app_locale_settings.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
#include "shell/browser/ui/cocoa/views_delegate_mac.h"
|
||||
#else
|
||||
#include "shell/browser/ui/views/electron_views_delegate.h"
|
||||
|
@ -368,7 +368,7 @@ int ElectronBrowserMainParts::PreCreateThreads() {
|
|||
// Force MediaCaptureDevicesDispatcher to be created on UI thread.
|
||||
MediaCaptureDevicesDispatcher::GetInstance();
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
ui::InitIdleMonitor();
|
||||
#endif
|
||||
|
||||
|
@ -432,7 +432,7 @@ void ElectronBrowserMainParts::ToolkitInitialized() {
|
|||
ui::CursorLoaderWin::SetCursorResourceModule(module_name);
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
views_delegate_.reset(new ViewsDelegateMac);
|
||||
#else
|
||||
views_delegate_ = std::make_unique<ViewsDelegate>();
|
||||
|
@ -486,7 +486,7 @@ void ElectronBrowserMainParts::PreMainMessageLoopRun() {
|
|||
DevToolsManagerDelegate::StartHttpHandler();
|
||||
}
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
// The corresponding call in macOS is in ElectronApplicationDelegate.
|
||||
Browser::Get()->WillFinishLaunching();
|
||||
Browser::Get()->DidFinishLaunching(base::DictionaryValue());
|
||||
|
@ -530,7 +530,7 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun() {
|
|||
ui::SetX11ErrorHandlers(X11EmptyErrorHandler, X11EmptyIOErrorHandler);
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
FreeAppDelegate();
|
||||
#endif
|
||||
|
||||
|
@ -557,14 +557,14 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun() {
|
|||
content::DevToolsAgentHost::StopRemoteDebuggingPipeHandler();
|
||||
}
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
void ElectronBrowserMainParts::PreMainMessageLoopStart() {
|
||||
PreMainMessageLoopStartCommon();
|
||||
}
|
||||
#endif
|
||||
|
||||
void ElectronBrowserMainParts::PreMainMessageLoopStartCommon() {
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
InitializeMainNib();
|
||||
RegisterURLHandler();
|
||||
#endif
|
||||
|
|
|
@ -55,7 +55,7 @@ class ElectronExtensionsBrowserClient;
|
|||
class ViewsDelegate;
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
class ViewsDelegateMac;
|
||||
#endif
|
||||
|
||||
|
@ -116,13 +116,13 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
|
|||
void HandleShutdownSignals();
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void FreeAppDelegate();
|
||||
void RegisterURLHandler();
|
||||
void InitializeMainNib();
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
std::unique_ptr<ViewsDelegateMac> views_delegate_;
|
||||
#else
|
||||
std::unique_ptr<ViewsDelegate> views_delegate_;
|
||||
|
|
|
@ -51,8 +51,6 @@ void AddStringsForPdf(base::DictionaryValue* dict) {
|
|||
{"tooltipPrint", IDS_PDF_TOOLTIP_PRINT},
|
||||
{"tooltipFitToPage", IDS_PDF_TOOLTIP_FIT_PAGE},
|
||||
{"tooltipFitToWidth", IDS_PDF_TOOLTIP_FIT_WIDTH},
|
||||
{"tooltipTwoUpViewDisable", IDS_PDF_TOOLTIP_TWO_UP_VIEW_DISABLE},
|
||||
{"tooltipTwoUpViewEnable", IDS_PDF_TOOLTIP_TWO_UP_VIEW_ENABLE},
|
||||
{"tooltipZoomIn", IDS_PDF_TOOLTIP_ZOOM_IN},
|
||||
{"tooltipZoomOut", IDS_PDF_TOOLTIP_ZOOM_OUT},
|
||||
};
|
||||
|
@ -69,9 +67,6 @@ void AddAdditionalDataForPdf(base::DictionaryValue* dict) {
|
|||
base::Value(base::FeatureList::IsEnabled(
|
||||
chrome_pdf::features::kSaveEditedPDFForm)));
|
||||
dict->SetKey("pdfAnnotationsEnabled", base::Value(false));
|
||||
dict->SetKey("pdfTwoUpViewEnabled",
|
||||
base::Value(base::FeatureList::IsEnabled(
|
||||
chrome_pdf::features::kPDFTwoUpView)));
|
||||
dict->SetKey("printingEnabled", base::Value(true));
|
||||
#endif // BUILDFLAG(ENABLE_PDF)
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent(
|
|||
int frame_tree_node_id,
|
||||
int render_process_id,
|
||||
int render_frame_id,
|
||||
content::mojom::TransferrableURLLoaderPtr transferrable_loader,
|
||||
blink::mojom::TransferrableURLLoaderPtr transferrable_loader,
|
||||
const GURL& original_url) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <string>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "content/public/common/transferrable_url_loader.mojom.h"
|
||||
#include "third_party/blink/public/mojom/loader/transferrable_url_loader.mojom.h"
|
||||
|
||||
namespace extensions {
|
||||
|
||||
|
@ -35,7 +35,7 @@ class StreamsPrivateAPI {
|
|||
int frame_tree_node_id,
|
||||
int render_process_id,
|
||||
int render_frame_id,
|
||||
content::mojom::TransferrableURLLoaderPtr transferrable_loader,
|
||||
blink::mojom::TransferrableURLLoaderPtr transferrable_loader,
|
||||
const GURL& original_url);
|
||||
};
|
||||
|
||||
|
|
|
@ -205,7 +205,7 @@ void ElectronExtensionSystem::InstallUpdate(
|
|||
bool install_immediately,
|
||||
InstallUpdateCallback install_update_callback) {
|
||||
NOTREACHED();
|
||||
base::DeleteFile(temp_dir, true /* recursive */);
|
||||
base::DeletePathRecursively(temp_dir);
|
||||
}
|
||||
|
||||
bool ElectronExtensionSystem::FinishDelayedInstallationIfReady(
|
||||
|
|
|
@ -42,7 +42,7 @@ const FontDefault kFontDefaults[] = {
|
|||
{prefs::kWebKitCursiveFontFamily, IDS_CURSIVE_FONT_FAMILY},
|
||||
{prefs::kWebKitFantasyFontFamily, IDS_FANTASY_FONT_FAMILY},
|
||||
{prefs::kWebKitPictographFontFamily, IDS_PICTOGRAPH_FONT_FAMILY},
|
||||
#if defined(OS_CHROMEOS) || defined(OS_MACOSX) || defined(OS_WIN)
|
||||
#if defined(OS_CHROMEOS) || defined(OS_MAC) || defined(OS_WIN)
|
||||
{prefs::kWebKitStandardFontFamilyJapanese,
|
||||
IDS_STANDARD_FONT_FAMILY_JAPANESE},
|
||||
{prefs::kWebKitFixedFontFamilyJapanese, IDS_FIXED_FONT_FAMILY_JAPANESE},
|
||||
|
@ -66,7 +66,7 @@ const FontDefault kFontDefaults[] = {
|
|||
{prefs::kWebKitSansSerifFontFamilyTraditionalHan,
|
||||
IDS_SANS_SERIF_FONT_FAMILY_TRADITIONAL_HAN},
|
||||
#endif
|
||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
||||
#if defined(OS_MAC) || defined(OS_WIN)
|
||||
{prefs::kWebKitCursiveFontFamilySimplifiedHan,
|
||||
IDS_CURSIVE_FONT_FAMILY_SIMPLIFIED_HAN},
|
||||
{prefs::kWebKitCursiveFontFamilyTraditionalHan,
|
||||
|
|
|
@ -139,7 +139,7 @@ void NativeWindow::InitFromOptions(const gin_helper::Dictionary& options) {
|
|||
bool fullscreen = false;
|
||||
if (options.Get(options::kFullscreen, &fullscreen) && !fullscreen) {
|
||||
// Disable fullscreen button if 'fullscreen' is specified to false.
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
fullscreenable = false;
|
||||
#endif
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ void NativeWindow::InitFromOptions(const gin_helper::Dictionary& options) {
|
|||
if (options.Get(options::kKiosk, &kiosk) && kiosk) {
|
||||
SetKiosk(kiosk);
|
||||
}
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
std::string type;
|
||||
if (options.Get(options::kVibrancyType, &type)) {
|
||||
SetVibrancy(type);
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace electron {
|
|||
class ElectronMenuModel;
|
||||
class NativeBrowserView;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
typedef NSView* NativeWindowHandle;
|
||||
#else
|
||||
typedef gfx::AcceleratedWidget NativeWindowHandle;
|
||||
|
@ -195,7 +195,7 @@ class NativeWindow : public base::SupportsUserData,
|
|||
virtual void SetVibrancy(const std::string& type);
|
||||
|
||||
// Traffic Light API
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
virtual void SetTrafficLightPosition(const gfx::Point& position) = 0;
|
||||
virtual gfx::Point GetTrafficLightPosition() const = 0;
|
||||
virtual void RedrawTrafficLights() = 0;
|
||||
|
|
|
@ -116,9 +116,9 @@ class NativeWindowClientView : public views::ClientView {
|
|||
: views::ClientView(widget, root_view), window_(window) {}
|
||||
~NativeWindowClientView() override = default;
|
||||
|
||||
bool CanClose() override {
|
||||
views::CloseRequestResult OnWindowCloseRequested() override {
|
||||
window_->NotifyWindowCloseButtonClicked();
|
||||
return false;
|
||||
return views::CloseRequestResult::kCannotClose;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -57,7 +57,7 @@ class OffScreenHostDisplayClient : public viz::HostDisplayClient {
|
|||
private:
|
||||
void IsOffscreen(IsOffscreenCallback callback) override;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void OnDisplayReceivedCALayerParams(
|
||||
const gfx::CALayerParams& ca_layer_params) override;
|
||||
#endif
|
||||
|
|
|
@ -639,13 +639,16 @@ bool OffScreenRenderWidgetHostView::InstallTransparency() {
|
|||
return false;
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void OffScreenRenderWidgetHostView::SetActive(bool active) {}
|
||||
|
||||
void OffScreenRenderWidgetHostView::ShowDefinitionForSelection() {}
|
||||
|
||||
void OffScreenRenderWidgetHostView::SpeakSelection() {}
|
||||
|
||||
void OffScreenRenderWidgetHostView::SetWindowFrameInScreen(
|
||||
const gfx::Rect& rect) {}
|
||||
|
||||
bool OffScreenRenderWidgetHostView::UpdateNSViewAndDisplay() {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -99,12 +99,13 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
|||
bool request_unadjusted_movement) override;
|
||||
void UnlockMouse(void) override;
|
||||
void TakeFallbackContentFrom(content::RenderWidgetHostView* view) override;
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void SetActive(bool active) override;
|
||||
void ShowDefinitionForSelection() override;
|
||||
void SpeakSelection() override;
|
||||
void SetWindowFrameInScreen(const gfx::Rect& rect) override;
|
||||
bool UpdateNSViewAndDisplay();
|
||||
#endif // defined(OS_MACOSX)
|
||||
#endif // defined(OS_MAC)
|
||||
|
||||
// content::RenderWidgetHostViewBase:
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ OffScreenWebContentsView::OffScreenWebContentsView(
|
|||
bool transparent,
|
||||
const OnPaintCallback& callback)
|
||||
: native_window_(nullptr), transparent_(transparent), callback_(callback) {
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
PlatformCreate();
|
||||
#endif
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ OffScreenWebContentsView::~OffScreenWebContentsView() {
|
|||
if (native_window_)
|
||||
native_window_->RemoveObserver(this);
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
PlatformDestroy();
|
||||
#endif
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ gfx::Size OffScreenWebContentsView::GetSize() {
|
|||
return native_window_ ? native_window_->GetSize() : gfx::Size();
|
||||
}
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
gfx::NativeView OffScreenWebContentsView::GetNativeView() const {
|
||||
if (!native_window_)
|
||||
return gfx::NativeView();
|
||||
|
@ -154,11 +154,11 @@ void OffScreenWebContentsView::RenderViewHostChanged(
|
|||
|
||||
void OffScreenWebContentsView::SetOverscrollControllerEnabled(bool enabled) {}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
bool OffScreenWebContentsView::CloseTabAfterEventTrackingIfNeeded() {
|
||||
return false;
|
||||
}
|
||||
#endif // defined(OS_MACOSX)
|
||||
#endif // defined(OS_MAC)
|
||||
|
||||
void OffScreenWebContentsView::StartDragging(
|
||||
const content::DropData& drop_data,
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "content/public/browser/web_contents.h"
|
||||
#include "shell/browser/osr/osr_render_widget_host_view.h"
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
#ifdef __OBJC__
|
||||
@class OffScreenView;
|
||||
#else
|
||||
|
@ -62,7 +62,7 @@ class OffScreenWebContentsView : public content::WebContentsView,
|
|||
content::RenderViewHost* new_host) override;
|
||||
void SetOverscrollControllerEnabled(bool enabled) override;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
bool CloseTabAfterEventTrackingIfNeeded() override;
|
||||
#endif
|
||||
|
||||
|
@ -81,7 +81,7 @@ class OffScreenWebContentsView : public content::WebContentsView,
|
|||
int GetFrameRate() const;
|
||||
|
||||
private:
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void PlatformCreate();
|
||||
void PlatformDestroy();
|
||||
#endif
|
||||
|
@ -98,7 +98,7 @@ class OffScreenWebContentsView : public content::WebContentsView,
|
|||
// Weak refs.
|
||||
content::WebContents* web_contents_ = nullptr;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
OffScreenView* offScreenView_;
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "ui/aura/window.h"
|
||||
#include "ui/base/dragdrop/drag_drop_types.h"
|
||||
#include "ui/base/dragdrop/file_info/file_info.h"
|
||||
#include "ui/base/dragdrop/mojom/drag_drop_types.mojom-shared.h"
|
||||
#include "ui/base/dragdrop/os_exchange_data.h"
|
||||
#include "ui/display/screen.h"
|
||||
#include "ui/gfx/geometry/point.h"
|
||||
|
@ -39,12 +40,12 @@ void DragFileItems(const std::vector<base::FilePath>& files,
|
|||
return;
|
||||
|
||||
gfx::Point location = display::Screen::GetScreen()->GetCursorScreenPoint();
|
||||
// TODO(varunjain): Properly determine and send DRAG_EVENT_SOURCE below.
|
||||
// TODO(varunjain): Properly determine and send DragEventSource below.
|
||||
aura::client::GetDragDropClient(root_window)
|
||||
->StartDragAndDrop(
|
||||
std::move(data), root_window, view, location,
|
||||
ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK,
|
||||
ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE);
|
||||
ui::mojom::DragEventSource::kMouse);
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -137,8 +137,9 @@ class FileChooserDialog {
|
|||
|
||||
// We need to call gtk_window_present after making the widgets visible to
|
||||
// make sure window gets correctly raised and gets focus.
|
||||
int time = ui::X11EventSource::GetInstance()->GetTimestamp();
|
||||
gtk_window_present_with_time(GTK_WINDOW(dialog_), time);
|
||||
x11::Time time = ui::X11EventSource::GetInstance()->GetTimestamp();
|
||||
gtk_window_present_with_time(GTK_WINDOW(dialog_),
|
||||
static_cast<uint32_t>(time));
|
||||
}
|
||||
|
||||
void RunSaveAsynchronous(
|
||||
|
|
|
@ -146,7 +146,7 @@ bool WriteFile(const base::FilePath& path, const SkBitmap& bitmap) {
|
|||
void DeleteTempDirectory(const base::FilePath& dir_path) {
|
||||
if (dir_path.empty())
|
||||
return;
|
||||
base::DeleteFile(dir_path, true);
|
||||
base::DeletePathRecursively(dir_path);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -32,7 +32,7 @@ class InspectableWebContentsView {
|
|||
}
|
||||
InspectableWebContentsViewDelegate* GetDelegate() const { return delegate_; }
|
||||
|
||||
#if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
|
||||
#if defined(TOOLKIT_VIEWS) && !defined(OS_MAC)
|
||||
// Returns the container control, which has devtools view attached.
|
||||
virtual views::View* GetView() = 0;
|
||||
|
||||
|
|
|
@ -135,8 +135,9 @@ class GtkMessageBox : public NativeWindowObserver {
|
|||
gtk_widget_show(dialog_);
|
||||
// We need to call gtk_window_present after making the widgets visible to
|
||||
// make sure window gets correctly raised and gets focus.
|
||||
int time = ui::X11EventSource::GetInstance()->GetTimestamp();
|
||||
gtk_window_present_with_time(GTK_WINDOW(dialog_), time);
|
||||
x11::Time time = ui::X11EventSource::GetInstance()->GetTimestamp();
|
||||
gtk_window_present_with_time(GTK_WINDOW(dialog_),
|
||||
static_cast<uint32_t>(time));
|
||||
}
|
||||
|
||||
int RunSynchronous() {
|
||||
|
|
|
@ -40,7 +40,7 @@ class TrayIcon {
|
|||
// status icon (e.g. Ubuntu Unity).
|
||||
virtual void SetToolTip(const std::string& tool_tip) = 0;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
// Set/Get flag determining whether to ignore double click events.
|
||||
virtual void SetIgnoreDoubleClickEvents(bool ignore) = 0;
|
||||
virtual bool GetIgnoreDoubleClickEvents() = 0;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "cc/paint/skia_paint_canvas.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "ui/accessibility/ax_enums.mojom.h"
|
||||
#include "ui/base/dragdrop/drag_drop_types.h"
|
||||
#include "ui/events/keycodes/keyboard_codes.h"
|
||||
#include "ui/gfx/canvas.h"
|
||||
#include "ui/gfx/geometry/point.h"
|
||||
|
|
|
@ -57,9 +57,9 @@ class DevToolsWindowDelegate : public views::ClientView,
|
|||
}
|
||||
|
||||
// views::ClientView:
|
||||
bool CanClose() override {
|
||||
views::CloseRequestResult OnWindowCloseRequested() override {
|
||||
shell_->inspectable_web_contents()->CloseDevTools();
|
||||
return false;
|
||||
return views::CloseRequestResult::kCannotClose;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -305,7 +305,7 @@ void MenuBar::RebuildChildren() {
|
|||
RemoveAllChildViews(true);
|
||||
for (int i = 0, n = GetItemCount(); i < n; ++i) {
|
||||
auto* button =
|
||||
new SubmenuButton(menu_model_->GetLabelAt(i), this, background_color_);
|
||||
new SubmenuButton(this, menu_model_->GetLabelAt(i), background_color_);
|
||||
button->set_tag(i);
|
||||
AddChildView(button);
|
||||
}
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
|
||||
namespace electron {
|
||||
|
||||
SubmenuButton::SubmenuButton(const base::string16& title,
|
||||
views::ButtonListener* button_listener,
|
||||
SubmenuButton::SubmenuButton(views::ButtonListener* button_listener,
|
||||
const base::string16& title,
|
||||
const SkColor& background_color)
|
||||
: views::MenuButton(
|
||||
gfx::RemoveAcceleratorChar(title, '&', nullptr, nullptr),
|
||||
button_listener),
|
||||
button_listener,
|
||||
gfx::RemoveAcceleratorChar(title, '&', nullptr, nullptr)),
|
||||
background_color_(background_color) {
|
||||
#if defined(OS_LINUX)
|
||||
// Dont' use native style border.
|
||||
|
|
|
@ -16,8 +16,8 @@ namespace electron {
|
|||
// Special button that used by menu bar to show submenus.
|
||||
class SubmenuButton : public views::MenuButton {
|
||||
public:
|
||||
SubmenuButton(const base::string16& title,
|
||||
views::ButtonListener* button_listener,
|
||||
SubmenuButton(views::ButtonListener* button_listener,
|
||||
const base::string16& title,
|
||||
const SkColor& background_color);
|
||||
~SubmenuButton() override;
|
||||
|
||||
|
|
|
@ -55,10 +55,9 @@ void WindowStateWatcher::DidProcessXEvent(x11::Event* x11_event) {
|
|||
}
|
||||
|
||||
bool WindowStateWatcher::IsWindowStateEvent(x11::Event* x11_event) const {
|
||||
XEvent* xev = &x11_event->xlib_event();
|
||||
return (static_cast<x11::Atom>(xev->xproperty.atom) == window_state_atom_ &&
|
||||
xev->type == PropertyNotify &&
|
||||
xev->xproperty.window == static_cast<uint32_t>(widget_));
|
||||
auto* property = x11_event->As<x11::PropertyNotifyEvent>();
|
||||
return (property && property->atom == window_state_atom_ &&
|
||||
static_cast<uint32_t>(property->window) == widget_);
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -153,7 +153,7 @@ WebContentsPreferences::WebContentsPreferences(
|
|||
} else {
|
||||
SetDefaultBoolIfUndefined(options::kAllowRunningInsecureContent, false);
|
||||
}
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
SetDefaultBoolIfUndefined(options::kScrollBounce, false);
|
||||
#endif
|
||||
SetDefaultBoolIfUndefined(options::kOffscreen, false);
|
||||
|
@ -382,7 +382,7 @@ void WebContentsPreferences::AppendCommandLineSwitches(
|
|||
command_line->AppendSwitchASCII(switches::kOpenerID,
|
||||
base::NumberToString(opener_id));
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
// Enable scroll bounce.
|
||||
if (IsEnabled(options::kScrollBounce))
|
||||
command_line->AppendSwitch(switches::kScrollBounce);
|
||||
|
|
|
@ -39,6 +39,7 @@ void WebViewGuestDelegate::AttachToIframe(
|
|||
content::WebContents::FromRenderFrameHost(embedder_frame));
|
||||
|
||||
content::WebContents* guest_web_contents = api_web_contents_->web_contents();
|
||||
|
||||
// Attach this inner WebContents |guest_web_contents| to the outer
|
||||
// WebContents |embedder_web_contents|. The outer WebContents's
|
||||
// frame |embedder_frame| hosts the inner WebContents.
|
||||
|
|
|
@ -94,7 +94,7 @@ void WindowList::RemoveObserver(WindowListObserver* observer) {
|
|||
void WindowList::CloseAllWindows() {
|
||||
std::vector<base::WeakPtr<NativeWindow>> weak_windows =
|
||||
ConvertToWeakPtrVector(GetInstance()->windows_);
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
std::reverse(weak_windows.begin(), weak_windows.end());
|
||||
#endif
|
||||
for (const auto& window : weak_windows) {
|
||||
|
|
|
@ -206,7 +206,7 @@ void Clipboard::WriteImage(const gfx::Image& image,
|
|||
}
|
||||
}
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
void Clipboard::WriteFindText(const base::string16& text) {}
|
||||
base::string16 Clipboard::ReadFindText() {
|
||||
return base::string16();
|
||||
|
|
|
@ -76,7 +76,7 @@ base::FilePath NormalizePath(const base::FilePath& path) {
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
bool IsTemplateFilename(const base::FilePath& path) {
|
||||
return (base::MatchPattern(path.value(), "*Template.*") ||
|
||||
base::MatchPattern(path.value(), "*Template@*x.*"));
|
||||
|
@ -233,7 +233,7 @@ v8::Local<v8::Value> NativeImage::GetBitmap(gin::Arguments* args) {
|
|||
|
||||
v8::Local<v8::Value> NativeImage::GetNativeHandle(
|
||||
gin_helper::ErrorThrower thrower) {
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
if (IsEmpty())
|
||||
return node::Buffer::New(thrower.isolate(), 0).ToLocalChecked();
|
||||
|
||||
|
@ -356,7 +356,7 @@ void NativeImage::AddRepresentation(const gin_helper::Dictionary& options) {
|
|||
}
|
||||
}
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
void NativeImage::SetTemplateImage(bool setAsTemplate) {}
|
||||
|
||||
bool NativeImage::IsTemplateImage() {
|
||||
|
@ -407,7 +407,7 @@ gin::Handle<NativeImage> NativeImage::CreateFromPath(
|
|||
electron::util::PopulateImageSkiaRepsFromPath(&image_skia, image_path);
|
||||
gfx::Image image(image_skia);
|
||||
gin::Handle<NativeImage> handle = Create(isolate, image);
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
if (IsTemplateFilename(image_path))
|
||||
handle->SetTemplateImage(true);
|
||||
#endif
|
||||
|
@ -504,7 +504,7 @@ gin::Handle<NativeImage> NativeImage::CreateFromDataURL(v8::Isolate* isolate,
|
|||
return CreateEmpty(isolate);
|
||||
}
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
gin::Handle<NativeImage> NativeImage::CreateFromNamedImage(gin::Arguments* args,
|
||||
std::string name) {
|
||||
return CreateEmpty(args->isolate());
|
||||
|
|
|
@ -209,7 +209,7 @@ v8::Local<v8::Value> ElectronBindings::GetSystemMemoryInfo(
|
|||
dict.Set("free", free);
|
||||
|
||||
// NB: These return bogus values on macOS
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
dict.Set("swapTotal", mem_info.swap_total);
|
||||
dict.Set("swapFree", mem_info.swap_free);
|
||||
#endif
|
||||
|
|
|
@ -22,7 +22,7 @@ ScopedTemporaryFile::~ScopedTemporaryFile() {
|
|||
#if defined(OS_WIN)
|
||||
base::DeleteFileAfterReboot(path_);
|
||||
#else
|
||||
base::DeleteFile(path_, false);
|
||||
base::DeleteFile(path_);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ void SetPlatformCrashKey() {
|
|||
static crash_reporter::CrashKeyString<8> platform_key("platform");
|
||||
#if defined(OS_WIN)
|
||||
platform_key.Set("win32");
|
||||
#elif defined(OS_MACOSX)
|
||||
#elif defined(OS_MAC)
|
||||
platform_key.Set("darwin");
|
||||
#elif defined(OS_LINUX)
|
||||
platform_key.Set("linux");
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#if defined(OS_WIN)
|
||||
#include "base/base_paths_win.h"
|
||||
#elif defined(OS_MACOSX)
|
||||
#elif defined(OS_MAC)
|
||||
#include "base/base_paths_mac.h"
|
||||
#endif
|
||||
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
#include "third_party/blink/public/common/input/web_keyboard_event.h"
|
||||
#include "third_party/blink/public/common/input/web_mouse_event.h"
|
||||
#include "third_party/blink/public/common/input/web_mouse_wheel_event.h"
|
||||
#include "third_party/blink/public/web/web_device_emulation_params.h"
|
||||
#include "third_party/blink/public/common/widget/device_emulation_params.h"
|
||||
#include "third_party/blink/public/platform/web_size.h"
|
||||
#include "ui/base/clipboard/clipboard.h"
|
||||
#include "ui/events/keycodes/dom/keycode_converter.h"
|
||||
#include "ui/events/keycodes/keyboard_code_conversion.h"
|
||||
|
@ -292,21 +293,21 @@ bool Converter<blink::WebSize>::FromV8(v8::Isolate* isolate,
|
|||
return dict.Get("width", &out->width) && dict.Get("height", &out->height);
|
||||
}
|
||||
|
||||
bool Converter<blink::WebDeviceEmulationParams>::FromV8(
|
||||
bool Converter<blink::DeviceEmulationParams>::FromV8(
|
||||
v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
blink::WebDeviceEmulationParams* out) {
|
||||
blink::DeviceEmulationParams* out) {
|
||||
gin_helper::Dictionary dict;
|
||||
if (!ConvertFromV8(isolate, val, &dict))
|
||||
return false;
|
||||
|
||||
std::string screen_position;
|
||||
if (dict.Get("screenPosition", &screen_position)) {
|
||||
screen_position = base::ToLowerASCII(screen_position);
|
||||
if (screen_position == "mobile")
|
||||
out->screen_position = blink::WebDeviceEmulationParams::kMobile;
|
||||
else if (screen_position == "desktop")
|
||||
out->screen_position = blink::WebDeviceEmulationParams::kDesktop;
|
||||
std::string screen_type;
|
||||
if (dict.Get("screenPosition", &screen_type)) {
|
||||
screen_type = base::ToLowerASCII(screen_type);
|
||||
if (screen_type == "mobile")
|
||||
out->screen_type = blink::mojom::EmulatedScreenType::kMobile;
|
||||
else if (screen_type == "desktop")
|
||||
out->screen_type = blink::mojom::EmulatedScreenType::kDesktop;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace blink {
|
|||
class WebMouseEvent;
|
||||
class WebMouseWheelEvent;
|
||||
class WebKeyboardEvent;
|
||||
struct WebDeviceEmulationParams;
|
||||
struct DeviceEmulationParams;
|
||||
struct WebSize;
|
||||
} // namespace blink
|
||||
|
||||
|
@ -60,10 +60,10 @@ struct Converter<blink::WebSize> {
|
|||
};
|
||||
|
||||
template <>
|
||||
struct Converter<blink::WebDeviceEmulationParams> {
|
||||
struct Converter<blink::DeviceEmulationParams> {
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
blink::WebDeviceEmulationParams* out);
|
||||
blink::DeviceEmulationParams* out);
|
||||
};
|
||||
|
||||
template <>
|
||||
|
|
|
@ -24,7 +24,7 @@ ui::KeyboardCode KeyboardCodeFromKeyIdentifier(const std::string& s,
|
|||
str == "meta") {
|
||||
return ui::VKEY_COMMAND;
|
||||
} else if (str == "commandorcontrol" || str == "cmdorctrl") {
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
return ui::VKEY_COMMAND;
|
||||
#else
|
||||
return ui::VKEY_CONTROL;
|
||||
|
|
|
@ -257,7 +257,7 @@ std::unique_ptr<const char* []> StringVectorToArgArray(
|
|||
}
|
||||
|
||||
base::FilePath GetResourcesPath() {
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
return MainApplicationBundlePath().Append("Contents").Append("Resources");
|
||||
#else
|
||||
auto* command_line = base::CommandLine::ForCurrentProcess();
|
||||
|
|
|
@ -50,7 +50,7 @@ void Beep();
|
|||
bool GetFolderPath(int key, base::FilePath* result);
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
bool GetLoginItemEnabled();
|
||||
bool SetLoginItemEnabled(bool enabled);
|
||||
#endif
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "shell/common/v8_value_serializer.h"
|
||||
#include "shell/renderer/electron_render_frame_observer.h"
|
||||
#include "shell/renderer/renderer_client_base.h"
|
||||
#include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-shared.h"
|
||||
#include "third_party/blink/public/web/blink.h"
|
||||
#include "third_party/blink/public/web/web_local_frame.h"
|
||||
#include "third_party/blink/public/web/web_message_port_converter.h"
|
||||
|
@ -212,7 +213,8 @@ void ElectronApiServiceImpl::ReceivePostMessage(
|
|||
void ElectronApiServiceImpl::NotifyUserActivation() {
|
||||
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
if (frame)
|
||||
frame->NotifyUserActivation();
|
||||
frame->NotifyUserActivation(
|
||||
blink::mojom::UserActivationNotificationType::kInteraction);
|
||||
}
|
||||
|
||||
void ElectronApiServiceImpl::TakeHeapSnapshot(
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#include "third_party/blink/public/web/web_view.h"
|
||||
#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h" // nogncheck
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue