diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-17 07:07:10 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-17 07:07:10 +0000 |
commit | 8463713acc4688461ea7aa330d82b41882d7cff2 (patch) | |
tree | 14f7cf5afa351c66f6e40469e2ee2e94159966fb /chrome | |
parent | ced9fd798f845db743b4237834a7914847ca04f7 (diff) | |
download | chromium_src-8463713acc4688461ea7aa330d82b41882d7cff2.zip chromium_src-8463713acc4688461ea7aa330d82b41882d7cff2.tar.gz chromium_src-8463713acc4688461ea7aa330d82b41882d7cff2.tar.bz2 |
Removing a method unecessary in FindBarWin.
BUG=None
TEST=Bring up the find box. Press Esc (the box should close). Hit a URL that takes a long time to load. While it is loading, press ESC, the load should stop.
Review URL: http://codereview.chromium.org/126230
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18605 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/views/find_bar_win.cc | 44 | ||||
-rw-r--r-- | chrome/browser/views/find_bar_win.h | 7 |
2 files changed, 9 insertions, 42 deletions
diff --git a/chrome/browser/views/find_bar_win.cc b/chrome/browser/views/find_bar_win.cc index f3bfdd7..51e1b20 100644 --- a/chrome/browser/views/find_bar_win.cc +++ b/chrome/browser/views/find_bar_win.cc @@ -89,29 +89,23 @@ FindBar* CreateFindBar(BrowserView* browser_view) { FindBarWin::FindBarWin(BrowserView* browser_view) : browser_view_(browser_view), find_dialog_animation_offset_(0), - focus_manager_(NULL), esc_accel_target_registered_(false), find_bar_controller_(NULL) { - gfx::NativeView parent_view = browser_view->GetWidget()->GetNativeView(); + view_ = new FindBarView(this); + + // Initialize the host. + host_.reset(new Host(this)); + host_->Init(browser_view->GetWidget()->GetNativeView(), gfx::Rect(), false); + host_->SetContentsView(view_); // Start listening to focus changes, so we can register and unregister our // own handler for Escape. - SetFocusChangeListener(parent_view); - - view_ = new FindBarView(this); - - views::FocusManager* focus_manager = views::FocusManager::GetFocusManager( - parent_view); - DCHECK(focus_manager); + focus_manager_ = views::FocusManager::GetFocusManager(host_->GetNativeView()); + 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)); - - // Initialize the host. - host_.reset(new Host(this)); - host_->Init(parent_view, gfx::Rect(), false); - host_->SetContentsView(view_); + focus_tracker_.reset(new views::ExternalFocusTracker(view_, focus_manager_)); // Start the process of animating the opening of the window. animation_.reset(new SlideAnimation(this)); @@ -568,26 +562,6 @@ void FindBarWin::SetDialogPosition(const gfx::Rect& new_pos, bool no_redraw) { #endif } -void FindBarWin::SetFocusChangeListener(gfx::NativeView parent_view) { -#if defined(OS_WIN) - // When tabs get torn off the tab-strip they get a new window with a new - // FocusManager, which means we need to clean up old listener and start a new - // one with the new FocusManager. - if (focus_manager_) { - if (esc_accel_target_registered_) - UnregisterEscAccelerator(); - focus_manager_->RemoveFocusChangeListener(this); - } - - // Register as a listener with the new focus manager. - focus_manager_ = views::FocusManager::GetFocusManager(parent_view); - DCHECK(focus_manager_); - focus_manager_->AddFocusChangeListener(this); -#else - NOTIMPLEMENTED(); -#endif -} - void FindBarWin::RestoreSavedFocus() { if (focus_tracker_.get() == NULL) { // TODO(brettw) Focus() should be on TabContentsView. diff --git a/chrome/browser/views/find_bar_win.h b/chrome/browser/views/find_bar_win.h index db7b3e7..732fd36 100644 --- a/chrome/browser/views/find_bar_win.h +++ b/chrome/browser/views/find_bar_win.h @@ -53,13 +53,6 @@ class FindBarWin : public views::AcceleratorTarget, // Whether we are animating the position of the Find window. bool IsAnimating(); - // We need to monitor focus changes so that we can register a handler for - // Escape when we get focus and unregister it when we looses focus. This - // function unregisters our old Escape accelerator (if registered) and - // registers a new one with the FocusManager associated with the - // new |parent_view|. - void SetFocusChangeListener(gfx::NativeView parent_view); - #if defined(OS_WIN) // Forwards selected keystrokes to the renderer. This is useful to make sure // that arrow keys and PageUp and PageDown result in scrolling, instead of |