OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_VIEWS_FIND_BAR_HOST_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FIND_BAR_HOST_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_FIND_BAR_HOST_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FIND_BAR_HOST_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "chrome/browser/ui/find_bar/find_bar.h" | 9 #include "chrome/browser/ui/find_bar/find_bar.h" |
10 #include "chrome/browser/ui/views/dropdown_bar_host.h" | 10 #include "chrome/browser/ui/views/dropdown_bar_host.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 public FindBar, | 36 public FindBar, |
37 public FindBarTesting { | 37 public FindBarTesting { |
38 public: | 38 public: |
39 explicit FindBarHost(BrowserView* browser_view); | 39 explicit FindBarHost(BrowserView* browser_view); |
40 virtual ~FindBarHost(); | 40 virtual ~FindBarHost(); |
41 | 41 |
42 // Forwards selected key events to the renderer. This is useful to make sure | 42 // Forwards selected key events to the renderer. This is useful to make sure |
43 // that arrow keys and PageUp and PageDown result in scrolling, instead of | 43 // that arrow keys and PageUp and PageDown result in scrolling, instead of |
44 // being eaten because the FindBar has focus. Returns true if the keystroke | 44 // being eaten because the FindBar has focus. Returns true if the keystroke |
45 // was forwarded, false if not. | 45 // was forwarded, false if not. |
46 bool MaybeForwardKeyEventToWebpage(const views::KeyEvent& key_event); | 46 bool MaybeForwardKeyEventToWebpage(const ui::KeyEvent& key_event); |
47 | 47 |
48 // FindBar implementation: | 48 // FindBar implementation: |
49 virtual FindBarController* GetFindBarController() const OVERRIDE; | 49 virtual FindBarController* GetFindBarController() const OVERRIDE; |
50 virtual void SetFindBarController( | 50 virtual void SetFindBarController( |
51 FindBarController* find_bar_controller) OVERRIDE; | 51 FindBarController* find_bar_controller) OVERRIDE; |
52 virtual void Show(bool animate) OVERRIDE; | 52 virtual void Show(bool animate) OVERRIDE; |
53 virtual void Hide(bool animate) OVERRIDE; | 53 virtual void Hide(bool animate) OVERRIDE; |
54 virtual void SetFocusAndSelection() OVERRIDE; | 54 virtual void SetFocusAndSelection() OVERRIDE; |
55 virtual void ClearResults(const FindNotificationDetails& results) OVERRIDE; | 55 virtual void ClearResults(const FindNotificationDetails& results) OVERRIDE; |
56 virtual void StopAnimation() OVERRIDE; | 56 virtual void StopAnimation() OVERRIDE; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 // Additional accelerator handling (on top of what DropDownBarHost does). | 114 // Additional accelerator handling (on top of what DropDownBarHost does). |
115 virtual void RegisterAccelerators() OVERRIDE; | 115 virtual void RegisterAccelerators() OVERRIDE; |
116 virtual void UnregisterAccelerators() OVERRIDE; | 116 virtual void UnregisterAccelerators() OVERRIDE; |
117 | 117 |
118 private: | 118 private: |
119 // Allows implementation to tweak widget position. | 119 // Allows implementation to tweak widget position. |
120 void GetWidgetPositionNative(gfx::Rect* avoid_overlapping_rect); | 120 void GetWidgetPositionNative(gfx::Rect* avoid_overlapping_rect); |
121 | 121 |
122 // Allows native implementation to prevent key events from being forwarded. | 122 // Allows native implementation to prevent key events from being forwarded. |
123 bool ShouldForwardKeyEventToWebpageNative( | 123 bool ShouldForwardKeyEventToWebpageNative(const ui::KeyEvent& key_event); |
124 const views::KeyEvent& key_event); | |
125 | 124 |
126 // Returns the FindBarView. | 125 // Returns the FindBarView. |
127 FindBarView* find_bar_view(); | 126 FindBarView* find_bar_view(); |
128 | 127 |
129 // A pointer back to the owning controller. | 128 // A pointer back to the owning controller. |
130 FindBarController* find_bar_controller_; | 129 FindBarController* find_bar_controller_; |
131 | 130 |
132 DISALLOW_COPY_AND_ASSIGN(FindBarHost); | 131 DISALLOW_COPY_AND_ASSIGN(FindBarHost); |
133 }; | 132 }; |
134 | 133 |
135 #endif // CHROME_BROWSER_UI_VIEWS_FIND_BAR_HOST_H_ | 134 #endif // CHROME_BROWSER_UI_VIEWS_FIND_BAR_HOST_H_ |
OLD | NEW |