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 8fbaf83d06bbb51bb7b3ca78f550a3d8140e048e..12da4c83bdfce6920f63e793ed5bcb6e2c8ed2ff 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,17 @@ 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(); |
+ // Add itself as observer on InstantService, preload instant NTP. |
samarth
2013/08/12 19:07:28
nit: Adds itself .. and preloads Instant NTP.
Anuj
2013/08/13 00:18:09
Done.
|
+ void Init(); |
+ |
// 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. |
@@ -135,16 +138,13 @@ class InstantNTPPrerenderer |
virtual void UndoAllMostVisitedDeletions() OVERRIDE; |
virtual void InstantPageLoadFailed(content::WebContents* contents) OVERRIDE; |
- // Called when the default search provider changes. Resets InstantNTP. |
- void OnDefaultSearchProviderChanged(const std::string& pref_name); |
+ // Overridden from InstantServiceObserver: |
+ 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; |