blob: 3a73f3ad755900379df5de1da2fb35c1c1461d7b [file] [log] [blame]
Patricia Alfonso3b296e9f2023-09-14 15:18:141// Copyright 2023 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_TPCD_EXPERIMENT_EXPERIMENT_MANAGER_H_
6#define CHROME_BROWSER_TPCD_EXPERIMENT_EXPERIMENT_MANAGER_H_
7
Arthur Sonzognife132ee2024-01-15 11:01:048#include <optional>
9
Nan Lin12bbaa82023-09-26 22:45:3410#include "base/functional/callback_forward.h"
Nan Lin03748b42023-09-22 19:21:0311
Patricia Alfonso3b296e9f2023-09-14 15:18:1412namespace tpcd::experiment {
13
14class ExperimentManager {
15 public:
Nan Lin12bbaa82023-09-26 22:45:3416 using EligibilityDecisionCallback = base::OnceCallback<void(bool)>;
17
Nan Linad324892023-09-28 02:06:2118 ExperimentManager() = default;
19 virtual ~ExperimentManager() = default;
Patricia Alfonso3b296e9f2023-09-14 15:18:1420
Nan Lin12bbaa82023-09-26 22:45:3421 // Called by `EligibilityService` to tell the manager whether a profile is
22 // eligible, with a callback to complete the profile-level work required once
Nan Linad324892023-09-28 02:06:2123 // the final decision is made.
24 virtual void SetClientEligibility(
Nan Lin12bbaa82023-09-26 22:45:3425 bool is_eligible,
Nan Linad324892023-09-28 02:06:2126 EligibilityDecisionCallback on_eligibility_decision_callback) = 0;
Patricia Alfonso3b296e9f2023-09-14 15:18:14