OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_RENDERER_SEARCHBOX_SEARCHBOX_H_ | 5 #ifndef CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ |
6 #define CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ | 6 #define CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "chrome/common/instant_types.h" | 12 #include "chrome/common/instant_types.h" |
13 #include "chrome/common/search_types.h" | 13 #include "chrome/common/search_types.h" |
| 14 #include "content/public/common/page_transition_types.h" |
14 #include "content/public/renderer/render_view_observer.h" | 15 #include "content/public/renderer/render_view_observer.h" |
15 #include "content/public/renderer/render_view_observer_tracker.h" | 16 #include "content/public/renderer/render_view_observer_tracker.h" |
16 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
17 | 18 |
18 namespace content { | 19 namespace content { |
19 class RenderView; | 20 class RenderView; |
20 } | 21 } |
21 | 22 |
22 class SearchBox : public content::RenderViewObserver, | 23 class SearchBox : public content::RenderViewObserver, |
23 public content::RenderViewObserverTracker<SearchBox> { | 24 public content::RenderViewObserverTracker<SearchBox> { |
24 public: | 25 public: |
25 explicit SearchBox(content::RenderView* render_view); | 26 explicit SearchBox(content::RenderView* render_view); |
26 virtual ~SearchBox(); | 27 virtual ~SearchBox(); |
27 | 28 |
28 // Sends ViewHostMsg_SetSuggestions to the browser. | 29 // Sends ChromeViewHostMsg_SetSuggestions to the browser. |
29 void SetSuggestions(const std::vector<InstantSuggestion>& suggestions); | 30 void SetSuggestions(const std::vector<InstantSuggestion>& suggestions); |
30 | 31 |
31 // Sends ViewHostMsg_ShowInstantPreview to the browser. | 32 // Sends ChromeViewHostMsg_ShowInstantPreview to the browser. |
32 void ShowInstantPreview(InstantShownReason reason, | 33 void ShowInstantPreview(InstantShownReason reason, |
33 int height, | 34 int height, |
34 InstantSizeUnits units); | 35 InstantSizeUnits units); |
35 | 36 |
36 // Sends ViewHostMsg_StartCapturingKeyStrokes to the browser. | 37 // Sends ChromeViewHostMsg_StartCapturingKeyStrokes to the browser. |
37 void StartCapturingKeyStrokes(); | 38 void StartCapturingKeyStrokes(); |
38 | 39 |
39 // Sends ViewHostMsg_StopCapturingKeyStrokes to the browser. | 40 // Sends ChromeViewHostMsg_StopCapturingKeyStrokes to the browser. |
40 void StopCapturingKeyStrokes(); | 41 void StopCapturingKeyStrokes(); |
41 | 42 |
| 43 // Send ChromeViewHostMsg_SearchBoxNavigate to the browser. |
| 44 void NavigateToURL(const GURL& url, content::PageTransition transition); |
| 45 |
42 const string16& query() const { return query_; } | 46 const string16& query() const { return query_; } |
43 bool verbatim() const { return verbatim_; } | 47 bool verbatim() const { return verbatim_; } |
44 size_t selection_start() const { return selection_start_; } | 48 size_t selection_start() const { return selection_start_; } |
45 size_t selection_end() const { return selection_end_; } | 49 size_t selection_end() const { return selection_end_; } |
46 int results_base() const { return results_base_; } | 50 int results_base() const { return results_base_; } |
47 const chrome::search::Mode& mode() const { return mode_; } | 51 const chrome::search::Mode& mode() const { return mode_; } |
48 bool is_key_capture_enabled() const { return is_key_capture_enabled_; } | 52 bool is_key_capture_enabled() const { return is_key_capture_enabled_; } |
49 bool display_instant_results() const { return display_instant_results_; } | 53 bool display_instant_results() const { return display_instant_results_; } |
50 | 54 |
51 gfx::Rect GetRect(); | 55 gfx::Rect GetRect(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 bool is_key_capture_enabled_; | 97 bool is_key_capture_enabled_; |
94 chrome::search::Mode mode_; | 98 chrome::search::Mode mode_; |
95 ThemeBackgroundInfo theme_info_; | 99 ThemeBackgroundInfo theme_info_; |
96 int theme_area_height_; | 100 int theme_area_height_; |
97 bool display_instant_results_; | 101 bool display_instant_results_; |
98 | 102 |
99 DISALLOW_COPY_AND_ASSIGN(SearchBox); | 103 DISALLOW_COPY_AND_ASSIGN(SearchBox); |
100 }; | 104 }; |
101 | 105 |
102 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ | 106 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ |
OLD | NEW |