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

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: Cleanup. 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 side-by-side diff with in-line comments
Download patch
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 f27d7e060aca997a649b1731647613e37726e88f..36367c71292b7b2483a55d11d4e24cc9b4fe070e 100644
--- a/chrome/browser/ui/browser_instant_controller.h
+++ b/chrome/browser/ui/browser_instant_controller.h
@@ -10,6 +10,7 @@
#include "base/prefs/public/pref_change_registrar.h"
#include "chrome/browser/instant/instant_controller.h"
#include "chrome/browser/instant/instant_unload_handler.h"
+#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/search/search_model_observer.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -43,10 +44,21 @@ 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|. Returns true if and only if we update |target_contents|.
+ bool MaybeSwapInInstantContents(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 { return browser_->profile(); }
+
// Returns the InstantController or NULL if there is no InstantController for
// this BrowserInstantController.
InstantController* instant() { return &instant_; }
@@ -113,6 +125,10 @@ 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, content::WebContents* new_contents);
+
Browser* const browser_;
InstantController instant_;

Powered by Google App Engine
This is Rietveld 408576698