summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/find_bar_host.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-02 19:05:19 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-02 19:05:19 +0000
commit3a31d4855b91065ffd87d7de3f4db0ef92c94ec7 (patch)
treea6e7f7e5b57cd1cf9d8741260e81882142a74ff4 /chrome/browser/views/find_bar_host.cc
parent8062678b6b02902058d2a688099a650783fc5556 (diff)
downloadchromium_src-3a31d4855b91065ffd87d7de3f4db0ef92c94ec7.zip
chromium_src-3a31d4855b91065ffd87d7de3f4db0ef92c94ec7.tar.gz
chromium_src-3a31d4855b91065ffd87d7de3f4db0ef92c94ec7.tar.bz2
The focus would only be restored properly the first time the
find-in-bar box was closed. Also wrote an interactive ui test and took the opportunity to convert the existing find-in-bar interactive ui test to be a browser test. BUG=23599 TEST=See bug. Review URL: http://codereview.chromium.org/251064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27875 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/find_bar_host.cc')
-rw-r--r--chrome/browser/views/find_bar_host.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/chrome/browser/views/find_bar_host.cc b/chrome/browser/views/find_bar_host.cc
index a87edc2..46888af 100644
--- a/chrome/browser/views/find_bar_host.cc
+++ b/chrome/browser/views/find_bar_host.cc
@@ -53,11 +53,6 @@ FindBarHost::FindBarHost(BrowserView* browser_view)
views::FocusManager::GetFocusManagerForNativeView(host_->GetNativeView());
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_));
} 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.
@@ -74,6 +69,10 @@ FindBarHost::~FindBarHost() {
}
void FindBarHost::Show() {
+ // 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_));
+
if (disable_animations_during_testing_) {
animation_->Reset(1);
MoveWindowIfNecessary(gfx::Rect(), true);