Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(999)

Unified Diff: ui/accessibility/platform/ax_platform_node_mac.mm

Issue 2715543003: Views a11y: Implement AXPlatformNode::FromNativeViewAccessible on all platforms. (Closed)
Patch Set: Try removing default impl for FromNativeViewAccessible again. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accessibility/platform/ax_platform_node_mac.mm
diff --git a/ui/accessibility/platform/ax_platform_node_mac.mm b/ui/accessibility/platform/ax_platform_node_mac.mm
index 5d3c0caaeae2a62489aede774f6bc7178a36bb5f..cc60602643eb74d48e5d796f3d4693ac8a3e609f 100644
--- a/ui/accessibility/platform/ax_platform_node_mac.mm
+++ b/ui/accessibility/platform/ax_platform_node_mac.mm
@@ -12,6 +12,7 @@
#include "ui/accessibility/ax_action_data.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/accessibility/ax_role_properties.h"
+#include "ui/accessibility/platform/ax_platform_node.h"
#include "ui/accessibility/platform/ax_platform_node_delegate.h"
#include "ui/base/l10n/l10n_util.h"
#import "ui/gfx/mac/coordinate_conversion.h"
@@ -230,7 +231,11 @@ void NotifyMacEvent(AXPlatformNodeCocoa* target, ui::AXEvent event_type) {
- (NSString*)getStringAttribute:(ui::AXStringAttribute)attribute;
@end
-@implementation AXPlatformNodeCocoa
+@implementation AXPlatformNodeCocoa {
+ ui::AXPlatformNodeBase* node_; // Weak. Retains us.
+}
+
+@synthesize node = node_;
// A mapping of AX roles to native roles.
+ (NSString*)nativeRoleFromAXRole:(ui::AXRole)role {
@@ -650,6 +655,14 @@ AXPlatformNode* AXPlatformNode::Create(AXPlatformNodeDelegate* delegate) {
return node;
}
+// static
+AXPlatformNode* AXPlatformNode::FromNativeViewAccessible(
+ gfx::NativeViewAccessible accessible) {
+ if ([accessible isKindOfClass:[AXPlatformNodeCocoa class]])
+ return [accessible node];
+ return nullptr;
+}
+
AXPlatformNodeMac::AXPlatformNodeMac() {
}
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698