Commit 98a28aaa authored by alemate@chromium.org's avatar alemate@chromium.org

Use default wallpaper when user wallpaper info points to empty file path.

In tests user wallpaper info can point to empty paths.
Use default wallpaper in this case.


BUG=371295
TEST=none

Review URL: https://codereview.chromium.org/309643008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274383 0039d316-1c4b-4281-b951-d872f2087c98
parent e5b1e437
......@@ -1055,6 +1055,13 @@ void WallpaperManager::ScheduleSetUserWallpaper(const std::string& user_id,
GetPendingWallpaper(user_id, delayed)
->ResetSetWallpaperImage(user_wallpaper, info);
} else {
if (info.file.empty()) {
// Uses default built-in wallpaper when file is empty. Eventually, we
// will only ship one built-in wallpaper in ChromeOS image.
GetPendingWallpaper(user_id, delayed)->ResetSetDefaultWallpaper();
return;
}
if (info.type == User::CUSTOMIZED || info.type == User::POLICY) {
const char* sub_dir = GetCustomWallpaperSubdirForCurrentResolution();
// Wallpaper is not resized when layout is ash::WALLPAPER_LAYOUT_CENTER.
......@@ -1074,13 +1081,6 @@ void WallpaperManager::ScheduleSetUserWallpaper(const std::string& user_id,
return;
}
if (info.file.empty()) {
// Uses default built-in wallpaper when file is empty. Eventually, we
// will only ship one built-in wallpaper in ChromeOS image.
GetPendingWallpaper(user_id, delayed)->ResetSetDefaultWallpaper();
return;
}
// Load downloaded ONLINE or converted DEFAULT wallpapers.
GetPendingWallpaper(user_id, delayed)->ResetLoadWallpaper(info);
}
......@@ -1169,6 +1169,9 @@ void WallpaperManager::CacheUserWallpaper(const std::string& user_id) {
return;
WallpaperInfo info;
if (GetUserWallpaperInfo(user_id, &info)) {
if (info.file.empty())
return;
base::FilePath wallpaper_dir;
base::FilePath wallpaper_path;
if (info.type == User::CUSTOMIZED || info.type == User::POLICY) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment