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

Unified Diff: ui/accessibility/platform/ax_platform_node_mac.mm

Issue 2341633006: MacViews/a11y: Allow accessibility clients to update the selected text. (Closed)
Patch Set: Delete unused method declarations and revert redundant a11y notification. 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 side-by-side diff with in-line comments
Download patch
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 be9eb9e3679d2214a2f36a34f17e09f50335b97b..9c0bf7ad0327deb3535895df506fe8899d214b69 100644
--- a/ui/accessibility/platform/ax_platform_node_mac.mm
+++ b/ui/accessibility/platform/ax_platform_node_mac.mm
@@ -378,11 +378,9 @@ void NotifyMacEvent(AXPlatformNodeCocoa* target, ui::AXEvent event_type) {
return NO;
}
- if ([attributeName isEqualToString:NSAccessibilityValueAttribute])
+ if ([attributeName isEqualToString:NSAccessibilityValueAttribute] ||
+ [attributeName isEqualToString:NSAccessibilitySelectedTextAttribute])
return node_->GetDelegate()->CanSetStringValue();
- // TODO(patricialor): Implement and merge with conditional for value above.
- if ([attributeName isEqualToString:NSAccessibilitySelectedTextAttribute])
- return NO;
if ([attributeName isEqualToString:NSAccessibilityFocusedAttribute]) {
if (ui::AXViewState::IsFlagSet(node_->GetData().state,
@@ -398,7 +396,11 @@ void NotifyMacEvent(AXPlatformNodeCocoa* target, ui::AXEvent event_type) {
- (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
if ([attribute isEqualToString:NSAccessibilityValueAttribute] &&
[value isKindOfClass:[NSString class]])
tapted 2016/10/20 05:54:59 perhaps at the top of the function, if (![value
Patti Lor 2016/10/24 04:31:48 This doesn't work for all attributes - e.g., NSAcc
tapted 2016/10/24 06:11:57 Acknowledged.
- node_->GetDelegate()->SetStringValue(base::SysNSStringToUTF16(value));
+ node_->GetDelegate()->SetStringValue(base::SysNSStringToUTF16(value),
+ false);
tapted 2016/10/20 05:54:59 now that the body spans 2 lines, the `if` (and els
Patti Lor 2016/10/24 04:31:48 Done.
+ else if ([attribute isEqualToString:NSAccessibilitySelectedTextAttribute] &&
+ [value isKindOfClass:[NSString class]])
+ node_->GetDelegate()->SetStringValue(base::SysNSStringToUTF16(value), true);
// TODO(patricialor): Plumb through all the other writable attributes as
// specified in accessibilityIsAttributeSettable.

Powered by Google App Engine
This is Rietveld 408576698