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

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: Fix compile error and final test in NativeWidgetMacTest. Created 4 years, 2 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 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 - (NSString*)getStringAttribute:(ui::AXStringAttribute)attribute { 267 - (NSString*)getStringAttribute:(ui::AXStringAttribute)attribute {
268 std::string attributeValue; 268 std::string attributeValue;
269 if (node_->GetStringAttribute(attribute, &attributeValue)) 269 if (node_->GetStringAttribute(attribute, &attributeValue))
270 return base::SysUTF8ToNSString(attributeValue); 270 return base::SysUTF8ToNSString(attributeValue);
271 return nil; 271 return nil;
272 } 272 }
273 273
274 // NSAccessibility informal protocol implementation. 274 // NSAccessibility informal protocol implementation.
275 275
276 - (BOOL)accessibilityIsIgnored { 276 - (BOOL)accessibilityIsIgnored {
277 return [[self AXRole] isEqualToString:NSAccessibilityUnknownRole]; 277 return [[self AXRole] isEqualToString:NSAccessibilityUnknownRole] ||
278 node_->GetDelegate()->IsIgnored();
278 } 279 }
279 280
280 - (id)accessibilityHitTest:(NSPoint)point { 281 - (id)accessibilityHitTest:(NSPoint)point {
281 for (AXPlatformNodeCocoa* child in [self AXChildren]) { 282 for (AXPlatformNodeCocoa* child in [self AXChildren]) {
282 if (NSPointInRect(point, child.boundsInScreen)) 283 if (NSPointInRect(point, child.boundsInScreen))
tapted 2016/10/18 04:38:31 Perhaps we can tackle this logic. Something like
283 return [child accessibilityHitTest:point]; 284 return [child accessibilityHitTest:point];
284 } 285 }
285 return NSAccessibilityUnignoredAncestor(self); 286 return NSAccessibilityUnignoredAncestor(self);
286 } 287 }
287 288
288 - (NSArray*)accessibilityActionNames { 289 - (NSArray*)accessibilityActionNames {
289 return nil; 290 return nil;
290 } 291 }
291 292
292 - (NSArray*)accessibilityAttributeNames { 293 - (NSArray*)accessibilityAttributeNames {
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 } 571 }
571 NotifyMacEvent(target, event_type); 572 NotifyMacEvent(target, event_type);
572 } 573 }
573 574
574 int AXPlatformNodeMac::GetIndexInParent() { 575 int AXPlatformNodeMac::GetIndexInParent() {
575 // TODO(dmazzoni): implement this. http://crbug.com/396137 576 // TODO(dmazzoni): implement this. http://crbug.com/396137
576 return -1; 577 return -1;
577 } 578 }
578 579
579 } // namespace ui 580 } // 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