| 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 <set> |
| 8 |
| 7 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 8 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 9 #include "base/sys_info.h" | 11 #include "base/sys_info.h" |
| 10 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 12 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 11 #include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h" | 13 #include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h" |
| 12 #include "chrome/browser/chromeos/login/users/fake_supervised_user_manager.h" | 14 #include "chrome/browser/chromeos/login/users/fake_supervised_user_manager.h" |
| 13 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 15 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
| 14 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 16 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 15 #include "chrome/browser/chromeos/settings/cros_settings.h" | 17 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 16 #include "chrome/grit/theme_resources.h" | 18 #include "chrome/grit/theme_resources.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 user->set_username_hash(ProfileHelper::GetUserIdHashByUserIdForTesting( | 89 user->set_username_hash(ProfileHelper::GetUserIdHashByUserIdForTesting( |
| 88 account_id.GetUserEmail())); | 90 account_id.GetUserEmail())); |
| 89 users_.push_back(user); | 91 users_.push_back(user); |
| 90 return user; | 92 return user; |
| 91 } | 93 } |
| 92 | 94 |
| 93 user_manager::User* FakeChromeUserManager::AddArcKioskAppUser( | 95 user_manager::User* FakeChromeUserManager::AddArcKioskAppUser( |
| 94 const AccountId& account_id) { | 96 const AccountId& account_id) { |
| 95 user_manager::User* user = | 97 user_manager::User* user = |
| 96 user_manager::User::CreateArcKioskAppUser(account_id); | 98 user_manager::User::CreateArcKioskAppUser(account_id); |
| 99 user->set_username_hash(ProfileHelper::GetUserIdHashByUserIdForTesting( |
| 100 account_id.GetUserEmail())); |
| 97 users_.push_back(user); | 101 users_.push_back(user); |
| 98 return user; | 102 return user; |
| 99 } | 103 } |
| 100 | 104 |
| 101 const user_manager::User* FakeChromeUserManager::AddPublicAccountUser( | 105 const user_manager::User* FakeChromeUserManager::AddPublicAccountUser( |
| 102 const AccountId& account_id) { | 106 const AccountId& account_id) { |
| 103 user_manager::User* user = | 107 user_manager::User* user = |
| 104 user_manager::User::CreatePublicAccountUser(account_id); | 108 user_manager::User::CreatePublicAccountUser(account_id); |
| 105 user->set_username_hash(ProfileHelper::GetUserIdHashByUserIdForTesting( | 109 user->set_username_hash(ProfileHelper::GetUserIdHashByUserIdForTesting( |
| 106 account_id.GetUserEmail())); | 110 account_id.GetUserEmail())); |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 if (active_account_id_.is_valid()) { | 644 if (active_account_id_.is_valid()) { |
| 641 for (const auto& user : users_) { | 645 for (const auto& user : users_) { |
| 642 if (user->GetAccountId() == active_account_id_) | 646 if (user->GetAccountId() == active_account_id_) |
| 643 return user; | 647 return user; |
| 644 } | 648 } |
| 645 } | 649 } |
| 646 return users_[0]; | 650 return users_[0]; |
| 647 } | 651 } |
| 648 | 652 |
| 649 } // namespace chromeos | 653 } // namespace chromeos |
| OLD | NEW |