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" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // Sends ViewHostMsg_StopCapturingKeyStrokes to the browser. | 39 // Sends ViewHostMsg_StopCapturingKeyStrokes to the browser. |
40 void StopCapturingKeyStrokes(); | 40 void StopCapturingKeyStrokes(); |
41 | 41 |
42 const string16& query() const { return query_; } | 42 const string16& query() const { return query_; } |
43 bool verbatim() const { return verbatim_; } | 43 bool verbatim() const { return verbatim_; } |
44 size_t selection_start() const { return selection_start_; } | 44 size_t selection_start() const { return selection_start_; } |
45 size_t selection_end() const { return selection_end_; } | 45 size_t selection_end() const { return selection_end_; } |
46 int results_base() const { return results_base_; } | 46 int results_base() const { return results_base_; } |
47 const chrome::search::Mode& mode() const { return mode_; } | 47 const chrome::search::Mode& mode() const { return mode_; } |
| 48 bool is_key_capture_enabled() const { return is_key_capture_enabled_; } |
48 bool display_instant_results() const { return display_instant_results_; } | 49 bool display_instant_results() const { return display_instant_results_; } |
49 | 50 |
50 gfx::Rect GetRect(); | 51 gfx::Rect GetRect(); |
51 const std::vector<InstantAutocompleteResult>& GetAutocompleteResults(); | 52 const std::vector<InstantAutocompleteResult>& GetAutocompleteResults(); |
52 // Searchbox retains ownership of this object. | 53 // Searchbox retains ownership of this object. |
53 const InstantAutocompleteResult* | 54 const InstantAutocompleteResult* |
54 GetAutocompleteResultWithId(size_t restricted_id) const; | 55 GetAutocompleteResultWithId(size_t restricted_id) const; |
55 const ThemeBackgroundInfo& GetThemeBackgroundInfo(); | 56 const ThemeBackgroundInfo& GetThemeBackgroundInfo(); |
56 int GetThemeAreaHeight(); | 57 int GetThemeAreaHeight(); |
57 | 58 |
58 private: | 59 private: |
59 // Overridden from content::RenderViewObserver: | 60 // Overridden from content::RenderViewObserver: |
60 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 61 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
61 virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE; | 62 virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE; |
62 | 63 |
63 void OnChange(const string16& query, | 64 void OnChange(const string16& query, |
64 bool verbatim, | 65 bool verbatim, |
65 size_t selection_start, | 66 size_t selection_start, |
66 size_t selection_end); | 67 size_t selection_end); |
67 void OnSubmit(const string16& query); | 68 void OnSubmit(const string16& query); |
68 void OnCancel(const string16& query); | 69 void OnCancel(const string16& query); |
69 void OnResize(const gfx::Rect& bounds); | 70 void OnResize(const gfx::Rect& bounds); |
70 void OnDetermineIfPageSupportsInstant(); | 71 void OnDetermineIfPageSupportsInstant(); |
71 void OnAutocompleteResults( | 72 void OnAutocompleteResults( |
72 const std::vector<InstantAutocompleteResult>& results); | 73 const std::vector<InstantAutocompleteResult>& results); |
73 void OnUpOrDownKeyPressed(int count); | 74 void OnUpOrDownKeyPressed(int count); |
| 75 void OnKeyCaptureChange(bool is_key_capture_enabled); |
74 void OnModeChanged(const chrome::search::Mode& mode); | 76 void OnModeChanged(const chrome::search::Mode& mode); |
75 void OnSetDisplayInstantResults(bool display_instant_results); | 77 void OnSetDisplayInstantResults(bool display_instant_results); |
76 void OnThemeChanged(const ThemeBackgroundInfo& theme_info); | 78 void OnThemeChanged(const ThemeBackgroundInfo& theme_info); |
77 void OnThemeAreaHeightChanged(int height); | 79 void OnThemeAreaHeightChanged(int height); |
78 | 80 |
79 // Sets the searchbox values to their initial value. | 81 // Sets the searchbox values to their initial value. |
80 void Reset(); | 82 void Reset(); |
81 | 83 |
82 string16 query_; | 84 string16 query_; |
83 bool verbatim_; | 85 bool verbatim_; |
84 size_t selection_start_; | 86 size_t selection_start_; |
85 size_t selection_end_; | 87 size_t selection_end_; |
86 size_t results_base_; | 88 size_t results_base_; |
87 gfx::Rect rect_; | 89 gfx::Rect rect_; |
88 std::vector<InstantAutocompleteResult> autocomplete_results_; | 90 std::vector<InstantAutocompleteResult> autocomplete_results_; |
89 size_t last_results_base_; | 91 size_t last_results_base_; |
90 std::vector<InstantAutocompleteResult> last_autocomplete_results_; | 92 std::vector<InstantAutocompleteResult> last_autocomplete_results_; |
| 93 bool is_key_capture_enabled_; |
91 chrome::search::Mode mode_; | 94 chrome::search::Mode mode_; |
92 ThemeBackgroundInfo theme_info_; | 95 ThemeBackgroundInfo theme_info_; |
93 int theme_area_height_; | 96 int theme_area_height_; |
94 bool display_instant_results_; | 97 bool display_instant_results_; |
95 | 98 |
96 DISALLOW_COPY_AND_ASSIGN(SearchBox); | 99 DISALLOW_COPY_AND_ASSIGN(SearchBox); |
97 }; | 100 }; |
98 | 101 |
99 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ | 102 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ |
OLD | NEW |