Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(643)

Side by Side Diff: chrome/browser/instant/instant_controller.h

Issue 12001002: InstantExtended: Transient naventry for preview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 active NavigationEntry into a transient history entry
230 // for the active tab. Used to update the tab title and make the back button
231 // work as expected when the preview is shown at full height but not yet
232 // committed.
233 void SetTransientHistoryEntry();
234
235 // Updates the url in the transient history entry for the overlay.
sreeram 2013/01/25 21:28:02 Nit: url -> URL
236 void UpdateTransientHistoryEntry(const GURL& url);
237
238 // Restores the old transient entry for the active tab, if any.
239 void ResetTransientHistoryEntry();
240
228 // Send the omnibox popup bounds to the page. 241 // Send the omnibox popup bounds to the page.
229 void SendPopupBoundsToPage(); 242 void SendPopupBoundsToPage();
230 243
231 // If |template_url| is a valid TemplateURL for use with Instant, fills in 244 // If |template_url| is a valid TemplateURL for use with Instant, fills in
232 // |instant_url| and returns true; returns false otherwise. 245 // |instant_url| and returns true; returns false otherwise.
233 // Note: If the command-line switch kInstantURL is set, this method uses its 246 // 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|. 247 // value for |instant_url| and returns true without examining |template_url|.
235 bool GetInstantURL(const TemplateURL* template_url, 248 bool GetInstantURL(const TemplateURL* template_url,
236 std::string* instant_url) const; 249 std::string* instant_url) const;
237 250
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 333
321 // The timestamp at which query editing began. This value is used when the 334 // The timestamp at which query editing began. This value is used when the
322 // preview is showed and cleared when the preview is hidden. 335 // preview is showed and cleared when the preview is hidden.
323 base::Time first_interaction_time_; 336 base::Time first_interaction_time_;
324 337
325 // Whether to allow the preview to show search suggestions. In general, the 338 // Whether to allow the preview to show search suggestions. In general, the
326 // preview is allowed to show search suggestions whenever |search_mode_| is 339 // preview is allowed to show search suggestions whenever |search_mode_| is
327 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. 340 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false.
328 bool allow_preview_to_show_search_suggestions_; 341 bool allow_preview_to_show_search_suggestions_;
329 342
343 // The transient navigation entry associated with the active tab before
344 // we clobbered it for the overlay.
345 scoped_ptr<content::NavigationEntry> saved_transient_entry_;
346
347 // True iff Instant has set a transient history entry for the active tab.
348 bool instant_set_transient_entry_;
349
330 DISALLOW_COPY_AND_ASSIGN(InstantController); 350 DISALLOW_COPY_AND_ASSIGN(InstantController);
331 }; 351 };
332 352
333 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ 353 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/instant/instant_controller.cc » ('j') | chrome/browser/instant/instant_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698