Commit 1d8fb732 authored by Mario Sanchez Prada's avatar Mario Sanchez Prada Committed by Commit Bot

Convert chrome/browser/ui/autofill/chrome_autofill_client.cc to Identity service

Migrated away from SigninManagerBase::GetAuthenticatedAccountId() and
AccountTrackerService::GetAccountInfo(), to rely on the IdentityManager.

Bug: 903886
Change-Id: I4bd70c490760a9d22687545f7d22851f9cdb9a5a
Reviewed-on: https://chromium-review.googlesource.com/c/1331473Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Mario Sanchez Prada <mario@igalia.com>
Cr-Commit-Position: refs/heads/master@{#607632}
parent 0272e9b9
......@@ -19,9 +19,7 @@
#include "chrome/browser/password_manager/chrome_password_manager_client.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/account_tracker_service_factory.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/signin/signin_promo_util.h"
#include "chrome/browser/ssl/insecure_sensitive_input_driver_factory.h"
#include "chrome/browser/ssl/security_state_tab_helper.h"
......@@ -53,17 +51,15 @@
#include "components/password_manager/core/browser/password_requirements_service.h"
#include "components/prefs/pref_service.h"
#include "components/signin/core/browser/account_info.h"
#include "components/signin/core/browser/account_tracker_service.h"
#include "components/signin/core/browser/signin_buildflags.h"
#include "components/signin/core/browser/signin_header_helper.h"
#include "components/signin/core/browser/signin_manager.h"
#include "components/signin/core/browser/signin_manager_base.h"
#include "components/signin/core/browser/signin_metrics.h"
#include "components/ukm/content/source_url_recorder.h"
#include "components/user_prefs/user_prefs.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/ssl_status.h"
#include "services/identity/public/cpp/identity_manager.h"
#include "ui/gfx/geometry/rect.h"
#if defined(OS_ANDROID)
......@@ -571,14 +567,11 @@ base::string16 ChromeAutofillClient::GetAccountHolderName() {
Profile* profile = GetProfile();
if (!profile)
return base::string16();
SigninManagerBase* signin_manager =
SigninManagerFactory::GetForProfile(profile);
AccountTrackerService* account_tracker =
AccountTrackerServiceFactory::GetForProfile(profile);
if (!signin_manager || !account_tracker)
identity::IdentityManager* identity_manager =
IdentityManagerFactory::GetForProfile(profile);
if (!identity_manager)
return base::string16();
AccountInfo account_info = account_tracker->GetAccountInfo(
signin_manager->GetAuthenticatedAccountId());
AccountInfo account_info = identity_manager->GetPrimaryAccountInfo();
return base::UTF8ToUTF16(account_info.full_name);
}
......
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