blob: 8da11c3eb7f6ebcf3f16af5def847ee05191b4cc [file] [log] [blame]
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_PRIVACY_SANDBOX_TRACKING_PROTECTION_ONBOARDING_H_
#define COMPONENTS_PRIVACY_SANDBOX_TRACKING_PROTECTION_ONBOARDING_H_
#include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "components/keyed_service/core/keyed_service.h"
class PrefService;
namespace privacy_sandbox {
// A Service which controls the onboarding onto tracking protection - namely
// Third Party Cookie Deprecation. It is meant to be called from the Mode B/B'
// Experiment service, as well as the Cookie Settings service.
class TrackingProtectionOnboarding : public KeyedService {
public:
// Enum value interfacing with the TrackingProtectionOnboarding service
// callers, to indicate the status the onboarding is at.
enum class OnboardingStatus {
kIneligible = 0,
kEligible = 1,
kOnboarded = 2,
kMaxValue = kOnboarded,
};
// Enum value interfacing with the TrackingProtectionOnboarding service
// callers, to indicate the status the silent onboarding is at.
enum class SilentOnboardingStatus {
kIneligible = 0,
kEligible = 1,
kOnboarded = 2,
kMaxValue = kOnboarded,
};
explicit TrackingProtectionOnboarding(PrefService* pref_service);
~TrackingProtectionOnboarding() override;
// KeyedService:
void Shutdown() override;
// Indicates the onboarding status for the user. Return value is the enum
// defined above.
OnboardingStatus GetOnboardingStatus() const;
// Indicates the silent onboarding status for the user. Return value is the
// enum defined above.
SilentOnboardingStatus GetSilentOnboardingStatus() const;
private:
raw_ptr<PrefService> pref_service_;
};
} // namespace privacy_sandbox
#endif // COMPONENTS_PRIVACY_SANDBOX_TRACKING_PROTECTION_ONBOARDING_H_