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

Side by Side Diff: ui/accessibility/platform/ax_platform_node_mac.mm

Issue 2119413004: a11y: Exclude children of nested keyboard accessible controls from a11y tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Before revert of cross-platform ignored a11y elements. Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ui/accessibility/platform/ax_platform_node_mac.h" 5 #import "ui/accessibility/platform/ax_platform_node_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 - (NSString*)getStringAttribute:(ui::AXStringAttribute)attribute { 272 - (NSString*)getStringAttribute:(ui::AXStringAttribute)attribute {
273 std::string attributeValue; 273 std::string attributeValue;
274 if (node_->GetStringAttribute(attribute, &attributeValue)) 274 if (node_->GetStringAttribute(attribute, &attributeValue))
275 return base::SysUTF8ToNSString(attributeValue); 275 return base::SysUTF8ToNSString(attributeValue);
276 return nil; 276 return nil;
277 } 277 }
278 278
279 // NSAccessibility informal protocol implementation. 279 // NSAccessibility informal protocol implementation.
280 280
281 - (BOOL)accessibilityIsIgnored { 281 - (BOOL)accessibilityIsIgnored {
282 return [[self AXRole] isEqualToString:NSAccessibilityUnknownRole]; 282 return node_->GetData().role == ui::AX_ROLE_IGNORED ||
283 node_->GetDelegate()->IsIgnored();
283 } 284 }
284 285
285 - (id)accessibilityHitTest:(NSPoint)point { 286 - (id)accessibilityHitTest:(NSPoint)point {
286 for (AXPlatformNodeCocoa* child in [self AXChildren]) { 287 for (AXPlatformNodeCocoa* child in [self AXChildren]) {
287 if (NSPointInRect(point, child.boundsInScreen)) 288 if (NSPointInRect(point, child.boundsInScreen))
288 return [child accessibilityHitTest:point]; 289 return [child accessibilityHitTest:point];
289 } 290 }
290 return NSAccessibilityUnignoredAncestor(self); 291 return NSAccessibilityUnignoredAncestor(self);
291 } 292 }
292 293
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 } 583 }
583 NotifyMacEvent(native_node_, event_type); 584 NotifyMacEvent(native_node_, event_type);
584 } 585 }
585 586
586 int AXPlatformNodeMac::GetIndexInParent() { 587 int AXPlatformNodeMac::GetIndexInParent() {
587 // TODO(dmazzoni): implement this. http://crbug.com/396137 588 // TODO(dmazzoni): implement this. http://crbug.com/396137
588 return -1; 589 return -1;
589 } 590 }
590 591
591 } // namespace ui 592 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_delegate.h ('k') | ui/accessibility/platform/test_ax_node_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698