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

Side by Side Diff: chrome/browser/chromeos/login/user_manager_impl.cc

Issue 9764012: Restore to user selected wallpaper after browser crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Create a dummy class to fix test fail. Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/login/user_manager_impl.h" 5 #include "chrome/browser/chromeos/login/user_manager_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/desktop_background/desktop_background_controller.h" 10 #include "ash/desktop_background/desktop_background_controller.h"
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 void UserManagerImpl::SaveWallpaperDefaultIndex(const std::string& username, 916 void UserManagerImpl::SaveWallpaperDefaultIndex(const std::string& username,
917 int wallpaper_index) { 917 int wallpaper_index) {
918 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 918 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
919 919
920 PrefService* local_state = g_browser_process->local_state(); 920 PrefService* local_state = g_browser_process->local_state();
921 DictionaryPrefUpdate wallpapers_update(local_state, 921 DictionaryPrefUpdate wallpapers_update(local_state,
922 UserManager::kUserWallpapers); 922 UserManager::kUserWallpapers);
923 wallpapers_update->SetWithoutPathExpansion(username, 923 wallpapers_update->SetWithoutPathExpansion(username,
924 new base::FundamentalValue(wallpaper_index)); 924 new base::FundamentalValue(wallpaper_index));
925 ash::Shell::GetInstance()->desktop_background_controller()-> 925 ash::Shell::GetInstance()->desktop_background_controller()->
926 OnDesktopBackgroundChanged(wallpaper_index); 926 OnDesktopBackgroundChanged();
927 } 927 }
928 928
929 void UserManagerImpl::SetUserImage(const std::string& username, 929 void UserManagerImpl::SetUserImage(const std::string& username,
930 int image_index, 930 int image_index,
931 const SkBitmap& image) { 931 const SkBitmap& image) {
932 User* user = const_cast<User*>(FindUser(username)); 932 User* user = const_cast<User*>(FindUser(username));
933 // User may have been removed by now. 933 // User may have been removed by now.
934 if (user) { 934 if (user) {
935 // For existing users, a valid image index should have been set upon loading 935 // For existing users, a valid image index should have been set upon loading
936 // them from Local State. 936 // them from Local State.
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1212 BrowserThread::PostTask( 1212 BrowserThread::PostTask(
1213 BrowserThread::FILE, 1213 BrowserThread::FILE,
1214 FROM_HERE, 1214 FROM_HERE,
1215 base::Bind(&UserManagerImpl::DeleteUserImage, 1215 base::Bind(&UserManagerImpl::DeleteUserImage,
1216 base::Unretained(this), 1216 base::Unretained(this),
1217 image_path)); 1217 image_path));
1218 } 1218 }
1219 } 1219 }
1220 1220
1221 } // namespace chromeos 1221 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/background/desktop_background_observer.cc ('k') | chrome/browser/ui/views/ash/chrome_shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698