Commit c3ff5d73 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.

Bug: 926204
Change-Id: Id94473af07c7050ad813475ba045421c1f2c1a36
Reviewed-on: https://chromium-review.googlesource.com/c/1470700Reviewed-by: default avatarRyan Hansberry <hansberry@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634590}
parent 122a91af
...@@ -275,16 +275,13 @@ AccountId EasyUnlockServiceRegular::GetAccountId() const { ...@@ -275,16 +275,13 @@ AccountId EasyUnlockServiceRegular::GetAccountId() const {
// |profile| has to be a signed-in profile with IdentityManager already // |profile| has to be a signed-in profile with IdentityManager already
// created. Otherwise, just crash to collect stack. // created. Otherwise, just crash to collect stack.
DCHECK(identity_manager); DCHECK(identity_manager);
const AccountInfo account_info = identity_manager->GetPrimaryAccountInfo(); const CoreAccountInfo account_info =
identity_manager->GetPrimaryAccountInfo();
// A regular signed-in (i.e., non-login) profile should always have an email. // A regular signed-in (i.e., non-login) profile should always have an email.
// TODO(crbug.com/857494): Enable this DCHECK once all browser tests create // TODO(crbug.com/857494): Enable this DCHECK once all browser tests create
// correctly signed in profiles. // correctly signed in profiles.
// DCHECK(!account_info.email.empty()); // DCHECK(!account_info.email.empty());
return account_info.email.empty() return AccountIdFromAccountInfo(account_info);
? EmptyAccountId()
: AccountId::FromUserEmailGaiaId(
gaia::CanonicalizeEmail(account_info.email),
account_info.gaia);
} }
void EasyUnlockServiceRegular::SetHardlockAfterKeyOperation( void EasyUnlockServiceRegular::SetHardlockAfterKeyOperation(
......
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