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

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

Issue 309643008: Use default wallpaper when user wallpaper info points to empty file path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10fa0b1dafcb8a14ea4061724e03031bec6f2a75..6b1bd991b00819aadb3266a2b37dcbc1ddf60af5 100644
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
@@ -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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698