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 "chromeos/cryptohome/cryptohome_parameters.h" |
| 8 #include "components/signin/core/account_id/account_id.h" |
| 9 #include "components/user_manager/known_user.h" |
| 10 |
| 11 namespace cryptohome { |
| 12 |
| 13 class AccountId GetAccountId(const Identification& user_id) { |
| 14 const std::vector<AccountId> known_account_ids = |
| 15 user_manager::known_user::GetKnownAccountIds(); |
| 16 |
| 17 for (const AccountId& known_id : known_account_ids) { |
| 18 if (known_id.GetGaiaIdKey() == user_id.id()) |
| 19 return known_id; |
| 20 } |
| 21 |
| 22 return user_manager::known_user::GetAccountId(user_id.id(), |
| 23 std::string() /* gaia_id */); |
| 24 } |
| 25 |
| 26 } // namespace cryptohome |
OLD | NEW |