Index: chrome/browser/chromeos/login/user_manager_impl.cc |
diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc |
index 88a4c763102b8639b8e306545c4514d15d3f9de0..018a7c9de9a403a16698c603ae6dce20f973ee79 100644 |
--- a/chrome/browser/chromeos/login/user_manager_impl.cc |
+++ b/chrome/browser/chromeos/login/user_manager_impl.cc |
@@ -6,6 +6,9 @@ |
#include <vector> |
+#include "ash/shell.h" |
+#include "ash/desktop_background/desktop_background_controller.h" |
+#include "ash/desktop_background/desktop_background_resources.h" |
#include "base/bind.h" |
#include "base/command_line.h" |
#include "base/compiler_specific.h" |
@@ -889,6 +892,31 @@ void UserManagerImpl::SetInitialUserImage(const std::string& username) { |
SaveUserDefaultImageIndex(username, image_id); |
} |
+int UserManagerImpl::GetUserWallpaper(const std::string& username) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ |
+ PrefService* local_state = g_browser_process->local_state(); |
+ const DictionaryValue* user_wallpapers = |
+ local_state->GetDictionary(UserManager::kUserWallpapers); |
+ int index = ash::GetDefaultWallpaperIndex(); |
+ user_wallpapers->GetIntegerWithoutPathExpansion(username, |
+ &index); |
+ return index; |
+} |
+ |
+void UserManagerImpl::SaveWallpaperDefaultIndex(const std::string& username, |
+ int wallpaper_index) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ |
+ PrefService* local_state = g_browser_process->local_state(); |
+ DictionaryPrefUpdate wallpapers_update(local_state, |
+ UserManager::kUserWallpapers); |
+ wallpapers_update->SetWithoutPathExpansion(username, |
+ new base::FundamentalValue(wallpaper_index)); |
+ ash::Shell::GetInstance()->desktop_background_controller()-> |
+ OnDesktopBackgroundChanged(wallpaper_index); |
+} |
+ |
void UserManagerImpl::SetUserImage(const std::string& username, |
int image_index, |
const SkBitmap& image) { |
@@ -1145,6 +1173,10 @@ void UserManagerImpl::RemoveUserFromListInternal(const std::string& email) { |
user_to_remove = it; |
} |
+ DictionaryPrefUpdate prefs_wallpapers_update(prefs, |
+ kUserWallpapers); |
+ prefs_wallpapers_update->RemoveWithoutPathExpansion(email, NULL); |
+ |
DictionaryPrefUpdate prefs_images_update(prefs, kUserImages); |
std::string image_path_string; |
prefs_images_update->GetStringWithoutPathExpansion(email, &image_path_string); |