Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chromeos/login/auth/utils.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
|
xiyuan
2016/02/17 23:14:26
not used?
Alexander Alekseev
2016/02/18 13:45:15
Done.
| |
| 8 #include "chromeos/cryptohome/cryptohome_parameters.h" | |
| 9 #include "components/signin/core/account_id/account_id.h" | |
| 10 #include "components/user_manager/known_user.h" | |
| 11 | |
| 12 namespace cryptohome { | |
| 13 | |
| 14 class AccountId GetAccountId(const Identification& user_id) { | |
| 15 const std::vector<AccountId> known_account_ids = | |
| 16 user_manager::known_user::GetKnownAccountIds(); | |
| 17 | |
| 18 for (const AccountId& known_id : known_account_ids) { | |
| 19 if (known_id.GetGaiaIdKey() == user_id.id()) | |
| 20 return known_id; | |
| 21 } | |
| 22 | |
| 23 return user_manager::known_user::GetAccountId(user_id.id(), | |
| 24 std::string() /* gaia_id */); | |
| 25 } | |
| 26 | |
| 27 } // namespace cryptohome | |
| OLD | NEW |