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

Unified Diff: chrome/browser/views/find_bar_win.cc

Issue 161001: Workaround focus manager crasher (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/find_bar_win.cc
===================================================================
--- chrome/browser/views/find_bar_win.cc (revision 21433)
+++ chrome/browser/views/find_bar_win.cc (working copy)
@@ -102,11 +102,18 @@
// own handler for Escape.
focus_manager_ =
views::FocusManager::GetFocusManagerForNativeView(host_->GetNativeView());
- focus_manager_->AddFocusChangeListener(this);
+ if (focus_manager_) {
+ focus_manager_->AddFocusChangeListener(this);
- // Stores the currently focused view, and tracks focus changes so that we can
- // restore focus when the find box is closed.
- focus_tracker_.reset(new views::ExternalFocusTracker(view_, focus_manager_));
+ // Stores the currently focused view, and tracks focus changes so that we
+ // can restore focus when the find box is closed.
+ focus_tracker_.reset(new views::ExternalFocusTracker(view_,
+ focus_manager_));
+ } else {
+ // In some cases (see bug http://crbug.com/17056) it seems we may not have
+ // a focus manager. Please reopen the bug if you hit this.
+ NOTREACHED();
+ }
// Start the process of animating the opening of the window.
animation_.reset(new SlideAnimation(this));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698