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

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

Issue 1261073003: Tolerate GetRoot() returning null. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
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 #include "content/browser/accessibility/browser_accessibility_manager_mac.h" 5 #include "content/browser/accessibility/browser_accessibility_manager_mac.h"
6 6
7 #import "base/logging.h" 7 #import "base/logging.h"
8 #import "content/browser/accessibility/browser_accessibility_cocoa.h" 8 #import "content/browser/accessibility/browser_accessibility_cocoa.h"
9 #import "content/browser/accessibility/browser_accessibility_mac.h" 9 #import "content/browser/accessibility/browser_accessibility_mac.h"
10 #include "content/common/accessibility_messages.h" 10 #include "content/common/accessibility_messages.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 if (!created_live_region) 181 if (!created_live_region)
182 return; 182 return;
183 183
184 // This code is to work around a bug in VoiceOver, where a new live 184 // This code is to work around a bug in VoiceOver, where a new live
185 // region that gets added is ignored. VoiceOver seems to only scan the 185 // region that gets added is ignored. VoiceOver seems to only scan the
186 // page for live regions once. By recreating the NSAccessibility 186 // page for live regions once. By recreating the NSAccessibility
187 // object for the root of the tree, we force VoiceOver to clear out its 187 // object for the root of the tree, we force VoiceOver to clear out its
188 // internal state and find newly-added live regions this time. 188 // internal state and find newly-added live regions this time.
189 BrowserAccessibilityMac* root = 189 BrowserAccessibilityMac* root =
190 static_cast<BrowserAccessibilityMac*>(GetRoot()); 190 static_cast<BrowserAccessibilityMac*>(GetRoot());
191 root->RecreateNativeObject(); 191 if (root) {
192 NotifyAccessibilityEvent(ui::AX_EVENT_CHILDREN_CHANGED, root); 192 root->RecreateNativeObject();
193 NotifyAccessibilityEvent(ui::AX_EVENT_CHILDREN_CHANGED, root);
194 }
193 } 195 }
194 196
195 } // namespace content 197 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698