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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // Sends ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem to the browser. | 107 // Sends ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem to the browser. |
108 void DeleteMostVisitedItem(InstantRestrictedID most_visited_item_id); | 108 void DeleteMostVisitedItem(InstantRestrictedID most_visited_item_id); |
109 | 109 |
110 // Sends ChromeViewHostMsg_SearchBoxUndoMostVisitedDeletion to the browser. | 110 // Sends ChromeViewHostMsg_SearchBoxUndoMostVisitedDeletion to the browser. |
111 void UndoMostVisitedDeletion(InstantRestrictedID most_visited_item_id); | 111 void UndoMostVisitedDeletion(InstantRestrictedID most_visited_item_id); |
112 | 112 |
113 // Sends ChromeViewHostMsg_SearchBoxUndoAllMostVisitedDeletions to the | 113 // Sends ChromeViewHostMsg_SearchBoxUndoAllMostVisitedDeletions to the |
114 // browser. | 114 // browser. |
115 void UndoAllMostVisitedDeletions(); | 115 void UndoAllMostVisitedDeletions(); |
116 | 116 |
| 117 // Generates the thumbnail URL of the most visited item specified by the |
| 118 // |transient_url|. If the |transient_url| is valid, returns true and fills in |
| 119 // |url|. If the |transient_url| is invalid, returns false and |url| is not |
| 120 // set. |
| 121 // |
| 122 // Valid form of |transient_url|: |
| 123 // chrome-search://thumb/<render_view_id>/<most_visited_item_id> |
| 124 bool GenerateThumbnailURLFromTransientURL(const GURL& transient_url, |
| 125 GURL* url) const; |
| 126 |
| 127 // Generates the favicon URL of the most visited item specified by the |
| 128 // |transient_url|. If the |transient_url| is valid, returns true and fills in |
| 129 // |url|. If the |transient_url| is invalid, returns false and |url| is not |
| 130 // set. |
| 131 // |
| 132 // Valid form of |transient_url|: |
| 133 // chrome-search://favicon/<render_view_id>/<most_visited_item_id> |
| 134 bool GenerateFaviconURLFromTransientURL(const GURL& transient_url, |
| 135 GURL* url) const; |
| 136 |
117 private: | 137 private: |
118 // Overridden from content::RenderViewObserver: | 138 // Overridden from content::RenderViewObserver: |
119 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 139 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
120 | 140 |
121 void OnChange(const string16& query, | 141 void OnChange(const string16& query, |
122 bool verbatim, | 142 bool verbatim, |
123 size_t selection_start, | 143 size_t selection_start, |
124 size_t selection_end); | 144 size_t selection_end); |
125 void OnSubmit(const string16& query); | 145 void OnSubmit(const string16& query); |
126 void OnCancel(const string16& query); | 146 void OnCancel(const string16& query); |
(...skipping 10 matching lines...) Expand all Loading... |
137 size_t selection_start, | 157 size_t selection_start, |
138 size_t selection_end); | 158 size_t selection_end); |
139 void OnFocusChanged(OmniboxFocusState new_focus_state, | 159 void OnFocusChanged(OmniboxFocusState new_focus_state, |
140 OmniboxFocusChangeReason reason); | 160 OmniboxFocusChangeReason reason); |
141 void OnSetDisplayInstantResults(bool display_instant_results); | 161 void OnSetDisplayInstantResults(bool display_instant_results); |
142 void OnThemeChanged(const ThemeBackgroundInfo& theme_info); | 162 void OnThemeChanged(const ThemeBackgroundInfo& theme_info); |
143 void OnThemeAreaHeightChanged(int height); | 163 void OnThemeAreaHeightChanged(int height); |
144 void OnFontInformationReceived(const string16& omnibox_font, | 164 void OnFontInformationReceived(const string16& omnibox_font, |
145 size_t omnibox_font_size); | 165 size_t omnibox_font_size); |
146 void OnMostVisitedChanged( | 166 void OnMostVisitedChanged( |
147 const std::vector<InstantMostVisitedItemIDPair>& items); | 167 const std::vector<InstantMostVisitedItem>& items); |
148 void OnToggleVoiceSearch(); | 168 void OnToggleVoiceSearch(); |
149 | 169 |
150 // Returns the current zoom factor of the render view or 1 on failure. | 170 // Returns the current zoom factor of the render view or 1 on failure. |
151 double GetZoom() const; | 171 double GetZoom() const; |
152 | 172 |
153 // Sets the searchbox values to their initial value. | 173 // Sets the searchbox values to their initial value. |
154 void Reset(); | 174 void Reset(); |
155 | 175 |
156 // Sets the query to a new value. | 176 // Sets the query to a new value. |
157 void SetQuery(const string16& query, bool verbatim); | 177 void SetQuery(const string16& query, bool verbatim); |
(...skipping 15 matching lines...) Expand all Loading... |
173 string16 omnibox_font_; | 193 string16 omnibox_font_; |
174 size_t omnibox_font_size_; | 194 size_t omnibox_font_size_; |
175 InstantRestrictedIDCache<InstantAutocompleteResult> | 195 InstantRestrictedIDCache<InstantAutocompleteResult> |
176 autocomplete_results_cache_; | 196 autocomplete_results_cache_; |
177 InstantRestrictedIDCache<InstantMostVisitedItem> most_visited_items_cache_; | 197 InstantRestrictedIDCache<InstantMostVisitedItem> most_visited_items_cache_; |
178 | 198 |
179 DISALLOW_COPY_AND_ASSIGN(SearchBox); | 199 DISALLOW_COPY_AND_ASSIGN(SearchBox); |
180 }; | 200 }; |
181 | 201 |
182 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ | 202 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ |
OLD | NEW |