| 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 a004cc9adf88ea1ca21497bc0b12c834f340c121..3cfbb7dab38d3bc6267d7567ca5d6e7a09317c71 100644
|
| --- a/chrome/browser/chromeos/login/user_manager_impl.cc
|
| +++ b/chrome/browser/chromeos/login/user_manager_impl.cc
|
| @@ -448,6 +448,13 @@ void UserManagerImpl::StubUserLoggedIn() {
|
| kStubDefaultImageIndex);
|
| }
|
|
|
| +void UserManagerImpl::UserSelected(const std::string& email) {
|
| + if (IsKnownUser(email)) {
|
| + ash::Shell::GetInstance()->desktop_background_controller()->
|
| + SetDefaultWallpaper(FindUserWallpaperIndex(email));
|
| + }
|
| +}
|
| +
|
| void UserManagerImpl::RemoveUser(const std::string& email,
|
| RemoveUserDelegate* delegate) {
|
| if (!IsKnownUser(email))
|
| @@ -882,6 +889,20 @@ const User* UserManagerImpl::FindUserInList(const std::string& email) const {
|
| return NULL;
|
| }
|
|
|
| +int UserManagerImpl::FindUserWallpaperIndex(const std::string& email) {
|
| + PrefService* local_state = g_browser_process->local_state();
|
| + const DictionaryValue* user_wallpapers =
|
| + local_state->GetDictionary(UserManager::kUserWallpapers);
|
| + int index;
|
| + if (!user_wallpapers->GetIntegerWithoutPathExpansion(email, &index))
|
| + index = current_user_wallpaper_index_;
|
| + if (index < 0 || index >= ash::GetWallpaperCount()) {
|
| + index = ash::GetDefaultWallpaperIndex();
|
| + SaveUserWallpaperIndex(index);
|
| + }
|
| + return index;
|
| +}
|
| +
|
| void UserManagerImpl::NotifyOnLogin() {
|
| CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| content::NotificationService::current()->Notify(
|
| @@ -944,19 +965,7 @@ int UserManagerImpl::GetUserWallpaperIndex() {
|
| const chromeos::User& user = GetLoggedInUser();
|
| std::string username = user.email();
|
| DCHECK(!username.empty());
|
| -
|
| - PrefService* local_state = g_browser_process->local_state();
|
| - const DictionaryValue* user_wallpapers =
|
| - local_state->GetDictionary(UserManager::kUserWallpapers);
|
| - int index;
|
| - if (!user_wallpapers->GetIntegerWithoutPathExpansion(username, &index))
|
| - index = current_user_wallpaper_index_;
|
| -
|
| - if (index < 0 || index >= ash::GetWallpaperCount()) {
|
| - index = ash::GetDefaultWallpaperIndex();
|
| - SaveUserWallpaperIndex(index);
|
| - }
|
| - return index;
|
| + return FindUserWallpaperIndex(username);
|
| }
|
|
|
| void UserManagerImpl::SaveUserWallpaperIndex(int wallpaper_index) {
|
|
|