Chromium Code Reviews| Index: content/browser/accessibility/browser_accessibility_cocoa.mm |
| diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm |
| index a0a8338f3f294ec228f5613173c49785afc1e264..35011bc1a4ea892e1b9b0534cd082f06aad64845 100644 |
| --- a/content/browser/accessibility/browser_accessibility_cocoa.mm |
| +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm |
| @@ -12,6 +12,7 @@ |
| #include "base/mac/foundation_util.h" |
| #include "base/mac/scoped_cftyperef.h" |
| +#import "base/mac/sdk_forward_declarations.h" |
|
tapted
2016/09/28 01:03:19
nit: remove?
Patti Lor
2016/10/04 05:45:14
Done.
|
| #include "base/strings/string16.h" |
| #include "base/strings/sys_string_conversions.h" |
| #include "base/strings/utf_string_conversions.h" |
| @@ -106,11 +107,6 @@ const int kAXResultsLimitNoLimit = -1; |
| extern "C" { |
| -// See http://openradar.appspot.com/9896491. This SPI has been tested on 10.5, |
| -// 10.6, and 10.7. It allows accessibility clients to observe events posted on |
| -// this object. |
| -void NSAccessibilityUnregisterUniqueIdForUIElement(id element); |
| - |
| // The following are private accessibility APIs required for cursor navigation |
| // and text selection. VoiceOver started relying on them in Mac OS X 10.11. |
| #if !defined(MAC_OS_X_VERSION_10_11) || \ |
| @@ -610,8 +606,10 @@ NSString* const NSAccessibilityRequiredAttribute = @"AXRequired"; |
| } |
| - (void)detach { |
| - if (browserAccessibility_) |
| - NSAccessibilityUnregisterUniqueIdForUIElement(self); |
| + if (!browserAccessibility_) |
| + return; |
| + NSAccessibilityPostNotification( |
| + self, NSAccessibilityUIElementDestroyedNotification); |
| browserAccessibility_ = nullptr; |
| } |
| @@ -2880,7 +2878,10 @@ NSString* const NSAccessibilityRequiredAttribute = @"AXRequired"; |
| return browserAccessibility_->GetId(); |
| } |
| -- (BOOL)accessibilityShouldUseUniqueId { |
| +- (BOOL)accessibilityNotifiesWhenDestroyed { |
| + // Indicate that BrowserAccessibilityCocoa will post a notification when it's |
| + // destroyed (see - detach). This allows VoiceOver to do some internal |
| + // things more efficiently. |
|
tapted
2016/09/28 01:03:19
Yeah it would be awesome if we can drop the privat
Patti Lor
2016/10/04 05:45:14
The decision to delete the private API stuff here
|
| return YES; |
| } |