chore: bump chromium to 096e5313aaf19dfa0c4710145c34d (master) (#26535)
* chore: bump chromium in DEPS to 1d6b29cd85c1c3cba093b8b69b2727cc26eaac97 * update patches * chore: use 'libvulkan.so.1' in the linux manifests CL:2538430
Upstream renamed libvulkan.so to libvulkan.so.1, so sync our manifests. * chore: update expected window-open default policy. CL:2429247
Upstream CL contiues the work to make `strict-origin-when-cross-origin` the default referrer policy. This commit changes our window-open tests to expect that policy over the previous `no-referrer-when-downgrade`. * chore: bump chromium in DEPS to 69cb7c65ad845cdab1cd5f4256237e72fceba2dd * chore: re-export chromium patches No code changes; just line numbers. `git am` failed because the upstream changes were just large enough to require patching to fail w/o fuzzing. The broken patch was patches/chromium/feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch * update patches * chore: bump chromium in DEPS to c6d97a240d30e5f5166856f5ae6ee14d95b9a4f0 * update patches * fixup! chore: update expected window-open default policy. * chore: disallow copying CppHeapCreateParams Experimental commit to resolve FTBS36405680 (L25345)
which introduces a new struct CppHeapCreateParams that aggregates a vector of unique_ptrs. Our Windows CI is unhappy that this struct implicitly deletes its copy ctor, so this commit makes it explicit. Xref:2536642
* update patches * chore: bump chromium in DEPS to 0df9a85ffa0ad4711b41a089842e40b87ba88055 * update patches * fixup! chore: bump chromium to ac06d6903a2c981ab90a8162f1ba0 (master) (#26499) * chore: update calls to gfx::RemoveAcceleratorChar. The call signature for gfx::RemoveAccelerator changed in2546471
. This commit updates use to match that. * chore: bump chromium in DEPS to 43d6c496251e08d3781bfadbe9727688551f74a9 * update patches * chore: bump chromium in DEPS to 1fb5c9825be4e2271c4fef0e802f5d970b32f62f * update patches * chore: bump chromium in DEPS to 8a1f078d67825e727a598b89a8924699df8d3850 * chore: bump chromium in DEPS to 28ff715b3a97d8cedc143bad671edb08b6de5fc2 * chore: update patches * Remove most service manifest remnants from Content2296482
* Reland "Portals: Fix a11y for orphaned portals"2542812
* Convert CallbackList::Subscription to a standalone class.2522860
* fix: actually apply the zlib patch * chore: bump chromium in DEPS to 75b464e6357190ca302ba9ce8f8c2bf5a3b709ae * chore: update patches * chore: bump chromium@b884b9b2f647c59a75f5d2055030afa33d50ca10 * chore: bump chromium in DEPS to 829261dadcefdc54ce5fdf7c5fac2929786a63ce * chore: bump chromium in DEPS to 5df3e69605c7c0130374aaccb91fc4726a558db2 * chore: bump chromium in DEPS to 22db748d5b7b90f87e6e97ef4c92a727ac753ea4 * chore: bump chromium in DEPS to 1475df80282b7eeeb0e153d8375bfe651f083bf8 * chore: bump chromium in DEPS to 6d34fe9e9b7386edd90574617bfa4008de972d72 * chore: update patches * Disable CertVerifierService for now 2559260: Enable CertVerifierService by default |2559260
* Remove force_ignore_site_for_cookies until we figure out what to do instead 2499162: Remove |force_ignore_site_for_cookies| from IPCs (e.g. ResourceRequest). |2499162
* chore: bump chromium in DEPS to 95aeb1c59ebc03d19ba077b0cd707463d1b2865e * update patches * Set site_for_cookies to request url so that URLLoader::ShouldForceIgnoreSiteForCookies returns true * 2490383: a11y inspect reorg: implement accessible tree formatter factory2490383
* 2485887: [Extensions][web_accessible_resources] Use |matches|.2485887
* update v8 headers * chore: bump chromium in DEPS to 38587dc379a8cf4d4a13e482a6e89f2fe681144e * update patches * 2555005: [api] Simplify ScriptOrigin2555005
* 2563553: Remove Flash from PermissionRequestTypes and PermissionTypes.2563553
* 2546146: Remove browser-hosted InterfaceProvider2546146
* Actually apply nan patch * update patches * chore: bump chromium in DEPS to 6718d4b50c9db975c5642ca5b68e8dc7ee1b7615 * update patches * 2546146: Remove browser-hosted InterfaceProvider2546146
* chore: bump chromium in DEPS to 338cc300e3fe3a4cb4883e9ccdc34a32f3dfe034 * chore: bump chromium in DEPS to d9baeb1d192c23ceb1e1c4bbe6af98380b263bc1 * chore: bump chromium in DEPS to 3ca3051932683739b304e721cc394b6c66f841fe * chore: bump chromium in DEPS to 89292a4ae29096e5313aaf19dfa0c4710145c34d * 2571639: mac: Remove code to support OS X 10.10 in //sandbox2571639
* Fixup patch indices * Do not build MTLManagedObjectAdapter It's been removed in newer Mantle versions and uses a deprecated enum * update patches * Remove sendToAll https://github.com/electron/electron/pull/26771 * 2569367: Remove dead fullscreen code in RenderWidgetHostView and friends2569367
* Remove deprecated performFileOperation usage * 2568359: mac: Ignore Wdeprecated-declarations for LSSharedFileList* functions.2568359
* 2561401: Add OutputPresenterX11 which uses X11 present extension.2561401
* 2565511: [objects] Remove MakeExternal case for uncached internal strings2565511
* fixup: Add disconnect logic to ElectronBrowserHandlerImpl * Allow local networking override for ATS https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html * Refactor: clean up rfh getters in ElectronBrowserHandlerImpl * Update patches * Remove unneeded BindTo * Don't assign ElectronBrowserHandlerImpl at all Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
parent
c8eb4ecc0c
commit
4588a41161
123 changed files with 1011 additions and 738 deletions
|
@ -1,24 +0,0 @@
|
|||
// Copyright (c) 2019 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "shell/app/manifests.h"
|
||||
|
||||
#include "base/no_destructor.h"
|
||||
#include "electron/shell/common/api/api.mojom.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "services/service_manager/public/cpp/manifest_builder.h"
|
||||
|
||||
const service_manager::Manifest& GetElectronContentBrowserOverlayManifest() {
|
||||
static base::NoDestructor<service_manager::Manifest> manifest{
|
||||
service_manager::ManifestBuilder()
|
||||
.WithDisplayName("Electron (browser process)")
|
||||
.RequireCapability("device", "device:geolocation_control")
|
||||
.RequireCapability("chrome_printing", "converter")
|
||||
.ExposeInterfaceFilterCapability_Deprecated(
|
||||
"navigation:frame", "renderer",
|
||||
service_manager::Manifest::InterfaceList<
|
||||
electron::mojom::ElectronBrowser>())
|
||||
.Build()};
|
||||
return *manifest;
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright (c) 2019 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef SHELL_APP_MANIFESTS_H_
|
||||
#define SHELL_APP_MANIFESTS_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "services/service_manager/public/cpp/manifest.h"
|
||||
|
||||
const service_manager::Manifest& GetElectronContentBrowserOverlayManifest();
|
||||
|
||||
#endif // SHELL_APP_MANIFESTS_H_
|
|
@ -63,9 +63,7 @@ class Cookies : public gin::Wrappable<Cookies>,
|
|||
void OnCookieChanged(const net::CookieChangeInfo& change);
|
||||
|
||||
private:
|
||||
std::unique_ptr<base::CallbackList<void(
|
||||
const net::CookieChangeInfo& change)>::Subscription>
|
||||
cookie_change_subscription_;
|
||||
base::CallbackListSubscription cookie_change_subscription_;
|
||||
|
||||
// Weak reference; ElectronBrowserContext is guaranteed to outlive us.
|
||||
ElectronBrowserContext* browser_context_;
|
||||
|
|
|
@ -372,9 +372,9 @@ gin::Handle<SimpleURLLoaderWrapper> SimpleURLLoaderWrapper::Create(
|
|||
return gin::Handle<SimpleURLLoaderWrapper>();
|
||||
}
|
||||
auto request = std::make_unique<network::ResourceRequest>();
|
||||
request->force_ignore_site_for_cookies = true;
|
||||
opts.Get("method", &request->method);
|
||||
opts.Get("url", &request->url);
|
||||
request->site_for_cookies = net::SiteForCookies::FromUrl(request->url);
|
||||
opts.Get("referrer", &request->referrer);
|
||||
std::string origin;
|
||||
opts.Get("origin", &origin);
|
||||
|
|
|
@ -612,11 +612,6 @@ WebContents::WebContents(v8::Isolate* isolate,
|
|||
web_contents->SetUserData(kElectronApiWebContentsKey,
|
||||
std::make_unique<UserDataLink>(GetWeakPtr()));
|
||||
InitZoomController(web_contents, gin::Dictionary::CreateEmpty(isolate));
|
||||
|
||||
registry_.AddInterface(base::BindRepeating(&WebContents::BindElectronBrowser,
|
||||
base::Unretained(this)));
|
||||
receivers_.set_disconnect_handler(base::BindRepeating(
|
||||
&WebContents::OnElectronBrowserConnectionError, base::Unretained(this)));
|
||||
}
|
||||
|
||||
WebContents::WebContents(v8::Isolate* isolate,
|
||||
|
@ -804,10 +799,6 @@ void WebContents::InitWithSessionAndOptions(
|
|||
script_executor_.reset(new extensions::ScriptExecutor(web_contents()));
|
||||
#endif
|
||||
|
||||
registry_.AddInterface(base::BindRepeating(&WebContents::BindElectronBrowser,
|
||||
base::Unretained(this)));
|
||||
receivers_.set_disconnect_handler(base::BindRepeating(
|
||||
&WebContents::OnElectronBrowserConnectionError, base::Unretained(this)));
|
||||
AutofillDriverFactory::CreateForWebContents(web_contents());
|
||||
|
||||
web_contents()->SetUserAgentOverride(blink::UserAgentOverride::UserAgentOnly(
|
||||
|
@ -1481,55 +1472,50 @@ bool WebContents::EmitNavigationEvent(
|
|||
frame_routing_id);
|
||||
}
|
||||
|
||||
void WebContents::BindElectronBrowser(
|
||||
mojo::PendingReceiver<mojom::ElectronBrowser> receiver,
|
||||
content::RenderFrameHost* render_frame_host) {
|
||||
auto id = receivers_.Add(this, std::move(receiver), render_frame_host);
|
||||
frame_to_receivers_map_[render_frame_host].push_back(id);
|
||||
}
|
||||
|
||||
void WebContents::OnElectronBrowserConnectionError() {
|
||||
auto receiver_id = receivers_.current_receiver();
|
||||
auto* frame_host = receivers_.current_context();
|
||||
base::Erase(frame_to_receivers_map_[frame_host], receiver_id);
|
||||
}
|
||||
|
||||
void WebContents::Message(bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments) {
|
||||
blink::CloneableMessage arguments,
|
||||
content::RenderFrameHost* render_frame_host) {
|
||||
TRACE_EVENT1("electron", "WebContents::Message", "channel", channel);
|
||||
// webContents.emit('-ipc-message', new Event(), internal, channel,
|
||||
// arguments);
|
||||
EmitWithSender("-ipc-message", receivers_.current_context(), InvokeCallback(),
|
||||
EmitWithSender("-ipc-message", render_frame_host,
|
||||
electron::mojom::ElectronBrowser::InvokeCallback(), internal,
|
||||
channel, std::move(arguments));
|
||||
}
|
||||
|
||||
void WebContents::Invoke(
|
||||
bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments,
|
||||
electron::mojom::ElectronBrowser::InvokeCallback callback,
|
||||
content::RenderFrameHost* render_frame_host) {
|
||||
TRACE_EVENT1("electron", "WebContents::Invoke", "channel", channel);
|
||||
// webContents.emit('-ipc-invoke', new Event(), internal, channel, arguments);
|
||||
EmitWithSender("-ipc-invoke", render_frame_host, std::move(callback),
|
||||
internal, channel, std::move(arguments));
|
||||
}
|
||||
|
||||
void WebContents::Invoke(bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments,
|
||||
InvokeCallback callback) {
|
||||
TRACE_EVENT1("electron", "WebContents::Invoke", "channel", channel);
|
||||
// webContents.emit('-ipc-invoke', new Event(), internal, channel, arguments);
|
||||
EmitWithSender("-ipc-invoke", receivers_.current_context(),
|
||||
std::move(callback), internal, channel, std::move(arguments));
|
||||
}
|
||||
|
||||
void WebContents::OnFirstNonEmptyLayout() {
|
||||
if (receivers_.current_context() == web_contents()->GetMainFrame()) {
|
||||
void WebContents::OnFirstNonEmptyLayout(
|
||||
content::RenderFrameHost* render_frame_host) {
|
||||
if (render_frame_host == web_contents()->GetMainFrame()) {
|
||||
Emit("ready-to-show");
|
||||
}
|
||||
}
|
||||
|
||||
void WebContents::ReceivePostMessage(const std::string& channel,
|
||||
blink::TransferableMessage message) {
|
||||
void WebContents::ReceivePostMessage(
|
||||
const std::string& channel,
|
||||
blink::TransferableMessage message,
|
||||
content::RenderFrameHost* render_frame_host) {
|
||||
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
auto wrapped_ports =
|
||||
MessagePort::EntanglePorts(isolate, std::move(message.ports));
|
||||
v8::Local<v8::Value> message_value =
|
||||
electron::DeserializeV8Value(isolate, message);
|
||||
EmitWithSender("-ipc-ports", receivers_.current_context(), InvokeCallback(),
|
||||
false, channel, message_value, std::move(wrapped_ports));
|
||||
EmitWithSender("-ipc-ports", render_frame_host,
|
||||
electron::mojom::ElectronBrowser::InvokeCallback(), false,
|
||||
channel, message_value, std::move(wrapped_ports));
|
||||
}
|
||||
|
||||
void WebContents::PostMessage(const std::string& channel,
|
||||
|
@ -1565,15 +1551,17 @@ void WebContents::PostMessage(const std::string& channel,
|
|||
std::move(transferable_message));
|
||||
}
|
||||
|
||||
void WebContents::MessageSync(bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments,
|
||||
MessageSyncCallback callback) {
|
||||
void WebContents::MessageSync(
|
||||
bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments,
|
||||
electron::mojom::ElectronBrowser::MessageSyncCallback callback,
|
||||
content::RenderFrameHost* render_frame_host) {
|
||||
TRACE_EVENT1("electron", "WebContents::MessageSync", "channel", channel);
|
||||
// webContents.emit('-ipc-message-sync', new Event(sender, message), internal,
|
||||
// channel, arguments);
|
||||
EmitWithSender("-ipc-message-sync", receivers_.current_context(),
|
||||
std::move(callback), internal, channel, std::move(arguments));
|
||||
EmitWithSender("-ipc-message-sync", render_frame_host, std::move(callback),
|
||||
internal, channel, std::move(arguments));
|
||||
}
|
||||
|
||||
void WebContents::MessageTo(bool internal,
|
||||
|
@ -1590,11 +1578,13 @@ void WebContents::MessageTo(bool internal,
|
|||
}
|
||||
|
||||
void WebContents::MessageHost(const std::string& channel,
|
||||
blink::CloneableMessage arguments) {
|
||||
blink::CloneableMessage arguments,
|
||||
content::RenderFrameHost* render_frame_host) {
|
||||
TRACE_EVENT1("electron", "WebContents::MessageHost", "channel", channel);
|
||||
// webContents.emit('ipc-message-host', new Event(), channel, args);
|
||||
EmitWithSender("ipc-message-host", receivers_.current_context(),
|
||||
InvokeCallback(), channel, std::move(arguments));
|
||||
EmitWithSender("ipc-message-host", render_frame_host,
|
||||
electron::mojom::ElectronBrowser::InvokeCallback(), channel,
|
||||
std::move(arguments));
|
||||
}
|
||||
|
||||
void WebContents::UpdateDraggableRegions(
|
||||
|
@ -1608,18 +1598,6 @@ void WebContents::RenderFrameDeleted(
|
|||
// A WebFrameMain can outlive its RenderFrameHost so we need to mark it as
|
||||
// disposed to prevent access to it.
|
||||
WebFrameMain::RenderFrameDeleted(render_frame_host);
|
||||
|
||||
// A RenderFrameHost can be destroyed before the related Mojo binding is
|
||||
// closed, which can result in Mojo calls being sent for RenderFrameHosts
|
||||
// that no longer exist. To prevent this from happening, when a
|
||||
// RenderFrameHost goes away, we close all the bindings related to that
|
||||
// frame.
|
||||
auto it = frame_to_receivers_map_.find(render_frame_host);
|
||||
if (it == frame_to_receivers_map_.end())
|
||||
return;
|
||||
for (auto id : it->second)
|
||||
receivers_.Remove(id);
|
||||
frame_to_receivers_map_.erase(it);
|
||||
}
|
||||
|
||||
void WebContents::DidStartNavigation(
|
||||
|
@ -3038,7 +3016,8 @@ void WebContents::SetTemporaryZoomLevel(double level) {
|
|||
zoom_controller_->SetTemporaryZoomLevel(level);
|
||||
}
|
||||
|
||||
void WebContents::DoGetZoomLevel(DoGetZoomLevelCallback callback) {
|
||||
void WebContents::DoGetZoomLevel(
|
||||
electron::mojom::ElectronBrowser::DoGetZoomLevelCallback callback) {
|
||||
std::move(callback).Run(GetZoomLevel());
|
||||
}
|
||||
|
||||
|
|
|
@ -98,8 +98,7 @@ class WebContents : public gin::Wrappable<WebContents>,
|
|||
public content::WebContentsObserver,
|
||||
public content::WebContentsDelegate,
|
||||
public InspectableWebContentsDelegate,
|
||||
public InspectableWebContentsViewDelegate,
|
||||
public mojom::ElectronBrowser {
|
||||
public InspectableWebContentsViewDelegate {
|
||||
public:
|
||||
enum class Type {
|
||||
kBackgroundPage, // An extension background page.
|
||||
|
@ -412,6 +411,38 @@ class WebContents : public gin::Wrappable<WebContents>,
|
|||
fullscreen_frame_ = rfh;
|
||||
}
|
||||
|
||||
// mojom::ElectronBrowser
|
||||
void Message(bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments,
|
||||
content::RenderFrameHost* render_frame_host);
|
||||
void Invoke(bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments,
|
||||
electron::mojom::ElectronBrowser::InvokeCallback callback,
|
||||
content::RenderFrameHost* render_frame_host);
|
||||
void OnFirstNonEmptyLayout(content::RenderFrameHost* render_frame_host);
|
||||
void ReceivePostMessage(const std::string& channel,
|
||||
blink::TransferableMessage message,
|
||||
content::RenderFrameHost* render_frame_host);
|
||||
void MessageSync(
|
||||
bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments,
|
||||
electron::mojom::ElectronBrowser::MessageSyncCallback callback,
|
||||
content::RenderFrameHost* render_frame_host);
|
||||
void MessageTo(bool internal,
|
||||
int32_t web_contents_id,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments);
|
||||
void MessageHost(const std::string& channel,
|
||||
blink::CloneableMessage arguments,
|
||||
content::RenderFrameHost* render_frame_host);
|
||||
void UpdateDraggableRegions(std::vector<mojom::DraggableRegionPtr> regions);
|
||||
void SetTemporaryZoomLevel(double level);
|
||||
void DoGetZoomLevel(
|
||||
electron::mojom::ElectronBrowser::DoGetZoomLevelCallback callback);
|
||||
|
||||
private:
|
||||
// Does not manage lifetime of |web_contents|.
|
||||
WebContents(v8::Isolate* isolate, content::WebContents* web_contents);
|
||||
|
@ -588,11 +619,6 @@ class WebContents : public gin::Wrappable<WebContents>,
|
|||
|
||||
ElectronBrowserContext* GetBrowserContext() const;
|
||||
|
||||
// Binds the given request for the ElectronBrowser API. When the
|
||||
// RenderFrameHost is destroyed, all related bindings will be removed.
|
||||
void BindElectronBrowser(
|
||||
mojo::PendingReceiver<mojom::ElectronBrowser> receiver,
|
||||
content::RenderFrameHost* render_frame_host);
|
||||
void OnElectronBrowserConnectionError();
|
||||
|
||||
#if BUILDFLAG(ENABLE_OSR)
|
||||
|
@ -600,32 +626,6 @@ class WebContents : public gin::Wrappable<WebContents>,
|
|||
OffScreenRenderWidgetHostView* GetOffScreenRenderWidgetHostView() const;
|
||||
#endif
|
||||
|
||||
// mojom::ElectronBrowser
|
||||
void Message(bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments) override;
|
||||
void Invoke(bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments,
|
||||
InvokeCallback callback) override;
|
||||
void OnFirstNonEmptyLayout() override;
|
||||
void ReceivePostMessage(const std::string& channel,
|
||||
blink::TransferableMessage message) override;
|
||||
void MessageSync(bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments,
|
||||
MessageSyncCallback callback) override;
|
||||
void MessageTo(bool internal,
|
||||
int32_t web_contents_id,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments) override;
|
||||
void MessageHost(const std::string& channel,
|
||||
blink::CloneableMessage arguments) override;
|
||||
void UpdateDraggableRegions(
|
||||
std::vector<mojom::DraggableRegionPtr> regions) override;
|
||||
void SetTemporaryZoomLevel(double level) override;
|
||||
void DoGetZoomLevel(DoGetZoomLevelCallback callback) override;
|
||||
|
||||
// Called when received a synchronous message from renderer to
|
||||
// get the zoom level.
|
||||
void OnGetZoomLevel(content::RenderFrameHost* frame_host,
|
||||
|
@ -784,10 +784,6 @@ class WebContents : public gin::Wrappable<WebContents>,
|
|||
content::RenderFrameHost* fullscreen_frame_ = nullptr;
|
||||
|
||||
service_manager::BinderRegistryWithArgs<content::RenderFrameHost*> registry_;
|
||||
mojo::ReceiverSet<mojom::ElectronBrowser, content::RenderFrameHost*>
|
||||
receivers_;
|
||||
std::map<content::RenderFrameHost*, std::vector<mojo::ReceiverId>>
|
||||
frame_to_receivers_map_;
|
||||
|
||||
base::WeakPtrFactory<WebContents> weak_factory_;
|
||||
|
||||
|
|
|
@ -308,6 +308,8 @@ Browser::LoginItemSettings Browser::GetLoginItemSettings(
|
|||
}
|
||||
|
||||
void RemoveFromLoginItems() {
|
||||
#pragma clang diagnostic push // https://crbug.com/1154377
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
// logic to find the login item copied from GetLoginItemForApp in
|
||||
// base/mac/mac_util.mm
|
||||
base::ScopedCFTypeRef<LSSharedFileListRef> login_items(
|
||||
|
@ -333,6 +335,7 @@ void RemoveFromLoginItems() {
|
|||
}
|
||||
}
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
void Browser::SetLoginItemSettings(LoginItemSettings settings) {
|
||||
|
|
|
@ -24,8 +24,7 @@ CookieChangeNotifier::CookieChangeNotifier(
|
|||
|
||||
CookieChangeNotifier::~CookieChangeNotifier() = default;
|
||||
|
||||
std::unique_ptr<
|
||||
base::CallbackList<void(const net::CookieChangeInfo& change)>::Subscription>
|
||||
base::CallbackListSubscription
|
||||
CookieChangeNotifier::RegisterCookieChangeCallback(
|
||||
const base::Callback<void(const net::CookieChangeInfo& change)>& cb) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
|
|
|
@ -24,9 +24,7 @@ class CookieChangeNotifier : public network::mojom::CookieChangeListener {
|
|||
~CookieChangeNotifier() override;
|
||||
|
||||
// Register callbacks that needs to notified on any cookie store changes.
|
||||
std::unique_ptr<base::CallbackList<
|
||||
void(const net::CookieChangeInfo& change)>::Subscription>
|
||||
RegisterCookieChangeCallback(
|
||||
base::CallbackListSubscription RegisterCookieChangeCallback(
|
||||
const base::Callback<void(const net::CookieChangeInfo& change)>& cb);
|
||||
|
||||
private:
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
#include "content/public/common/url_constants.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
#include "electron/grit/electron_resources.h"
|
||||
#include "electron/shell/common/api/api.mojom.h"
|
||||
#include "mojo/public/cpp/bindings/binder_map.h"
|
||||
#include "net/base/escape.h"
|
||||
#include "net/ssl/ssl_cert_request_info.h"
|
||||
|
@ -59,7 +60,6 @@
|
|||
#include "services/network/public/cpp/features.h"
|
||||
#include "services/network/public/cpp/resource_request_body.h"
|
||||
#include "shell/app/electron_crash_reporter_client.h"
|
||||
#include "shell/app/manifests.h"
|
||||
#include "shell/browser/api/electron_api_app.h"
|
||||
#include "shell/browser/api/electron_api_crash_reporter.h"
|
||||
#include "shell/browser/api/electron_api_protocol.h"
|
||||
|
@ -69,6 +69,7 @@
|
|||
#include "shell/browser/child_web_contents_tracker.h"
|
||||
#include "shell/browser/electron_autofill_driver_factory.h"
|
||||
#include "shell/browser/electron_browser_context.h"
|
||||
#include "shell/browser/electron_browser_handler_impl.h"
|
||||
#include "shell/browser/electron_browser_main_parts.h"
|
||||
#include "shell/browser/electron_navigation_throttle.h"
|
||||
#include "shell/browser/electron_quota_permission_context.h"
|
||||
|
@ -1083,13 +1084,6 @@ ElectronBrowserClient::GetSystemNetworkContext() {
|
|||
return g_browser_process->system_network_context_manager()->GetContext();
|
||||
}
|
||||
|
||||
base::Optional<service_manager::Manifest>
|
||||
ElectronBrowserClient::GetServiceManifestOverlay(base::StringPiece name) {
|
||||
if (name == content::mojom::kBrowserServiceName)
|
||||
return GetElectronContentBrowserOverlayManifest();
|
||||
return base::nullopt;
|
||||
}
|
||||
|
||||
std::unique_ptr<content::BrowserMainParts>
|
||||
ElectronBrowserClient::CreateBrowserMainParts(
|
||||
const content::MainFunctionParams& params) {
|
||||
|
@ -1599,6 +1593,12 @@ void BindBadgeManagerFrameReceiver(
|
|||
LOG(WARNING) << "The Chromium Badging API is not available in Electron";
|
||||
}
|
||||
|
||||
void BindElectronBrowser(
|
||||
content::RenderFrameHost* frame_host,
|
||||
mojo::PendingReceiver<electron::mojom::ElectronBrowser> receiver) {
|
||||
ElectronBrowserHandlerImpl::Create(frame_host, std::move(receiver));
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
||||
void BindMimeHandlerService(
|
||||
content::RenderFrameHost* frame_host,
|
||||
|
@ -1637,6 +1637,8 @@ void ElectronBrowserClient::RegisterBrowserInterfaceBindersForFrame(
|
|||
base::BindRepeating(&BindNetworkHintsHandler));
|
||||
map->Add<blink::mojom::BadgeService>(
|
||||
base::BindRepeating(&BindBadgeManagerFrameReceiver));
|
||||
map->Add<electron::mojom::ElectronBrowser>(
|
||||
base::BindRepeating(&BindElectronBrowser));
|
||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
||||
map->Add<extensions::mime_handler::MimeHandlerService>(
|
||||
base::BindRepeating(&BindMimeHandlerService));
|
||||
|
|
|
@ -163,8 +163,6 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
|
|||
network::mojom::CertVerifierCreationParams* cert_verifier_creation_params)
|
||||
override;
|
||||
network::mojom::NetworkContext* GetSystemNetworkContext() override;
|
||||
base::Optional<service_manager::Manifest> GetServiceManifestOverlay(
|
||||
base::StringPiece name) override;
|
||||
content::MediaObserver* GetMediaObserver() override;
|
||||
content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;
|
||||
content::PlatformNotificationService* GetPlatformNotificationService(
|
||||
|
|
144
shell/browser/electron_browser_handler_impl.cc
Normal file
144
shell/browser/electron_browser_handler_impl.cc
Normal file
|
@ -0,0 +1,144 @@
|
|||
// Copyright (c) 2019 Slack Technologies, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "shell/browser/electron_browser_handler_impl.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
|
||||
|
||||
namespace electron {
|
||||
ElectronBrowserHandlerImpl::ElectronBrowserHandlerImpl(
|
||||
content::RenderFrameHost* frame_host,
|
||||
mojo::PendingReceiver<mojom::ElectronBrowser> receiver)
|
||||
: render_process_id_(frame_host->GetProcess()->GetID()),
|
||||
render_frame_id_(frame_host->GetRoutingID()),
|
||||
weak_factory_(this) {
|
||||
content::WebContents* web_contents =
|
||||
content::WebContents::FromRenderFrameHost(frame_host);
|
||||
DCHECK(web_contents);
|
||||
content::WebContentsObserver::Observe(web_contents);
|
||||
|
||||
receiver_.Bind(std::move(receiver));
|
||||
receiver_.set_disconnect_handler(base::BindOnce(
|
||||
&ElectronBrowserHandlerImpl::OnConnectionError, GetWeakPtr()));
|
||||
}
|
||||
|
||||
ElectronBrowserHandlerImpl::~ElectronBrowserHandlerImpl() = default;
|
||||
|
||||
void ElectronBrowserHandlerImpl::WebContentsDestroyed() {
|
||||
delete this;
|
||||
}
|
||||
|
||||
void ElectronBrowserHandlerImpl::OnConnectionError() {
|
||||
delete this;
|
||||
}
|
||||
|
||||
void ElectronBrowserHandlerImpl::Message(bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments) {
|
||||
api::WebContents* api_web_contents = api::WebContents::From(web_contents());
|
||||
if (api_web_contents) {
|
||||
api_web_contents->Message(internal, channel, std::move(arguments),
|
||||
GetRenderFrameHost());
|
||||
}
|
||||
}
|
||||
void ElectronBrowserHandlerImpl::Invoke(bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments,
|
||||
InvokeCallback callback) {
|
||||
api::WebContents* api_web_contents = api::WebContents::From(web_contents());
|
||||
if (api_web_contents) {
|
||||
api_web_contents->Invoke(internal, channel, std::move(arguments),
|
||||
std::move(callback), GetRenderFrameHost());
|
||||
}
|
||||
}
|
||||
|
||||
void ElectronBrowserHandlerImpl::OnFirstNonEmptyLayout() {
|
||||
api::WebContents* api_web_contents = api::WebContents::From(web_contents());
|
||||
if (api_web_contents) {
|
||||
api_web_contents->OnFirstNonEmptyLayout(GetRenderFrameHost());
|
||||
}
|
||||
}
|
||||
|
||||
void ElectronBrowserHandlerImpl::ReceivePostMessage(
|
||||
const std::string& channel,
|
||||
blink::TransferableMessage message) {
|
||||
api::WebContents* api_web_contents = api::WebContents::From(web_contents());
|
||||
if (api_web_contents) {
|
||||
api_web_contents->ReceivePostMessage(channel, std::move(message),
|
||||
GetRenderFrameHost());
|
||||
}
|
||||
}
|
||||
|
||||
void ElectronBrowserHandlerImpl::MessageSync(bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments,
|
||||
MessageSyncCallback callback) {
|
||||
api::WebContents* api_web_contents = api::WebContents::From(web_contents());
|
||||
if (api_web_contents) {
|
||||
api_web_contents->MessageSync(internal, channel, std::move(arguments),
|
||||
std::move(callback), GetRenderFrameHost());
|
||||
}
|
||||
}
|
||||
|
||||
void ElectronBrowserHandlerImpl::MessageTo(bool internal,
|
||||
int32_t web_contents_id,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments) {
|
||||
api::WebContents* api_web_contents = api::WebContents::From(web_contents());
|
||||
if (api_web_contents) {
|
||||
api_web_contents->MessageTo(internal, web_contents_id, channel,
|
||||
std::move(arguments));
|
||||
}
|
||||
}
|
||||
|
||||
void ElectronBrowserHandlerImpl::MessageHost(
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments) {
|
||||
api::WebContents* api_web_contents = api::WebContents::From(web_contents());
|
||||
if (api_web_contents) {
|
||||
api_web_contents->MessageHost(channel, std::move(arguments),
|
||||
GetRenderFrameHost());
|
||||
}
|
||||
}
|
||||
|
||||
void ElectronBrowserHandlerImpl::UpdateDraggableRegions(
|
||||
std::vector<mojom::DraggableRegionPtr> regions) {
|
||||
api::WebContents* api_web_contents = api::WebContents::From(web_contents());
|
||||
if (api_web_contents) {
|
||||
api_web_contents->UpdateDraggableRegions(std::move(regions));
|
||||
}
|
||||
}
|
||||
|
||||
void ElectronBrowserHandlerImpl::SetTemporaryZoomLevel(double level) {
|
||||
api::WebContents* api_web_contents = api::WebContents::From(web_contents());
|
||||
if (api_web_contents) {
|
||||
api_web_contents->SetTemporaryZoomLevel(level);
|
||||
}
|
||||
}
|
||||
|
||||
void ElectronBrowserHandlerImpl::DoGetZoomLevel(
|
||||
DoGetZoomLevelCallback callback) {
|
||||
api::WebContents* api_web_contents = api::WebContents::From(web_contents());
|
||||
if (api_web_contents) {
|
||||
api_web_contents->DoGetZoomLevel(std::move(callback));
|
||||
}
|
||||
}
|
||||
|
||||
content::RenderFrameHost* ElectronBrowserHandlerImpl::GetRenderFrameHost() {
|
||||
return content::RenderFrameHost::FromID(render_process_id_, render_frame_id_);
|
||||
}
|
||||
|
||||
// static
|
||||
void ElectronBrowserHandlerImpl::Create(
|
||||
content::RenderFrameHost* frame_host,
|
||||
mojo::PendingReceiver<mojom::ElectronBrowser> receiver) {
|
||||
new ElectronBrowserHandlerImpl(frame_host, std::move(receiver));
|
||||
}
|
||||
} // namespace electron
|
82
shell/browser/electron_browser_handler_impl.h
Normal file
82
shell/browser/electron_browser_handler_impl.h
Normal file
|
@ -0,0 +1,82 @@
|
|||
// Copyright (c) 2019 Slack Technologies, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef SHELL_BROWSER_ELECTRON_BROWSER_HANDLER_IMPL_H_
|
||||
#define SHELL_BROWSER_ELECTRON_BROWSER_HANDLER_IMPL_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "content/public/browser/web_contents_observer.h"
|
||||
#include "electron/shell/common/api/api.mojom.h"
|
||||
#include "shell/browser/api/electron_api_web_contents.h"
|
||||
|
||||
namespace content {
|
||||
class RenderFrameHost;
|
||||
} // namespace content
|
||||
|
||||
namespace electron {
|
||||
class ElectronBrowserHandlerImpl : public mojom::ElectronBrowser,
|
||||
public content::WebContentsObserver {
|
||||
public:
|
||||
explicit ElectronBrowserHandlerImpl(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
mojo::PendingReceiver<mojom::ElectronBrowser> receiver);
|
||||
|
||||
static void Create(content::RenderFrameHost* frame_host,
|
||||
mojo::PendingReceiver<mojom::ElectronBrowser> receiver);
|
||||
|
||||
// mojom::ElectronBrowser:
|
||||
void Message(bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments) override;
|
||||
void Invoke(bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments,
|
||||
InvokeCallback callback) override;
|
||||
void OnFirstNonEmptyLayout() override;
|
||||
void ReceivePostMessage(const std::string& channel,
|
||||
blink::TransferableMessage message) override;
|
||||
void MessageSync(bool internal,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments,
|
||||
MessageSyncCallback callback) override;
|
||||
void MessageTo(bool internal,
|
||||
int32_t web_contents_id,
|
||||
const std::string& channel,
|
||||
blink::CloneableMessage arguments) override;
|
||||
void MessageHost(const std::string& channel,
|
||||
blink::CloneableMessage arguments) override;
|
||||
void UpdateDraggableRegions(
|
||||
std::vector<mojom::DraggableRegionPtr> regions) override;
|
||||
void SetTemporaryZoomLevel(double level) override;
|
||||
void DoGetZoomLevel(DoGetZoomLevelCallback callback) override;
|
||||
|
||||
base::WeakPtr<ElectronBrowserHandlerImpl> GetWeakPtr() {
|
||||
return weak_factory_.GetWeakPtr();
|
||||
}
|
||||
|
||||
private:
|
||||
~ElectronBrowserHandlerImpl() override;
|
||||
|
||||
// content::WebContentsObserver:
|
||||
void WebContentsDestroyed() override;
|
||||
|
||||
void OnConnectionError();
|
||||
|
||||
content::RenderFrameHost* GetRenderFrameHost();
|
||||
|
||||
const int render_process_id_;
|
||||
const int render_frame_id_;
|
||||
|
||||
mojo::Receiver<mojom::ElectronBrowser> receiver_{this};
|
||||
|
||||
base::WeakPtrFactory<ElectronBrowserHandlerImpl> weak_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ElectronBrowserHandlerImpl);
|
||||
};
|
||||
} // namespace electron
|
||||
#endif // SHELL_BROWSER_ELECTRON_BROWSER_HANDLER_IMPL_H_
|
|
@ -463,8 +463,12 @@ void ElectronBrowserMainParts::PreMainMessageLoopRun() {
|
|||
auto* command_line = base::CommandLine::ForCurrentProcess();
|
||||
if (command_line->HasSwitch(switches::kRemoteDebuggingPipe)) {
|
||||
// --remote-debugging-pipe
|
||||
auto on_disconnect = base::BindOnce([]() {
|
||||
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
|
||||
base::BindOnce([]() { Browser::Get()->Quit(); }));
|
||||
});
|
||||
content::DevToolsAgentHost::StartRemoteDebuggingPipeHandler(
|
||||
base::OnceClosure());
|
||||
std::move(on_disconnect));
|
||||
} else if (command_line->HasSwitch(switches::kRemoteDebuggingPort)) {
|
||||
// --remote-debugging-port
|
||||
DevToolsManagerDelegate::StartHttpHandler();
|
||||
|
|
|
@ -179,7 +179,7 @@ void ElectronExtensionsBrowserClient::LoadResourceFromResourceBundle(
|
|||
}
|
||||
|
||||
namespace {
|
||||
bool AllowCrossRendererResourceLoad(const GURL& url,
|
||||
bool AllowCrossRendererResourceLoad(const network::ResourceRequest& request,
|
||||
blink::mojom::ResourceType resource_type,
|
||||
ui::PageTransition page_transition,
|
||||
int child_id,
|
||||
|
@ -189,7 +189,7 @@ bool AllowCrossRendererResourceLoad(const GURL& url,
|
|||
const extensions::ProcessMap& process_map,
|
||||
bool* allowed) {
|
||||
if (extensions::url_request_util::AllowCrossRendererResourceLoad(
|
||||
url, resource_type, page_transition, child_id, is_incognito,
|
||||
request, resource_type, page_transition, child_id, is_incognito,
|
||||
extension, extensions, process_map, allowed)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ bool AllowCrossRendererResourceLoad(const GURL& url,
|
|||
} // namespace
|
||||
|
||||
bool ElectronExtensionsBrowserClient::AllowCrossRendererResourceLoad(
|
||||
const GURL& url,
|
||||
const network::ResourceRequest& request,
|
||||
blink::mojom::ResourceType resource_type,
|
||||
ui::PageTransition page_transition,
|
||||
int child_id,
|
||||
|
@ -219,7 +219,7 @@ bool ElectronExtensionsBrowserClient::AllowCrossRendererResourceLoad(
|
|||
const extensions::ProcessMap& process_map) {
|
||||
bool allowed = false;
|
||||
if (::electron::AllowCrossRendererResourceLoad(
|
||||
url, resource_type, page_transition, child_id, is_incognito,
|
||||
request, resource_type, page_transition, child_id, is_incognito,
|
||||
extension, extensions, process_map, &allowed)) {
|
||||
return allowed;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ class ElectronExtensionsBrowserClient
|
|||
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
|
||||
bool send_cors_header) override;
|
||||
bool AllowCrossRendererResourceLoad(
|
||||
const GURL& url,
|
||||
const network::ResourceRequest& request,
|
||||
blink::mojom::ResourceType resource_type,
|
||||
ui::PageTransition page_transition,
|
||||
int child_id,
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "electron/buildflags/buildflags.h"
|
||||
#include "media/base/media_switches.h"
|
||||
#include "net/base/features.h"
|
||||
#include "services/network/public/cpp/features.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
|
@ -34,7 +35,8 @@ void InitializeFeatureList() {
|
|||
// https://groups.google.com/a/chromium.org/g/embedder-dev/c/4yJi4Twj2NM/m/9bhpWureCAAJ
|
||||
std::string(",") + net::features::kSameSiteByDefaultCookies.name +
|
||||
std::string(",") +
|
||||
net::features::kCookiesWithoutSameSiteMustBeSecure.name;
|
||||
net::features::kCookiesWithoutSameSiteMustBeSecure.name +
|
||||
std::string(",") + network::features::kCertVerifierService.name;
|
||||
|
||||
// https://www.polymer-project.org/blog/2018-10-02-webcomponents-v0-deprecations
|
||||
// https://chromium-review.googlesource.com/c/chromium/src/+/1869562
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "base/bind.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "extensions/browser/extension_navigation_ui_data.h"
|
||||
#include "net/base/ip_endpoint.h"
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "components/keyed_service/core/keyed_service_shutdown_notifier.h"
|
||||
#include "content/public/browser/content_browser_client.h"
|
||||
#include "extensions/browser/api/web_request/web_request_info.h"
|
||||
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
||||
|
@ -171,10 +170,6 @@ class ProxyingWebSocket : public network::mojom::WebSocketHandshakeClient,
|
|||
|
||||
extensions::WebRequestInfo info_;
|
||||
|
||||
// Notifies the proxy that the browser context has been shutdown.
|
||||
std::unique_ptr<KeyedServiceShutdownNotifier::Subscription>
|
||||
shutdown_notifier_;
|
||||
|
||||
base::WeakPtrFactory<ProxyingWebSocket> weak_factory_{this};
|
||||
DISALLOW_COPY_AND_ASSIGN(ProxyingWebSocket);
|
||||
};
|
||||
|
|
|
@ -244,13 +244,6 @@ OffScreenRenderWidgetHostView::~OffScreenRenderWidgetHostView() {
|
|||
root_layer_.reset();
|
||||
}
|
||||
|
||||
content::BrowserAccessibilityManager*
|
||||
OffScreenRenderWidgetHostView::CreateBrowserAccessibilityManager(
|
||||
content::BrowserAccessibilityDelegate*,
|
||||
bool) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void OffScreenRenderWidgetHostView::InitAsChild(gfx::NativeView) {
|
||||
DCHECK(parent_host_view_);
|
||||
|
||||
|
@ -419,9 +412,6 @@ void OffScreenRenderWidgetHostView::InitAsPopup(
|
|||
Show();
|
||||
}
|
||||
|
||||
void OffScreenRenderWidgetHostView::InitAsFullscreen(
|
||||
content::RenderWidgetHostView*) {}
|
||||
|
||||
void OffScreenRenderWidgetHostView::UpdateCursor(const content::WebCursor&) {}
|
||||
|
||||
content::CursorManager* OffScreenRenderWidgetHostView::GetCursorManager() {
|
||||
|
|
|
@ -68,10 +68,6 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
|||
gfx::Size initial_size);
|
||||
~OffScreenRenderWidgetHostView() override;
|
||||
|
||||
content::BrowserAccessibilityManager* CreateBrowserAccessibilityManager(
|
||||
content::BrowserAccessibilityDelegate*,
|
||||
bool) override;
|
||||
|
||||
// content::RenderWidgetHostView:
|
||||
void InitAsChild(gfx::NativeView) override;
|
||||
void SetSize(const gfx::Size&) override;
|
||||
|
@ -112,7 +108,6 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
|||
void ResetFallbackToFirstNavigationSurface() override;
|
||||
void InitAsPopup(content::RenderWidgetHostView* rwhv,
|
||||
const gfx::Rect& rect) override;
|
||||
void InitAsFullscreen(content::RenderWidgetHostView*) override;
|
||||
void UpdateCursor(const content::WebCursor&) override;
|
||||
void SetIsLoading(bool is_loading) override;
|
||||
void TextInputStateChanged(const ui::mojom::TextInputState& params) override;
|
||||
|
|
|
@ -28,6 +28,11 @@
|
|||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>AtomApplication</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
||||
<true/>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
|
|
|
@ -426,15 +426,6 @@ bool ElectronBundleMover::Trash(NSString* path) {
|
|||
error:NULL];
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
result = [[NSWorkspace sharedWorkspace]
|
||||
performFileOperation:NSWorkspaceRecycleOperation
|
||||
source:[path stringByDeletingLastPathComponent]
|
||||
destination:@""
|
||||
files:[NSArray arrayWithObject:[path lastPathComponent]]
|
||||
tag:NULL];
|
||||
}
|
||||
|
||||
// As a last resort try trashing with AppleScript.
|
||||
// This allows us to trash the app in macOS Sierra even when the app is
|
||||
// running inside an app translocation image.
|
||||
|
|
|
@ -22,9 +22,7 @@ namespace electron {
|
|||
|
||||
SubmenuButton::SubmenuButton(const base::string16& title,
|
||||
const SkColor& background_color)
|
||||
: views::MenuButton(
|
||||
PressedCallback(),
|
||||
gfx::RemoveAcceleratorChar(title, '&', nullptr, nullptr)),
|
||||
: views::MenuButton(PressedCallback(), gfx::RemoveAccelerator(title)),
|
||||
background_color_(background_color) {
|
||||
#if defined(OS_LINUX)
|
||||
// Dont' use native style border.
|
||||
|
@ -95,7 +93,8 @@ bool SubmenuButton::GetUnderlinePosition(const base::string16& text,
|
|||
int* start,
|
||||
int* end) const {
|
||||
int pos, span;
|
||||
base::string16 trimmed = gfx::RemoveAcceleratorChar(text, '&', &pos, &span);
|
||||
base::string16 trimmed =
|
||||
gfx::LocateAndRemoveAcceleratorChar(text, &pos, &span);
|
||||
if (pos > -1 && span != 0) {
|
||||
*accelerator = base::ToUpperASCII(trimmed[pos]);
|
||||
GetCharacterPosition(trimmed, pos, start);
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
#include "chrome/grit/dev_ui_browser_resources.h" // nogncheck
|
||||
#include "components/pref_registry/pref_registry_syncable.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "content/public/browser/accessibility_tree_formatter.h"
|
||||
#include "content/public/browser/ax_event_notification_details.h"
|
||||
#include "content/public/browser/ax_inspect_factory.h"
|
||||
#include "content/public/browser/browser_accessibility_state.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/favicon_status.h"
|
||||
|
|
|
@ -53,7 +53,7 @@ class ZoomLevelDelegate : public content::ZoomLevelDelegate {
|
|||
|
||||
PrefService* pref_service_;
|
||||
content::HostZoomMap* host_zoom_map_;
|
||||
std::unique_ptr<content::HostZoomMap::Subscription> zoom_subscription_;
|
||||
base::CallbackListSubscription zoom_subscription_;
|
||||
std::string partition_key_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ZoomLevelDelegate);
|
||||
|
|
|
@ -190,8 +190,6 @@ v8::Local<v8::Value> Converter<content::PermissionType>::ToV8(
|
|||
return StringToV8(isolate, "clipboard-read");
|
||||
case content::PermissionType::CLIPBOARD_SANITIZED_WRITE:
|
||||
return StringToV8(isolate, "clipboard-sanitized-write");
|
||||
case content::PermissionType::FLASH:
|
||||
return StringToV8(isolate, "flash");
|
||||
case content::PermissionType::CAMERA_PAN_TILT_ZOOM:
|
||||
case content::PermissionType::FONT_ACCESS:
|
||||
return StringToV8(isolate, "font-access");
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "shell/common/node_bindings.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "shell/common/v8_value_serializer.h"
|
||||
#include "third_party/blink/public/common/browser_interface_broker_proxy.h"
|
||||
#include "third_party/blink/public/web/web_local_frame.h"
|
||||
#include "third_party/blink/public/web/web_message_port_converter.h"
|
||||
|
||||
|
@ -58,7 +59,7 @@ class IPCRenderer : public gin::Wrappable<IPCRenderer>,
|
|||
v8::Global<v8::Context>(isolate, isolate->GetCurrentContext());
|
||||
weak_context_.SetWeak();
|
||||
|
||||
render_frame->GetRemoteInterfaces()->GetInterface(
|
||||
render_frame->GetBrowserInterfaceBroker()->GetInterface(
|
||||
electron_browser_remote_.BindNewPipeAndPassReceiver());
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "shell/common/options_switches.h"
|
||||
#include "shell/renderer/api/electron_api_spell_check_client.h"
|
||||
#include "shell/renderer/electron_renderer_client.h"
|
||||
#include "third_party/blink/public/common/browser_interface_broker_proxy.h"
|
||||
#include "third_party/blink/public/common/page/page_zoom.h"
|
||||
#include "third_party/blink/public/common/web_cache/web_cache_resource_type_stats.h"
|
||||
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
|
||||
|
@ -361,7 +362,7 @@ void SetZoomLevel(gin_helper::ErrorThrower thrower,
|
|||
}
|
||||
|
||||
mojo::Remote<mojom::ElectronBrowser> browser_remote;
|
||||
render_frame->GetRemoteInterfaces()->GetInterface(
|
||||
render_frame->GetBrowserInterfaceBroker()->GetInterface(
|
||||
browser_remote.BindNewPipeAndPassReceiver());
|
||||
browser_remote->SetTemporaryZoomLevel(level);
|
||||
}
|
||||
|
@ -378,7 +379,7 @@ double GetZoomLevel(gin_helper::ErrorThrower thrower,
|
|||
}
|
||||
|
||||
mojo::Remote<mojom::ElectronBrowser> browser_remote;
|
||||
render_frame->GetRemoteInterfaces()->GetInterface(
|
||||
render_frame->GetBrowserInterfaceBroker()->GetInterface(
|
||||
browser_remote.BindNewPipeAndPassReceiver());
|
||||
browser_remote->DoGetZoomLevel(&result);
|
||||
return result;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "services/service_manager/public/cpp/interface_provider.h"
|
||||
#include "shell/common/options_switches.h"
|
||||
#include "shell/common/world_ids.h"
|
||||
#include "third_party/blink/public/common/browser_interface_broker_proxy.h"
|
||||
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
|
||||
#include "third_party/blink/public/platform/web_isolated_world_info.h"
|
||||
#include "third_party/blink/public/web/blink.h"
|
||||
|
@ -110,7 +111,7 @@ void ElectronRenderFrameObserver::DraggableRegionsChanged() {
|
|||
}
|
||||
|
||||
mojo::Remote<mojom::ElectronBrowser> browser_remote;
|
||||
render_frame_->GetRemoteInterfaces()->GetInterface(
|
||||
render_frame_->GetBrowserInterfaceBroker()->GetInterface(
|
||||
browser_remote.BindNewPipeAndPassReceiver());
|
||||
browser_remote->UpdateDraggableRegions(std::move(regions));
|
||||
}
|
||||
|
@ -130,7 +131,7 @@ void ElectronRenderFrameObserver::DidMeaningfulLayout(
|
|||
blink::WebMeaningfulLayout layout_type) {
|
||||
if (layout_type == blink::WebMeaningfulLayout::kVisuallyNonEmpty) {
|
||||
mojo::Remote<mojom::ElectronBrowser> browser_remote;
|
||||
render_frame_->GetRemoteInterfaces()->GetInterface(
|
||||
render_frame_->GetBrowserInterfaceBroker()->GetInterface(
|
||||
browser_remote.BindNewPipeAndPassReceiver());
|
||||
browser_remote->OnFirstNonEmptyLayout();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue