| Index: chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
|
| diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
|
| index 44b02c8385a3fe081bc879507df4d73c1bfd4355..06ac0f5e9d82322f438961677ae6ae8be3a4df74 100644
|
| --- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
|
| +++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
|
| @@ -15,6 +15,7 @@
|
| #include "ash/shell.h"
|
| #include "ash/sysui/public/interfaces/wallpaper.mojom.h"
|
| #include "base/bind.h"
|
| +#include "base/bind_helpers.h"
|
| #include "base/command_line.h"
|
| #include "base/files/file_enumerator.h"
|
| #include "base/files/file_path.h"
|
| @@ -170,6 +171,16 @@ wallpaper::WallpaperFilesId HashWallpaperFilesIdStr(
|
| return wallpaper::WallpaperFilesId::FromString(result);
|
| }
|
|
|
| +// Returns true if HashWallpaperFilesIdStr will not assert().
|
| +bool CanGetFilesId() {
|
| + return SystemSaltGetter::Get()->GetRawSalt();
|
| +}
|
| +
|
| +// Call |closure| when HashWallpaperFilesIdStr will not assert().
|
| +void CallWhenCanGetFilesId(const base::Closure& closure) {
|
| + SystemSaltGetter::Get()->AddOnSystemSaltReady(closure);
|
| +}
|
| +
|
| void SetKnownUserWallpaperFilesId(
|
| const AccountId& account_id,
|
| const wallpaper::WallpaperFilesId& wallpaper_files_id) {
|
| @@ -881,6 +892,14 @@ void WallpaperManager::RemovePendingWallpaperFromList(
|
| void WallpaperManager::SetPolicyControlledWallpaper(
|
| const AccountId& account_id,
|
| std::unique_ptr<user_manager::UserImage> user_image) {
|
| + if (!CanGetFilesId()) {
|
| + CallWhenCanGetFilesId(
|
| + base::Bind(&WallpaperManager::SetPolicyControlledWallpaper,
|
| + weak_factory_.GetWeakPtr(), account_id,
|
| + base::Passed(std::move(user_image))));
|
| + return;
|
| + }
|
| +
|
| const wallpaper::WallpaperFilesId wallpaper_files_id = GetFilesId(account_id);
|
|
|
| if (!wallpaper_files_id.is_valid())
|
|
|