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

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

Issue 11348165: Remove PrefObserver usages, batch 10. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android 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
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 476150a58fd297a610e04ebcce47122fff38f2a2..94af9f3a0cc9a4df103f8421fec9b025c2f9175b 100644
--- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
@@ -88,7 +88,10 @@ NTPLoginHandler::~NTPLoginHandler() {
void NTPLoginHandler::RegisterMessages() {
PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
- username_pref_.Init(prefs::kGoogleServicesUsername, pref_service, this);
+ username_pref_.Init(prefs::kGoogleServicesUsername,
+ pref_service,
+ base::Bind(&NTPLoginHandler::UpdateLogin,
+ base::Unretained(this)));
registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED,
content::NotificationService::AllSources());
@@ -117,12 +120,6 @@ void NTPLoginHandler::Observe(int type,
}
}
-void NTPLoginHandler::OnPreferenceChanged(PrefServiceBase* service,
- const std::string& pref_name) {
- if (prefs::kGoogleServicesUsername == pref_name)
- UpdateLogin();
-}
-
void NTPLoginHandler::HandleInitializeSyncLogin(const ListValue* args) {
UpdateLogin();
}

Powered by Google App Engine
This is Rietveld 408576698