| 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/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 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 | 30 |
| 31 } // namespace browser | 31 } // namespace browser |
| 32 | 32 |
| 33 //////////////////////////////////////////////////////////////////////////////// | 33 //////////////////////////////////////////////////////////////////////////////// |
| 34 // FindBarHost, public: | 34 // FindBarHost, public: |
| 35 | 35 |
| 36 FindBarHost::FindBarHost(BrowserView* browser_view) | 36 FindBarHost::FindBarHost(BrowserView* browser_view) |
| 37 : DropdownBarHost(browser_view), | 37 : DropdownBarHost(browser_view), |
| 38 find_bar_controller_(NULL) { | 38 find_bar_controller_(NULL) { |
| 39 Init(new FindBarView(this)); | 39 FindBarView* find_bar_view = new FindBarView(this); |
| 40 Init(find_bar_view, find_bar_view); |
| 40 } | 41 } |
| 41 | 42 |
| 42 FindBarHost::~FindBarHost() { | 43 FindBarHost::~FindBarHost() { |
| 43 } | 44 } |
| 44 | 45 |
| 45 bool FindBarHost::MaybeForwardKeyEventToWebpage( | 46 bool FindBarHost::MaybeForwardKeyEventToWebpage( |
| 46 const views::KeyEvent& key_event) { | 47 const views::KeyEvent& key_event) { |
| 47 if (!ShouldForwardKeyEventToWebpageNative(key_event)) { | 48 if (!ShouldForwardKeyEventToWebpageNative(key_event)) { |
| 48 // Native implementation says not to forward these events. | 49 // Native implementation says not to forward these events. |
| 49 return false; | 50 return false; |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 304 |
| 304 DropdownBarHost::UnregisterAccelerators(); | 305 DropdownBarHost::UnregisterAccelerators(); |
| 305 } | 306 } |
| 306 | 307 |
| 307 //////////////////////////////////////////////////////////////////////////////// | 308 //////////////////////////////////////////////////////////////////////////////// |
| 308 // private: | 309 // private: |
| 309 | 310 |
| 310 FindBarView* FindBarHost::find_bar_view() { | 311 FindBarView* FindBarHost::find_bar_view() { |
| 311 return static_cast<FindBarView*>(view()); | 312 return static_cast<FindBarView*>(view()); |
| 312 } | 313 } |
| OLD | NEW |