| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/users/fake_chrome_user_manager.h" | 5 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
| 9 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 9 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 10 #include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h" | 10 #include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 return AddUserWithAffiliation(account_id, false); | 41 return AddUserWithAffiliation(account_id, false); |
| 42 } | 42 } |
| 43 | 43 |
| 44 const user_manager::User* FakeChromeUserManager::AddUserWithAffiliation( | 44 const user_manager::User* FakeChromeUserManager::AddUserWithAffiliation( |
| 45 const AccountId& account_id, | 45 const AccountId& account_id, |
| 46 bool is_affiliated) { | 46 bool is_affiliated) { |
| 47 user_manager::User* user = user_manager::User::CreateRegularUser(account_id); | 47 user_manager::User* user = user_manager::User::CreateRegularUser(account_id); |
| 48 user->SetAffiliation(is_affiliated); | 48 user->SetAffiliation(is_affiliated); |
| 49 user->set_username_hash(ProfileHelper::GetUserIdHashByUserIdForTesting( | 49 user->set_username_hash(ProfileHelper::GetUserIdHashByUserIdForTesting( |
| 50 account_id.GetUserEmail())); | 50 account_id.GetUserEmail())); |
| 51 user->SetStubImage(user_manager::UserImage( | 51 user->SetStubImage(make_scoped_ptr(new user_manager::UserImage( |
| 52 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 52 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 53 IDR_PROFILE_PICTURE_LOADING)), | 53 IDR_PROFILE_PICTURE_LOADING))), |
| 54 user_manager::User::USER_IMAGE_PROFILE, false); | 54 user_manager::User::USER_IMAGE_PROFILE, false); |
| 55 users_.push_back(user); | 55 users_.push_back(user); |
| 56 chromeos::ProfileHelper::Get()->SetProfileToUserMappingForTesting(user); | 56 chromeos::ProfileHelper::Get()->SetProfileToUserMappingForTesting(user); |
| 57 return user; | 57 return user; |
| 58 } | 58 } |
| 59 | 59 |
| 60 const user_manager::User* FakeChromeUserManager::AddPublicAccountUser( | 60 const user_manager::User* FakeChromeUserManager::AddPublicAccountUser( |
| 61 const AccountId& account_id) { | 61 const AccountId& account_id) { |
| 62 user_manager::User* user = | 62 user_manager::User* user = |
| 63 user_manager::User::CreatePublicAccountUser(account_id); | 63 user_manager::User::CreatePublicAccountUser(account_id); |
| 64 user->set_username_hash(ProfileHelper::GetUserIdHashByUserIdForTesting( | 64 user->set_username_hash(ProfileHelper::GetUserIdHashByUserIdForTesting( |
| 65 account_id.GetUserEmail())); | 65 account_id.GetUserEmail())); |
| 66 user->SetStubImage(user_manager::UserImage( | 66 user->SetStubImage(make_scoped_ptr(new user_manager::UserImage( |
| 67 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 67 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 68 IDR_PROFILE_PICTURE_LOADING)), | 68 IDR_PROFILE_PICTURE_LOADING))), |
| 69 user_manager::User::USER_IMAGE_PROFILE, false); | 69 user_manager::User::USER_IMAGE_PROFILE, false); |
| 70 users_.push_back(user); | 70 users_.push_back(user); |
| 71 return user; | 71 return user; |
| 72 } | 72 } |
| 73 | 73 |
| 74 void FakeChromeUserManager::AddKioskAppUser( | 74 void FakeChromeUserManager::AddKioskAppUser( |
| 75 const AccountId& kiosk_app_account_id) { | 75 const AccountId& kiosk_app_account_id) { |
| 76 user_manager::User* user = | 76 user_manager::User* user = |
| 77 user_manager::User::CreateKioskAppUser(kiosk_app_account_id); | 77 user_manager::User::CreateKioskAppUser(kiosk_app_account_id); |
| 78 user->set_username_hash(ProfileHelper::GetUserIdHashByUserIdForTesting( | 78 user->set_username_hash(ProfileHelper::GetUserIdHashByUserIdForTesting( |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 NOTIMPLEMENTED(); | 267 NOTIMPLEMENTED(); |
| 268 return; | 268 return; |
| 269 } | 269 } |
| 270 | 270 |
| 271 bool FakeChromeUserManager::IsValidDefaultUserImageId(int image_index) const { | 271 bool FakeChromeUserManager::IsValidDefaultUserImageId(int image_index) const { |
| 272 NOTIMPLEMENTED(); | 272 NOTIMPLEMENTED(); |
| 273 return false; | 273 return false; |
| 274 } | 274 } |
| 275 | 275 |
| 276 } // namespace chromeos | 276 } // namespace chromeos |
| OLD | NEW |