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

Unified Diff: chrome/browser/ui/browser_instant_controller.h

Issue 11824050: InstantExtended: Committed NTP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo to fix blacklisting. Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/browser_instant_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_instant_controller.h
diff --git a/chrome/browser/ui/browser_instant_controller.h b/chrome/browser/ui/browser_instant_controller.h
index f154992bd2343718214995631babb4e24e882da3..1063988cb3a3ea05519f4d38c2d3def640ffe88b 100644
--- a/chrome/browser/ui/browser_instant_controller.h
+++ b/chrome/browser/ui/browser_instant_controller.h
@@ -43,23 +43,38 @@ class BrowserInstantController : public content::NotificationObserver,
// Registers Instant related preferences.
static void RegisterUserPrefs(PrefServiceSyncable* prefs);
+ // If |url| is the new tab page URL, set |target_contents| to the preloaded
+ // NTP contents from InstantController. If |source_contents| is not NULL, we
+ // replace it with the new |target_contents| in the tabstrip and delete
+ // |source_contents|. Otherwise, the caller owns |target_contents| and is
+ // responsible for inserting it into the tabstrip.
+ //
+ // Returns true if and only if we update |target_contents|.
+ bool MaybeSwapInInstantNTPContents(
+ const GURL& url,
+ content::WebContents* source_contents,
+ content::WebContents** target_contents);
+
// Commits the current Instant, returning true on success. This is intended
// for use from OpenCurrentURL.
bool OpenInstant(WindowOpenDisposition disposition);
+ // Returns the Profile associated with the Browser that owns this object.
+ Profile* profile() const;
+
// Returns the InstantController or NULL if there is no InstantController for
// this BrowserInstantController.
InstantController* instant() { return &instant_; }
// Invoked by |instant_| to commit the |preview| by merging it into the active
- // tab or adding it as a new tab. We take ownership of |preview|.
- void CommitInstant(content::WebContents* preview, bool in_new_tab);
+ // tab or adding it as a new tab.
+ void CommitInstant(scoped_ptr<content::WebContents> preview, bool in_new_tab);
// Invoked by |instant_| to autocomplete the |suggestion| into the omnibox.
void SetInstantSuggestion(const InstantSuggestion& suggestion);
// Invoked by |instant_| to get the bounds that the preview is placed at,
- // in screen coordinated.
+ // in screen coordinates.
gfx::Rect GetInstantBounds();
// Invoked by |instant_| to notify that the preview gained focus, usually due
@@ -113,6 +128,11 @@ class BrowserInstantController : public content::NotificationObserver,
// Helper for handling theme area height change.
void OnThemeAreaHeightChanged(int height);
+ // Replaces the contents at tab |index| with |new_contents| and deletes the
+ // existing contents.
+ void ReplaceWebContentsAt(int index,
+ scoped_ptr<content::WebContents> new_contents);
+
Browser* const browser_;
InstantController instant_;
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/browser_instant_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698