Mihai Sardarescu | 160ec66 | 2018-07-18 21:13:51 | [diff] [blame] | 1 | // 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 | #include "components/unified_consent/scoped_unified_consent.h" |
| 6 | |
| 7 | #include <map> |
| 8 | #include <string> |
| 9 | #include <utility> |
| 10 | |
| 11 | #include "base/bind.h" |
| 12 | #include "base/feature_list.h" |
| 13 | #include "base/logging.h" |
Thomas Tangl | 460a5861 | 2018-11-30 12:06:52 | [diff] [blame] | 14 | #include "components/unified_consent/feature.h" |
Mihai Sardarescu | 160ec66 | 2018-07-18 21:13:51 | [diff] [blame] | 15 | |
| 16 | namespace unified_consent { |
| 17 | |
| 18 | ScopedUnifiedConsent::ScopedUnifiedConsent(UnifiedConsentFeatureState state) { |
Mihai Sardarescu | 160ec66 | 2018-07-18 21:13:51 | [diff] [blame] | 19 | switch (state) { |
| 20 | case UnifiedConsentFeatureState::kDisabled: |
| 21 | unified_consent_feature_list_.InitAndDisableFeature(kUnifiedConsent); |
| 22 | break; |
Thomas Tangl | 460a5861 | 2018-11-30 12:06:52 | [diff] [blame] | 23 | case UnifiedConsentFeatureState::kEnabled: |
Mihai Sardarescu | 160ec66 | 2018-07-18 21:13:51 | [diff] [blame] | 24 | unified_consent_feature_list_.InitAndEnableFeature(kUnifiedConsent); |
| 25 | break; |
Mihai Sardarescu | 160ec66 | 2018-07-18 21:13:51 | [diff] [blame] | 26 | } |
Mihai Sardarescu | 160ec66 | 2018-07-18 21:13:51 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | ScopedUnifiedConsent::~ScopedUnifiedConsent() {} |
| 30 | |
| 31 | } // namespace unified_consent |