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 933e0a854c2520c2bb1f07c56254d174c175f24b..624536893fd9850f41fca46c1ac2dc110cb99edb 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,20 @@ 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(); |
+ // Adds itself as observer on InstantService, preloads instant NTP. |
samarth
2013/08/14 00:24:14
nit: the first part is just an implementation deta
Anuj
2013/08/14 06:38:57
Done.
|
+ void Init(); |
+ |
+ // Removes itself as observer on InstantService, deletes NTP contents if any. |
+ void Destroy(); |
+ |
// 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. |
@@ -137,16 +143,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; |