Chromium Code Reviews| 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 89444bf0c6fc94c35e48945a9e872c6ee53a89c0..f472e173aa270890d40e15151f77042623dc772c 100644 |
| --- a/ui/accessibility/platform/ax_platform_node_mac.mm |
| +++ b/ui/accessibility/platform/ax_platform_node_mac.mm |
| @@ -244,6 +244,13 @@ RoleMap BuildSubroleMap() { |
| return [NSValue valueWithSize:self.boundsInScreen.size]; |
| } |
| +- (NSString*)AXTitle { |
| + std::string value; |
| + if (node_->GetStringAttribute(ui::AX_ATTR_NAME, &value)) |
| + return base::SysUTF8ToNSString(value); |
| + return nil; |
| +} |
| + |
| // NSAccessibility informal protocol implementation. |
| - (BOOL)accessibilityIsIgnored { |
| @@ -269,7 +276,12 @@ RoleMap BuildSubroleMap() { |
| NSAccessibilityPositionAttribute, |
| NSAccessibilityRoleAttribute, |
| NSAccessibilitySizeAttribute, |
| + |
| + // Always add title. Cocoa asks for it regardless of it appearing in here, |
|
dmazzoni
2015/03/06 07:58:01
Rather than a comment for "title", I'd maybe just
tapted
2015/03/06 11:01:18
Done. Added the comment at top.
The comment on Ti
|
| + // most things should have it, and it's OK to return nil. |
| + NSAccessibilityTitleAttribute, |
| ]; |
| + // TODO(tapted): Add additional attributes based on role. |
| } |
| - (BOOL)accessibilityIsAttributeSettable:(NSString*)attribute { |