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

Unified Diff: content/browser/accessibility/browser_accessibility_manager_mac.mm

Issue 2173563005: Newly created live regions should fire a private notification on the Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Live region created is followed by live region changed in Safari. Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/accessibility/browser_accessibility_manager_mac.mm
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
index 604e42008faa45669f06517fad947ed8f2c832f0..72c25b0c301cd2a5cd23dbd781873f4c7ebc5655 100644
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
@@ -65,6 +65,8 @@ NSString* const NSAccessibilityLoadCompleteNotification =
@"AXLoadComplete";
NSString* const NSAccessibilityInvalidStatusChangedNotification =
@"AXInvalidStatusChanged";
+NSString* const NSAccessibilityLiveRegionCreatedNotification =
+ @"AXLiveRegionCreated";
NSString* const NSAccessibilityLiveRegionChangedNotification =
@"AXLiveRegionChanged";
NSString* const NSAccessibilityExpandedChanged =
@@ -261,7 +263,10 @@ void BrowserAccessibilityManagerMac::NotifyAccessibilityEvent(
return;
}
break;
- // TODO(nektar): Need to add an event for live region created.
+ case ui::AX_EVENT_ALERT:
+ mac_notification = NSAccessibilityLiveRegionCreatedNotification;
+ // A live region created notification must be followed by a live region
+ // changed notification.
case ui::AX_EVENT_LIVE_REGION_CHANGED:
mac_notification = NSAccessibilityLiveRegionChangedNotification;
break;
@@ -284,7 +289,6 @@ void BrowserAccessibilityManagerMac::NotifyAccessibilityEvent(
break;
// These events are not used on Mac for now.
- case ui::AX_EVENT_ALERT:
case ui::AX_EVENT_TEXT_CHANGED:
case ui::AX_EVENT_CHILDREN_CHANGED:
case ui::AX_EVENT_MENU_LIST_VALUE_CHANGED:
@@ -383,7 +387,8 @@ void BrowserAccessibilityManagerMac::OnAtomicUpdateFinished(
BrowserAccessibility* obj = GetFromAXNode(changed_node);
if (obj && obj->HasStringAttribute(ui::AX_ATTR_LIVE_STATUS)) {
created_live_region = true;
- break;
+ NotifyAccessibilityEvent(BrowserAccessibilityEvent::FromTreeChange,
+ ui::AX_EVENT_ALERT, obj);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698