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/desktop_background/desktop_background_controller.h" | 9 #include "ash/desktop_background/desktop_background_controller.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 CrosLibrary::Get()->GetCertLibrary()->LoadKeyStore(); | 897 CrosLibrary::Get()->GetCertLibrary()->LoadKeyStore(); |
898 | 898 |
899 // Schedules current user ownership check on file thread. | 899 // Schedules current user ownership check on file thread. |
900 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 900 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
901 base::Bind(&UserManagerImpl::CheckOwnership, | 901 base::Bind(&UserManagerImpl::CheckOwnership, |
902 base::Unretained(this))); | 902 base::Unretained(this))); |
903 } | 903 } |
904 | 904 |
905 void UserManagerImpl::SetInitialUserImage(const std::string& username) { | 905 void UserManagerImpl::SetInitialUserImage(const std::string& username) { |
906 // Choose a random default image. | 906 // Choose a random default image. |
907 int image_id = base::RandInt(0, kDefaultImagesCount - 1); | 907 int image_id = |
| 908 base::RandInt(kFirstDefaultImageIndex, kDefaultImagesCount - 1); |
908 SaveUserDefaultImageIndex(username, image_id); | 909 SaveUserDefaultImageIndex(username, image_id); |
909 } | 910 } |
910 | 911 |
911 void UserManagerImpl::MigrateWallpaperData() { | 912 void UserManagerImpl::MigrateWallpaperData() { |
912 PrefService* local_state = g_browser_process->local_state(); | 913 PrefService* local_state = g_browser_process->local_state(); |
913 if (local_state) { | 914 if (local_state) { |
914 const DictionaryValue* user_wallpapers = | 915 const DictionaryValue* user_wallpapers = |
915 local_state->GetDictionary(kUserWallpapers); | 916 local_state->GetDictionary(kUserWallpapers); |
916 int index; | 917 int index; |
917 const DictionaryValue* new_user_wallpapers = | 918 const DictionaryValue* new_user_wallpapers = |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 BrowserThread::PostTask( | 1371 BrowserThread::PostTask( |
1371 BrowserThread::FILE, | 1372 BrowserThread::FILE, |
1372 FROM_HERE, | 1373 FROM_HERE, |
1373 base::Bind(&UserManagerImpl::DeleteUserImage, | 1374 base::Bind(&UserManagerImpl::DeleteUserImage, |
1374 base::Unretained(this), | 1375 base::Unretained(this), |
1375 image_path)); | 1376 image_path)); |
1376 } | 1377 } |
1377 } | 1378 } |
1378 | 1379 |
1379 } // namespace chromeos | 1380 } // namespace chromeos |
OLD | NEW |