Commit 13934f8e authored by bshe@chromium.org's avatar bshe@chromium.org

Use default wallpaper at login screen when user choose a custom wallpaper


BUG=143004
TEST=Set a custom wallpaper, logout. At login screen, click that user's profile
picture. The wallpaper should be default wallpaper. Login again, the user custom
wallpaper should display again.


Review URL: https://chromiumcodereview.appspot.com/10827376

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152045 0039d316-1c4b-4281-b951-d872f2087c98
parent 6c98b035
...@@ -426,18 +426,16 @@ void WallpaperManager::SetUserWallpaper(const std::string& email) { ...@@ -426,18 +426,16 @@ void WallpaperManager::SetUserWallpaper(const std::string& email) {
index = ash::GetNextWallpaperIndex(index); index = ash::GetNextWallpaperIndex(index);
SaveUserWallpaperProperties(email, User::DAILY, index); SaveUserWallpaperProperties(email, User::DAILY, index);
} else if (type == User::CUSTOMIZED) { } else if (type == User::CUSTOMIZED) {
gfx::ImageSkia custom_wallpaper; // For security reason, use default wallpaper instead of custom wallpaper
if (GetCustomWallpaperFromCache(email, &custom_wallpaper)) { // at login screen. The security issue is tracked in issue 143198. Once it
// In customized mode, we use index pref to save the user selected // fixed, we should then only use custom wallpaper.
// wallpaper layout. See function SaveWallpaperToLocalState(). if (!UserManager::Get()->IsUserLoggedIn()) {
ash::WallpaperLayout layout = static_cast<ash::WallpaperLayout>(index); index = ash::GetDefaultWallpaperIndex();
ash::Shell::GetInstance()->desktop_background_controller()->
SetCustomWallpaper(custom_wallpaper, layout);
} else { } else {
FetchCustomWallpaper(email); FetchCustomWallpaper(email);
}
return; return;
} }
}
ash::Shell::GetInstance()->desktop_background_controller()-> ash::Shell::GetInstance()->desktop_background_controller()->
SetDefaultWallpaper(index, false); SetDefaultWallpaper(index, false);
SetLastSelectedUser(email); SetLastSelectedUser(email);
...@@ -517,12 +515,8 @@ void WallpaperManager::CacheUserWallpaper(const std::string& email) { ...@@ -517,12 +515,8 @@ void WallpaperManager::CacheUserWallpaper(const std::string& email) {
base::Time date; base::Time date;
GetUserWallpaperProperties(email, &type, &index, &date); GetUserWallpaperProperties(email, &type, &index, &date);
if (type == User::CUSTOMIZED) { if (type == User::CUSTOMIZED) {
std::string wallpaper_path = GetWallpaperPathForUser(email, false).value(); ash::Shell::GetInstance()->desktop_background_controller()->
CacheDefaultWallpaper(ash::GetDefaultWallpaperIndex());
// Uses WeakPtr here to make the request cancelable.
wallpaper_loader_->Start(wallpaper_path, 0,
base::Bind(&WallpaperManager::CacheWallpaper,
weak_factory_.GetWeakPtr(), email));
} else { } else {
ash::Shell::GetInstance()->desktop_background_controller()-> ash::Shell::GetInstance()->desktop_background_controller()->
CacheDefaultWallpaper(index); CacheDefaultWallpaper(index);
......
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