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

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

Issue 2010493005: a11y/Mac: Add screenreader support for SubtleNotificationView announcements. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and use title instead of value. Created 4 years, 6 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 620841889eae237edc5ee3a5a3f4f237f6de4a33..b10a9adf66e859f535ff68635684f38f26ea2412 100644
--- a/ui/accessibility/platform/ax_platform_node_mac.mm
+++ b/ui/accessibility/platform/ax_platform_node_mac.mm
@@ -307,6 +307,9 @@ RoleMap BuildSubroleMap() {
@end
+// TODO(patricialor): Remove this when the deployment target is 10.9 or later.
dmazzoni 2016/06/21 20:09:36 Just an idea: rather than a TODO, how about just m
tapted 2016/06/22 00:23:38 This is a good suggestion! But I have an alternati
Patti Lor 2016/06/23 01:00:39 Done, thanks for the suggestions. I stole that bit
+extern NSString* const NSAccessibilityPriorityKey;
+
namespace ui {
// static
@@ -335,7 +338,22 @@ gfx::NativeViewAccessible AXPlatformNodeMac::GetNativeViewAccessible() {
}
void AXPlatformNodeMac::NotifyAccessibilityEvent(ui::AXEvent event_type) {
- // TODO(dmazzoni): implement this. http://crbug.com/396137
+ switch (event_type) {
+ case ui::AX_EVENT_ALERT: {
+ NSString* announcement = base::SysUTF8ToNSString(
+ GetData().GetStringAttribute(ui::AX_ATTR_NAME));
+ NSDictionary* notification_info = @{
+ NSAccessibilityAnnouncementKey : announcement,
+ NSAccessibilityPriorityKey : @(NSAccessibilityPriorityHigh)
tapted 2016/06/22 00:23:38 does NSAccessibilityPriorityKey : NSAccessibility
Patti Lor 2016/06/23 01:00:39 It complains "collection element of type 'NSAccess
tapted 2016/07/11 03:46:47 Ah - right you are. [NSNumber numberWithInteger:NS
+ };
+ NSAccessibilityPostNotificationWithUserInfo(
+ [NSApp mainWindow], NSAccessibilityAnnouncementRequestedNotification,
+ notification_info);
+ } break;
+ default:
+ // TODO(dmazzoni): implement this. http://crbug.com/396137
+ break;
+ }
}
int AXPlatformNodeMac::GetIndexInParent() {

Powered by Google App Engine
This is Rietveld 408576698