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

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

Issue 2772973003: Chrome OS: revert the device wallpaper change within a user session. (Closed)
Patch Set: Created 3 years, 9 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 | components/wallpaper/wallpaper_manager_base.h » ('j') | 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 823b4604992f3093eb10fae332db6948a66b4289..6ab667ec98f801ecfd8ad7d22700dfe806c10163 100644
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
@@ -1041,20 +1041,10 @@ void WallpaperManager::OnDeviceWallpaperDecoded(
wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED,
user_manager::User::DEVICE,
base::Time::Now().LocalMidnight()};
- if (user_manager::UserManager::Get()->IsUserLoggedIn()) {
- // In a user's session treat the device wallpaper as a normal custom
- // wallpaper. It should be persistent and can be overriden by other user
- // selected wallpapers.
- SetUserWallpaperInfo(account_id, wallpaper_info, true /* is_persistent */);
- GetPendingWallpaper(account_id, false)
- ->ResetSetWallpaperImage(user_image->image(), wallpaper_info);
- wallpaper_cache_[account_id] = CustomWallpaperElement(
- GetDeviceWallpaperFilePath(), user_image->image());
- } else {
- // In the login screen set the device wallpaper as the wallpaper.
- GetPendingWallpaper(user_manager::SignInAccountId(), false)
- ->ResetSetWallpaperImage(user_image->image(), wallpaper_info);
- }
+ DCHECK(!user_manager::UserManager::Get()->IsUserLoggedIn());
+ // In the login screen set the device wallpaper as the wallpaper.
+ GetPendingWallpaper(user_manager::SignInAccountId(), false)
+ ->ResetSetWallpaperImage(user_image->image(), wallpaper_info);
}
void WallpaperManager::InitializeRegisteredDeviceWallpaper() {
@@ -1150,19 +1140,9 @@ bool WallpaperManager::ShouldSetDeviceWallpaper(const AccountId& account_id,
return false;
}
- // Only set the device wallpaper if 1) we're at the login screen or 2) there
- // is no user policy wallpaper in a user session and the user has the default
- // wallpaper or device wallpaper in a user session. Note in the latter case,
- // the device wallpaper can be overridden by user-selected wallpapers.
- if (user_manager::UserManager::Get()->IsUserLoggedIn()) {
- WallpaperInfo info;
- if (GetUserWallpaperInfo(account_id, &info) &&
- (info.type == user_manager::User::POLICY ||
- (info.type != user_manager::User::DEFAULT &&
- info.type != user_manager::User::DEVICE))) {
- return false;
- }
- }
+ // Only set the device wallpaper if we're at the login screen.
+ if (user_manager::UserManager::Get()->IsUserLoggedIn())
+ return false;
return true;
}
« no previous file with comments | « no previous file | components/wallpaper/wallpaper_manager_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698