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