Commit 17d11907 authored by Sergio Villar Senin's avatar Sergio Villar Senin Committed by Commit Bot

Convert arc_terms_of_service_screen_handler.cc to IdentityManager

It was using SigninManagerBase API to get the primary (authenticated)
account id. It's now using the IdentityManager API.

Bug: 890808
Change-Id: Ifabe11ca68de07949fcad2f81c022723dcb842ef
Reviewed-on: https://chromium-review.googlesource.com/c/1276769Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Reviewed-by: default avatarAlexander Alekseev <alemate@chromium.org>
Commit-Queue: Sergio Villar <svillar@igalia.com>
Cr-Commit-Position: refs/heads/master@{#599925}
parent d6bb93ac
......@@ -18,7 +18,7 @@
#include "chrome/browser/consent_auditor/consent_auditor_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/grit/generated_resources.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/network/network_handler.h"
......@@ -28,9 +28,9 @@
#include "components/consent_auditor/consent_auditor.h"
#include "components/login/localized_values_builder.h"
#include "components/prefs/pref_service.h"
#include "components/signin/core/browser/signin_manager_base.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "services/identity/public/cpp/identity_manager.h"
#include "ui/base/l10n/l10n_util.h"
using ArcBackupAndRestoreConsent =
......@@ -303,10 +303,9 @@ void ArcTermsOfServiceScreenHandler::RecordConsents(
Profile* profile = ProfileManager::GetActiveUserProfile();
consent_auditor::ConsentAuditor* consent_auditor =
ConsentAuditorFactory::GetForProfile(profile);
SigninManagerBase* signin_manager =
SigninManagerFactory::GetForProfile(profile);
DCHECK(signin_manager->IsAuthenticated());
const std::string account_id = signin_manager->GetAuthenticatedAccountId();
auto* identity_manager = IdentityManagerFactory::GetForProfile(profile);
DCHECK(identity_manager->HasPrimaryAccount());
const std::string account_id = identity_manager->GetPrimaryAccountId();
ArcPlayTermsOfServiceConsent play_consent;
play_consent.set_status(tos_accepted ? UserConsentTypes::GIVEN
......
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