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

Unified Diff: chrome/browser/chromeos/login/wallpaper_manager.cc

Issue 23494053: Remove NOTIFICATION_SYSTEM_SETTING_CHANGED, switch CrosSettings to base::CallbackRegistry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops Created 7 years, 3 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
Index: chrome/browser/chromeos/login/wallpaper_manager.cc
diff --git a/chrome/browser/chromeos/login/wallpaper_manager.cc b/chrome/browser/chromeos/login/wallpaper_manager.cc
index 10bf168a15d71bfc89f8c11cbc0e02e5189a4e4e..5bfbdb577eb450bbc109412be981dba21a6908fa 100644
--- a/chrome/browser/chromeos/login/wallpaper_manager.cc
+++ b/chrome/browser/chromeos/login/wallpaper_manager.cc
@@ -162,8 +162,7 @@ WallpaperManager::~WallpaperManager() {
}
void WallpaperManager::Shutdown() {
- CrosSettings::Get()->RemoveSettingsObserver(
- kAccountsPrefShowUserNamesOnSignIn, this);
+ show_user_name_on_signin_subscription_.reset();
no_observers_ = true;
Mattias Nissler (ping if slow) 2013/09/18 09:09:48 You probably want to nuke |no_observers_| and repl
Avi (use Gerrit) 2013/09/18 16:41:44 Done.
}
@@ -175,8 +174,11 @@ void WallpaperManager::RegisterPrefs(PrefRegistrySimple* registry) {
}
void WallpaperManager::AddObservers() {
- CrosSettings::Get()->AddSettingsObserver(kAccountsPrefShowUserNamesOnSignIn,
- this);
+ show_user_name_on_signin_subscription_ =
+ CrosSettings::Get()->AddSettingsObserver(
+ kAccountsPrefShowUserNamesOnSignIn,
+ base::Bind(&WallpaperManager::InitializeRegisteredDeviceWallpaper,
+ base::Unretained(this)));
no_observers_ = false;
}
@@ -324,13 +326,6 @@ void WallpaperManager::Observe(int type,
}
break;
}
- case chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED: {
- if (*content::Details<const std::string>(details).ptr() ==
- kAccountsPrefShowUserNamesOnSignIn) {
- InitializeRegisteredDeviceWallpaper();
- }
- break;
- }
default:
NOTREACHED() << "Unexpected notification " << type;
}

Powered by Google App Engine
This is Rietveld 408576698