2020-01-13 14:04:38 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
|
|
Date: Thu, 20 Sep 2018 17:48:49 -0700
|
2021-05-19 18:20:12 +00:00
|
|
|
Subject: mas: avoid usage of NSAccessibilityRemoteUIElement
|
2020-01-13 14:04:38 +00:00
|
|
|
|
|
|
|
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
|
2023-03-10 16:07:42 +00:00
|
|
|
index 3600a7ce7b3e6540767f64c631f352aa62240459..3147961f3d1c2c1690b5adf16a9a58f71456c5d0 100644
|
2020-01-13 14:04:38 +00:00
|
|
|
--- a/components/remote_cocoa/app_shim/application_bridge.mm
|
|
|
|
+++ b/components/remote_cocoa/app_shim/application_bridge.mm
|
2022-02-10 02:58:52 +00:00
|
|
|
@@ -51,6 +51,7 @@
|
2020-01-13 14:04:38 +00:00
|
|
|
|
|
|
|
// NativeWidgetNSWindowHostHelper:
|
|
|
|
id GetNativeViewAccessible() override {
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
if (!remote_accessibility_element_) {
|
2023-03-10 16:07:42 +00:00
|
|
|
int64_t browser_pid = 0;
|
2020-01-13 14:04:38 +00:00
|
|
|
std::vector<uint8_t> element_token;
|
2022-02-10 02:58:52 +00:00
|
|
|
@@ -61,6 +62,9 @@ id GetNativeViewAccessible() override {
|
2020-01-13 14:04:38 +00:00
|
|
|
ui::RemoteAccessibility::GetRemoteElementFromToken(element_token);
|
|
|
|
}
|
|
|
|
return remote_accessibility_element_.get();
|
|
|
|
+#else
|
|
|
|
+ return nil;
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
void DispatchKeyEvent(ui::KeyEvent* event) override {
|
|
|
|
bool event_handled = false;
|
2022-02-10 02:58:52 +00:00
|
|
|
@@ -99,8 +103,10 @@ void GetWordAt(const gfx::Point& location_in_content,
|
2020-01-13 14:04:38 +00:00
|
|
|
mojo::AssociatedRemote<mojom::TextInputHost> text_input_host_remote_;
|
|
|
|
|
|
|
|
std::unique_ptr<NativeWidgetNSWindowBridge> bridge_;
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
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
|
2023-05-10 14:47:48 +00:00
|
|
|
index f13ccec0334aa6b47cce180630b15298b86a4162..fa76a984f3dea99bdb337b44ceb8e397cae6a4ec 100644
|
2020-01-13 14:04:38 +00:00
|
|
|
--- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
|
|
|
|
+++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
|
2023-03-31 02:03:58 +00:00
|
|
|
@@ -572,10 +572,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) {
|
2020-01-13 14:04:38 +00:00
|
|
|
// this should be treated as an error and caught early.
|
|
|
|
CHECK(bridged_view_);
|
|
|
|
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
// 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
|
2023-05-10 14:47:48 +00:00
|
|
|
index c87ae83d0a9755401a343b5392a22540c7051769..dc01554c00518561b1b7275c1eeea94785310a78 100644
|
2020-01-13 14:04:38 +00:00
|
|
|
--- a/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm
|
|
|
|
+++ b/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm
|
2023-03-10 16:07:42 +00:00
|
|
|
@@ -87,8 +87,10 @@ id GetFocusedBrowserAccessibilityElement() override {
|
2020-01-13 14:04:38 +00:00
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
void SetAccessibilityWindow(NSWindow* window) override {
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
host_->SetRemoteAccessibilityWindowToken(
|
|
|
|
ui::RemoteAccessibility::GetTokenForLocalElement(window));
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void ForwardKeyboardEvent(const content::NativeWebKeyboardEvent& key_event,
|
2023-03-10 16:07:42 +00:00
|
|
|
@@ -150,8 +152,10 @@ void SmartMagnify(const blink::WebGestureEvent& web_event) override {
|
2020-01-13 14:04:38 +00:00
|
|
|
|
|
|
|
mojo::AssociatedRemote<mojom::RenderWidgetHostNSViewHost> host_;
|
|
|
|
std::unique_ptr<RenderWidgetHostNSViewBridge> bridge_;
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
base::scoped_nsobject<NSAccessibilityRemoteUIElement>
|
|
|
|
remote_accessibility_element_;
|
|
|
|
+#endif
|
|
|
|
};
|
2021-11-24 08:45:59 +00:00
|
|
|
}
|
|
|
|
|
2022-07-13 21:26:16 +00:00
|
|
|
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
2023-03-10 16:07:42 +00:00
|
|
|
index 3a81bbe5542f39c82f6ccf6643f491cb73ecb2aa..6b156ac4c514855f73fedc85fb9b0080e8e61463 100644
|
2022-07-13 21:26:16 +00:00
|
|
|
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
|
|
|
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
2022-10-17 14:22:24 +00:00
|
|
|
@@ -22,7 +22,9 @@
|
2022-07-13 21:26:16 +00:00
|
|
|
#include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
|
|
|
|
#include "ui/accessibility/ax_role_properties.h"
|
|
|
|
#include "ui/accessibility/platform/ax_private_webkit_constants_mac.h"
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2022-07-13 21:26:16 +00:00
|
|
|
#include "ui/base/cocoa/remote_accessibility_api.h"
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
2023-03-10 16:07:42 +00:00
|
|
|
@@ -225,6 +227,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
+#if !IS_MAS_BUILD()
|
|
|
|
BrowserAccessibilityManager* root_manager = GetManagerForRootFrame();
|
|
|
|
if (root_manager) {
|
|
|
|
BrowserAccessibilityManagerMac* root_manager_mac =
|
|
|
|
@@ -247,6 +250,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
if (base::mac::IsOS10_13()) {
|
|
|
|
// Use the announcement API to get around OS <= 10.13 VoiceOver bug
|
|
|
|
@@ -643,6 +647,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
2022-07-13 21:26:16 +00:00
|
|
|
if ([NSApp isActive])
|
|
|
|
return window == [NSApp accessibilityFocusedWindow];
|
|
|
|
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2022-07-13 21:26:16 +00:00
|
|
|
// TODO(accessibility): We need a solution to the problem described below.
|
|
|
|
// If the window is NSAccessibilityRemoteUIElement, there are some challenges:
|
|
|
|
// 1. NSApp is the browser which spawned the PWA, and what it considers the
|
2023-03-10 16:07:42 +00:00
|
|
|
@@ -670,6 +675,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
2022-07-13 21:26:16 +00:00
|
|
|
// from within the app shim content.
|
|
|
|
if ([window isKindOfClass:[NSAccessibilityRemoteUIElement class]])
|
|
|
|
return true;
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2020-01-13 14:04:38 +00:00
|
|
|
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
|
2023-03-15 09:20:32 +00:00
|
|
|
index efca18c2a229b5d5afdcf5ac9c3057e0294bedd3..7a589e826f5c221259ac82ddfeba5985feb39d00 100644
|
2020-01-13 14:04:38 +00:00
|
|
|
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
|
|
|
|
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
|
2023-03-10 16:07:42 +00:00
|
|
|
@@ -51,7 +51,9 @@ class ScopedPasswordInputEnabler;
|
2020-01-13 14:04:38 +00:00
|
|
|
|
|
|
|
@protocol RenderWidgetHostViewMacDelegate;
|
|
|
|
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
@class NSAccessibilityRemoteUIElement;
|
|
|
|
+#endif
|
|
|
|
@class RenderWidgetHostViewCocoa;
|
|
|
|
|
|
|
|
namespace content {
|
2023-03-15 09:20:32 +00:00
|
|
|
@@ -664,10 +666,12 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
|
2020-01-13 14:04:38 +00:00
|
|
|
// EnsureSurfaceSynchronizedForWebTest().
|
|
|
|
uint32_t latest_capture_sequence_number_ = 0u;
|
|
|
|
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
// 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
|
2023-04-12 11:37:48 +00:00
|
|
|
index a7cbd153f799d8e6da61fb255c3d1d70c18fa514..2e3a87b7694f105a684ac2500ae5fb6861eee668 100644
|
2020-01-13 14:04:38 +00:00
|
|
|
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
|
|
|
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
2023-03-10 16:07:42 +00:00
|
|
|
@@ -254,8 +254,10 @@
|
2020-01-13 14:04:38 +00:00
|
|
|
void RenderWidgetHostViewMac::MigrateNSViewBridge(
|
|
|
|
remote_cocoa::mojom::Application* remote_cocoa_application,
|
|
|
|
uint64_t parent_ns_view_id) {
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
// Destroy the previous remote accessibility element.
|
|
|
|
remote_window_accessible_.reset();
|
|
|
|
+#endif
|
|
|
|
|
2023-02-03 11:43:42 +00:00
|
|
|
// Reset `ns_view_` before resetting `remote_ns_view_` to avoid dangling
|
|
|
|
// pointers. `ns_view_` gets reinitialized later in this method.
|
2023-04-12 11:37:48 +00:00
|
|
|
@@ -1567,8 +1569,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
2020-01-13 14:04:38 +00:00
|
|
|
|
|
|
|
gfx::NativeViewAccessible
|
|
|
|
RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() {
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
if (remote_window_accessible_)
|
|
|
|
return remote_window_accessible_.get();
|
|
|
|
+#endif
|
|
|
|
return [GetInProcessNSView() window];
|
|
|
|
}
|
|
|
|
|
2023-04-12 11:37:48 +00:00
|
|
|
@@ -1612,9 +1616,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
2020-01-13 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) {
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
// When running in-process, just use the NSView's NSWindow as its own
|
|
|
|
// accessibility element.
|
|
|
|
remote_window_accessible_.reset();
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame(
|
2023-04-12 11:37:48 +00:00
|
|
|
@@ -2116,12 +2122,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
2020-01-13 14:04:38 +00:00
|
|
|
|
|
|
|
void RenderWidgetHostViewMac::SetRemoteAccessibilityWindowToken(
|
|
|
|
const std::vector<uint8_t>& window_token) {
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
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
|
2023-05-10 14:47:48 +00:00
|
|
|
index cd69e2430bec3724f43a08318254272c0512e980..056a7b1bd399510688841cb68da3985690deb0c7 100644
|
2020-01-13 14:04:38 +00:00
|
|
|
--- a/ui/base/BUILD.gn
|
|
|
|
+++ b/ui/base/BUILD.gn
|
2023-05-10 14:47:48 +00:00
|
|
|
@@ -368,6 +368,13 @@ component("base") {
|
2022-05-17 16:48:40 +00:00
|
|
|
sources += [ "resource/resource_bundle_lacros.cc" ]
|
2020-01-13 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ if (is_mas_build) {
|
|
|
|
+ sources -= [
|
|
|
|
+ "cocoa/remote_accessibility_api.h",
|
|
|
|
+ "cocoa/remote_accessibility_api.mm",
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
|
|
+
|
2020-10-28 00:33:04 +00:00
|
|
|
if (is_ios) {
|
|
|
|
sources += [
|
|
|
|
"device_form_factor_ios.mm",
|
2020-01-13 14:04:38 +00:00
|
|
|
diff --git a/ui/base/cocoa/remote_accessibility_api.h b/ui/base/cocoa/remote_accessibility_api.h
|
2023-03-10 16:07:42 +00:00
|
|
|
index aa09619a3137d1878c9f5c111a348703965dd16f..6553de29e861c15028564ffe4a4b9b01f2b42c5b 100644
|
2020-01-13 14:04:38 +00:00
|
|
|
--- a/ui/base/cocoa/remote_accessibility_api.h
|
|
|
|
+++ b/ui/base/cocoa/remote_accessibility_api.h
|
|
|
|
@@ -11,6 +11,8 @@
|
2020-05-26 20:06:26 +00:00
|
|
|
#include "base/component_export.h"
|
2020-01-13 14:04:38 +00:00
|
|
|
#include "base/mac/scoped_nsobject.h"
|
|
|
|
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
+
|
|
|
|
@interface NSAccessibilityRemoteUIElement : NSObject
|
|
|
|
+ (void)registerRemoteUIProcessIdentifier:(int)pid;
|
2023-03-10 16:07:42 +00:00
|
|
|
+ (NSData*)remoteTokenForLocalUIElement:(id)element;
|
|
|
|
@@ -32,4 +34,6 @@ class COMPONENT_EXPORT(UI_BASE) RemoteAccessibility {
|
2020-01-13 14:04:38 +00:00
|
|
|
|
|
|
|
} // 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
|
2023-05-10 14:47:48 +00:00
|
|
|
index aa89421a689ad3f0872e51fa19624d2371948c21..e63b249a9bdc23545121a513156bfa32e92fec0b 100644
|
2020-01-13 14:04:38 +00:00
|
|
|
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.h
|
|
|
|
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h
|
2022-07-13 21:26:16 +00:00
|
|
|
@@ -32,7 +32,9 @@
|
2020-01-13 14:04:38 +00:00
|
|
|
#include "ui/views/window/dialog_observer.h"
|
|
|
|
|
|
|
|
@class NativeWidgetMacNSWindow;
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
@class NSAccessibilityRemoteUIElement;
|
|
|
|
+#endif
|
|
|
|
@class NSView;
|
|
|
|
|
|
|
|
namespace remote_cocoa {
|
2023-05-10 14:47:48 +00:00
|
|
|
@@ -458,11 +460,13 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
|
2020-01-13 14:04:38 +00:00
|
|
|
mojo::AssociatedRemote<remote_cocoa::mojom::NativeWidgetNSWindow>
|
|
|
|
remote_ns_window_remote_;
|
|
|
|
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
// 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
|
2023-05-10 14:47:48 +00:00
|
|
|
index dca21f43003231445b2c6fe0cfe07cd9ad9247ba..c6a33c2a85206295426292406291af670ce65ab0 100644
|
2020-01-13 14:04:38 +00:00
|
|
|
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
|
|
|
|
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
|
2023-05-10 14:47:48 +00:00
|
|
|
@@ -339,14 +339,22 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
2020-01-13 14:04:38 +00:00
|
|
|
NativeWidgetMacNSWindowHost::GetNativeViewAccessibleForNSView() const {
|
|
|
|
if (in_process_ns_window_bridge_)
|
|
|
|
return in_process_ns_window_bridge_->ns_view();
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
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();
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
return remote_window_accessible_.get();
|
|
|
|
+#else
|
|
|
|
+ return nullptr;
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
remote_cocoa::mojom::NativeWidgetNSWindow*
|
2023-05-10 14:47:48 +00:00
|
|
|
@@ -1333,6 +1341,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
2020-01-13 14:04:38 +00:00
|
|
|
void NativeWidgetMacNSWindowHost::SetRemoteAccessibilityTokens(
|
|
|
|
const std::vector<uint8_t>& window_token,
|
|
|
|
const std::vector<uint8_t>& view_token) {
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
remote_window_accessible_ =
|
|
|
|
ui::RemoteAccessibility::GetRemoteElementFromToken(window_token);
|
|
|
|
remote_view_accessible_ =
|
2023-05-10 14:47:48 +00:00
|
|
|
@@ -1340,14 +1349,17 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
2023-03-10 16:07:42 +00:00
|
|
|
[remote_view_accessible_ setWindowUIElement:remote_window_accessible_.get()];
|
2020-01-13 14:04:38 +00:00
|
|
|
[remote_view_accessible_
|
|
|
|
setTopLevelUIElement:remote_window_accessible_.get()];
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
bool NativeWidgetMacNSWindowHost::GetRootViewAccessibilityToken(
|
2023-03-10 16:07:42 +00:00
|
|
|
int64_t* pid,
|
2020-01-13 14:04:38 +00:00
|
|
|
std::vector<uint8_t>* token) {
|
2022-11-14 20:46:52 +00:00
|
|
|
+#if !IS_MAS_BUILD()
|
2020-01-13 14:04:38 +00:00
|
|
|
*pid = getpid();
|
|
|
|
id element_id = GetNativeViewAccessible();
|
|
|
|
*token = ui::RemoteAccessibility::GetTokenForLocalElement(element_id);
|
|
|
|
+#endif
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|