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

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

Issue 271533004: Turning on MultiProfile by default for ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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
Index: chrome/browser/chromeos/login/wallpaper_manager.cc
diff --git a/chrome/browser/chromeos/login/wallpaper_manager.cc b/chrome/browser/chromeos/login/wallpaper_manager.cc
index 7b2c8584c3dc50c3304b048d3753228e76a993ac..674f8e05d3162abaceb06728b634d81c9e59dc12 100644
--- a/chrome/browser/chromeos/login/wallpaper_manager.cc
+++ b/chrome/browser/chromeos/login/wallpaper_manager.cc
@@ -544,28 +544,24 @@ void WallpaperManager::EnsureLoggedInUserWallpaperLoaded() {
void WallpaperManager::ClearDisposableWallpaperCache() {
// Cancel callback for previous cache requests.
weak_factory_.InvalidateWeakPtrs();
- if (!UserManager::IsMultipleProfilesAllowed()) {
- wallpaper_cache_.clear();
- } else {
- // Keep the wallpaper of logged in users in cache at multi-profile mode.
- std::set<std::string> logged_in_users_names;
- const UserList& logged_users = UserManager::Get()->GetLoggedInUsers();
- for (UserList::const_iterator it = logged_users.begin();
- it != logged_users.end();
- ++it) {
- logged_in_users_names.insert((*it)->email());
- }
+ // Keep the wallpaper of logged in users in cache at multi-profile mode.
+ std::set<std::string> logged_in_users_names;
+ const UserList& logged_users = UserManager::Get()->GetLoggedInUsers();
+ for (UserList::const_iterator it = logged_users.begin();
+ it != logged_users.end();
+ ++it) {
+ logged_in_users_names.insert((*it)->email());
+ }
- CustomWallpaperMap logged_in_users_cache;
- for (CustomWallpaperMap::iterator it = wallpaper_cache_.begin();
- it != wallpaper_cache_.end(); ++it) {
- if (logged_in_users_names.find(it->first) !=
- logged_in_users_names.end()) {
- logged_in_users_cache.insert(*it);
- }
+ CustomWallpaperMap logged_in_users_cache;
+ for (CustomWallpaperMap::iterator it = wallpaper_cache_.begin();
+ it != wallpaper_cache_.end(); ++it) {
+ if (logged_in_users_names.find(it->first) !=
+ logged_in_users_names.end()) {
+ logged_in_users_cache.insert(*it);
}
- wallpaper_cache_ = logged_in_users_cache;
}
+ wallpaper_cache_ = logged_in_users_cache;
}
base::FilePath WallpaperManager::GetCustomWallpaperPath(
@@ -916,8 +912,7 @@ void WallpaperManager::SetCustomWallpaper(const std::string& user_id,
GetPendingWallpaper(user_id, false)->ResetSetWallpaperImage(image, info);
}
- if (UserManager::IsMultipleProfilesAllowed())
- wallpaper_cache_[user_id] = image;
+ wallpaper_cache_[user_id] = image;
}
void WallpaperManager::SetDefaultWallpaperNow(const std::string& user_id) {
@@ -1098,8 +1093,7 @@ void WallpaperManager::SetWallpaperFromImageSkia(const std::string& user_id,
return;
WallpaperInfo info;
info.layout = layout;
- if (UserManager::IsMultipleProfilesAllowed())
- wallpaper_cache_[user_id] = image;
+ wallpaper_cache_[user_id] = image;
if (update_wallpaper) {
GetPendingWallpaper(last_selected_user_, false /* Not delayed */)
@@ -1492,11 +1486,7 @@ void WallpaperManager::OnWallpaperDecoded(
return;
}
- // Only cache the user wallpaper at login screen and for multi profile users.
- if (!UserManager::Get()->IsUserLoggedIn() ||
- UserManager::IsMultipleProfilesAllowed()) {
- wallpaper_cache_[user_id] = user_image.image();
- }
+ wallpaper_cache_[user_id] = user_image.image();
if (update_wallpaper) {
ash::Shell::GetInstance()
« no previous file with comments | « chrome/browser/chromeos/login/user_manager_unittest.cc ('k') | chrome/browser/chromeos/profiles/profile_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698