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

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

Issue 11299304: Callback to function InitializeRegisteredDeviceWallpaper after cros settings can be trusted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 8 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/chromeos/login/wallpaper_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 89638ee30469ad136da1b12deafd67fec25655a5..94e26257307efa5527b50c371a9fd7eae46f7c41 100644
--- a/chrome/browser/chromeos/login/wallpaper_manager.cc
+++ b/chrome/browser/chromeos/login/wallpaper_manager.cc
@@ -216,32 +216,13 @@ void WallpaperManager::InitializeWallpaper() {
bool disable_new_oobe = CommandLine::ForCurrentProcess()->
HasSwitch(switches::kDisableNewOobe);
- bool disable_boot_animation = CommandLine::ForCurrentProcess()->
- HasSwitch(switches::kDisableBootAnimation);
if (!user_manager->IsUserLoggedIn()) {
if (!disable_new_oobe) {
if (!WizardController::IsDeviceRegistered()) {
SetDefaultWallpaper();
} else {
- bool show_users = true;
- bool result = CrosSettings::Get()->GetBoolean(
- kAccountsPrefShowUserNamesOnSignIn, &show_users);
- DCHECK(result) << "Unable to fetch setting "
- << kAccountsPrefShowUserNamesOnSignIn;
- const chromeos::UserList& users = user_manager->GetUsers();
- if (!show_users || users.empty()) {
- // Boot into sign in form, preload default wallpaper.
- SetDefaultWallpaper();
- return;
- }
-
- if (!disable_boot_animation) {
- // Normal boot, load user wallpaper.
- // If normal boot animation is disabled wallpaper would be set
- // asynchronously once user pods are loaded.
- SetUserWallpaper(users[0]->email());
- }
+ InitializeRegisteredDeviceWallpaper();
}
}
return;
@@ -660,6 +641,35 @@ void WallpaperManager::DeleteUserWallpapers(const std::string& email) {
false);
}
+void WallpaperManager::InitializeRegisteredDeviceWallpaper() {
+ if (CrosSettingsProvider::TEMPORARILY_UNTRUSTED ==
+ CrosSettings::Get()->PrepareTrustedValues(
+ base::Bind(&WallpaperManager::InitializeRegisteredDeviceWallpaper,
+ base::Unretained(this)))) {
+ return;
+ }
+ bool disable_boot_animation = CommandLine::ForCurrentProcess()->
+ HasSwitch(switches::kDisableBootAnimation);
+ bool show_users = true;
+ bool result = CrosSettings::Get()->GetBoolean(
+ kAccountsPrefShowUserNamesOnSignIn, &show_users);
+ DCHECK(result) << "Unable to fetch setting "
+ << kAccountsPrefShowUserNamesOnSignIn;
+ const chromeos::UserList& users = UserManager::Get()->GetUsers();
+ if (!show_users || users.empty()) {
+ // Boot into sign in form, preload default wallpaper.
+ SetDefaultWallpaper();
+ return;
+ }
+
+ if (!disable_boot_animation) {
+ // Normal boot, load user wallpaper.
+ // If normal boot animation is disabled wallpaper would be set
+ // asynchronously once user pods are loaded.
+ SetUserWallpaper(users[0]->email());
+ }
+}
+
void WallpaperManager::LoadWallpaper(const std::string& email,
const WallpaperInfo& info,
bool update_wallpaper) {
« no previous file with comments | « chrome/browser/chromeos/login/wallpaper_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698