#include "components/unified_consent/url_keyed_data_collection_consent_helper.h"
#include <map>
#include <set>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/observer_list.h"
#include "base/ranges/algorithm.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/prefs/pref_service.h"
#include "components/sync/base/data_type.h"
#include "components/sync/service/sync_service.h"
#include "components/sync/service/sync_service_observer.h"
#include "components/sync/service/sync_service_utils.h"
#include "components/unified_consent/pref_names.h"
namespace unified_consent {
namespace {
class PrefBasedUrlKeyedDataCollectionConsentHelper
: public UrlKeyedDataCollectionConsentHelper { … };
class SyncBasedUrlKeyedDataCollectionConsentHelper
: public UrlKeyedDataCollectionConsentHelper,
syncer::SyncServiceObserver { … };
PrefBasedUrlKeyedDataCollectionConsentHelper::
PrefBasedUrlKeyedDataCollectionConsentHelper(PrefService* pref_service)
: … { … }
UrlKeyedDataCollectionConsentHelper::State
PrefBasedUrlKeyedDataCollectionConsentHelper::GetConsentState() { … }
void PrefBasedUrlKeyedDataCollectionConsentHelper::OnPrefChanged() { … }
SyncBasedUrlKeyedDataCollectionConsentHelper::
SyncBasedUrlKeyedDataCollectionConsentHelper(
syncer::SyncService* sync_service,
std::set<syncer::DataType> sync_data_types,
bool require_sync_feature_enabled)
: … { … }
SyncBasedUrlKeyedDataCollectionConsentHelper::
~SyncBasedUrlKeyedDataCollectionConsentHelper() { … }
UrlKeyedDataCollectionConsentHelper::State
SyncBasedUrlKeyedDataCollectionConsentHelper::GetConsentState() { … }
void SyncBasedUrlKeyedDataCollectionConsentHelper::OnStateChanged(
syncer::SyncService* sync_service) { … }
void SyncBasedUrlKeyedDataCollectionConsentHelper::OnSyncShutdown(
syncer::SyncService* sync_service) { … }
void SyncBasedUrlKeyedDataCollectionConsentHelper::UpdateSyncDataTypeStates() { … }
}
UrlKeyedDataCollectionConsentHelper::UrlKeyedDataCollectionConsentHelper() =
default;
UrlKeyedDataCollectionConsentHelper::~UrlKeyedDataCollectionConsentHelper() =
default;
std::unique_ptr<UrlKeyedDataCollectionConsentHelper>
UrlKeyedDataCollectionConsentHelper::NewAnonymizedDataCollectionConsentHelper(
PrefService* pref_service) { … }
std::unique_ptr<UrlKeyedDataCollectionConsentHelper>
UrlKeyedDataCollectionConsentHelper::NewPersonalizedDataCollectionConsentHelper(
syncer::SyncService* sync_service) { … }
std::unique_ptr<UrlKeyedDataCollectionConsentHelper>
UrlKeyedDataCollectionConsentHelper::
NewPersonalizedBookmarksDataCollectionConsentHelper(
syncer::SyncService* sync_service,
bool require_sync_feature_enabled) { … }
bool UrlKeyedDataCollectionConsentHelper::IsEnabled() { … }
void UrlKeyedDataCollectionConsentHelper::AddObserver(Observer* observer) { … }
void UrlKeyedDataCollectionConsentHelper::RemoveObserver(Observer* observer) { … }
void UrlKeyedDataCollectionConsentHelper::FireOnStateChanged() { … }
}