| 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 */);
|
| +}
|
| +
|
| +} // namespace cryptohome
|
|
|