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

Unified Diff: chrome/browser/ui/navigation_correction_tab_observer.cc

Issue 294563002: Revert of Elimate NOTIFICATION_GOOGLE_URL_UPDATED (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « chrome/browser/ui/navigation_correction_tab_observer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 de87c7c78e5fe03dd462832225f4a1bb80d87ca1..e4b3c4c9230331b6e4de59e40531750cf68770b7 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,13 +36,8 @@
base::Unretained(this)));
}
- 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)));
- }
+ registrar_.Add(this, chrome::NOTIFICATION_GOOGLE_URL_UPDATED,
+ content::Source<Profile>(profile_->GetOriginalProfile()));
}
NavigationCorrectionTabObserver::~NavigationCorrectionTabObserver() {
@@ -65,12 +60,18 @@
}
////////////////////////////////////////////////////////////////////////////////
-// Internal helpers
+// content::NotificationObserver overrides
-void NavigationCorrectionTabObserver::OnGoogleURLUpdated(GURL old_url,
- GURL new_url) {
+void NavigationCorrectionTabObserver::Observe(
+ int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) {
+ DCHECK_EQ(chrome::NOTIFICATION_GOOGLE_URL_UPDATED, type);
UpdateNavigationCorrectionInfo(web_contents()->GetRenderViewHost());
}
+
+////////////////////////////////////////////////////////////////////////////////
+// Internal helpers
GURL NavigationCorrectionTabObserver::GetNavigationCorrectionURL() const {
// Disable navigation corrections when the preference is disabled or when in
« no previous file with comments | « chrome/browser/ui/navigation_correction_tab_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698