Chromium Code Reviews| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 if (it != specific_flows_.end()) { | 131 if (it != specific_flows_.end()) { |
| 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())); |
|
Alexander Alekseev
2016/04/27 21:11:18
nit: active_user_ = nullptr ?
Roman Sorokin (ftl)
2016/04/28 13:27:58
Done.
| |
| 142 if (!users_.empty() && active_account_id_.is_valid()) { | 142 if (!users_.empty() && active_account_id_.is_valid()) { |
| 143 for (user_manager::User* user : users_) | 143 for (user_manager::User* user : users_) { |
|
peletskyi
2016/04/28 12:00:55
nit: User* const
| |
| 144 user->set_is_active(user->GetAccountId() == active_account_id_); | 144 if (user->GetAccountId() == active_account_id_) { |
| 145 active_user_ = user; | |
| 146 user->set_is_active(true); | |
| 147 } else { | |
| 148 user->set_is_active(false); | |
| 149 } | |
| 150 } | |
| 145 } | 151 } |
| 146 } | 152 } |
| 147 | 153 |
| 148 const AccountId& FakeChromeUserManager::GetOwnerAccountId() const { | 154 const AccountId& FakeChromeUserManager::GetOwnerAccountId() const { |
| 149 return owner_account_id_; | 155 return owner_account_id_; |
| 150 } | 156 } |
| 151 | 157 |
| 152 void FakeChromeUserManager::SessionStarted() { | 158 void FakeChromeUserManager::SessionStarted() { |
| 153 } | 159 } |
| 154 | 160 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 NOTIMPLEMENTED(); | 275 NOTIMPLEMENTED(); |
| 270 return; | 276 return; |
| 271 } | 277 } |
| 272 | 278 |
| 273 bool FakeChromeUserManager::IsValidDefaultUserImageId(int image_index) const { | 279 bool FakeChromeUserManager::IsValidDefaultUserImageId(int image_index) const { |
| 274 NOTIMPLEMENTED(); | 280 NOTIMPLEMENTED(); |
| 275 return false; | 281 return false; |
| 276 } | 282 } |
| 277 | 283 |
| 278 } // namespace chromeos | 284 } // namespace chromeos |
| OLD | NEW |