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

Unified Diff: chrome/browser/ui/webui/settings/profile_info_handler.cc

Issue 2568973002: chromeos: Replace user image notifications with observer (Closed)
Patch Set: rebase Created 4 years 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/settings/profile_info_handler.h ('k') | components/user_manager/user_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/settings/profile_info_handler.cc
diff --git a/chrome/browser/ui/webui/settings/profile_info_handler.cc b/chrome/browser/ui/webui/settings/profile_info_handler.cc
index 2acd3c5944ae336f3c84a46018cea0d340921efd..ae1f85949c7cad890db3b935ab0fd9c9651067d6 100644
--- a/chrome/browser/ui/webui/settings/profile_info_handler.cc
+++ b/chrome/browser/ui/webui/settings/profile_info_handler.cc
@@ -63,8 +63,7 @@ void ProfileInfoHandler::OnJavascriptAllowed() {
base::Unretained(this)));
#if defined(OS_CHROMEOS)
- registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED,
- content::NotificationService::AllSources());
+ user_manager::UserManager::Get()->AddObserver(this);
#endif
}
@@ -75,15 +74,12 @@ void ProfileInfoHandler::OnJavascriptDisallowed() {
profile_pref_registrar_.RemoveAll();
#if defined(OS_CHROMEOS)
- registrar_.RemoveAll();
+ user_manager::UserManager::Get()->RemoveObserver(this);
#endif
}
#if defined(OS_CHROMEOS)
-void ProfileInfoHandler::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- DCHECK_EQ(chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, type);
+void ProfileInfoHandler::OnUserImageChanged(const user_manager::User& user) {
PushProfileInfo();
}
#endif
« no previous file with comments | « chrome/browser/ui/webui/settings/profile_info_handler.h ('k') | components/user_manager/user_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698