OLD | NEW |
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_host.h" | 5 #include "chrome/browser/views/find_bar_host.h" |
6 | 6 |
7 #include "app/slide_animation.h" | 7 #include "app/slide_animation.h" |
8 #include "base/keyboard_codes.h" | 8 #include "base/keyboard_codes.h" |
9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 //////////////////////////////////////////////////////////////////////////////// | 89 //////////////////////////////////////////////////////////////////////////////// |
90 // FindBarWin, views::AcceleratorTarget implementation: | 90 // FindBarWin, views::AcceleratorTarget implementation: |
91 | 91 |
92 bool FindBarHost::AcceleratorPressed(const views::Accelerator& accelerator) { | 92 bool FindBarHost::AcceleratorPressed(const views::Accelerator& accelerator) { |
93 #if defined(OS_WIN) | 93 #if defined(OS_WIN) |
94 DCHECK(accelerator.GetKeyCode() == VK_ESCAPE); // We only expect Escape key. | 94 DCHECK(accelerator.GetKeyCode() == VK_ESCAPE); // We only expect Escape key. |
95 #endif | 95 #endif |
96 // This will end the Find session and hide the window, causing it to loose | 96 // This will end the Find session and hide the window, causing it to loose |
97 // focus and in the process unregister us as the handler for the Escape | 97 // focus and in the process unregister us as the handler for the Escape |
98 // accelerator through the FocusWillChange event. | 98 // accelerator through the FocusWillChange event. |
99 find_bar_controller_->EndFindSession(); | 99 find_bar_controller_->EndFindSession(FindBarController::kKeepSelection); |
100 | 100 |
101 return true; | 101 return true; |
102 } | 102 } |
103 | 103 |
104 //////////////////////////////////////////////////////////////////////////////// | 104 //////////////////////////////////////////////////////////////////////////////// |
105 // FindBarTesting implementation: | 105 // FindBarTesting implementation: |
106 | 106 |
107 bool FindBarHost::GetFindBarWindowInfo(gfx::Point* position, | 107 bool FindBarHost::GetFindBarWindowInfo(gfx::Point* position, |
108 bool* fully_visible) { | 108 bool* fully_visible) { |
109 if (!find_bar_controller_ || | 109 if (!find_bar_controller_ || |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 // input. Otherwise Up and Down arrow key strokes get eaten. "Nom Nom Nom". | 249 // input. Otherwise Up and Down arrow key strokes get eaten. "Nom Nom Nom". |
250 render_view_host->ClearFocusedNode(); | 250 render_view_host->ClearFocusedNode(); |
251 NativeWebKeyboardEvent event = GetKeyboardEvent(contents, key_stroke); | 251 NativeWebKeyboardEvent event = GetKeyboardEvent(contents, key_stroke); |
252 render_view_host->ForwardKeyboardEvent(event); | 252 render_view_host->ForwardKeyboardEvent(event); |
253 return true; | 253 return true; |
254 } | 254 } |
255 | 255 |
256 FindBarView* FindBarHost::find_bar_view() { | 256 FindBarView* FindBarHost::find_bar_view() { |
257 return static_cast<FindBarView*>(view()); | 257 return static_cast<FindBarView*>(view()); |
258 } | 258 } |
OLD | NEW |