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/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
10 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 10 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 delete it->second; | 132 delete it->second; |
133 specific_flows_.erase(it); | 133 specific_flows_.erase(it); |
134 } | 134 } |
135 } | 135 } |
136 | 136 |
137 void FakeChromeUserManager::SwitchActiveUser(const AccountId& account_id) { | 137 void FakeChromeUserManager::SwitchActiveUser(const AccountId& account_id) { |
138 active_account_id_ = account_id; | 138 active_account_id_ = account_id; |
139 ProfileHelper::Get()->ActiveUserHashChanged( | 139 ProfileHelper::Get()->ActiveUserHashChanged( |
140 ProfileHelper::GetUserIdHashByUserIdForTesting( | 140 ProfileHelper::GetUserIdHashByUserIdForTesting( |
141 account_id.GetUserEmail())); | 141 account_id.GetUserEmail())); |
| 142 active_user_ = nullptr; |
142 if (!users_.empty() && active_account_id_.is_valid()) { | 143 if (!users_.empty() && active_account_id_.is_valid()) { |
143 for (user_manager::User* user : users_) | 144 for (user_manager::User* const user : users_) { |
144 user->set_is_active(user->GetAccountId() == active_account_id_); | 145 if (user->GetAccountId() == active_account_id_) { |
| 146 active_user_ = user; |
| 147 user->set_is_active(true); |
| 148 } else { |
| 149 user->set_is_active(false); |
| 150 } |
| 151 } |
145 } | 152 } |
146 } | 153 } |
147 | 154 |
148 const AccountId& FakeChromeUserManager::GetOwnerAccountId() const { | 155 const AccountId& FakeChromeUserManager::GetOwnerAccountId() const { |
149 return owner_account_id_; | 156 return owner_account_id_; |
150 } | 157 } |
151 | 158 |
152 void FakeChromeUserManager::SessionStarted() { | 159 void FakeChromeUserManager::SessionStarted() { |
153 } | 160 } |
154 | 161 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 NOTIMPLEMENTED(); | 276 NOTIMPLEMENTED(); |
270 return; | 277 return; |
271 } | 278 } |
272 | 279 |
273 bool FakeChromeUserManager::IsValidDefaultUserImageId(int image_index) const { | 280 bool FakeChromeUserManager::IsValidDefaultUserImageId(int image_index) const { |
274 NOTIMPLEMENTED(); | 281 NOTIMPLEMENTED(); |
275 return false; | 282 return false; |
276 } | 283 } |
277 | 284 |
278 } // namespace chromeos | 285 } // namespace chromeos |
OLD | NEW |