Commit 02aaf3b0 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

[s13n] Convert ArcPlayStoreEnabledPreferenceHandler to IdentityManager

BUG=890771

Change-Id: I9fbb028db7c7e4c259885aa804ef475bb79deb47
Reviewed-on: https://chromium-review.googlesource.com/c/1296872Reviewed-by: default avatarHidehiko Abe <hidehiko@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#602258}
parent 66e8edfc
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "chrome/browser/consent_auditor/consent_auditor_factory.h" #include "chrome/browser/consent_auditor/consent_auditor_factory.h"
#include "chrome/browser/prefs/pref_service_syncable_util.h" #include "chrome/browser/prefs/pref_service_syncable_util.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/ui/app_list/arc/arc_app_utils.h" #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
#include "components/arc/arc_prefs.h" #include "components/arc/arc_prefs.h"
#include "components/arc/arc_util.h" #include "components/arc/arc_util.h"
#include "components/consent_auditor/consent_auditor.h" #include "components/consent_auditor/consent_auditor.h"
#include "components/signin/core/browser/signin_manager_base.h"
#include "components/sync_preferences/pref_service_syncable.h" #include "components/sync_preferences/pref_service_syncable.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "services/identity/public/cpp/identity_manager.h"
using sync_pb::UserConsentTypes; using sync_pb::UserConsentTypes;
...@@ -125,15 +125,14 @@ void ArcPlayStoreEnabledPreferenceHandler::OnPreferenceChanged() { ...@@ -125,15 +125,14 @@ void ArcPlayStoreEnabledPreferenceHandler::OnPreferenceChanged() {
chrome_launcher_controller->UnpinAppWithID(kPlayStoreAppId); chrome_launcher_controller->UnpinAppWithID(kPlayStoreAppId);
// Tell Consent Auditor that the Play Store consent was revoked. // Tell Consent Auditor that the Play Store consent was revoked.
SigninManagerBase* signin_manager = identity::IdentityManager* identity_manager =
SigninManagerFactory::GetForProfile(profile_); IdentityManagerFactory::GetForProfile(profile_);
// TODO(crbug.com/850297): Fix unrelated tests that are not properly // TODO(crbug.com/850297): Fix unrelated tests that are not properly
// setting up the state of signin_manager and enable the DCHECK instead of // setting up the state of identity_manager and enable the DCHECK instead
// the conditional below. // of the conditional below.
// DCHECK(signin_manager->IsAuthenticated()); // DCHECK(identity_manager->HasPrimaryAccount());
if (signin_manager->IsAuthenticated()) { if (identity_manager->HasPrimaryAccount()) {
const std::string account_id = const std::string account_id = identity_manager->GetPrimaryAccountId();
signin_manager->GetAuthenticatedAccountId();
UserConsentTypes::ArcPlayTermsOfServiceConsent play_consent; UserConsentTypes::ArcPlayTermsOfServiceConsent play_consent;
play_consent.set_status(UserConsentTypes::NOT_GIVEN); play_consent.set_status(UserConsentTypes::NOT_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