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 1b841569615e845be4cf624c2bf50d4f2b7e4ef7..d475cae9a03bed85040533fb9df277979bc59d90 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" |
| #include "base/strings/string16.h" |
| #include "base/strings/sys_string_conversions.h" |
| #include "base/strings/utf_string_conversions.h" |
| @@ -107,11 +108,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) || \ |
| @@ -603,8 +599,11 @@ bool InitializeAccessibilityTreeSearch( |
| } |
| - (void)detach { |
| - if (browserAccessibility_) |
| - NSAccessibilityUnregisterUniqueIdForUIElement(self); |
| + if (!browserAccessibility_) |
| + return; |
| + NSAccessibilityPostNotification( |
| + self, NSAccessibilityUIElementDestroyedNotification); |
| + NSAccessibilityUnregisterUniqueIdForUIElement(self); |
| browserAccessibility_ = nullptr; |
| } |
| @@ -2853,6 +2852,10 @@ bool InitializeAccessibilityTreeSearch( |
| return browserAccessibility_->GetId(); |
| } |
| +- (BOOL)accessibilityNotifiesWhenDestroyed { |
| + return YES; |
|
tapted
2016/09/26 05:19:17
Comment here why this is done? Reading the comment
Patti Lor
2016/09/28 00:29:14
Ah - I think this might actually not be needed (at
|
| +} |
| + |
| - (BOOL)accessibilityShouldUseUniqueId { |
| return YES; |
| } |