Chromium Code Reviews| Index: chromeos/login/auth/utils.cc |
| diff --git a/chromeos/login/auth/utils.cc b/chromeos/login/auth/utils.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c36e9bdafed8e90369142eb339ce0adc4566db43 |
| --- /dev/null |
| +++ b/chromeos/login/auth/utils.cc |
| @@ -0,0 +1,26 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chromeos/login/auth/utils.h" |
| + |
| +#include "chromeos/cryptohome/cryptohome_parameters.h" |
| +#include "components/signin/core/account_id/account_id.h" |
| +#include "components/user_manager/known_user.h" |
| + |
| +namespace cryptohome { |
| + |
| +class AccountId GetAccountId(const Identification& user_id) { |
| + const std::vector<AccountId> known_account_ids = |
| + user_manager::known_user::GetKnownAccountIds(); |
| + |
| + for (const AccountId& known_id : known_account_ids) { |
| + if (known_id.GetGaiaIdKey() == user_id.id()) |
| + return known_id; |
| + } |
| + |
| + return user_manager::known_user::GetAccountId(user_id.id(), |
| + std::string() /* gaia_id */); |
| +} |
|
stevenjb
2016/02/23 19:27:34
This is a strange place to put something in the cr
Alexander Alekseev
2016/02/24 01:52:57
First of all, one of the important steps in this C
stevenjb
2016/02/24 17:25:43
I do not see a single instance of "namespace crypt
Alexander Alekseev
2016/02/25 07:40:46
Done.
|
| + |
| +} // namespace cryptohome |