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

Unified Diff: chrome/browser/ui/search/instant_ntp_prerenderer.h

Issue 20388003: Reload Instant NTP and Instant-process tabs on search url change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added ui and unit tests Created 7 years, 5 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/search/instant_ntp_prerenderer.h
diff --git a/chrome/browser/ui/search/instant_ntp_prerenderer.h b/chrome/browser/ui/search/instant_ntp_prerenderer.h
index 8786c1e94b248902ef8c2a75497525d0e6d3a728..9cf05f2660f1e3b6ed7bddcd2ba5849e8163de6d 100644
--- a/chrome/browser/ui/search/instant_ntp_prerenderer.h
+++ b/chrome/browser/ui/search/instant_ntp_prerenderer.h
@@ -11,14 +11,13 @@
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/prefs/pref_change_registrar.h"
+#include "chrome/browser/search/instant_service_observer.h"
#include "chrome/browser/ui/search/instant_page.h"
#include "content/public/browser/web_contents.h"
#include "net/base/network_change_notifier.h"
-class InstantExtendedTest;
class InstantNTP;
class InstantService;
-class InstantTestBase;
class Profile;
// InstantNTPPrerenderer maintains a prerendered instance of InstantNTP.
@@ -31,13 +30,14 @@ class Profile;
// InstantNTPPrerenderer is owned by InstantService.
class InstantNTPPrerenderer
: public InstantPage::Delegate,
- public net::NetworkChangeNotifier::NetworkChangeObserver {
+ public net::NetworkChangeNotifier::NetworkChangeObserver,
+ public InstantServiceObserver {
public:
InstantNTPPrerenderer(Profile* profile, PrefService* prefs);
virtual ~InstantNTPPrerenderer();
// Preloads |ntp_| with a new InstantNTP.
- void PreloadInstantNTP();
+ void ReloadInstantNTP();
// Releases and returns the InstantNTP WebContents. May be NULL. Loads a new
// WebContents for the InstantNTP.
@@ -136,16 +136,14 @@ class InstantNTPPrerenderer
virtual void UndoAllMostVisitedDeletions() OVERRIDE;
virtual void InstantPageLoadFailed(content::WebContents* contents) OVERRIDE;
+ // Overridden from InstantServiceObserver:
// Called when the default search provider changes. Resets InstantNTP.
samarth 2013/08/02 21:51:15 nit: just delete this line
Anuj 2013/08/09 07:22:00 Done.
- void OnDefaultSearchProviderChanged(const std::string& pref_name);
+ virtual void DefaultSearchProviderChanged() OVERRIDE;
+ virtual void GoogleURLUpdated() OVERRIDE;
// Recreates |ntp_| using |instant_url|.
void ResetNTP(const std::string& instant_url);
- // Resets |ntp_| with a new InstantNTP. Called when |ntp_| is stale or when a
- // pref is changed.
- void ReloadStaleNTP();
-
// Returns true if |ntp_| has an up-to-date Instant URL and supports Instant.
// Note that local URLs will not pass this check.
bool PageIsCurrent() const;

Powered by Google App Engine
This is Rietveld 408576698