chore: bump chromium to 6d130075d378a64187360ba4e7820 (master) (#24256)

* chore: bump chromium in DEPS to 7fb9778894d73378bff51087ce869ea5aa6e5d5d

* chore: bump chromium in DEPS to 83da426e53d423f0530fc23433b6d2c4d0548442

* update patches

* remove chromeos-only TtsControllerDelegate

Refs: 2255314

* SharedUserScriptMaster -> SharedUserScriptManager

Refs: 2258357

* avoid deprecated DISALLOW_COPY_AND_ASSIGN

https://groups.google.com/a/chromium.org/forum/#!msg/cxx/qwH2hxaEjac/TUKq6eqfCwAJ

* chore: bump chromium in DEPS to b2eaf9ff4e6b03267bf279583ea20ceb2b25e9d0

* update patches

* rename GetHighContrastColorScheme -> GetPlatformHighContrastColorScheme

Refs: 2250224

* remove vulkan info collection

Refs: 2252818

* add max_xcode_version build var

Refs: 2264867

* add missing headers

* chore: bump chromium in DEPS to cded18ca1138f7e8efc904f077ddcca34f0135cf

* update patches

* add empty floc blocklist to BrowserProcessImpl

Refs: 2240873

* chore: bump chromium in DEPS to f06602226cd80bf677b2ce013a94a2fb7f6ac58d

* chore: bump chromium in DEPS to 747aa4bfc74fc6cf7f08ee72624cd69ae41ae28d

* chore: bump chromium in DEPS to 31c0105e50fcc4e94de33e5c8602c755ace4a32b

* chore: update patches

* Reland "[base] Stop including check.h, notreached.h, etc. in logging.h"

2264297

* X11 and Ozone: make sure gfx::AcceleratedWidget to be uint32_t

2260554

* Move zygote from //services/service_manager back to //content

2252466

* chore: update v8 patches

* [XProto] Remove usage of Shape extension

2262113

* fixup! add empty floc blocklist to BrowserProcessImpl

* Require macOS 10.15.1 sdk

2238504

* Use newer Xcode version 11.5.0

* update src cache

* chore: bump chromium in DEPS to 60a9883e35db3f6f91916f0878e88e1849c17b11

* chore: update patches

* Reland "Reland "New toolchain for Windows 10 19041 SDK""

2255527

* update patches

* Convert raw NonClientFrameViews to unique_ptrs

2240417

* [printing] Move PrintHostMsg_DidPreviewDocument_Params to print.mojom

2257035

* chore: bump chromium in DEPS to 12c233c2a85bfa28fb279f390121ba681e52a71b

* chore: update patches

* Removing oppressive language for the directory chrome/browser/apps

2269822

* Inclusion: rename SpellcheckLanguageBlacklistPolicyHandler

2267646

* Clean up duplicate WebContents "is fullscreen" functions

2275148

* Adds icon loading service with sandbox for Windows.

1987273

* No more Vulkan info collection for UMA on Windows

2252818

* fix lint

* chore: update buildflag conditions

* chore: bump chromium in DEPS to a837d4c4230ace4f10b2768728f4044b7995dfa5

* update hunspell files

* chore: update patches

* Make content::FileSelectListener a RefCounted

2275338

* fix build failures on MAS

* update patches

* fixup! Reland "[base] Stop including check.h, notreached.h, etc. in logging.h"

* fix build on windows

* Check for GDI exhaustion if window creation fails

2244124

* chore: bump chromium in DEPS to 2c9b2a73be4ef9ec22d8b6da8e174cb80753f125

* chore: update patches

* Network Service: Move DeleteCookiePredicate into public folder

2264186

* chore: bump chromium in DEPS to fa2606299bcc02c362528d26b5dcf8c8a0db0735

* chore: bump chromium in DEPS to d9c235d1227204dbae3708daae851573a3566b94

* chore: bump chromium in DEPS to 2f82c284243c035f49a747fd1ead6c44b4b31093

* chore: update patches

* Move creating the LayerTreeSettings into blink.

2267720

* chore: bump chromium in DEPS to 914112f1d9af9e4974059dc403da62699a55550f

* update patches

* chore: bump chromium in DEPS to e0bc1ffae6393fc543a2da94c88167df75859b36

* refactor: match upstream print preview handling (#24452)

* update patches

* chore: bump chromium in DEPS to 0881423156abe084164b51ab58ce93a8bd380524

* update patches

* update patches

* give a type to pendingPromise

* chore: bump chromium in DEPS to 11a8c1534b16d130075d378a64187360ba4e7820

* update patches

* 2272609: Move //services/service_manager/sandbox to //sandbox/policy.

2272609

* update patches

* fixup! 2272609: Move //services/service_manager/sandbox to //sandbox/policy.

* fixup! 2272609: Move //services/service_manager/sandbox to //sandbox/policy.

* 2264511: Cookies: Update SetCanonicalCookie to return CookieAccessResult

2264511

* chore: fix setAlwaysOnTop test

The window must be visible for state to be updated properly.

* Revert "Migrate modules/desktop_capture and modules/video_capture to webrtc::Mutex."

https://webrtc-review.googlesource.com/c/src/+/179080

* update patches

Co-authored-by: Andy Locascio <andy@slack-corp.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
This commit is contained in:
Electron Bot 2020-07-13 18:13:34 -07:00 committed by GitHub
parent 36bd940bc3
commit 8bbdc224ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
140 changed files with 852 additions and 750 deletions

View file

@ -26,8 +26,8 @@
#include "electron/buildflags/buildflags.h"
#include "extensions/common/constants.h"
#include "ipc/ipc_buildflags.h"
#include "sandbox/policy/switches.h"
#include "services/service_manager/embedder/switches.h"
#include "services/service_manager/sandbox/switches.h"
#include "services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler.h"
#include "shell/app/electron_content_client.h"
#include "shell/browser/electron_browser_client.h"
@ -80,7 +80,7 @@ bool IsBrowserProcess(base::CommandLine* cmd) {
bool IsSandboxEnabled(base::CommandLine* command_line) {
return command_line->HasSwitch(switches::kEnableSandbox) ||
!command_line->HasSwitch(service_manager::switches::kNoSandbox);
!command_line->HasSwitch(sandbox::policy::switches::kNoSandbox);
}
// Returns true if this subprocess type needs the ResourceBundle initialized
@ -228,7 +228,7 @@ bool ElectronMainDelegate::BasicStartupComplete(int* exit_code) {
base::debug::EnableInProcessStackDumping();
if (env->HasVar("ELECTRON_DISABLE_SANDBOX"))
command_line->AppendSwitch(service_manager::switches::kNoSandbox);
command_line->AppendSwitch(sandbox::policy::switches::kNoSandbox);
tracing_sampler_profiler_ =
tracing::TracingSamplerProfiler::CreateOnMainThread();
@ -262,7 +262,7 @@ bool ElectronMainDelegate::BasicStartupComplete(int* exit_code) {
// Check for --no-sandbox parameter when running as root.
if (getuid() == 0 && IsSandboxEnabled(command_line))
LOG(FATAL) << "Running as root without --"
<< service_manager::switches::kNoSandbox
<< sandbox::policy::switches::kNoSandbox
<< " is not supported. See https://crbug.com/638180.";
#endif

View file

@ -32,7 +32,7 @@
#include "media/audio/audio_manager.h"
#include "net/ssl/client_cert_identity.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "services/service_manager/sandbox/switches.h"
#include "sandbox/policy/switches.h"
#include "shell/browser/api/electron_api_menu.h"
#include "shell/browser/api/electron_api_session.h"
#include "shell/browser/api/electron_api_web_contents.h"
@ -1360,7 +1360,7 @@ v8::Local<v8::Promise> App::GetGPUInfo(v8::Isolate* isolate,
}
static void RemoveNoSandboxSwitch(base::CommandLine* command_line) {
if (command_line->HasSwitch(service_manager::switches::kNoSandbox)) {
if (command_line->HasSwitch(sandbox::policy::switches::kNoSandbox)) {
const base::CommandLine::CharType* noSandboxArg =
FILE_PATH_LITERAL("--no-sandbox");
base::CommandLine::StringVector modified_command_line;

View file

@ -322,7 +322,7 @@ void BrowserWindow::OnWindowResize() {
void BrowserWindow::OnWindowLeaveFullScreen() {
BaseWindow::OnWindowLeaveFullScreen();
#if defined(OS_MACOSX)
if (web_contents()->IsFullscreenForCurrentTab())
if (web_contents()->IsFullscreen())
web_contents()->ExitFullscreen(true);
#endif
}

View file

@ -339,12 +339,11 @@ v8::Local<v8::Promise> Cookies::Set(v8::Isolate* isolate,
manager->SetCanonicalCookie(
*canonical_cookie, url, options,
base::BindOnce(
[](gin_helper::Promise<void> promise,
net::CookieInclusionStatus status) {
if (status.IsInclude()) {
[](gin_helper::Promise<void> promise, net::CookieAccessResult r) {
if (r.status.IsInclude()) {
promise.Resolve();
} else {
promise.RejectWithErrorMessage(InclusionStatusToString(status));
promise.RejectWithErrorMessage(InclusionStatusToString(r.status));
}
},
std::move(promise)));

View file

@ -89,8 +89,8 @@ bool NativeTheme::ShouldUseInvertedColorScheme() {
return false;
return is_inverted;
#else
return ui_theme_->GetHighContrastColorScheme() ==
ui::NativeTheme::HighContrastColorScheme::kDark;
return ui_theme_->GetPlatformHighContrastColorScheme() ==
ui::NativeTheme::PlatformHighContrastColorScheme::kDark;
#endif
}

View file

@ -7,6 +7,7 @@
#include <windows.h>
#include <wtsapi32.h>
#include "base/win/windows_types.h"
#include "base/win/wrapped_window_proc.h"
#include "ui/base/win/shell.h"
#include "ui/gfx/win/hwnd_util.h"
@ -34,7 +35,7 @@ void PowerMonitor::InitPlatformSpecificMonitors() {
// session lock and unlock events.
window_ = CreateWindow(MAKEINTATOM(atom_), 0, 0, 0, 0, 0, 0, HWND_MESSAGE, 0,
instance_, 0);
gfx::CheckWindowCreated(window_);
gfx::CheckWindowCreated(window_, ::GetLastError());
gfx::SetWindowUserData(window_, this);
// Tel windows we want to be notified with session events

View file

@ -38,8 +38,8 @@ bool SystemPreferences::IsDarkMode() {
bool SystemPreferences::IsInvertedColorScheme() {
return ui::NativeTheme::GetInstanceForNativeUi()
->GetHighContrastColorScheme() ==
ui::NativeTheme::HighContrastColorScheme::kDark;
->GetPlatformHighContrastColorScheme() ==
ui::NativeTheme::PlatformHighContrastColorScheme::kDark;
}
bool SystemPreferences::IsHighContrastColorScheme() {

View file

@ -10,6 +10,7 @@
#include "shell/browser/api/electron_api_system_preferences.h"
#include "base/win/core_winrt_util.h"
#include "base/win/windows_types.h"
#include "base/win/wrapped_window_proc.h"
#include "shell/common/color_util.h"
#include "ui/base/win/shell.h"
@ -209,7 +210,7 @@ void SystemPreferences::InitializeWindow() {
// receive broadcast messages like "WM_DWMCOLORIZATIONCOLORCHANGED".
window_ = CreateWindow(MAKEINTATOM(atom_), 0, WS_POPUP, 0, 0, 0, 0, 0, 0,
instance_, 0);
gfx::CheckWindowCreated(window_);
gfx::CheckWindowCreated(window_, ::GetLastError());
gfx::SetWindowUserData(window_, this);
}

View file

@ -113,18 +113,6 @@ void GPUInfoEnumerator::EndAuxAttributes() {
value_stack.pop();
}
void GPUInfoEnumerator::BeginDx12VulkanVersionInfo() {
value_stack.push(std::move(current));
current = std::make_unique<base::DictionaryValue>();
}
void GPUInfoEnumerator::EndDx12VulkanVersionInfo() {
auto& top_value = value_stack.top();
top_value->SetDictionary(kDx12VulkanVersionInfoKey, std::move(current));
current = std::move(top_value);
value_stack.pop();
}
void GPUInfoEnumerator::BeginOverlayInfo() {
value_stack.push(std::move(current));
current = std::make_unique<base::DictionaryValue>();

View file

@ -25,7 +25,6 @@ class GPUInfoEnumerator final : public gpu::GPUInfo::Enumerator {
const char* kImageDecodeAcceleratorSupportedProfileKey =
"imageDecodeAcceleratorSupportedProfile";
const char* kAuxAttributesKey = "auxAttributes";
const char* kDx12VulkanVersionInfoKey = "dx12VulkanVersionInfo";
const char* kOverlayInfo = "overlayInfo";
public:
@ -49,8 +48,6 @@ class GPUInfoEnumerator final : public gpu::GPUInfo::Enumerator {
void EndImageDecodeAcceleratorSupportedProfile() override;
void BeginAuxAttributes() override;
void EndAuxAttributes() override;
void BeginDx12VulkanVersionInfo() override;
void EndDx12VulkanVersionInfo() override;
void BeginOverlayInfo() override;
void EndOverlayInfo() override;
std::unique_ptr<base::DictionaryValue> GetDictionary();

View file

@ -9,6 +9,7 @@
#include <utility>
#include "chrome/common/chrome_switches.h"
#include "components/federated_learning/floc_blocklist_service.h" // nogncheck
#include "components/prefs/in_memory_pref_store.h"
#include "components/prefs/overlay_user_pref_store.h"
#include "components/prefs/pref_registry.h"
@ -237,6 +238,11 @@ BrowserProcessImpl::subresource_filter_ruleset_service() {
return nullptr;
}
federated_learning::FlocBlocklistService*
BrowserProcessImpl::floc_blocklist_service() {
return nullptr;
}
optimization_guide::OptimizationGuideService*
BrowserProcessImpl::optimization_guide_service() {
return nullptr;

View file

@ -79,6 +79,7 @@ class BrowserProcessImpl : public BrowserProcess {
safe_browsing::SafeBrowsingService* safe_browsing_service() override;
subresource_filter::RulesetService* subresource_filter_ruleset_service()
override;
federated_learning::FlocBlocklistService* floc_blocklist_service() override;
optimization_guide::OptimizationGuideService* optimization_guide_service()
override;
component_updater::ComponentUpdateService* component_updater() override;

View file

@ -330,7 +330,7 @@ content::ColorChooser* CommonWebContentsDelegate::OpenColorChooser(
void CommonWebContentsDelegate::RunFileChooser(
content::RenderFrameHost* render_frame_host,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) {
if (!web_dialog_helper_)
web_dialog_helper_ =
@ -341,7 +341,7 @@ void CommonWebContentsDelegate::RunFileChooser(
void CommonWebContentsDelegate::EnumerateDirectory(
content::WebContents* guest,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
const base::FilePath& path) {
if (!web_dialog_helper_)
web_dialog_helper_ =

View file

@ -84,10 +84,10 @@ class CommonWebContentsDelegate : public content::WebContentsDelegate,
const std::vector<blink::mojom::ColorSuggestionPtr>& suggestions)
override;
void RunFileChooser(content::RenderFrameHost* render_frame_host,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) override;
void EnumerateDirectory(content::WebContents* web_contents,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
const base::FilePath& path) override;
void EnterFullscreenModeForTab(
content::RenderFrameHost* requesting_frame,

View file

@ -39,6 +39,8 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/tts_controller.h"
#include "content/public/browser/tts_platform.h"
#include "content/public/common/content_descriptors.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
@ -129,10 +131,6 @@
#include "shell/browser/fake_location_provider.h"
#endif // BUILDFLAG(OVERRIDE_LOCATION_PROVIDER)
#if BUILDFLAG(ENABLE_TTS)
#include "chrome/browser/speech/tts_controller_delegate_impl.h"
#endif // BUILDFLAG(ENABLE_TTS)
#if BUILDFLAG(ENABLE_PRINTING)
#include "chrome/browser/printing/printing_message_filter.h"
#endif // BUILDFLAG(ENABLE_PRINTING)
@ -566,13 +564,8 @@ ElectronBrowserClient::CreateSpeechRecognitionManagerDelegate() {
return new ElectronSpeechRecognitionManagerDelegate;
}
content::TtsControllerDelegate*
ElectronBrowserClient::GetTtsControllerDelegate() {
#if BUILDFLAG(ENABLE_TTS)
return TtsControllerDelegateImpl::GetInstance();
#else
content::TtsPlatform* ElectronBrowserClient::GetTtsPlatform() {
return nullptr;
#endif
}
void ElectronBrowserClient::OverrideWebkitPrefs(

View file

@ -87,7 +87,8 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
content::SpeechRecognitionManagerDelegate*
CreateSpeechRecognitionManagerDelegate() override;
content::TtsControllerDelegate* GetTtsControllerDelegate() override;
content::TtsPlatform* GetTtsPlatform() override;
void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
content::WebPreferences* prefs) override;
SiteInstanceForNavigationType ShouldOverrideSiteInstanceForNavigation(

View file

@ -9,6 +9,7 @@
#include <string>
#include <utility>
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"

View file

@ -30,7 +30,7 @@
#include "extensions/browser/quota_service.h"
#include "extensions/browser/runtime_data.h"
#include "extensions/browser/service_worker_manager.h"
#include "extensions/browser/shared_user_script_master.h"
#include "extensions/browser/shared_user_script_manager.h"
#include "extensions/browser/value_store/value_store_factory_impl.h"
#include "extensions/common/constants.h"
#include "extensions/common/file_util.h"
@ -83,8 +83,8 @@ void ElectronExtensionSystem::InitForRegularProfile(bool extensions_enabled) {
runtime_data_ =
std::make_unique<RuntimeData>(ExtensionRegistry::Get(browser_context_));
quota_service_ = std::make_unique<QuotaService>();
shared_user_script_master_ =
std::make_unique<SharedUserScriptMaster>(browser_context_);
shared_user_script_manager_ =
std::make_unique<SharedUserScriptManager>(browser_context_);
app_sorting_ = std::make_unique<NullAppSorting>();
extension_loader_ =
std::make_unique<ElectronExtensionLoader>(browser_context_);
@ -137,8 +137,8 @@ ServiceWorkerManager* ElectronExtensionSystem::service_worker_manager() {
return service_worker_manager_.get();
}
SharedUserScriptMaster* ElectronExtensionSystem::shared_user_script_master() {
return new SharedUserScriptMaster(browser_context_);
SharedUserScriptManager* ElectronExtensionSystem::shared_user_script_manager() {
return new SharedUserScriptManager(browser_context_);
}
StateStore* ElectronExtensionSystem::state_store() {

View file

@ -60,7 +60,7 @@ class ElectronExtensionSystem : public ExtensionSystem {
RuntimeData* runtime_data() override;
ManagementPolicy* management_policy() override;
ServiceWorkerManager* service_worker_manager() override;
SharedUserScriptMaster* shared_user_script_master() override;
SharedUserScriptManager* shared_user_script_manager() override;
StateStore* state_store() override;
StateStore* rules_store() override;
scoped_refptr<ValueStoreFactory> store_factory() override;
@ -102,7 +102,7 @@ class ElectronExtensionSystem : public ExtensionSystem {
std::unique_ptr<ServiceWorkerManager> service_worker_manager_;
std::unique_ptr<RuntimeData> runtime_data_;
std::unique_ptr<QuotaService> quota_service_;
std::unique_ptr<SharedUserScriptMaster> shared_user_script_master_;
std::unique_ptr<SharedUserScriptManager> shared_user_script_manager_;
std::unique_ptr<AppSorting> app_sorting_;
std::unique_ptr<ElectronExtensionLoader> extension_loader_;

View file

@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "device/bluetooth/dbus/bluez_dbus_thread_manager.h"
namespace {

View file

@ -242,12 +242,13 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options,
}
if (!state_atom_list.empty())
ui::SetAtomArrayProperty(GetAcceleratedWidget(), "_NET_WM_STATE", "ATOM",
state_atom_list);
ui::SetAtomArrayProperty(static_cast<x11::Window>(GetAcceleratedWidget()),
"_NET_WM_STATE", "ATOM", state_atom_list);
// Set the _NET_WM_WINDOW_TYPE.
if (!window_type.empty())
SetWindowType(GetAcceleratedWidget(), window_type);
SetWindowType(static_cast<x11::Window>(GetAcceleratedWidget()),
window_type);
#endif
#if defined(OS_WIN)
@ -662,7 +663,7 @@ bool NativeWindowViews::MoveAbove(const std::string& sourceId) {
if (!IsWindowValid(static_cast<x11::Window>(id.id)))
return false;
electron::MoveWindowAbove(GetAcceleratedWidget(),
electron::MoveWindowAbove(static_cast<x11::Window>(GetAcceleratedWidget()),
static_cast<x11::Window>(id.id));
#endif
@ -679,7 +680,8 @@ void NativeWindowViews::MoveTop() {
size.width(), size.height(),
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
#elif defined(USE_X11)
electron::MoveWindowToForeground(GetAcceleratedWidget());
electron::MoveWindowToForeground(
static_cast<x11::Window>(GetAcceleratedWidget()));
#endif
}
@ -864,7 +866,7 @@ void NativeWindowViews::SetSkipTaskbar(bool skip) {
taskbar_host_.RestoreThumbarButtons(GetAcceleratedWidget());
}
#elif defined(USE_X11)
SetWMSpecState(GetAcceleratedWidget(), skip,
SetWMSpecState(static_cast<x11::Window>(GetAcceleratedWidget()), skip,
gfx::GetAtom("_NET_WM_STATE_SKIP_TASKBAR"));
#endif
}
@ -955,16 +957,23 @@ void NativeWindowViews::SetIgnoreMouseEvents(bool ignore, bool forward) {
SetForwardMouseMessages(forward);
}
#elif defined(USE_X11)
auto* connection = x11::Connection::Get();
if (ignore) {
XRectangle r = {0, 0, 1, 1};
XShapeCombineRectangles(gfx::GetXDisplay(),
static_cast<uint32_t>(GetAcceleratedWidget()),
ShapeInput, 0, 0, &r, 1, ShapeSet,
static_cast<int>(x11::ClipOrdering::YXBanded));
x11::Rectangle r{0, 0, 1, 1};
connection->shape().Rectangles({
.operation = x11::Shape::So::Set,
.destination_kind = x11::Shape::Sk::Input,
.ordering = x11::ClipOrdering::YXBanded,
.destination_window = static_cast<x11::Window>(GetAcceleratedWidget()),
.rectangles = {r},
});
} else {
XShapeCombineMask(gfx::GetXDisplay(),
static_cast<uint32_t>(GetAcceleratedWidget()), ShapeInput,
0, 0, x11::None, ShapeSet);
connection->shape().Mask({
.operation = x11::Shape::So::Set,
.destination_kind = x11::Shape::Sk::Input,
.destination_window = static_cast<x11::Window>(GetAcceleratedWidget()),
.source_bitmap = x11::Pixmap::None,
});
}
#endif
}
@ -1074,8 +1083,9 @@ void NativeWindowViews::SetParentWindow(NativeWindow* parent) {
XDisplay* xdisplay = gfx::GetXDisplay();
XSetTransientForHint(
xdisplay, static_cast<uint32_t>(GetAcceleratedWidget()),
static_cast<uint32_t>(parent ? parent->GetAcceleratedWidget()
: ui::GetX11RootWindow()));
static_cast<uint32_t>(
parent ? static_cast<x11::Window>(parent->GetAcceleratedWidget())
: ui::GetX11RootWindow()));
#elif defined(OS_WIN)
// To set parentship between windows into Windows is better to play with the
// owner instead of the parent, as Windows natively seems to do if a parent
@ -1153,7 +1163,8 @@ bool NativeWindowViews::IsVisibleOnAllWorkspaces() {
// determine whether the current window is visible on all workspaces.
x11::Atom sticky_atom = gfx::GetAtom("_NET_WM_STATE_STICKY");
std::vector<x11::Atom> wm_states;
ui::GetAtomArrayProperty(GetAcceleratedWidget(), "_NET_WM_STATE", &wm_states);
ui::GetAtomArrayProperty(static_cast<x11::Window>(GetAcceleratedWidget()),
"_NET_WM_STATE", &wm_states);
return std::find(wm_states.begin(), wm_states.end(), sticky_atom) !=
wm_states.end();
#endif
@ -1281,11 +1292,11 @@ void NativeWindowViews::SetIcon(const gfx::ImageSkia& icon) {
#if defined(USE_X11)
void NativeWindowViews::SetGTKDarkThemeEnabled(bool use_dark_theme) {
if (use_dark_theme) {
ui::SetStringProperty(GetAcceleratedWidget(),
ui::SetStringProperty(static_cast<x11::Window>(GetAcceleratedWidget()),
gfx::GetAtom("_GTK_THEME_VARIANT"),
gfx::GetAtom("UTF8_STRING"), "dark");
} else {
ui::SetStringProperty(GetAcceleratedWidget(),
ui::SetStringProperty(static_cast<x11::Window>(GetAcceleratedWidget()),
gfx::GetAtom("_GTK_THEME_VARIANT"),
gfx::GetAtom("UTF8_STRING"), "light");
}
@ -1404,17 +1415,17 @@ views::ClientView* NativeWindowViews::CreateClientView(views::Widget* widget) {
return new NativeWindowClientView(widget, root_view_.get(), this);
}
views::NonClientFrameView* NativeWindowViews::CreateNonClientFrameView(
views::Widget* widget) {
std::unique_ptr<views::NonClientFrameView>
NativeWindowViews::CreateNonClientFrameView(views::Widget* widget) {
#if defined(OS_WIN)
WinFrameView* frame_view = new WinFrameView;
auto frame_view = std::make_unique<WinFrameView>();
frame_view->Init(this, widget);
return frame_view;
#else
if (has_frame()) {
return new NativeFrameView(this, widget);
return std::make_unique<NativeFrameView>(this, widget);
} else {
FramelessView* frame_view = new FramelessView;
auto frame_view = std::make_unique<FramelessView>();
frame_view->Init(this, widget);
return frame_view;
}

View file

@ -184,7 +184,7 @@ class NativeWindowViews : public NativeWindow,
gfx::NativeView child,
const gfx::Point& location) override;
views::ClientView* CreateClientView(views::Widget* widget) override;
views::NonClientFrameView* CreateNonClientFrameView(
std::unique_ptr<views::NonClientFrameView> CreateNonClientFrameView(
views::Widget* widget) override;
void OnWidgetMove() override;
#if defined(OS_WIN)

View file

@ -7,6 +7,7 @@
#include <string>
#include <utility>
#include "base/logging.h"
#include "base/mac/mac_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"

View file

@ -6,6 +6,7 @@
#include <string>
#include "base/logging.h"
#include "shell/browser/notifications/mac/cocoa_notification.h"
#include "shell/browser/notifications/mac/notification_presenter_mac.h"

View file

@ -2,6 +2,8 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "base/logging.h"
#include "shell/browser/notifications/mac/notification_presenter_mac.h"
#include "shell/browser/notifications/mac/cocoa_notification.h"

View file

@ -13,6 +13,7 @@
#include "base/environment.h"
#include "base/files/file_util.h"
#include "base/hash/md5.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"

View file

@ -17,6 +17,7 @@
#include <utility>
#include <vector>
#include "base/check.h"
#include "shell/browser/notifications/win/win32_desktop_notifications/common.h"
#include "shell/browser/notifications/win/win32_desktop_notifications/toast.h"

View file

@ -9,7 +9,7 @@
#include "shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.h"
#include "base/logging.h"
#include "base/check.h"
namespace electron {

View file

@ -3,7 +3,10 @@
// found in the LICENSE file.
#include "shell/browser/notifications/win/win32_desktop_notifications/toast_uia.h"
#include <UIAutomation.h>
#include "base/check_op.h"
#include "shell/browser/notifications/win/win32_desktop_notifications/common.h"
#pragma comment(lib, "uiautomationcore.lib")

View file

@ -138,7 +138,7 @@ class ElectronDelegatedFrameHostClient
SkColor DelegatedFrameHostGetGutterColor() const override {
if (view_->render_widget_host()->delegate() &&
view_->render_widget_host()->delegate()->IsFullscreenForCurrentTab()) {
view_->render_widget_host()->delegate()->IsFullscreen()) {
return SK_ColorWHITE;
}
return *view_->GetBackgroundColor();

View file

@ -67,6 +67,9 @@ bool PrintPreviewMessageHandler::OnMessageReceived(
render_frame_host)
IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting,
OnMetafileReadyForPrinting)
IPC_MESSAGE_HANDLER(PrintHostMsg_DidPreviewPage, OnDidPreviewPage)
IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrepareDocumentForPreview,
OnDidPrepareForDocumentToPdf)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@ -74,14 +77,111 @@ bool PrintPreviewMessageHandler::OnMessageReceived(
void PrintPreviewMessageHandler::OnMetafileReadyForPrinting(
content::RenderFrameHost* render_frame_host,
const PrintHostMsg_DidPreviewDocument_Params& params,
const printing::mojom::DidPreviewDocumentParams& params,
const PrintHostMsg_PreviewIds& ids) {
// Always try to stop the worker.
StopWorker(params.document_cookie);
const printing::mojom::DidPrintContentParams& content = params.content;
if (!content.metafile_data_region.IsValid() ||
params.expected_pages_count <= 0) {
if (params.expected_pages_count == 0) {
RejectPromise(ids.request_id);
return;
}
const base::ReadOnlySharedMemoryRegion& metafile =
params.content->metafile_data_region;
if (printing::IsOopifEnabled()) {
auto* client =
printing::PrintCompositeClient::FromWebContents(web_contents());
DCHECK(client);
auto callback = base::BindOnce(
&PrintPreviewMessageHandler::OnCompositeDocumentToPdfDone,
weak_ptr_factory_.GetWeakPtr(), ids);
client->DoCompleteDocumentToPdf(
params.document_cookie, params.expected_pages_count,
mojo::WrapCallbackWithDefaultInvokeIfNotRun(
std::move(callback),
printing::mojom::PrintCompositor::Status::kCompositingFailure,
base::ReadOnlySharedMemoryRegion()));
} else {
ResolvePromise(
ids.request_id,
base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(metafile));
}
}
void PrintPreviewMessageHandler::OnPrepareForDocumentToPdfDone(
const PrintHostMsg_PreviewIds& ids,
printing::mojom::PrintCompositor::Status status) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (status != printing::mojom::PrintCompositor::Status::kSuccess) {
LOG(ERROR) << "Preparing document for pdf failed with error " << status;
}
}
void PrintPreviewMessageHandler::OnDidPrepareForDocumentToPdf(
content::RenderFrameHost* render_frame_host,
int document_cookie,
const PrintHostMsg_PreviewIds& ids) {
if (printing::IsOopifEnabled()) {
auto* client =
printing::PrintCompositeClient::FromWebContents(web_contents());
DCHECK(client);
if (client->GetIsDocumentConcurrentlyComposited(document_cookie))
return;
client->DoPrepareForDocumentToPdf(
document_cookie, render_frame_host,
mojo::WrapCallbackWithDefaultInvokeIfNotRun(
base::BindOnce(
&PrintPreviewMessageHandler::OnPrepareForDocumentToPdfDone,
weak_ptr_factory_.GetWeakPtr(), ids),
printing::mojom::PrintCompositor::Status::kCompositingFailure));
}
}
void PrintPreviewMessageHandler::OnCompositeDocumentToPdfDone(
const PrintHostMsg_PreviewIds& ids,
printing::mojom::PrintCompositor::Status status,
base::ReadOnlySharedMemoryRegion region) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (status != printing::mojom::PrintCompositor::Status::kSuccess) {
LOG(ERROR) << "Compositing pdf failed with error " << status;
RejectPromise(ids.request_id);
return;
}
ResolvePromise(
ids.request_id,
base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(region));
}
void PrintPreviewMessageHandler::OnCompositePdfPageDone(
int page_number,
int document_cookie,
const PrintHostMsg_PreviewIds& ids,
printing::mojom::PrintCompositor::Status status,
base::ReadOnlySharedMemoryRegion region) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (status != printing::mojom::PrintCompositor::Status::kSuccess) {
LOG(ERROR) << "Compositing pdf failed on page: " << page_number
<< " with error: " << status;
}
}
void PrintPreviewMessageHandler::OnDidPreviewPage(
content::RenderFrameHost* render_frame_host,
const printing::mojom::DidPreviewPageParams& params,
const PrintHostMsg_PreviewIds& ids) {
int page_number = params.page_number;
const printing::mojom::DidPrintContentParams& content = *params.content;
if (page_number < printing::FIRST_PAGE_INDEX ||
!content.metafile_data_region.IsValid()) {
RejectPromise(ids.request_id);
return;
}
@ -91,39 +191,18 @@ void PrintPreviewMessageHandler::OnMetafileReadyForPrinting(
printing::PrintCompositeClient::FromWebContents(web_contents());
DCHECK(client);
auto callback =
base::BindOnce(&PrintPreviewMessageHandler::OnCompositePdfDocumentDone,
weak_ptr_factory_.GetWeakPtr(), ids);
client->DoCompositeDocumentToPdf(
// Use utility process to convert skia metafile to pdf.
client->DoCompositePageToPdf(
params.document_cookie, render_frame_host, content,
mojo::WrapCallbackWithDefaultInvokeIfNotRun(
std::move(callback),
base::BindOnce(&PrintPreviewMessageHandler::OnCompositePdfPageDone,
weak_ptr_factory_.GetWeakPtr(), page_number,
params.document_cookie, ids),
printing::mojom::PrintCompositor::Status::kCompositingFailure,
base::ReadOnlySharedMemoryRegion()));
} else {
ResolvePromise(ids.request_id,
base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(
content.metafile_data_region));
}
}
void PrintPreviewMessageHandler::OnCompositePdfDocumentDone(
const PrintHostMsg_PreviewIds& ids,
printing::mojom::PrintCompositor::Status status,
base::ReadOnlySharedMemoryRegion region) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (status != printing::mojom::PrintCompositor::Status::kSuccess) {
DLOG(ERROR) << "Compositing pdf failed with error " << status;
RejectPromise(ids.request_id);
return;
}
ResolvePromise(
ids.request_id,
base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(region));
}
void PrintPreviewMessageHandler::PrintPreviewFailed(int32_t document_cookie,
int32_t request_id) {
StopWorker(document_cookie);

View file

@ -19,6 +19,7 @@
#include "v8/include/v8.h"
struct PrintHostMsg_DidPreviewDocument_Params;
struct PrintHostMsg_DidPreviewPage_Params;
struct PrintHostMsg_PreviewIds;
namespace content {
@ -50,12 +51,26 @@ class PrintPreviewMessageHandler
void OnMetafileReadyForPrinting(
content::RenderFrameHost* render_frame_host,
const PrintHostMsg_DidPreviewDocument_Params& params,
const printing::mojom::DidPreviewDocumentParams& params,
const PrintHostMsg_PreviewIds& ids);
void OnCompositePdfDocumentDone(
void OnCompositeDocumentToPdfDone(
const PrintHostMsg_PreviewIds& ids,
printing::mojom::PrintCompositor::Status status,
base::ReadOnlySharedMemoryRegion region);
void OnPrepareForDocumentToPdfDone(
const PrintHostMsg_PreviewIds& ids,
printing::mojom::PrintCompositor::Status status);
void OnDidPrepareForDocumentToPdf(content::RenderFrameHost* render_frame_host,
int document_cookie,
const PrintHostMsg_PreviewIds& ids);
void OnCompositePdfPageDone(int page_number,
int document_cookie,
const PrintHostMsg_PreviewIds& ids,
printing::mojom::PrintCompositor::Status status,
base::ReadOnlySharedMemoryRegion region);
void OnDidPreviewPage(content::RenderFrameHost* render_frame_host,
const printing::mojom::DidPreviewPageParams& params,
const PrintHostMsg_PreviewIds& ids);
// printing::mojo::PrintPreviewUI:
void SetOptionsFromDocument(

View file

@ -6,6 +6,7 @@
#include <windows.h>
#include "base/logging.h"
#include "base/process/launch.h"
#include "base/strings/stringprintf.h"
#include "base/win/scoped_handle.h"

View file

@ -4,6 +4,7 @@
#include "shell/browser/session_preferences.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
namespace electron {

View file

@ -37,9 +37,9 @@ bool SpecialStoragePolicy::HasSessionOnlyOrigins() {
return false;
}
network::SessionCleanupCookieStore::DeleteCookiePredicate
network::DeleteCookiePredicate
SpecialStoragePolicy::CreateDeleteCookieOnExitPredicate() {
return network::SessionCleanupCookieStore::DeleteCookiePredicate();
return network::DeleteCookiePredicate();
}
} // namespace electron

View file

@ -20,8 +20,7 @@ class SpecialStoragePolicy : public storage::SpecialStoragePolicy {
bool HasIsolatedStorage(const GURL& origin) override;
bool IsStorageSessionOnly(const GURL& origin) override;
bool HasSessionOnlyOrigins() override;
network::SessionCleanupCookieStore::DeleteCookiePredicate
CreateDeleteCookieOnExitPredicate() override;
network::DeleteCookiePredicate CreateDeleteCookieOnExitPredicate() override;
protected:
~SpecialStoragePolicy() override;

View file

@ -9,6 +9,7 @@
#include <string>
#include <vector>
#include "base/logging.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"

View file

@ -992,7 +992,7 @@ content::ColorChooser* InspectableWebContentsImpl::OpenColorChooser(
void InspectableWebContentsImpl::RunFileChooser(
content::RenderFrameHost* render_frame_host,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) {
auto* delegate = web_contents_->GetDelegate();
if (delegate)
@ -1001,7 +1001,7 @@ void InspectableWebContentsImpl::RunFileChooser(
void InspectableWebContentsImpl::EnumerateDirectory(
content::WebContents* source,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
const base::FilePath& path) {
auto* delegate = web_contents_->GetDelegate();
if (delegate)

View file

@ -187,10 +187,10 @@ class InspectableWebContentsImpl
const std::vector<blink::mojom::ColorSuggestionPtr>& suggestions)
override;
void RunFileChooser(content::RenderFrameHost* render_frame_host,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) override;
void EnumerateDirectory(content::WebContents* source,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
const base::FilePath& path) override;
void SendMessageAck(int request_id, const base::Value* arg1);

View file

@ -20,6 +20,9 @@ class InspectableWebContentsViewMac : public InspectableWebContentsView {
public:
explicit InspectableWebContentsViewMac(
InspectableWebContentsImpl* inspectable_web_contents_impl);
InspectableWebContentsViewMac(const InspectableWebContentsViewMac&) = delete;
InspectableWebContentsViewMac& operator=(
const InspectableWebContentsViewMac&) = delete;
~InspectableWebContentsViewMac() override;
gfx::NativeView GetNativeView() const override;
@ -41,8 +44,6 @@ class InspectableWebContentsViewMac : public InspectableWebContentsView {
InspectableWebContentsImpl* inspectable_web_contents_;
base::scoped_nsobject<ElectronInspectableWebContentsView> view_;
DISALLOW_COPY_AND_ASSIGN(InspectableWebContentsViewMac);
};
} // namespace electron

View file

@ -59,8 +59,8 @@ gfx::ImageSkia* ViewsDelegate::GetDefaultWindowIcon() const {
}
#endif
views::NonClientFrameView* ViewsDelegate::CreateDefaultNonClientFrameView(
views::Widget* widget) {
std::unique_ptr<views::NonClientFrameView>
ViewsDelegate::CreateDefaultNonClientFrameView(views::Widget* widget) {
return nullptr;
}

View file

@ -6,6 +6,7 @@
#define SHELL_BROWSER_UI_VIEWS_ELECTRON_VIEWS_DELEGATE_H_
#include <map>
#include <memory>
#include <string>
#include "base/compiler_specific.h"
@ -43,7 +44,7 @@ class ViewsDelegate : public views::ViewsDelegate {
#elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
gfx::ImageSkia* GetDefaultWindowIcon() const override;
#endif
views::NonClientFrameView* CreateDefaultNonClientFrameView(
std::unique_ptr<views::NonClientFrameView> CreateDefaultNonClientFrameView(
views::Widget* widget) override;
void AddRef() override;
void ReleaseRef() override;

View file

@ -172,7 +172,8 @@ std::string GetMenuModelStatus(ElectronMenuModel* model) {
GlobalMenuBarX11::GlobalMenuBarX11(NativeWindowViews* window)
: window_(window),
xwindow_(window_->GetNativeWindow()->GetHost()->GetAcceleratedWidget()) {
xwindow_(static_cast<x11::Window>(
window_->GetNativeWindow()->GetHost()->GetAcceleratedWidget())) {
EnsureMethodsLoaded();
if (server_new)
InitServer(xwindow_);

View file

@ -12,6 +12,7 @@
#include "shell/browser/ui/electron_menu_model.h"
#include "ui/base/glib/glib_signal.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/x/xproto.h"
typedef struct _DbusmenuMenuitem DbusmenuMenuitem;
typedef struct _DbusmenuServer DbusmenuServer;

View file

@ -6,6 +6,7 @@
#include <propkey.h> // for PKEY_* constants
#include "base/logging.h"
#include "base/win/scoped_co_mem.h"
#include "base/win/scoped_propvariant.h"
#include "base/win/win_util.h"

View file

@ -7,6 +7,7 @@
#include <objbase.h>
#include <utility>
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/windows_version.h"

View file

@ -8,8 +8,10 @@
#include <winuser.h>
#include "base/bind.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "base/win/win_util.h"
#include "base/win/windows_types.h"
#include "base/win/wrapped_window_proc.h"
#include "shell/browser/ui/win/notify_icon.h"
#include "ui/events/event_constants.h"
@ -68,7 +70,7 @@ NotifyIconHost::NotifyIconHost() {
// "TaskbarCreated".
window_ = CreateWindow(MAKEINTATOM(atom_), 0, WS_POPUP, 0, 0, 0, 0, 0, 0,
instance_, 0);
gfx::CheckWindowCreated(window_);
gfx::CheckWindowCreated(window_, ::GetLastError());
gfx::SetWindowUserData(window_, this);
}

View file

@ -20,7 +20,7 @@
#include "content/public/common/web_preferences.h"
#include "electron/buildflags/buildflags.h"
#include "net/base/filename_util.h"
#include "services/service_manager/sandbox/switches.h"
#include "sandbox/policy/switches.h"
#include "shell/browser/native_window.h"
#include "shell/browser/web_view_manager.h"
#include "shell/common/gin_converters/value_converter.h"
@ -318,7 +318,7 @@ void WebContentsPreferences::AppendCommandLineSwitches(
if (IsEnabled(options::kSandbox) || can_sandbox_frame) {
command_line->AppendSwitch(switches::kEnableSandbox);
} else if (!command_line->HasSwitch(switches::kEnableSandbox)) {
command_line->AppendSwitch(service_manager::switches::kNoSandbox);
command_line->AppendSwitch(sandbox::policy::switches::kNoSandbox);
command_line->AppendSwitch(::switches::kNoZygote);
}

View file

@ -47,7 +47,7 @@ class FileSelectHelper : public base::RefCounted<FileSelectHelper>,
REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE();
FileSelectHelper(content::RenderFrameHost* render_frame_host,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
blink::mojom::FileChooserParams::Mode mode)
: render_frame_host_(render_frame_host),
listener_(std::move(listener)),
@ -218,7 +218,7 @@ class FileSelectHelper : public base::RefCounted<FileSelectHelper>,
void WebContentsDestroyed() override { render_frame_host_ = nullptr; }
content::RenderFrameHost* render_frame_host_;
std::unique_ptr<content::FileSelectListener> listener_;
scoped_refptr<content::FileSelectListener> listener_;
blink::mojom::FileChooserParams::Mode mode_;
// DirectoryLister-specific members
@ -304,7 +304,7 @@ WebDialogHelper::~WebDialogHelper() = default;
void WebDialogHelper::RunFileChooser(
content::RenderFrameHost* render_frame_host,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) {
file_dialog::DialogSettings settings;
settings.force_detached = offscreen_;
@ -346,7 +346,7 @@ void WebDialogHelper::RunFileChooser(
void WebDialogHelper::EnumerateDirectory(
content::WebContents* web_contents,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
const base::FilePath& dir) {
int types = base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES |
base::FileEnumerator::INCLUDE_DOT_DOT;

View file

@ -31,10 +31,10 @@ class WebDialogHelper {
~WebDialogHelper();
void RunFileChooser(content::RenderFrameHost* render_frame_host,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params);
void EnumerateDirectory(content::WebContents* web_contents,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
const base::FilePath& path);
private:

View file

@ -13,6 +13,7 @@
#include <memory>
#include "base/file_version_info.h"
#include "base/notreached.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"

View file

@ -20,6 +20,8 @@ namespace asar {
class ScopedTemporaryFile {
public:
ScopedTemporaryFile();
ScopedTemporaryFile(const ScopedTemporaryFile&) = delete;
ScopedTemporaryFile& operator=(const ScopedTemporaryFile&) = delete;
virtual ~ScopedTemporaryFile();
// Init an empty temporary file with a certain extension.
@ -35,8 +37,6 @@ class ScopedTemporaryFile {
private:
base::FilePath path_;
DISALLOW_COPY_AND_ASSIGN(ScopedTemporaryFile);
};
} // namespace asar

View file

@ -97,15 +97,15 @@ void ElectronExtensionsClient::FilterHostPermissions(
NOTIMPLEMENTED();
}
void ElectronExtensionsClient::SetScriptingWhitelist(
const ExtensionsClient::ScriptingWhitelist& whitelist) {
scripting_whitelist_ = whitelist;
void ElectronExtensionsClient::SetScriptingAllowlist(
const ExtensionsClient::ScriptingAllowlist& allowlist) {
scripting_allowlist_ = allowlist;
}
const ExtensionsClient::ScriptingWhitelist&
ElectronExtensionsClient::GetScriptingWhitelist() const {
const ExtensionsClient::ScriptingAllowlist&
ElectronExtensionsClient::GetScriptingAllowlist() const {
// TODO(jamescook): Real whitelist.
return scripting_whitelist_;
return scripting_allowlist_;
}
extensions::URLPatternSet

View file

@ -26,7 +26,7 @@ namespace electron {
// The app_shell implementation of ExtensionsClient.
class ElectronExtensionsClient : public extensions::ExtensionsClient {
public:
typedef extensions::ExtensionsClient::ScriptingWhitelist ScriptingWhitelist;
using ScriptingAllowlist = extensions::ExtensionsClient::ScriptingAllowlist;
ElectronExtensionsClient();
~ElectronExtensionsClient() override;
@ -41,8 +41,8 @@ class ElectronExtensionsClient : public extensions::ExtensionsClient {
const extensions::URLPatternSet& hosts,
extensions::URLPatternSet* new_hosts,
extensions::PermissionIDSet* permissions) const override;
void SetScriptingWhitelist(const ScriptingWhitelist& whitelist) override;
const ScriptingWhitelist& GetScriptingWhitelist() const override;
void SetScriptingAllowlist(const ScriptingAllowlist& allowlist) override;
const ScriptingAllowlist& GetScriptingAllowlist() const override;
extensions::URLPatternSet GetPermittedChromeSchemeHosts(
const extensions::Extension* extension,
const extensions::APIPermissionSet& api_permissions) const override;
@ -52,7 +52,7 @@ class ElectronExtensionsClient : public extensions::ExtensionsClient {
bool IsBlacklistUpdateURL(const GURL& url) const override;
private:
ScriptingWhitelist scripting_whitelist_;
ScriptingAllowlist scripting_allowlist_;
const GURL webstore_base_url_;
const GURL webstore_update_url_;

View file

@ -32,6 +32,8 @@ namespace gin_helper {
class WrappableBase {
public:
WrappableBase();
WrappableBase(const WrappableBase&) = delete;
WrappableBase& operator=(const WrappableBase&) = delete;
virtual ~WrappableBase();
// Retrieve the v8 wrapper object cooresponding to this object.
@ -61,8 +63,6 @@ class WrappableBase {
const v8::WeakCallbackInfo<WrappableBase>& data);
v8::Isolate* isolate_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(WrappableBase);
};
} // namespace gin_helper

View file

@ -5,7 +5,7 @@
#ifndef SHELL_COMMON_NODE_INCLUDES_H_
#define SHELL_COMMON_NODE_INCLUDES_H_
#include "base/logging.h"
#include "base/check.h"
// Include common headers for using node APIs.

View file

@ -10,6 +10,7 @@
#include <utility>
#include <vector>
#include "base/logging.h"
#include "base/values.h"
#include "shell/common/gin_helper/dictionary.h"
#include "shell/common/node_bindings.h"

View file

@ -55,6 +55,8 @@ class SpellCheckClient::SpellcheckRequest {
const base::string16& text,
std::unique_ptr<blink::WebTextCheckingCompletion> completion)
: text_(text), completion_(std::move(completion)) {}
SpellcheckRequest(const SpellcheckRequest&) = delete;
SpellcheckRequest& operator=(const SpellcheckRequest&) = delete;
~SpellcheckRequest() = default;
const base::string16& text() const { return text_; }
@ -66,8 +68,6 @@ class SpellCheckClient::SpellcheckRequest {
std::vector<Word> word_list_; // List of Words found in text
// The interface to send the misspelled ranges to WebKit.
std::unique_ptr<blink::WebTextCheckingCompletion> completion_;
DISALLOW_COPY_AND_ASSIGN(SpellcheckRequest);
};
SpellCheckClient::SpellCheckClient(const std::string& language,

View file

@ -11,35 +11,54 @@
#include "base/threading/sequenced_task_runner_handle.h"
#include "content/public/utility/utility_thread.h"
#include "mojo/public/cpp/bindings/service_factory.h"
#include "sandbox/policy/switches.h"
#include "services/proxy_resolver/proxy_resolver_factory_impl.h"
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
#include "services/service_manager/public/cpp/service.h"
#include "services/service_manager/sandbox/switches.h"
#if defined(OS_WIN)
#include "chrome/services/util_win/public/mojom/util_read_icon.mojom.h"
#include "chrome/services/util_win/util_read_icon.h"
#endif // defined(OS_WIN)
#if BUILDFLAG(ENABLE_PRINTING)
#include "components/services/print_compositor/print_compositor_impl.h"
#include "components/services/print_compositor/public/mojom/print_compositor.mojom.h" // nogncheck
#endif // BUILDFLAG(ENABLE_PRINTING)
#if defined(OS_WIN)
#if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN)
#include "chrome/services/printing/pdf_to_emf_converter_factory.h"
#endif
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && defined(OS_WIN)
#include "chrome/utility/printing_handler.h"
#endif
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \
(BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN))
#include "chrome/services/printing/printing_service.h"
#include "chrome/services/printing/public/mojom/printing_service.mojom.h"
#include "chrome/utility/printing_handler.h"
#endif // defined(OS_WIN)
#endif // BUILDFLAG(ENABLE_PRINTING)
#endif
namespace electron {
namespace {
#if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN)
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \
(BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN))
auto RunPrintingService(
mojo::PendingReceiver<printing::mojom::PrintingService> receiver) {
return std::make_unique<printing::PrintingService>(std::move(receiver));
}
#endif
#if defined(OS_WIN)
auto RunWindowsIconReader(
mojo::PendingReceiver<chrome::mojom::UtilReadIcon> receiver) {
return std::make_unique<UtilReadIcon>(std::move(receiver));
}
#endif
#if BUILDFLAG(ENABLE_PRINTING)
auto RunPrintCompositor(
mojo::PendingReceiver<printing::mojom::PrintCompositor> receiver) {
@ -60,7 +79,7 @@ auto RunProxyResolver(
ElectronContentUtilityClient::ElectronContentUtilityClient()
: utility_process_running_elevated_(false) {
#if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN)
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && defined(OS_WIN)
printing_handler_ = std::make_unique<printing::PrintingHandler>();
#endif
}
@ -75,18 +94,18 @@ void ElectronContentUtilityClient::ExposeInterfacesToBrowser(
#if defined(OS_WIN)
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
utility_process_running_elevated_ = command_line->HasSwitch(
service_manager::switches::kNoSandboxAndElevatedPrivileges);
sandbox::policy::switches::kNoSandboxAndElevatedPrivileges);
#endif
// If our process runs with elevated privileges, only add elevated Mojo
// interfaces to the BinderMap.
if (!utility_process_running_elevated_) {
#if BUILDFLAG(ENABLE_PRINTING)
#if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN)
binders->Add(
base::BindRepeating(printing::PdfToEmfConverterFactory::Create),
base::ThreadTaskRunnerHandle::Get());
#endif
}
#endif
}
bool ElectronContentUtilityClient::OnMessageReceived(
@ -94,7 +113,7 @@ bool ElectronContentUtilityClient::OnMessageReceived(
if (utility_process_running_elevated_)
return false;
#if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN)
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && defined(OS_WIN)
if (printing_handler_->OnMessageReceived(message))
return true;
#endif
@ -105,11 +124,17 @@ bool ElectronContentUtilityClient::OnMessageReceived(
mojo::ServiceFactory*
ElectronContentUtilityClient::GetMainThreadServiceFactory() {
static base::NoDestructor<mojo::ServiceFactory> factory {
#if BUILDFLAG(ENABLE_PRINTING)
RunPrintCompositor,
#if defined(OS_WIN)
RunPrintingService
RunWindowsIconReader,
#endif
#if BUILDFLAG(ENABLE_PRINTING)
RunPrintCompositor,
#endif
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \
(BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN))
RunPrintingService,
#endif
};
return factory.get();

View file

@ -14,9 +14,9 @@
#include "mojo/public/cpp/bindings/binder_map.h"
#include "printing/buildflags/buildflags.h"
#if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN)
#include "chrome/utility/printing_handler.h"
#endif
namespace printing {
class PrintingHandler;
}
namespace electron {
@ -31,7 +31,7 @@ class ElectronContentUtilityClient : public content::ContentUtilityClient {
mojo::ServiceFactory* GetIOThreadServiceFactory() override;
private:
#if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN)
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && defined(OS_WIN)
std::unique_ptr<printing::PrintingHandler> printing_handler_;
#endif