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_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // ensure that the |loader_| is not already on the stack since it is deleted | 190 // ensure that the |loader_| is not already on the stack since it is deleted |
191 // in this call. | 191 // in this call. |
192 void CreateLoader(const std::string& instant_url, | 192 void CreateLoader(const std::string& instant_url, |
193 content::WebContents* active_tab); | 193 content::WebContents* active_tab); |
194 | 194 |
195 // Called when the |loader_| might be stale. If it's actually stale, and the | 195 // Called when the |loader_| might be stale. If it's actually stale, and the |
196 // omnibox doesn't have focus, and the preview isn't showing, the |loader_| is | 196 // omnibox doesn't have focus, and the preview isn't showing, the |loader_| is |
197 // deleted and recreated. Else the refresh is skipped. | 197 // deleted and recreated. Else the refresh is skipped. |
198 void OnStaleLoader(); | 198 void OnStaleLoader(); |
199 | 199 |
| 200 // If the |loader_| being used is in fallback mode, it will be switched back |
| 201 // to the remote loader if the loader is not showing and the omnibox does not |
| 202 // have focus. |
| 203 void MaybeSwitchToRemoteLoader(); |
| 204 |
200 // If the active tab is an Instant search results page, sets |instant_tab_| to | 205 // If the active tab is an Instant search results page, sets |instant_tab_| to |
201 // point to it. Else, deletes any existing |instant_tab_|. | 206 // point to it. Else, deletes any existing |instant_tab_|. |
202 void ResetInstantTab(); | 207 void ResetInstantTab(); |
203 | 208 |
204 // Hide the preview. Also sends an onchange event (with blank query) to the | 209 // Hide the preview. Also sends an onchange event (with blank query) to the |
205 // preview, telling it to clear out results for any old queries. | 210 // preview, telling it to clear out results for any old queries. |
206 void HideLoader(); | 211 void HideLoader(); |
207 | 212 |
208 // Like HideLoader(), but doesn't call OnStaleLoader(). Use HideLoader() | 213 // Like HideLoader(), but doesn't call OnStaleLoader(). Use HideLoader() |
209 // unless you are going to call loader_.reset() yourself subsequently. | 214 // unless you are going to call loader_.reset() yourself subsequently. |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 | 325 |
321 // Whether to allow the preview to show search suggestions. In general, the | 326 // Whether to allow the preview to show search suggestions. In general, the |
322 // preview is allowed to show search suggestions whenever |search_mode_| is | 327 // preview is allowed to show search suggestions whenever |search_mode_| is |
323 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. | 328 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. |
324 bool allow_preview_to_show_search_suggestions_; | 329 bool allow_preview_to_show_search_suggestions_; |
325 | 330 |
326 DISALLOW_COPY_AND_ASSIGN(InstantController); | 331 DISALLOW_COPY_AND_ASSIGN(InstantController); |
327 }; | 332 }; |
328 | 333 |
329 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 334 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
OLD | NEW |