diff options
Diffstat (limited to 'chromium/components/unified_consent')
3 files changed, 9 insertions, 18 deletions
diff --git a/chromium/components/unified_consent/url_keyed_data_collection_consent_helper.cc b/chromium/components/unified_consent/url_keyed_data_collection_consent_helper.cc index 89bf509caeb..2b7da836877 100644 --- a/chromium/components/unified_consent/url_keyed_data_collection_consent_helper.cc +++ b/chromium/components/unified_consent/url_keyed_data_collection_consent_helper.cc @@ -4,6 +4,9 @@ #include "components/unified_consent/url_keyed_data_collection_consent_helper.h" +#include <map> +#include <set> + #include "base/bind.h" #include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_service.h" @@ -13,8 +16,6 @@ #include "components/sync/driver/sync_service_utils.h" #include "components/unified_consent/pref_names.h" -#include <map> -#include <set> namespace unified_consent { @@ -146,8 +147,7 @@ UrlKeyedDataCollectionConsentHelper::~UrlKeyedDataCollectionConsentHelper() = // static std::unique_ptr<UrlKeyedDataCollectionConsentHelper> UrlKeyedDataCollectionConsentHelper::NewAnonymizedDataCollectionConsentHelper( - PrefService* pref_service, - syncer::SyncService* sync_service) { + PrefService* pref_service) { return std::make_unique<PrefBasedUrlKeyedDataCollectionConsentHelper>( pref_service); } diff --git a/chromium/components/unified_consent/url_keyed_data_collection_consent_helper.h b/chromium/components/unified_consent/url_keyed_data_collection_consent_helper.h index 77fa1c533d1..6e3e6a74dec 100644 --- a/chromium/components/unified_consent/url_keyed_data_collection_consent_helper.h +++ b/chromium/components/unified_consent/url_keyed_data_collection_consent_helper.h @@ -30,21 +30,13 @@ class UrlKeyedDataCollectionConsentHelper { // Creates a new |UrlKeyedDataCollectionConsentHelper| instance that checks // whether *anonymized* data collection is enabled. This should be used when // the client needs to check whether the user has granted consent for - // *anonymized* URL-keyed data collection. - // - // Implementation-wise we distinguish the following cases: - // 1. If |is_unified_consent_enabled| true, then the instance is backed by - // |pref_service|. Url-keyed data collection is enabled if the preference - // |prefs::kUrlKeyedAnonymizedDataCollectionEnabled| is set to true. - // - // 2. If |is_unified_consent_enabled| is false, then the instance is backed by - // the sync service. Url-keyed data collection is enabled if history sync - // has an active upload state. + // *anonymized* URL-keyed data collection. It is enabled if the preference + // |prefs::kUrlKeyedAnonymizedDataCollectionEnabled| from |pref_service| is + // set to true. // // Note: |pref_service| must outlive the returned instance. static std::unique_ptr<UrlKeyedDataCollectionConsentHelper> - NewAnonymizedDataCollectionConsentHelper(PrefService* pref_service, - syncer::SyncService* sync_service); + NewAnonymizedDataCollectionConsentHelper(PrefService* pref_service); // Creates a new |UrlKeyedDataCollectionConsentHelper| instance that checks // whether *personalized* data collection is enabled. This should be used when diff --git a/chromium/components/unified_consent/url_keyed_data_collection_consent_helper_unittest.cc b/chromium/components/unified_consent/url_keyed_data_collection_consent_helper_unittest.cc index 3d236f0aa4f..c0712bf57fb 100644 --- a/chromium/components/unified_consent/url_keyed_data_collection_consent_helper_unittest.cc +++ b/chromium/components/unified_consent/url_keyed_data_collection_consent_helper_unittest.cc @@ -66,8 +66,7 @@ class UrlKeyedDataCollectionConsentHelperTest TEST_F(UrlKeyedDataCollectionConsentHelperTest, AnonymizedDataCollection) { std::unique_ptr<UrlKeyedDataCollectionConsentHelper> helper = UrlKeyedDataCollectionConsentHelper:: - NewAnonymizedDataCollectionConsentHelper(&pref_service_, - &sync_service_); + NewAnonymizedDataCollectionConsentHelper(&pref_service_); helper->AddObserver(this); EXPECT_FALSE(helper->IsEnabled()); EXPECT_TRUE(state_changed_notifications_.empty()); |