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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 Loading... | |
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 |
OLD | NEW |