Patricia Alfonso | 3b296e9f | 2023-09-14 15:18:14 | [diff] [blame] | 1 | // 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 Sonzogni | fe132ee | 2024-01-15 11:01:04 | [diff] [blame] | 8 | #include <optional> |
| 9 | |
Nan Lin | 12bbaa8 | 2023-09-26 22:45:34 | [diff] [blame] | 10 | #include "base/functional/callback_forward.h" |
Nan Lin | 03748b4 | 2023-09-22 19:21:03 | [diff] [blame] | 11 | |
Patricia Alfonso | 3b296e9f | 2023-09-14 15:18:14 | [diff] [blame] | 12 | namespace tpcd::experiment { |
| 13 | |
| 14 | class ExperimentManager { |
| 15 | public: |
Nan Lin | 12bbaa8 | 2023-09-26 22:45:34 | [diff] [blame] | 16 | using EligibilityDecisionCallback = base::OnceCallback<void(bool)>; |
| 17 | |
Nan Lin | ad32489 | 2023-09-28 02:06:21 | [diff] [blame] | 18 | ExperimentManager() = default; |
| 19 | virtual ~ExperimentManager() = default; |
Patricia Alfonso | 3b296e9f | 2023-09-14 15:18:14 | [diff] [blame] | 20 | |
Nan Lin | 12bbaa8 | 2023-09-26 22:45:34 | [diff] [blame] | 21 | // 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 Lin | ad32489 | 2023-09-28 02:06:21 | [diff] [blame] | 23 | // the final decision is made. |
| 24 | virtual void SetClientEligibility( |
Nan Lin | 12bbaa8 | 2023-09-26 22:45:34 | [diff] [blame] | 25 | bool is_eligible, |
Nan Lin | ad32489 | 2023-09-28 02:06:21 | [diff] [blame] | 26 | EligibilityDecisionCallback on_eligibility_decision_callback) = 0; |
Patricia Alfonso | 3b296e9f | 2023-09-14 15:18:14 | [diff] [blame] |
|