Commit cfe86edf authored by Tanmoy Mollik's avatar Tanmoy Mollik Committed by Chromium LUCI CQ

Refactor components/unified_consent/* to use OnPrimaryAccountChanged()

Method OnPrimaryAccountCleared() is deprecated. This cl changes the
unified_consent code to use OnPrimaryAccountChanged() instead.

Bug: 1158855
Change-Id: I79f04420e957a95972651851b3dd706e7a9eaa05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2622373Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842106}
parent c4f3bc6b
......@@ -66,10 +66,14 @@ void UnifiedConsentService::Shutdown() {
sync_service_->RemoveObserver(this);
}
void UnifiedConsentService::OnPrimaryAccountCleared(
const CoreAccountInfo& account_info) {
// By design, clearing the primary account disables URL-keyed data collection.
SetUrlKeyedAnonymizedDataCollectionEnabled(false);
void UnifiedConsentService::OnPrimaryAccountChanged(
const signin::PrimaryAccountChangeEvent& event) {
if (event.GetEventTypeFor(signin::ConsentLevel::kSync) ==
signin::PrimaryAccountChangeEvent::Type::kCleared) {
// By design, clearing the primary account disables URL-keyed data
// collection.
SetUrlKeyedAnonymizedDataCollectionEnabled(false);
}
}
void UnifiedConsentService::OnStateChanged(syncer::SyncService* sync) {
......
......@@ -76,8 +76,8 @@ class UnifiedConsentService
void Shutdown() override;
// IdentityManager::Observer:
void OnPrimaryAccountCleared(
const CoreAccountInfo& previous_primary_account_info) override;
void OnPrimaryAccountChanged(
const signin::PrimaryAccountChangeEvent& event) override;
private:
friend class UnifiedConsentServiceTest;
......
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