| OLD | NEW |
| 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/renderer_host/render_view_host.h" | 9 #include "chrome/browser/renderer_host/render_view_host.h" |
| 10 #include "chrome/browser/tab_contents/tab_contents.h" | 10 #include "chrome/browser/tab_contents/tab_contents.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 FindBarHost::~FindBarHost() { | 42 FindBarHost::~FindBarHost() { |
| 43 } | 43 } |
| 44 | 44 |
| 45 bool FindBarHost::MaybeForwardKeyEventToWebpage( | 45 bool FindBarHost::MaybeForwardKeyEventToWebpage( |
| 46 const views::KeyEvent& key_event) { | 46 const views::KeyEvent& key_event) { |
| 47 if (!ShouldForwardKeyEventToWebpageNative(key_event)) { | 47 if (!ShouldForwardKeyEventToWebpageNative(key_event)) { |
| 48 // Native implementation says not to forward these events. | 48 // Native implementation says not to forward these events. |
| 49 return false; | 49 return false; |
| 50 } | 50 } |
| 51 | 51 |
| 52 switch (key_event.GetKeyCode()) { | 52 switch (key_event.key_code()) { |
| 53 case ui::VKEY_DOWN: | 53 case ui::VKEY_DOWN: |
| 54 case ui::VKEY_UP: | 54 case ui::VKEY_UP: |
| 55 case ui::VKEY_PRIOR: | 55 case ui::VKEY_PRIOR: |
| 56 case ui::VKEY_NEXT: | 56 case ui::VKEY_NEXT: |
| 57 break; | 57 break; |
| 58 case ui::VKEY_HOME: | 58 case ui::VKEY_HOME: |
| 59 case ui::VKEY_END: | 59 case ui::VKEY_END: |
| 60 if (key_event.IsControlDown()) | 60 if (key_event.IsControlDown()) |
| 61 break; | 61 break; |
| 62 // Fall through. | 62 // Fall through. |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 | 304 |
| 305 DropdownBarHost::UnregisterAccelerators(); | 305 DropdownBarHost::UnregisterAccelerators(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 //////////////////////////////////////////////////////////////////////////////// | 308 //////////////////////////////////////////////////////////////////////////////// |
| 309 // private: | 309 // private: |
| 310 | 310 |
| 311 FindBarView* FindBarHost::find_bar_view() { | 311 FindBarView* FindBarHost::find_bar_view() { |
| 312 return static_cast<FindBarView*>(view()); | 312 return static_cast<FindBarView*>(view()); |
| 313 } | 313 } |
| OLD | NEW |