Commit 01935ba2 authored by Henrique Ferreiro's avatar Henrique Ferreiro Committed by Commit Bot

Replace AccountTrackerService in profile_window.cc

Replace AccountTrackerService::GetAccountInfo() with
IdentityManager::GetPrimaryAccountInfo().

Bug: 922760
Change-Id: I39faccbf4fc622f808a1ec75e67656d55260c2bb
Reviewed-on: https://chromium-review.googlesource.com/c/1425611
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626183}
parent 735c7ad4
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "chrome/browser/profiles/profile_avatar_icon_util.h" #include "chrome/browser/profiles/profile_avatar_icon_util.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/account_reconcilor_factory.h" #include "chrome/browser/signin/account_reconcilor_factory.h"
#include "chrome/browser/signin/account_tracker_service_factory.h"
#include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/signin_ui_util.h" #include "chrome/browser/signin/signin_ui_util.h"
#include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/sync/profile_sync_service_factory.h"
...@@ -44,7 +43,6 @@ ...@@ -44,7 +43,6 @@
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/signin/core/browser/account_info.h" #include "components/signin/core/browser/account_info.h"
#include "components/signin/core/browser/account_reconcilor.h" #include "components/signin/core/browser/account_reconcilor.h"
#include "components/signin/core/browser/account_tracker_service.h"
#include "components/signin/core/browser/signin_pref_names.h" #include "components/signin/core/browser/signin_pref_names.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "extensions/buildflags/buildflags.h" #include "extensions/buildflags/buildflags.h"
...@@ -373,11 +371,10 @@ bool IsLockAvailable(Profile* profile) { ...@@ -373,11 +371,10 @@ bool IsLockAvailable(Profile* profile) {
// TODO(mlerman): After one release remove any hosted_domain reference to the // TODO(mlerman): After one release remove any hosted_domain reference to the
// pref, since all users will have this in the AccountTrackerService. // pref, since all users will have this in the AccountTrackerService.
if (hosted_domain.empty()) { if (hosted_domain.empty()) {
AccountTrackerService* account_tracker = auto* identity_manager = IdentityManagerFactory::GetForProfile(profile);
AccountTrackerServiceFactory::GetForProfile(profile); if (identity_manager->HasPrimaryAccount()) {
std::string account_id = hosted_domain = identity_manager->GetPrimaryAccountInfo().hosted_domain;
IdentityManagerFactory::GetForProfile(profile)->GetPrimaryAccountId(); }
hosted_domain = account_tracker->GetAccountInfo(account_id).hosted_domain;
} }
// TODO(mlerman): Prohibit only users who authenticate using SAML. Until then, // TODO(mlerman): Prohibit only users who authenticate using SAML. Until then,
// prohibited users who use hosted domains (aside from google.com). // prohibited users who use hosted domains (aside from google.com).
......
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