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

Unified Diff: content/browser/accessibility/browser_accessibility_manager_win.cc

Issue 1261073003: Tolerate GetRoot() returning null. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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_manager_mac.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_win.cc
diff --git a/content/browser/accessibility/browser_accessibility_manager_win.cc b/content/browser/accessibility/browser_accessibility_manager_win.cc
index bf70c576ad676d7f3e83c67ee2bb6466a6a08740..5ee08f0fae5d589717997fbdf4d784b000b52be5 100644
--- a/content/browser/accessibility/browser_accessibility_manager_win.cc
+++ b/content/browser/accessibility/browser_accessibility_manager_win.cc
@@ -150,13 +150,14 @@ void BrowserAccessibilityManagerWin::OnWindowFocused() {
// Try to fire a focus event on the root first and then the focused node.
// This will clear focus_event_on_root_needed_ if successful.
- if (focus_ != tree_->root())
+ if (focus_ != tree_->root() && GetRoot())
NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, GetRoot());
BrowserAccessibilityManager::OnWindowFocused();
}
void BrowserAccessibilityManagerWin::UserIsReloading() {
- MaybeCallNotifyWinEvent(IA2_EVENT_DOCUMENT_RELOAD, GetRoot());
+ if (GetRoot())
+ MaybeCallNotifyWinEvent(IA2_EVENT_DOCUMENT_RELOAD, GetRoot());
}
void BrowserAccessibilityManagerWin::NotifyAccessibilityEvent(
@@ -253,6 +254,9 @@ void BrowserAccessibilityManagerWin::NotifyAccessibilityEvent(
break;
}
+ if (!node)
+ return;
+
if (event_id != EVENT_MIN) {
// Pass the node's unique id in the |child_id| argument to NotifyWinEvent;
// the AT client will then call get_accChild on the HWND's accessibility
« no previous file with comments | « content/browser/accessibility/browser_accessibility_manager_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698