| 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 10 matching lines...) Expand all Loading... |
| 21 class RenderView; | 21 class RenderView; |
| 22 } | 22 } |
| 23 | 23 |
| 24 class SearchBox : public content::RenderViewObserver, | 24 class SearchBox : public content::RenderViewObserver, |
| 25 public content::RenderViewObserverTracker<SearchBox> { | 25 public content::RenderViewObserverTracker<SearchBox> { |
| 26 public: | 26 public: |
| 27 explicit SearchBox(content::RenderView* render_view); | 27 explicit SearchBox(content::RenderView* render_view); |
| 28 virtual ~SearchBox(); | 28 virtual ~SearchBox(); |
| 29 | 29 |
| 30 // Sends ChromeViewHostMsg_SetSuggestions to the browser. | 30 // Sends ChromeViewHostMsg_SetSuggestions to the browser. |
| 31 // If |suggestions| is non-empty and the first element in |suggestions| is of |
| 32 // type INSTANT_COMPLETE_REPLACE then this method will also update the current |
| 33 // query text. |
| 31 void SetSuggestions(const std::vector<InstantSuggestion>& suggestions); | 34 void SetSuggestions(const std::vector<InstantSuggestion>& suggestions); |
| 32 | 35 |
| 36 // Clears the current query text, used to ensure that restricted query strings |
| 37 // are not retained. |
| 38 void ClearQuery(); |
| 39 |
| 33 // Sends ChromeViewHostMsg_ShowInstantOverlay to the browser. | 40 // Sends ChromeViewHostMsg_ShowInstantOverlay to the browser. |
| 34 void ShowInstantOverlay(InstantShownReason reason, | 41 void ShowInstantOverlay(InstantShownReason reason, |
| 35 int height, | 42 int height, |
| 36 InstantSizeUnits units); | 43 InstantSizeUnits units); |
| 37 | 44 |
| 38 // Sends ChromeViewHostMsg_FocusOmnibox to the browser. | 45 // Sends ChromeViewHostMsg_FocusOmnibox to the browser. |
| 39 void FocusOmnibox(); | 46 void FocusOmnibox(); |
| 40 | 47 |
| 41 // Sends ChromeViewHostMsg_StartCapturingKeyStrokes to the browser. | 48 // Sends ChromeViewHostMsg_StartCapturingKeyStrokes to the browser. |
| 42 void StartCapturingKeyStrokes(); | 49 void StartCapturingKeyStrokes(); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 std::vector<InstantAutocompleteResult> autocomplete_results_; | 135 std::vector<InstantAutocompleteResult> autocomplete_results_; |
| 129 size_t last_results_base_; | 136 size_t last_results_base_; |
| 130 std::vector<InstantAutocompleteResult> last_autocomplete_results_; | 137 std::vector<InstantAutocompleteResult> last_autocomplete_results_; |
| 131 bool is_key_capture_enabled_; | 138 bool is_key_capture_enabled_; |
| 132 ThemeBackgroundInfo theme_info_; | 139 ThemeBackgroundInfo theme_info_; |
| 133 bool display_instant_results_; | 140 bool display_instant_results_; |
| 134 string16 omnibox_font_; | 141 string16 omnibox_font_; |
| 135 size_t omnibox_font_size_; | 142 size_t omnibox_font_size_; |
| 136 std::vector<InstantMostVisitedItem> most_visited_items_; | 143 std::vector<InstantMostVisitedItem> most_visited_items_; |
| 137 | 144 |
| 145 // URL to Restricted Id mapping. |
| 146 // TODO(dcblack): Unify this logic to work with both Most Visited and |
| 147 // history suggestions. (crbug/175768) |
| 148 std::map<string16, int> url_to_restricted_id_map_; |
| 149 std::map<int, string16> restricted_id_to_url_map_; |
| 150 int last_restricted_id_; |
| 151 |
| 138 DISALLOW_COPY_AND_ASSIGN(SearchBox); | 152 DISALLOW_COPY_AND_ASSIGN(SearchBox); |
| 139 }; | 153 }; |
| 140 | 154 |
| 141 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ | 155 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ |
| OLD | NEW |