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 18 matching lines...) Expand all Loading... | |
29 class AutocompleteProvider; | 29 class AutocompleteProvider; |
30 class InstantLoader; | 30 class InstantLoader; |
31 class InstantTab; | 31 class InstantTab; |
32 class TemplateURL; | 32 class TemplateURL; |
33 | 33 |
34 namespace chrome { | 34 namespace chrome { |
35 class BrowserInstantController; | 35 class BrowserInstantController; |
36 } | 36 } |
37 | 37 |
38 namespace content { | 38 namespace content { |
39 class NavigationEntry; | |
39 class WebContents; | 40 class WebContents; |
40 } | 41 } |
41 | 42 |
42 // InstantController maintains a WebContents that is intended to give a preview | 43 // InstantController maintains a WebContents that is intended to give a preview |
43 // of search suggestions and results. InstantController is owned by Browser via | 44 // of search suggestions and results. InstantController is owned by Browser via |
44 // BrowserInstantController. | 45 // BrowserInstantController. |
45 class InstantController { | 46 class InstantController { |
46 public: | 47 public: |
47 // The URL for the local omnibox popup. | 48 // The URL for the local omnibox popup. |
48 static const char* kLocalOmniboxPopupURL; | 49 static const char* kLocalOmniboxPopupURL; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
218 // Like HideLoader(), but doesn't call OnStaleLoader(). Use HideLoader() | 219 // Like HideLoader(), but doesn't call OnStaleLoader(). Use HideLoader() |
219 // unless you are going to call loader_.reset() yourself subsequently. | 220 // unless you are going to call loader_.reset() yourself subsequently. |
220 void HideInternal(); | 221 void HideInternal(); |
221 | 222 |
222 // Counterpart to HideLoader(). Asks the |browser_| to display the preview | 223 // Counterpart to HideLoader(). Asks the |browser_| to display the preview |
223 // with the given |height|. | 224 // with the given |height|. |
224 void ShowLoader(InstantShownReason reason, | 225 void ShowLoader(InstantShownReason reason, |
225 int height, | 226 int height, |
226 InstantSizeUnits units); | 227 InstantSizeUnits units); |
227 | 228 |
229 // Copies the loader's NavigationEntry into a transient history entry for the | |
sreeram
2013/01/25 18:17:29
loader's NavigationEntry -> loader's active Naviga
Jered
2013/01/25 19:27:18
Done.
| |
230 // active tab. Used to update the tab title and make the back button work as | |
231 // expected when the preview is shown at full height but not yet committed. | |
232 void SetTransientHistoryEntry(); | |
233 | |
234 // Restores the old transient entry for the active tab, if any. | |
235 void ResetTransientHistoryEntry(); | |
236 | |
237 // Updates the url in the transient history entry for the overlay. | |
238 void UpdateTransientHistoryEntry(const GURL& url); | |
239 | |
228 // Send the omnibox popup bounds to the page. | 240 // Send the omnibox popup bounds to the page. |
229 void SendPopupBoundsToPage(); | 241 void SendPopupBoundsToPage(); |
230 | 242 |
231 // If |template_url| is a valid TemplateURL for use with Instant, fills in | 243 // If |template_url| is a valid TemplateURL for use with Instant, fills in |
232 // |instant_url| and returns true; returns false otherwise. | 244 // |instant_url| and returns true; returns false otherwise. |
233 // Note: If the command-line switch kInstantURL is set, this method uses its | 245 // Note: If the command-line switch kInstantURL is set, this method uses its |
234 // value for |instant_url| and returns true without examining |template_url|. | 246 // value for |instant_url| and returns true without examining |template_url|. |
235 bool GetInstantURL(const TemplateURL* template_url, | 247 bool GetInstantURL(const TemplateURL* template_url, |
236 std::string* instant_url) const; | 248 std::string* instant_url) const; |
237 | 249 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
320 | 332 |
321 // The timestamp at which query editing began. This value is used when the | 333 // The timestamp at which query editing began. This value is used when the |
322 // preview is showed and cleared when the preview is hidden. | 334 // preview is showed and cleared when the preview is hidden. |
323 base::Time first_interaction_time_; | 335 base::Time first_interaction_time_; |
324 | 336 |
325 // Whether to allow the preview to show search suggestions. In general, the | 337 // Whether to allow the preview to show search suggestions. In general, the |
326 // preview is allowed to show search suggestions whenever |search_mode_| is | 338 // preview is allowed to show search suggestions whenever |search_mode_| is |
327 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. | 339 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. |
328 bool allow_preview_to_show_search_suggestions_; | 340 bool allow_preview_to_show_search_suggestions_; |
329 | 341 |
342 // The transient navigation entry associated with the active tab, if any. | |
343 scoped_ptr<content::NavigationEntry> transient_entry_; | |
344 | |
345 // True iff Instant has set a transient history entry for the active tab. | |
346 bool instant_set_transient_entry_; | |
347 | |
330 DISALLOW_COPY_AND_ASSIGN(InstantController); | 348 DISALLOW_COPY_AND_ASSIGN(InstantController); |
331 }; | 349 }; |
332 | 350 |
333 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 351 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
OLD | NEW |