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 4d816268b438a443befa612a408d080c71b33620..68e62d06857cc8eeae86eded12e31d66c7cf7786 100644 |
--- a/chrome/browser/chromeos/login/wallpaper_manager.cc |
+++ b/chrome/browser/chromeos/login/wallpaper_manager.cc |
@@ -226,6 +226,8 @@ void WallpaperManager::InitializeWallpaper() { |
if (!WizardController::IsDeviceRegistered()) { |
SetDefaultWallpaper(); |
} else { |
+ CrosSettings::Get()->AddSettingsObserver( |
+ kAccountsPrefShowUserNamesOnSignIn, this); |
InitializeRegisteredDeviceWallpaper(); |
} |
} |
@@ -267,6 +269,12 @@ void WallpaperManager::Observe(int type, |
} |
break; |
} |
+ case chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED: { |
+ if (*content::Details<const std::string>(details).ptr() == |
+ kAccountsPrefShowUserNamesOnSignIn) |
pastarmovj
2013/01/21 14:55:24
Multi-line conditions needs { } around the body.
bshe
2013/01/21 22:53:07
Done.
|
+ InitializeRegisteredDeviceWallpaper(); |
+ break; |
+ } |
default: |
NOTREACHED() << "Unexpected notification " << type; |
} |
@@ -557,6 +565,9 @@ WallpaperManager::~WallpaperManager() { |
ClearObsoleteWallpaperPrefs(); |
DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); |
system::TimezoneSettings::GetInstance()->RemoveObserver(this); |
+ CrosSettings::Get()->RemoveSettingsObserver( |
+ kAccountsPrefShowUserNamesOnSignIn, this); |
+ |
weak_factory_.InvalidateWeakPtrs(); |
} |
@@ -650,12 +661,9 @@ void WallpaperManager::DeleteUserWallpapers(const std::string& email) { |
} |
void WallpaperManager::InitializeRegisteredDeviceWallpaper() { |
- if (CrosSettingsProvider::TEMPORARILY_UNTRUSTED == |
- CrosSettings::Get()->PrepareTrustedValues( |
- base::Bind(&WallpaperManager::InitializeRegisteredDeviceWallpaper, |
- base::Unretained(this)))) { |
+ if (UserManager::Get()->IsUserLoggedIn()) |
return; |
- } |
+ |
bool disable_boot_animation = CommandLine::ForCurrentProcess()-> |
HasSwitch(switches::kDisableBootAnimation); |
bool show_users = true; |