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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_login_handler.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head for commit Created 8 years, 1 month 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/webui/ntp/ntp_login_handler.h ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/ntp_login_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
index 4702fb1070521eb809cb5a82a7798b861ff664b4..476150a58fd297a610e04ebcce47122fff38f2a2 100644
--- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
@@ -112,15 +112,17 @@ void NTPLoginHandler::Observe(int type,
const content::NotificationDetails& details) {
if (type == chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED) {
UpdateLogin();
- } else if (type == chrome::NOTIFICATION_PREF_CHANGED) {
- std::string* name = content::Details<std::string>(details).ptr();
- if (prefs::kGoogleServicesUsername == *name)
- UpdateLogin();
} else {
NOTREACHED();
}
}
+void NTPLoginHandler::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) {
+ if (prefs::kGoogleServicesUsername == pref_name)
+ UpdateLogin();
+}
+
void NTPLoginHandler::HandleInitializeSyncLogin(const ListValue* args) {
UpdateLogin();
}
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_login_handler.h ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698