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() { ...@@ -66,10 +66,14 @@ void UnifiedConsentService::Shutdown() {
sync_service_->RemoveObserver(this); sync_service_->RemoveObserver(this);
} }
void UnifiedConsentService::OnPrimaryAccountCleared( void UnifiedConsentService::OnPrimaryAccountChanged(
const CoreAccountInfo& account_info) { const signin::PrimaryAccountChangeEvent& event) {
// By design, clearing the primary account disables URL-keyed data collection. if (event.GetEventTypeFor(signin::ConsentLevel::kSync) ==
signin::PrimaryAccountChangeEvent::Type::kCleared) {
// By design, clearing the primary account disables URL-keyed data
// collection.
SetUrlKeyedAnonymizedDataCollectionEnabled(false); SetUrlKeyedAnonymizedDataCollectionEnabled(false);
}
} }
void UnifiedConsentService::OnStateChanged(syncer::SyncService* sync) { void UnifiedConsentService::OnStateChanged(syncer::SyncService* sync) {
......
...@@ -76,8 +76,8 @@ class UnifiedConsentService ...@@ -76,8 +76,8 @@ class UnifiedConsentService
void Shutdown() override; void Shutdown() override;
// IdentityManager::Observer: // IdentityManager::Observer:
void OnPrimaryAccountCleared( void OnPrimaryAccountChanged(
const CoreAccountInfo& previous_primary_account_info) override; const signin::PrimaryAccountChangeEvent& event) override;
private: private:
friend class UnifiedConsentServiceTest; 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