OLD | NEW |
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 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 SaveUserDefaultImageIndex(username, image_id); | 907 SaveUserDefaultImageIndex(username, image_id); |
908 } | 908 } |
909 | 909 |
910 int UserManagerImpl::GetUserWallpaper(const std::string& username) { | 910 int UserManagerImpl::GetUserWallpaper(const std::string& username) { |
911 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 911 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
912 | 912 |
913 PrefService* local_state = g_browser_process->local_state(); | 913 PrefService* local_state = g_browser_process->local_state(); |
914 const DictionaryValue* user_wallpapers = | 914 const DictionaryValue* user_wallpapers = |
915 local_state->GetDictionary(UserManager::kUserWallpapers); | 915 local_state->GetDictionary(UserManager::kUserWallpapers); |
916 int index = ash::GetDefaultWallpaperIndex(); | 916 int index = ash::GetDefaultWallpaperIndex(); |
917 if (!user_wallpapers->GetIntegerWithoutPathExpansion(username, &index)) | 917 user_wallpapers->GetIntegerWithoutPathExpansion(username, |
918 SaveWallpaperDefaultIndex(username, index); | 918 &index); |
919 return index; | 919 return index; |
920 } | 920 } |
921 | 921 |
922 void UserManagerImpl::SaveWallpaperDefaultIndex(const std::string& username, | 922 void UserManagerImpl::SaveWallpaperDefaultIndex(const std::string& username, |
923 int wallpaper_index) { | 923 int wallpaper_index) { |
924 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 924 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
925 | 925 |
926 PrefService* local_state = g_browser_process->local_state(); | 926 PrefService* local_state = g_browser_process->local_state(); |
927 DictionaryPrefUpdate wallpapers_update(local_state, | 927 DictionaryPrefUpdate wallpapers_update(local_state, |
928 UserManager::kUserWallpapers); | 928 UserManager::kUserWallpapers); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 BrowserThread::PostTask( | 1218 BrowserThread::PostTask( |
1219 BrowserThread::FILE, | 1219 BrowserThread::FILE, |
1220 FROM_HERE, | 1220 FROM_HERE, |
1221 base::Bind(&UserManagerImpl::DeleteUserImage, | 1221 base::Bind(&UserManagerImpl::DeleteUserImage, |
1222 base::Unretained(this), | 1222 base::Unretained(this), |
1223 image_path)); | 1223 image_path)); |
1224 } | 1224 } |
1225 } | 1225 } |
1226 | 1226 |
1227 } // namespace chromeos | 1227 } // namespace chromeos |
OLD | NEW |