Index: chrome/browser/search/instant_service.h |
diff --git a/chrome/browser/search/instant_service.h b/chrome/browser/search/instant_service.h |
index 393d0721fa06c06b3657c61f5e59482b230145f6..8475ef8ec96ccaff121f0d065b1cd72b0bd08c9f 100644 |
--- a/chrome/browser/search/instant_service.h |
+++ b/chrome/browser/search/instant_service.h |
@@ -15,16 +15,16 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/weak_ptr.h" |
#include "base/observer_list.h" |
-#include "base/prefs/pref_change_registrar.h" |
#include "chrome/browser/google/google_url_tracker.h" |
#include "chrome/browser/history/history_types.h" |
+#include "chrome/browser/search_engines/template_url_service_observer.h" |
#include "chrome/browser/ui/search/instant_search_prerenderer.h" |
#include "chrome/common/instant_types.h" |
#include "components/keyed_service/core/keyed_service.h" |
#include "content/public/browser/notification_observer.h" |
#include "content/public/browser/notification_registrar.h" |
+#include "url/gurl.h" |
-class GURL; |
class InstantIOContext; |
class InstantServiceObserver; |
class InstantTestBase; |
@@ -42,7 +42,8 @@ class URLRequest; |
// Tracks render process host IDs that are associated with Instant. |
class InstantService : public KeyedService, |
- public content::NotificationObserver { |
+ public content::NotificationObserver, |
+ public TemplateURLServiceObserver { |
public: |
explicit InstantService(Profile* profile); |
virtual ~InstantService(); |
@@ -108,7 +109,8 @@ class InstantService : public KeyedService, |
FRIEND_TEST_ALL_PREFIXES(InstantExtendedManualTest, |
MANUAL_SearchesFromFakebox); |
FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ProcessIsolation); |
- FRIEND_TEST_ALL_PREFIXES(InstantServiceTest, SendsSearchURLsToRenderer); |
+ FRIEND_TEST_ALL_PREFIXES(InstantServiceEnabledTest, |
+ SendsSearchURLsToRenderer); |
// Overridden from KeyedService: |
virtual void Shutdown() OVERRIDE; |
@@ -118,6 +120,10 @@ class InstantService : public KeyedService, |
const content::NotificationSource& source, |
const content::NotificationDetails& details) OVERRIDE; |
+ // Overridden from TemplateURLServiceObserver: |
+ virtual void OnTemplateURLServiceChanged() OVERRIDE; |
+ |
+ |
// Called when a renderer process is terminated. |
void OnRendererProcessTerminated(int process_id); |
@@ -135,8 +141,6 @@ class InstantService : public KeyedService, |
void OnGoogleURLUpdated(Profile* profile, |
GoogleURLTracker::UpdatedDetails* details); |
- void OnDefaultSearchProviderChanged(const std::string& pref_name); |
- |
void ResetInstantSearchPrerenderer(); |
Profile* const profile_; |
@@ -158,8 +162,6 @@ class InstantService : public KeyedService, |
content::NotificationRegistrar registrar_; |
- PrefChangeRegistrar profile_pref_registrar_; |
- |
scoped_refptr<InstantIOContext> instant_io_context_; |
// Set to NULL if the default search provider does not support Instant. |
@@ -168,6 +170,10 @@ class InstantService : public KeyedService, |
// Used for Top Sites async retrieval. |
base::WeakPtrFactory<InstantService> weak_ptr_factory_; |
+ // Used to avoid resetting the instant_prerenderer_ if an unrelated change to |
+ // the TemplateURLService occurs. |
+ GURL current_search_result_prefetch_base_url_; |
+ |
DISALLOW_COPY_AND_ASSIGN(InstantService); |
}; |