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

Side by Side Diff: chrome/browser/ui/views/find_bar_host.cc

Issue 8508055: Move views::Accelerator to ui in order to use it from aura code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/views/find_bar_host.h" 5 #include "chrome/browser/ui/views/find_bar_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 9 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
10 #include "chrome/browser/ui/find_bar/find_tab_helper.h" 10 #include "chrome/browser/ui/find_bar/find_tab_helper.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } else { 161 } else {
162 focus_tracker()->FocusLastFocusedExternalView(); 162 focus_tracker()->FocusLastFocusedExternalView();
163 } 163 }
164 } 164 }
165 165
166 FindBarTesting* FindBarHost::GetFindBarTesting() { 166 FindBarTesting* FindBarHost::GetFindBarTesting() {
167 return this; 167 return this;
168 } 168 }
169 169
170 //////////////////////////////////////////////////////////////////////////////// 170 ////////////////////////////////////////////////////////////////////////////////
171 // FindBarWin, views::AcceleratorTarget implementation: 171 // FindBarWin, ui::AcceleratorTarget implementation:
172 172
173 bool FindBarHost::AcceleratorPressed(const views::Accelerator& accelerator) { 173 bool FindBarHost::AcceleratorPressed(const ui::Accelerator& accelerator) {
174 ui::KeyboardCode key = accelerator.key_code(); 174 ui::KeyboardCode key = accelerator.key_code();
175 if (key == ui::VKEY_RETURN && accelerator.IsCtrlDown()) { 175 if (key == ui::VKEY_RETURN && accelerator.IsCtrlDown()) {
176 // Ctrl+Enter closes the Find session and navigates any link that is active. 176 // Ctrl+Enter closes the Find session and navigates any link that is active.
177 find_bar_controller_->EndFindSession(FindBarController::kActivateSelection); 177 find_bar_controller_->EndFindSession(FindBarController::kActivateSelection);
178 } else if (key == ui::VKEY_ESCAPE) { 178 } else if (key == ui::VKEY_ESCAPE) {
179 // This will end the Find session and hide the window, causing it to loose 179 // This will end the Find session and hide the window, causing it to loose
180 // focus and in the process unregister us as the handler for the Escape 180 // focus and in the process unregister us as the handler for the Escape
181 // accelerator through the FocusWillChange event. 181 // accelerator through the FocusWillChange event.
182 find_bar_controller_->EndFindSession(FindBarController::kKeepSelection); 182 find_bar_controller_->EndFindSession(FindBarController::kKeepSelection);
183 } else { 183 } else {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 313
314 DropdownBarHost::UnregisterAccelerators(); 314 DropdownBarHost::UnregisterAccelerators();
315 } 315 }
316 316
317 //////////////////////////////////////////////////////////////////////////////// 317 ////////////////////////////////////////////////////////////////////////////////
318 // private: 318 // private:
319 319
320 FindBarView* FindBarHost::find_bar_view() { 320 FindBarView* FindBarHost::find_bar_view() {
321 return static_cast<FindBarView*>(view()); 321 return static_cast<FindBarView*>(view());
322 } 322 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698