OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/user_manager/fake_user_manager.h" | 5 #include "components/user_manager/fake_user_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 const user_manager::User* FakeUserManager::AddUserWithAffiliation( | 48 const user_manager::User* FakeUserManager::AddUserWithAffiliation( |
49 const AccountId& account_id, | 49 const AccountId& account_id, |
50 bool is_affiliated) { | 50 bool is_affiliated) { |
51 user_manager::User* user = user_manager::User::CreateRegularUser(account_id); | 51 user_manager::User* user = user_manager::User::CreateRegularUser(account_id); |
52 user->SetAffiliation(is_affiliated); | 52 user->SetAffiliation(is_affiliated); |
53 users_.push_back(user); | 53 users_.push_back(user); |
54 return user; | 54 return user; |
55 } | 55 } |
56 | 56 |
| 57 void FakeUserManager::OnProfileInitialized(User* user) { |
| 58 user->set_profile_ever_initialized(true); |
| 59 } |
| 60 |
57 void FakeUserManager::RemoveUserFromList(const AccountId& account_id) { | 61 void FakeUserManager::RemoveUserFromList(const AccountId& account_id) { |
58 const user_manager::UserList::iterator it = | 62 const user_manager::UserList::iterator it = |
59 std::find_if(users_.begin(), users_.end(), | 63 std::find_if(users_.begin(), users_.end(), |
60 [&account_id](const user_manager::User* user) { | 64 [&account_id](const user_manager::User* user) { |
61 return user->GetAccountId() == account_id; | 65 return user->GetAccountId() == account_id; |
62 }); | 66 }); |
63 if (it != users_.end()) { | 67 if (it != users_.end()) { |
64 if (primary_user_ == *it) | 68 if (primary_user_ == *it) |
65 primary_user_ = nullptr; | 69 primary_user_ = nullptr; |
66 if (active_user_ != *it) | 70 if (active_user_ != *it) |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 NOTIMPLEMENTED(); | 352 NOTIMPLEMENTED(); |
349 return; | 353 return; |
350 } | 354 } |
351 | 355 |
352 bool FakeUserManager::IsValidDefaultUserImageId(int image_index) const { | 356 bool FakeUserManager::IsValidDefaultUserImageId(int image_index) const { |
353 NOTIMPLEMENTED(); | 357 NOTIMPLEMENTED(); |
354 return false; | 358 return false; |
355 } | 359 } |
356 | 360 |
357 } // namespace user_manager | 361 } // namespace user_manager |
OLD | NEW |