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

Side by Side Diff: content/browser/accessibility/browser_accessibility_mac.mm

Issue 272573003: Add hack so VoiceOver speaks updates to injected live regions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only recreate if it already exists Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #import "content/browser/accessibility/browser_accessibility_mac.h" 7 #import "content/browser/accessibility/browser_accessibility_mac.h"
8 8
9 #import "content/browser/accessibility/browser_accessibility_cocoa.h" 9 #import "content/browser/accessibility/browser_accessibility_cocoa.h"
10 #include "content/browser/accessibility/browser_accessibility_manager_mac.h" 10 #include "content/browser/accessibility/browser_accessibility_manager_mac.h"
(...skipping 30 matching lines...) Expand all
41 // reference to the cocoa object. 41 // reference to the cocoa object.
42 [browser_accessibility_cocoa_ release]; 42 [browser_accessibility_cocoa_ release];
43 // Finally, it's safe to delete this since we've detached. 43 // Finally, it's safe to delete this since we've detached.
44 delete this; 44 delete this;
45 } 45 }
46 46
47 bool BrowserAccessibilityMac::IsNative() const { 47 bool BrowserAccessibilityMac::IsNative() const {
48 return true; 48 return true;
49 } 49 }
50 50
51 void BrowserAccessibilityMac::RecreateNativeObject() {
52 if (!browser_accessibility_cocoa_)
53 return;
54
55 // Preserve the children so that recreating the native object doesn't
56 // end up recreating the whole subtree.
57 base::scoped_nsobject<NSMutableArray> children;
58 [browser_accessibility_cocoa_ swapChildren:&children];
59 [browser_accessibility_cocoa_ detach];
60 [browser_accessibility_cocoa_ release];
61 browser_accessibility_cocoa_ = [[BrowserAccessibilityCocoa alloc]
62 initWithObject:this];
63 [browser_accessibility_cocoa_ swapChildren:&children];
64 }
65
51 BrowserAccessibilityCocoa* BrowserAccessibility::ToBrowserAccessibilityCocoa() { 66 BrowserAccessibilityCocoa* BrowserAccessibility::ToBrowserAccessibilityCocoa() {
52 return static_cast<BrowserAccessibilityMac*>(this)-> 67 return static_cast<BrowserAccessibilityMac*>(this)->
53 native_view(); 68 native_view();
54 } 69 }
55 70
56 } // namespace content 71 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698