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 "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 7 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 8 #include "chrome/browser/chromeos/login/users/fake_supervised_user_manager.h" | 8 #include "chrome/browser/chromeos/login/users/fake_supervised_user_manager.h" |
| 9 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 9 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 10 #include "chrome/browser/chromeos/settings/cros_settings.h" | 10 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 } | 104 } |
| 105 | 105 |
| 106 void FakeChromeUserManager::ResetUserFlow(const std::string& email) { | 106 void FakeChromeUserManager::ResetUserFlow(const std::string& email) { |
| 107 FlowMap::iterator it = specific_flows_.find(email); | 107 FlowMap::iterator it = specific_flows_.find(email); |
| 108 if (it != specific_flows_.end()) { | 108 if (it != specific_flows_.end()) { |
| 109 delete it->second; | 109 delete it->second; |
| 110 specific_flows_.erase(it); | 110 specific_flows_.erase(it); |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 void FakeChromeUserManager::SwitchActiveUser(const std::string& email) { | 114 void FakeChromeUserManager::SwitchActiveUser(const UserID& user_id /*email*/) { |
|
Denis Kuznetsov (DE-MUC)
2015/06/10 16:50:45
drop commented part
| |
| 115 active_user_id_ = email; | 115 active_user_id_ = user_id; |
| 116 ProfileHelper::Get()->ActiveUserHashChanged( | 116 ProfileHelper::Get()->ActiveUserHashChanged( |
| 117 ProfileHelper::GetUserIdHashByUserIdForTesting(email)); | 117 ProfileHelper::GetUserIdHashByUserIdForTesting(user_id.GetUserEmail())); |
| 118 if (!users_.empty() && !active_user_id_.empty()) { | 118 if (!users_.empty() && !active_user_id_.empty()) { |
| 119 for (user_manager::User* user : users_) | 119 for (user_manager::User* user : users_) |
| 120 user->set_is_active(user->email() == active_user_id_); | 120 user->set_is_active(user->user_id() == active_user_id_); |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 | 123 |
| 124 const std::string& FakeChromeUserManager::GetOwnerEmail() const { | 124 const user_manager::UserID& FakeChromeUserManager::GetOwnerID() const { |
| 125 return owner_email_; | 125 return owner_id_; |
| 126 } | 126 } |
| 127 | 127 |
| 128 void FakeChromeUserManager::SessionStarted() { | 128 void FakeChromeUserManager::SessionStarted() { |
| 129 } | 129 } |
| 130 | 130 |
| 131 void FakeChromeUserManager::RemoveUser( | 131 void FakeChromeUserManager::RemoveUser( |
| 132 const std::string& email, | 132 const UserID& user_id, |
| 133 user_manager::RemoveUserDelegate* delegate) { | 133 user_manager::RemoveUserDelegate* delegate) { |
| 134 } | 134 } |
| 135 | 135 |
| 136 user_manager::UserList | 136 user_manager::UserList |
| 137 FakeChromeUserManager::GetUsersAllowedForSupervisedUsersCreation() const { | 137 FakeChromeUserManager::GetUsersAllowedForSupervisedUsersCreation() const { |
| 138 CrosSettings* cros_settings = CrosSettings::Get(); | 138 CrosSettings* cros_settings = CrosSettings::Get(); |
| 139 bool allow_new_user = true; | 139 bool allow_new_user = true; |
| 140 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 140 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
| 141 bool supervised_users_allowed = AreSupervisedUsersAllowed(); | 141 bool supervised_users_allowed = AreSupervisedUsersAllowed(); |
| 142 | 142 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 return false; | 179 return false; |
| 180 } | 180 } |
| 181 | 181 |
| 182 void FakeChromeUserManager::UpdateKnownUserPrefs( | 182 void FakeChromeUserManager::UpdateKnownUserPrefs( |
| 183 const user_manager::UserID& user_id, | 183 const user_manager::UserID& user_id, |
| 184 const base::DictionaryValue& values, | 184 const base::DictionaryValue& values, |
| 185 bool clear) { | 185 bool clear) { |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace chromeos | 188 } // namespace chromeos |
| OLD | NEW |