summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-24 20:51:35 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-24 20:51:35 +0000
commitb58d3c5ff1569f7c4284675545559e10d33f792b (patch)
tree13ceeb42a83c530ca45ae9b8d56bf851137b0b56
parent999f836e4ec525fc61c4cfb801368e645e5f7462 (diff)
downloadchromium_src-b58d3c5ff1569f7c4284675545559e10d33f792b.zip
chromium_src-b58d3c5ff1569f7c4284675545559e10d33f792b.tar.gz
chromium_src-b58d3c5ff1569f7c4284675545559e10d33f792b.tar.bz2
A crasher from the field indicates that the focus manager can be NULL when the FindBarWin is instanciated.
It is not clear how this can happen. BUG=17056 TEST=None Review URL: http://codereview.chromium.org/161001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21573 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/views/find_bar_win.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/chrome/browser/views/find_bar_win.cc b/chrome/browser/views/find_bar_win.cc
index e70fefd..fe78784 100644
--- a/chrome/browser/views/find_bar_win.cc
+++ b/chrome/browser/views/find_bar_win.cc
@@ -102,11 +102,18 @@ FindBarWin::FindBarWin(BrowserView* browser_view)
// 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));