2eb3bddb05
* chore: bump chromium in DEPS to 92.0.4500.2
* resolve conflicts
* update patches
* chore: cherry-pick 82434206f306 from chromium (#29060)
* fix patch
* chore: bump chromium in DEPS to 92.0.4501.0
* chore: bump chromium in DEPS to 92.0.4502.0
* chore: bump chromium in DEPS to 92.0.4503.0
* chore: update patches
* 2869869
: [Code Health] Refactor ListValue::Insert in gpu compositor
https://chromium-review.googlesource.com/c/chromium/src/+/2869869
* 2877924: Separate InkDropHost from InkDropHostView
https://chromium-review.googlesource.com/c/chromium/src/+/2877924
* chore: bump chromium in DEPS to 92.0.4504.0
* update patches
* Fixup for Separate InkDropHost from InkDropHostView
https://chromium-review.googlesource.com/c/chromium/src/+/2877924
* 2873469: Compute hashes of .pak files during the build, and check it at runtime.
https://chromium-review.googlesource.com/c/chromium/src/+/2873469
* 2874397: Remove flag to disable microtasks scope consistency checks
https://chromium-review.googlesource.com/c/v8/v8/+/2874397
* 2881471: Remove unneeded trace_event.h includes in headers.
https://chromium-review.googlesource.com/c/chromium/src/+/2881471
* 2844717: [Keyboard Tooltip] Rename RWHV*::SetTooltipText to UpdateTooltipUnderCursor
https://chromium-review.googlesource.com/c/chromium/src/+/2844717
* chore: bump chromium in DEPS to 92.0.4505.0
* chore: update patches
* 2883887: Retire ScopedObserver in /chrome/browser/predictors.
https://chromium-review.googlesource.com/c/chromium/src/+/2883887
* 2883694: Retire ScopedObserver in /chrome/browser.
https://chromium-review.googlesource.com/c/chromium/src/+/2883694
* fixup after merge
* fixup: Remove flag to disable microtasks scope consistency checks
* Temporarily disable setcallhandler-test.js nan test
This test should be renabled once https://github.com/electron/electron/pull/29028 lands
* Use gin_helper::MicrotasksScope instead of v8::MicrotasksScope
* chore: bump chromium in DEPS to 92.0.4506.0
* update patches
* Revert "update patches"
This reverts commit 333ec0d4c205bd3cbee28d2bc3d068871dbb900a.
* Revert "chore: bump chromium in DEPS to 92.0.4506.0"
This reverts commit 2bd52f8cd89b173c8b15a61d74fa7539cdbf574b.
* Fixup: Use gin_helper::MicrotasksScope instead of v8::MicrotasksScope
* Fixup: Use gin_helper::MicrotasksScope instead of v8::MicrotasksScope
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
290 lines
11 KiB
Diff
290 lines
11 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
Date: Thu, 20 Sep 2018 17:48:49 -0700
|
|
Subject: mas_disable_remote_accessibility.patch
|
|
|
|
Disable remote accessibility APIs (NSAccessibilityRemoteUIElement) for MAS
|
|
build.
|
|
|
|
According to ccameron:
|
|
|
|
NSAccessibilityRemoteUIElement is unnecessary for Electron's use-case. We use it
|
|
for progressive web apps (where the AXTree is in the browser process, but macOS
|
|
needs to think it's coming from the PWA process). I think it can just be chopped
|
|
out -- if there are any side-effects, we should be able to work around them.
|
|
|
|
diff --git a/components/remote_cocoa/app_shim/application_bridge.mm b/components/remote_cocoa/app_shim/application_bridge.mm
|
|
index 9ddda9116e7284cbccde8a51e23ad7560dd06367..e846091ad99b0154636489e53491209ff3cbfaaa 100644
|
|
--- a/components/remote_cocoa/app_shim/application_bridge.mm
|
|
+++ b/components/remote_cocoa/app_shim/application_bridge.mm
|
|
@@ -49,6 +49,7 @@
|
|
|
|
// NativeWidgetNSWindowHostHelper:
|
|
id GetNativeViewAccessible() override {
|
|
+#ifndef MAS_BUILD
|
|
if (!remote_accessibility_element_) {
|
|
int64_t browser_pid = 0;
|
|
std::vector<uint8_t> element_token;
|
|
@@ -59,6 +60,9 @@ id GetNativeViewAccessible() override {
|
|
ui::RemoteAccessibility::GetRemoteElementFromToken(element_token);
|
|
}
|
|
return remote_accessibility_element_.get();
|
|
+#else
|
|
+ return nil;
|
|
+#endif
|
|
}
|
|
void DispatchKeyEvent(ui::KeyEvent* event) override {
|
|
bool event_handled = false;
|
|
@@ -96,8 +100,10 @@ void GetWordAt(const gfx::Point& location_in_content,
|
|
mojo::AssociatedRemote<mojom::TextInputHost> text_input_host_remote_;
|
|
|
|
std::unique_ptr<NativeWidgetNSWindowBridge> bridge_;
|
|
+#ifndef MAS_BUILD
|
|
base::scoped_nsobject<NSAccessibilityRemoteUIElement>
|
|
remote_accessibility_element_;
|
|
+#endif
|
|
};
|
|
|
|
} // namespace
|
|
diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
|
|
index f20d8147d52df79b27e65036d947d3a8fbef93e4..f176e98283a86bd63109f3d2aa2754081d7bb4ed 100644
|
|
--- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
|
|
+++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
|
|
@@ -559,10 +559,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) {
|
|
// this should be treated as an error and caught early.
|
|
CHECK(bridged_view_);
|
|
|
|
+#ifndef MAS_BUILD
|
|
// Send the accessibility tokens for the NSView now that it exists.
|
|
host_->SetRemoteAccessibilityTokens(
|
|
ui::RemoteAccessibility::GetTokenForLocalElement(window_),
|
|
ui::RemoteAccessibility::GetTokenForLocalElement(bridged_view_));
|
|
+#endif
|
|
|
|
// Beware: This view was briefly removed (in favor of a bare CALayer) in
|
|
// crrev/c/1236675. The ordering of unassociated layers relative to NSView
|
|
diff --git a/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm b/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm
|
|
index c3a9fbf0f9d2b80c1de42a22ad094a286f0b559b..02493d4b62c98a3aebd3e460c459218a4dc4ea8e 100644
|
|
--- a/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm
|
|
+++ b/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm
|
|
@@ -70,8 +70,10 @@ id GetFocusedBrowserAccessibilityElement() override {
|
|
return nil;
|
|
}
|
|
void SetAccessibilityWindow(NSWindow* window) override {
|
|
+#ifndef MAS_BUILD
|
|
host_->SetRemoteAccessibilityWindowToken(
|
|
ui::RemoteAccessibility::GetTokenForLocalElement(window));
|
|
+#endif
|
|
}
|
|
|
|
void ForwardKeyboardEvent(const content::NativeWebKeyboardEvent& key_event,
|
|
@@ -133,8 +135,10 @@ void SmartMagnify(const blink::WebGestureEvent& web_event) override {
|
|
|
|
mojo::AssociatedRemote<mojom::RenderWidgetHostNSViewHost> host_;
|
|
std::unique_ptr<RenderWidgetHostNSViewBridge> bridge_;
|
|
+#ifndef MAS_BUILD
|
|
base::scoped_nsobject<NSAccessibilityRemoteUIElement>
|
|
remote_accessibility_element_;
|
|
+#endif
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostNSViewBridgeOwner);
|
|
};
|
|
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
|
|
index f46b1d431957d6fb86f67d340c02469cb9457188..78c4c7588af478823c3b2cdad52164e328b7f39e 100644
|
|
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
|
|
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
|
|
@@ -47,7 +47,9 @@ class ScopedPasswordInputEnabler;
|
|
|
|
@protocol RenderWidgetHostViewMacDelegate;
|
|
|
|
+#ifndef MAS_BUILD
|
|
@class NSAccessibilityRemoteUIElement;
|
|
+#endif
|
|
@class RenderWidgetHostViewCocoa;
|
|
|
|
namespace content {
|
|
@@ -658,10 +660,12 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
|
|
// EnsureSurfaceSynchronizedForWebTest().
|
|
uint32_t latest_capture_sequence_number_ = 0u;
|
|
|
|
+#ifndef MAS_BUILD
|
|
// Remote accessibility objects corresponding to the NSWindow that this is
|
|
// displayed to the user in.
|
|
base::scoped_nsobject<NSAccessibilityRemoteUIElement>
|
|
remote_window_accessible_;
|
|
+#endif
|
|
|
|
// Used to force the NSApplication's focused accessibility element to be the
|
|
// content::BrowserAccessibilityCocoa accessibility tree when the NSView for
|
|
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
|
index 9a6df39be13403107c5864f366a461bd66cb1aff..42d4d1390a4bb5217a5b70855038d7f5aec7caf3 100644
|
|
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
|
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
|
@@ -238,8 +238,10 @@
|
|
void RenderWidgetHostViewMac::MigrateNSViewBridge(
|
|
remote_cocoa::mojom::Application* remote_cocoa_application,
|
|
uint64_t parent_ns_view_id) {
|
|
+#ifndef MAS_BUILD
|
|
// Destroy the previous remote accessibility element.
|
|
remote_window_accessible_.reset();
|
|
+#endif
|
|
|
|
// Disconnect from the previous bridge (this will have the effect of
|
|
// destroying the associated bridge), and close the receiver (to allow it
|
|
@@ -1399,8 +1401,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
|
|
|
gfx::NativeViewAccessible
|
|
RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() {
|
|
+#ifndef MAS_BUILD
|
|
if (remote_window_accessible_)
|
|
return remote_window_accessible_.get();
|
|
+#endif
|
|
return [GetInProcessNSView() window];
|
|
}
|
|
|
|
@@ -1444,9 +1448,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
|
}
|
|
|
|
void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) {
|
|
+#ifndef MAS_BUILD
|
|
// When running in-process, just use the NSView's NSWindow as its own
|
|
// accessibility element.
|
|
remote_window_accessible_.reset();
|
|
+#endif
|
|
}
|
|
|
|
bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame(
|
|
@@ -1935,12 +1941,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
|
|
|
void RenderWidgetHostViewMac::SetRemoteAccessibilityWindowToken(
|
|
const std::vector<uint8_t>& window_token) {
|
|
+#ifndef MAS_BUILD
|
|
if (window_token.empty()) {
|
|
remote_window_accessible_.reset();
|
|
} else {
|
|
remote_window_accessible_ =
|
|
ui::RemoteAccessibility::GetRemoteElementFromToken(window_token);
|
|
}
|
|
+#endif
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
|
|
index a7fd3c7812a65cd10a53a2e29e7dd50b0aa428e9..f19cba3289def3fbd70b6106f7c4491b320bf608 100644
|
|
--- a/ui/base/BUILD.gn
|
|
+++ b/ui/base/BUILD.gn
|
|
@@ -328,6 +328,13 @@ component("base") {
|
|
]
|
|
}
|
|
|
|
+ if (is_mas_build) {
|
|
+ sources -= [
|
|
+ "cocoa/remote_accessibility_api.h",
|
|
+ "cocoa/remote_accessibility_api.mm",
|
|
+ ]
|
|
+ }
|
|
+
|
|
if (is_ios) {
|
|
sources += [
|
|
"device_form_factor_ios.mm",
|
|
diff --git a/ui/base/cocoa/remote_accessibility_api.h b/ui/base/cocoa/remote_accessibility_api.h
|
|
index e7adfee3210ec723c687adfcc4bee8827ef643e7..25a924a47eeb30d783ef83dbb4896c4bed139a27 100644
|
|
--- a/ui/base/cocoa/remote_accessibility_api.h
|
|
+++ b/ui/base/cocoa/remote_accessibility_api.h
|
|
@@ -11,6 +11,8 @@
|
|
#include "base/component_export.h"
|
|
#include "base/mac/scoped_nsobject.h"
|
|
|
|
+#ifndef MAS_BUILD
|
|
+
|
|
@interface NSAccessibilityRemoteUIElement : NSObject
|
|
+ (void)registerRemoteUIProcessIdentifier:(int)pid;
|
|
+ (NSData*)remoteTokenForLocalUIElement:(id)element;
|
|
@@ -32,4 +34,6 @@ class COMPONENT_EXPORT(UI_BASE) RemoteAccessibility {
|
|
|
|
} // namespace ui
|
|
|
|
+#endif // MAS_BUILD
|
|
+
|
|
#endif // UI_BASE_COCOA_REMOTE_ACCESSIBILITY_API_H_
|
|
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.h b/ui/views/cocoa/native_widget_mac_ns_window_host.h
|
|
index b6d860060e4ba86d8871bd19e7011a64eb057350..040a18fa5049698429d2c51b52d3240977657751 100644
|
|
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.h
|
|
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h
|
|
@@ -30,7 +30,9 @@
|
|
#include "ui/views/window/dialog_observer.h"
|
|
|
|
@class NativeWidgetMacNSWindow;
|
|
+#ifndef MAS_BUILD
|
|
@class NSAccessibilityRemoteUIElement;
|
|
+#endif
|
|
@class NSView;
|
|
|
|
namespace remote_cocoa {
|
|
@@ -416,11 +418,13 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
|
|
mojo::AssociatedRemote<remote_cocoa::mojom::NativeWidgetNSWindow>
|
|
remote_ns_window_remote_;
|
|
|
|
+#ifndef MAS_BUILD
|
|
// Remote accessibility objects corresponding to the NSWindow and its root
|
|
// NSView.
|
|
base::scoped_nsobject<NSAccessibilityRemoteUIElement>
|
|
remote_window_accessible_;
|
|
base::scoped_nsobject<NSAccessibilityRemoteUIElement> remote_view_accessible_;
|
|
+#endif
|
|
|
|
// Used to force the NSApplication's focused accessibility element to be the
|
|
// views::Views accessibility tree when the NSView for this is focused.
|
|
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
|
|
index 1de90c3bf77b2b1d69d10cd0fbe6e963f7b48861..f437109802677f1c237116eadfc2952249daf084 100644
|
|
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
|
|
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
|
|
@@ -285,14 +285,22 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
|
NativeWidgetMacNSWindowHost::GetNativeViewAccessibleForNSView() const {
|
|
if (in_process_ns_window_bridge_)
|
|
return in_process_ns_window_bridge_->ns_view();
|
|
+#ifndef MAS_BUILD
|
|
return remote_view_accessible_.get();
|
|
+#else
|
|
+ return nullptr;
|
|
+#endif
|
|
}
|
|
|
|
gfx::NativeViewAccessible
|
|
NativeWidgetMacNSWindowHost::GetNativeViewAccessibleForNSWindow() const {
|
|
if (in_process_ns_window_bridge_)
|
|
return in_process_ns_window_bridge_->ns_window();
|
|
+#ifndef MAS_BUILD
|
|
return remote_window_accessible_.get();
|
|
+#else
|
|
+ return nullptr;
|
|
+#endif
|
|
}
|
|
|
|
remote_cocoa::mojom::NativeWidgetNSWindow*
|
|
@@ -1173,6 +1181,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
|
void NativeWidgetMacNSWindowHost::SetRemoteAccessibilityTokens(
|
|
const std::vector<uint8_t>& window_token,
|
|
const std::vector<uint8_t>& view_token) {
|
|
+#ifndef MAS_BUILD
|
|
remote_window_accessible_ =
|
|
ui::RemoteAccessibility::GetRemoteElementFromToken(window_token);
|
|
remote_view_accessible_ =
|
|
@@ -1180,14 +1189,17 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
|
[remote_view_accessible_ setWindowUIElement:remote_window_accessible_.get()];
|
|
[remote_view_accessible_
|
|
setTopLevelUIElement:remote_window_accessible_.get()];
|
|
+#endif
|
|
}
|
|
|
|
bool NativeWidgetMacNSWindowHost::GetRootViewAccessibilityToken(
|
|
int64_t* pid,
|
|
std::vector<uint8_t>* token) {
|
|
+#ifndef MAS_BUILD
|
|
*pid = getpid();
|
|
id element_id = GetNativeViewAccessible();
|
|
*token = ui::RemoteAccessibility::GetTokenForLocalElement(element_id);
|
|
+#endif
|
|
return true;
|
|
}
|
|
|