Index: chrome/browser/ui/navigation_correction_tab_observer.cc |
diff --git a/chrome/browser/ui/navigation_correction_tab_observer.cc b/chrome/browser/ui/navigation_correction_tab_observer.cc |
index e4b3c4c9230331b6e4de59e40531750cf68770b7..de87c7c78e5fe03dd462832225f4a1bb80d87ca1 100644 |
--- a/chrome/browser/ui/navigation_correction_tab_observer.cc |
+++ b/chrome/browser/ui/navigation_correction_tab_observer.cc |
@@ -6,12 +6,12 @@ |
#include "base/prefs/pref_service.h" |
#include "chrome/browser/chrome_notification_types.h" |
+#include "chrome/browser/google/google_url_tracker_factory.h" |
#include "chrome/browser/google/google_util.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/common/pref_names.h" |
#include "chrome/common/render_messages.h" |
#include "components/pref_registry/pref_registry_syncable.h" |
-#include "content/public/browser/notification_service.h" |
#include "content/public/browser/render_frame_host.h" |
#include "content/public/browser/render_view_host.h" |
#include "content/public/browser/web_contents.h" |
@@ -36,8 +36,13 @@ |
base::Unretained(this))); |
} |
- registrar_.Add(this, chrome::NOTIFICATION_GOOGLE_URL_UPDATED, |
- content::Source<Profile>(profile_->GetOriginalProfile())); |
+ GoogleURLTracker* google_url_tracker = |
+ GoogleURLTrackerFactory::GetForProfile(profile_); |
+ if (google_url_tracker) { |
+ google_url_updated_subscription_ = google_url_tracker->RegisterCallback( |
+ base::Bind(&NavigationCorrectionTabObserver::OnGoogleURLUpdated, |
+ base::Unretained(this))); |
+ } |
} |
NavigationCorrectionTabObserver::~NavigationCorrectionTabObserver() { |
@@ -60,18 +65,12 @@ |
} |
//////////////////////////////////////////////////////////////////////////////// |
-// content::NotificationObserver overrides |
+// Internal helpers |
-void NavigationCorrectionTabObserver::Observe( |
- int type, |
- const content::NotificationSource& source, |
- const content::NotificationDetails& details) { |
- DCHECK_EQ(chrome::NOTIFICATION_GOOGLE_URL_UPDATED, type); |
+void NavigationCorrectionTabObserver::OnGoogleURLUpdated(GURL old_url, |
+ GURL new_url) { |
UpdateNavigationCorrectionInfo(web_contents()->GetRenderViewHost()); |
} |
- |
-//////////////////////////////////////////////////////////////////////////////// |
-// Internal helpers |
GURL NavigationCorrectionTabObserver::GetNavigationCorrectionURL() const { |
// Disable navigation corrections when the preference is disabled or when in |