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 5814956c24be36ad90145b97c913eaa8006679d0..67c78e9c41370e71f18ad3ff4ddd8dc2869f6f55 100644 |
| --- a/ui/accessibility/platform/ax_platform_node_mac.mm |
| +++ b/ui/accessibility/platform/ax_platform_node_mac.mm |
| @@ -384,7 +384,8 @@ void NotifyMacEvent(AXPlatformNodeCocoa* target, ui::AXEvent event_type) { |
| if ([attributeName isEqualToString:NSAccessibilityFocusedAttribute]) { |
| if (ui::AXNodeData::IsFlagSet(node_->GetData().state, |
| ui::AX_STATE_FOCUSABLE)) |
|
tapted
2016/11/11 00:36:25
nit: needs curlies now that the block below goes o
Patti Lor
2016/11/14 03:51:21
Oops, yeah this is definitely a mistake. Fixed now
|
| - return NO; |
| + return ui::AXNodeData::IsFlagSet(node_->GetData().state, |
| + ui::AX_STATE_FOCUSABLE); |
| } |
| // TODO(patricialor): Add callbacks for updating the above attributes except |
| @@ -393,13 +394,19 @@ void NotifyMacEvent(AXPlatformNodeCocoa* target, ui::AXEvent event_type) { |
| } |
| - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute { |
| - if ([attribute isEqualToString:NSAccessibilityValueAttribute] && |
| - [value isKindOfClass:[NSString class]]) { |
| - node_->GetDelegate()->SetStringValue(base::SysNSStringToUTF16(value), true); |
| - } else if ([attribute isEqualToString:NSAccessibilitySelectedTextAttribute] && |
| - [value isKindOfClass:[NSString class]]) { |
| - node_->GetDelegate()->SetStringValue(base::SysNSStringToUTF16(value), |
| - false); |
| + if ([value isKindOfClass:[NSString class]]) { |
| + if ([attribute isEqualToString:NSAccessibilityValueAttribute]) { |
| + node_->GetDelegate()->SetStringValue(base::SysNSStringToUTF16(value), |
| + true); |
| + } else if ([attribute |
| + isEqualToString:NSAccessibilitySelectedTextAttribute]) { |
| + node_->GetDelegate()->SetStringValue(base::SysNSStringToUTF16(value), |
| + false); |
| + } |
| + } else if ([value isKindOfClass:[NSNumber class]]) { |
| + if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) { |
| + node_->GetDelegate()->SetFocused([value boolValue]); |
| + } |
| } |
| // TODO(patricialor): Plumb through all the other writable attributes as |