Chromium Code Reviews| 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; |
| } |