OLD | NEW |
---|---|
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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
282 | 282 |
283 - (NSString*)getStringAttribute:(ui::AXStringAttribute)attribute { | 283 - (NSString*)getStringAttribute:(ui::AXStringAttribute)attribute { |
284 std::string attributeValue; | 284 std::string attributeValue; |
285 if (node_->GetStringAttribute(attribute, &attributeValue)) | 285 if (node_->GetStringAttribute(attribute, &attributeValue)) |
286 return base::SysUTF8ToNSString(attributeValue); | 286 return base::SysUTF8ToNSString(attributeValue); |
287 return nil; | 287 return nil; |
288 } | 288 } |
289 | 289 |
290 // NSAccessibility informal protocol implementation. | 290 // NSAccessibility informal protocol implementation. |
291 | 291 |
292 - (BOOL)accessibilityIsIgnored { | 292 - (BOOL)accessibilityIsIgnored { |
tapted
2017/04/05 06:03:33
Should this be updated to include ui::AX_ROLE_IGNO
Patti Lor
2017/04/11 05:40:45
I think this already happens - AX_ROLE_IGNORED is
| |
293 return [[self AXRole] isEqualToString:NSAccessibilityUnknownRole] || | 293 return [[self AXRole] isEqualToString:NSAccessibilityUnknownRole] || |
294 node_->GetData().HasStateFlag(ui::AX_STATE_INVISIBLE); | 294 node_->GetData().HasStateFlag(ui::AX_STATE_INVISIBLE); |
295 } | 295 } |
296 | 296 |
297 - (id)accessibilityHitTest:(NSPoint)point { | 297 - (id)accessibilityHitTest:(NSPoint)point { |
298 for (AXPlatformNodeCocoa* child in [self AXChildren]) { | 298 for (AXPlatformNodeCocoa* child in [self AXChildren]) { |
299 if (NSPointInRect(point, child.boundsInScreen)) | 299 if (![child accessibilityIsIgnored] && |
300 NSPointInRect(point, [child boundsInScreen])) { | |
300 return [child accessibilityHitTest:point]; | 301 return [child accessibilityHitTest:point]; |
302 } | |
301 } | 303 } |
302 return NSAccessibilityUnignoredAncestor(self); | 304 return NSAccessibilityUnignoredAncestor(self); |
303 } | 305 } |
304 | 306 |
305 - (BOOL)accessibilityNotifiesWhenDestroyed { | 307 - (BOOL)accessibilityNotifiesWhenDestroyed { |
306 return YES; | 308 return YES; |
307 } | 309 } |
308 | 310 |
309 - (id)accessibilityFocusedUIElement { | 311 - (id)accessibilityFocusedUIElement { |
310 return node_->GetDelegate()->GetFocus(); | 312 return node_->GetDelegate()->GetFocus(); |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
699 } | 701 } |
700 NotifyMacEvent(native_node_, event_type); | 702 NotifyMacEvent(native_node_, event_type); |
701 } | 703 } |
702 | 704 |
703 int AXPlatformNodeMac::GetIndexInParent() { | 705 int AXPlatformNodeMac::GetIndexInParent() { |
704 // TODO(dmazzoni): implement this. http://crbug.com/396137 | 706 // TODO(dmazzoni): implement this. http://crbug.com/396137 |
705 return -1; | 707 return -1; |
706 } | 708 } |
707 | 709 |
708 } // namespace ui | 710 } // namespace ui |
OLD | NEW |