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

Side by Side Diff: chrome/browser/views/find_bar_win.cc

Issue 146093: Relanding focus manager refactoring (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/views/find_bar_win.h" 5 #include "chrome/browser/views/find_bar_win.h"
6 6
7 #include "app/slide_animation.h" 7 #include "app/slide_animation.h"
8 #include "chrome/browser/browser.h" 8 #include "chrome/browser/browser.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/find_bar_controller.h" 10 #include "chrome/browser/find_bar_controller.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 FindBarWin::FindBarWin(BrowserView* browser_view) 89 FindBarWin::FindBarWin(BrowserView* browser_view)
90 : browser_view_(browser_view), 90 : browser_view_(browser_view),
91 find_dialog_animation_offset_(0), 91 find_dialog_animation_offset_(0),
92 esc_accel_target_registered_(false), 92 esc_accel_target_registered_(false),
93 find_bar_controller_(NULL) { 93 find_bar_controller_(NULL) {
94 view_ = new FindBarView(this); 94 view_ = new FindBarView(this);
95 95
96 // Initialize the host. 96 // Initialize the host.
97 host_.reset(new Host(this)); 97 host_.reset(new Host(this));
98 host_->Init(browser_view->GetWidget()->GetNativeView(), gfx::Rect(), false); 98 host_->Init(browser_view->GetWidget()->GetNativeView(), gfx::Rect());
99 host_->SetContentsView(view_); 99 host_->SetContentsView(view_);
100 100
101 // Start listening to focus changes, so we can register and unregister our 101 // Start listening to focus changes, so we can register and unregister our
102 // own handler for Escape. 102 // own handler for Escape.
103 focus_manager_ = views::FocusManager::GetFocusManager(host_->GetNativeView()); 103 focus_manager_ =
104 views::FocusManager::GetFocusManagerForNativeView(host_->GetNativeView());
104 focus_manager_->AddFocusChangeListener(this); 105 focus_manager_->AddFocusChangeListener(this);
105 106
106 // Stores the currently focused view, and tracks focus changes so that we can 107 // Stores the currently focused view, and tracks focus changes so that we can
107 // restore focus when the find box is closed. 108 // restore focus when the find box is closed.
108 focus_tracker_.reset(new views::ExternalFocusTracker(view_, focus_manager_)); 109 focus_tracker_.reset(new views::ExternalFocusTracker(view_, focus_manager_));
109 110
110 // Start the process of animating the opening of the window. 111 // Start the process of animating the opening of the window.
111 animation_.reset(new SlideAnimation(this)); 112 animation_.reset(new SlideAnimation(this));
112 } 113 }
113 114
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 focus_tracker_.reset(NULL); 612 focus_tracker_.reset(NULL);
612 } 613 }
613 614
614 void FindBarWin::AudibleAlert() { 615 void FindBarWin::AudibleAlert() {
615 #if defined(OS_WIN) 616 #if defined(OS_WIN)
616 MessageBeep(MB_OK); 617 MessageBeep(MB_OK);
617 #else 618 #else
618 NOTIMPLEMENTED(); 619 NOTIMPLEMENTED();
619 #endif 620 #endif
620 } 621 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698