blob: f4bce3894a9635c4330601cc30f89c89b92d7bcf [file] [log] [blame]
Mihai Sardarescu160ec662018-07-18 21:13:511// Copyright 2018 The Chromium Authors. All rights reserved.
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 COMPONENTS_UNIFIED_CONSENT_SCOPED_UNIFIED_CONSENT_H_
6#define COMPONENTS_UNIFIED_CONSENT_SCOPED_UNIFIED_CONSENT_H_
7
8#include <memory>
9
10#include "base/macros.h"
11#include "base/test/scoped_feature_list.h"
Mihai Sardarescu160ec662018-07-18 21:13:5112
13namespace unified_consent {
14
Thomas Tangl460a58612018-11-30 12:06:5215// State of the "Unified Consent" feature.
16enum class UnifiedConsentFeatureState {
17 // Unified consent is disabled.
18 kDisabled,
19 // Unified consent is enabled.
20 kEnabled,
21};
22
Mihai Sardarescu160ec662018-07-18 21:13:5123// Changes the unified consent feature state while it is in scope. Useful for
24// tests.
25// Also enables the feature |switches::kSyncUserConsentSeparateType| as
26// unified consent depends on its.
27class ScopedUnifiedConsent {
28 public:
29 explicit ScopedUnifiedConsent(UnifiedConsentFeatureState state);
30 ~ScopedUnifiedConsent();
31
32 private:
Mihai Sardarescu160ec662018-07-18 21:13:5133 base::test::ScopedFeatureList unified_consent_feature_list_;
34
35 DISALLOW_COPY_AND_ASSIGN(ScopedUnifiedConsent);
36};
37
38} // namespace unified_consent
39
40#endif // COMPONENTS_UNIFIED_CONSENT_SCOPED_UNIFIED_CONSENT_H_