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

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

Issue 2969293002: Revert of Fix lifetime problems in AXPlatformNodeCocoa. (Closed)
Patch Set: Created 3 years, 5 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 | « no previous file | ui/views/widget/native_widget_mac_accessibility_unittest.mm » ('j') | 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 2b09d34d70eab2b78d19fb0bffa5eba1d8576ac4..2eb4dba0a3ac50dff8940613b19157feedcb0654 100644
--- a/ui/accessibility/platform/ax_platform_node_mac.mm
+++ b/ui/accessibility/platform/ax_platform_node_mac.mm
@@ -311,9 +311,6 @@
// NSAccessibility informal protocol implementation.
- (BOOL)accessibilityIsIgnored {
- if (!node_)
- return YES;
-
return [[self AXRole] isEqualToString:NSAccessibilityUnknownRole] ||
node_->GetData().HasState(ui::AX_STATE_INVISIBLE);
}
@@ -333,13 +330,10 @@
}
- (id)accessibilityFocusedUIElement {
- return node_ ? node_->GetDelegate()->GetFocus() : nil;
+ return node_->GetDelegate()->GetFocus();
}
- (NSArray*)accessibilityActionNames {
- if (!node_)
- return @[];
-
base::scoped_nsobject<NSMutableArray> axActions(
[[NSMutableArray alloc] init]);
@@ -361,11 +355,7 @@
}
- (void)accessibilityPerformAction:(NSString*)action {
- // Actions are performed asynchronously, so it's always possible for an object
- // to change its mind after previously reporting an action as available.
- if (![[self accessibilityActionNames] containsObject:action])
- return;
-
+ DCHECK([[self accessibilityActionNames] containsObject:action]);
ui::AXActionData data;
if ([action isEqualToString:NSAccessibilityShowMenuAction] &&
AlsoUseShowMenuActionForDefaultAction(node_->GetData())) {
@@ -388,9 +378,6 @@
}
- (NSArray*)accessibilityAttributeNames {
- if (!node_)
- return @[];
-
// These attributes are required on all accessibility objects.
NSArray* const kAllRoleAttributes = @[
NSAccessibilityChildrenAttribute,
@@ -460,7 +447,7 @@
- (NSArray*)accessibilityParameterizedAttributeNames {
if (!node_)
- return @[];
+ return nil;
static NSArray* const kSelectableTextAttributes = [@[
NSAccessibilityLineForIndexParameterizedAttribute,
@@ -485,9 +472,6 @@
}
- (BOOL)accessibilityIsAttributeSettable:(NSString*)attributeName {
- if (!node_)
- return NO;
-
if (node_->GetData().HasState(ui::AX_STATE_DISABLED))
return NO;
@@ -525,9 +509,6 @@
}
- (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
- if (!node_)
- return;
-
ui::AXActionData data;
// Check for attributes first. Only the |data.action| should be set here - any
@@ -566,9 +547,6 @@
}
- (id)accessibilityAttributeValue:(NSString*)attribute {
- if (!node_)
- return nil; // Return nil when detached. Even for AXRole.
-
SEL selector = NSSelectorFromString(attribute);
if ([self respondsToSelector:selector])
return [self performSelector:selector];
@@ -577,9 +555,6 @@
- (id)accessibilityAttributeValue:(NSString*)attribute
forParameter:(id)parameter {
- if (!node_)
- return nil;
-
SEL selector = NSSelectorFromString([attribute stringByAppendingString:@":"]);
if ([self respondsToSelector:selector])
return [self performSelector:selector withObject:parameter];
@@ -592,7 +567,6 @@
- (NSString*)AXRole {
if (!node_)
return nil;
-
return [[self class] nativeRoleFromAXRole:node_->GetData().role];
}
@@ -660,8 +634,7 @@
- (NSArray*)AXChildren {
if (!node_)
- return @[];
-
+ return nil;
int count = node_->GetChildCount();
NSMutableArray* children = [NSMutableArray arrayWithCapacity:count];
for (int i = 0; i < count; ++i)
« no previous file with comments | « no previous file | ui/views/widget/native_widget_mac_accessibility_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698