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

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

Issue 11968044: Fix login visual hitch on chromebook (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add settings observer and using unnamed sequence thread Created 7 years, 11 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 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;

Powered by Google App Engine
This is Rietveld 408576698