| Index: components/user_manager/known_user.cc
|
| diff --git a/components/user_manager/known_user.cc b/components/user_manager/known_user.cc
|
| index 973e12b78ee890d584ccda602932cc6682207af4..abf508015218f128b687990ddc34fb117dec38ee 100644
|
| --- a/components/user_manager/known_user.cc
|
| +++ b/components/user_manager/known_user.cc
|
| @@ -256,6 +256,40 @@ AccountId GetAccountId(const std::string& user_email,
|
| : AccountId::FromUserEmailGaiaId(user_email, gaia_id));
|
| }
|
|
|
| +std::vector<AccountId> GetKnownAccountIds() {
|
| + std::vector<AccountId> result;
|
| + PrefService* local_state = GetLocalState();
|
| +
|
| + // Local State may not be initialized in tests.
|
| + if (!local_state)
|
| + return result;
|
| +
|
| + const base::ListValue* known_users = local_state->GetList(kKnownUsers);
|
| + for (size_t i = 0; i < known_users->GetSize(); ++i) {
|
| + const base::DictionaryValue* element = nullptr;
|
| + if (known_users->GetDictionary(i, &element)) {
|
| + std::string email;
|
| + std::string gaia_id;
|
| + const bool has_email = element->GetString(kCanonicalEmail, &email);
|
| + const bool has_gaia_id = element->GetString(kGAIAIdKey, &gaia_id);
|
| + if (has_email || has_gaia_id) {
|
| + result.push_back(AccountId::FromUserEmailGaiaId(email, gaia_id));
|
| + }
|
| + }
|
| + }
|
| + return result;
|
| +}
|
| +
|
| +AccountId MayBeDeserializeAccountId(
|
| + const std::string& maybe_serialized_account_id) {
|
| + AccountId result(EmptyAccountId());
|
| +
|
| + if (AccountId::Deserialize(maybe_serialized_account_id, &result))
|
| + return result;
|
| +
|
| + return GetAccountId(maybe_serialized_account_id, std::string() /* gaia_id */);
|
| +}
|
| +
|
| bool GetGaiaIdMigrationStatus(const AccountId& account_id,
|
| const std::string& subsystem) {
|
| bool migrated = false;
|
|
|