Commit fbdfd22b authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Preparation to convert GetPrimaryAccount to return CoreAccountInfo

Change client code to work as if IdentityManager::GetPrimaryAccount
where returning a CoreAccountInfo instead of an AccountInfo. Method
will be updated in a followup CL.

This CL was uploaded by git cl split.

Bug: 926204
Change-Id: I7ed54720bb93c83df6802f83034138f71bb8e479
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1499515
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarThomas Tangl <tangltom@chromium.org>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638602}
parent ee3dfe72
......@@ -498,10 +498,11 @@ base::Value PeopleHandler::GetStoredAccountsList() {
// If dice is disabled (and unified consent enabled), show only the primary
// account.
auto* identity_manager = IdentityManagerFactory::GetForProfile(profile_);
if (identity_manager->HasPrimaryAccount()) {
accounts_list.push_back(
GetAccountValue(identity_manager->GetPrimaryAccountInfo()));
}
base::Optional<AccountInfo> primary_account_info =
identity_manager->FindExtendedAccountInfoForAccount(
identity_manager->GetPrimaryAccountInfo());
if (primary_account_info.has_value())
accounts_list.push_back(GetAccountValue(primary_account_info.value()));
}
return accounts;
......@@ -766,7 +767,9 @@ void PeopleHandler::HandlePauseSync(const base::ListValue* args) {
auto* identity_manager = IdentityManagerFactory::GetForProfile(profile_);
DCHECK(identity_manager->HasPrimaryAccount());
AccountInfo primary_account_info = identity_manager->GetPrimaryAccountInfo();
CoreAccountInfo primary_account_info =
identity_manager->GetPrimaryAccountInfo();
identity_manager->GetAccountsMutator()->AddOrUpdateAccount(
primary_account_info.gaia, primary_account_info.email,
OAuth2TokenServiceDelegate::kInvalidRefreshToken,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment