Commit 16e66649 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: Iae27a30eb1a4bc45987f003fbb9c82142715e9cb
Reviewed-on: https://chromium-review.googlesource.com/c/1483019
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635188}
parent f6331862
......@@ -276,7 +276,13 @@ class UserImageManagerTest : public LoginManagerTest,
auto* identity_manager = IdentityManagerFactory::GetForProfile(profile);
identity::SetRefreshTokenForPrimaryAccount(identity_manager,
kRandomTokenStrForTesting);
auto account_info = identity_manager->GetPrimaryAccountInfo();
CoreAccountInfo core_info = identity_manager->GetPrimaryAccountInfo();
AccountInfo account_info;
account_info.email = core_info.email;
account_info.gaia = core_info.gaia;
account_info.account_id = core_info.account_id;
account_info.is_under_advanced_protection =
core_info.is_under_advanced_protection;
account_info.full_name = account_info.email;
account_info.given_name = account_info.email;
account_info.hosted_domain = kNoHostedDomainFound;
......
......@@ -296,9 +296,15 @@ class SaveCardBubbleViewsFullFormBrowserTest
void SetAccountFullName(const std::string& full_name) {
identity::IdentityManager* identity_manager =
IdentityManagerFactory::GetForProfile(browser()->profile());
AccountInfo info = identity_manager->GetPrimaryAccountInfo();
info.full_name = full_name;
identity::UpdateAccountInfoForAccount(identity_manager, info);
CoreAccountInfo core_info = identity_manager->GetPrimaryAccountInfo();
AccountInfo account_info;
account_info.account_id = core_info.account_id;
account_info.gaia = core_info.gaia;
account_info.email = core_info.email;
account_info.is_under_advanced_protection =
core_info.is_under_advanced_protection;
account_info.full_name = full_name;
identity::UpdateAccountInfoForAccount(identity_manager, account_info);
}
void SubmitForm() {
......
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