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

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

Issue 1706353002: Added the selected text marker range to the dictionary for the selection change notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed standard text fields. Created 4 years, 10 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 | « content/browser/accessibility/browser_accessibility_cocoa.mm ('k') | 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 3d6ff9af6537c2eca3fc5ee30d2f333c2f2dc39a..712de431a523bc58d62ed3f51f4302e2f72d1170 100644
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
@@ -183,24 +183,27 @@ void BrowserAccessibilityManagerMac::NotifyAccessibilityEvent(
break;
case ui::AX_EVENT_DOCUMENT_SELECTION_CHANGED: {
mac_notification = NSAccessibilitySelectedTextChangedNotification;
+ // WebKit fires a notification both on the focused object and the root.
+ BrowserAccessibility* focus = GetFocus();
+ if (!focus)
+ break;
+ NSAccessibilityPostNotification(focus->ToBrowserAccessibilityCocoa(),
+ mac_notification);
+
if (base::mac::IsOSElCapitanOrLater()) {
// |NSAccessibilityPostNotificationWithUserInfo| should be used on OS X
// 10.11 or later to notify Voiceover about text selection changes. This
// API has been present on versions of OS X since 10.7 but doesn't
// appear to be needed by Voiceover before version 10.11.
- // WebKit fires a notification both on the focused object and the root.
NSDictionary* user_info =
GetUserInfoForSelectedTextChangedNotification();
- BrowserAccessibility* focus = GetFocus();
- if (!focus)
- return;
- NSAccessibilityPostNotificationWithUserInfo(
- focus->ToBrowserAccessibilityCocoa(), mac_notification, user_info);
-
BrowserAccessibility* root = GetRoot();
if (!root)
return;
+
+ NSAccessibilityPostNotificationWithUserInfo(
+ focus->ToBrowserAccessibilityCocoa(), mac_notification, user_info);
NSAccessibilityPostNotificationWithUserInfo(
root->ToBrowserAccessibilityCocoa(), mac_notification, user_info);
return;
« no previous file with comments | « content/browser/accessibility/browser_accessibility_cocoa.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698