Kyle Milka | 9ae0cdee | 2017-07-20 20:24:57 | [diff] [blame] | 1 | // Copyright 2017 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_VARIATIONS_PLATFORM_FIELD_TRIALS_H_ |
| 6 | #define COMPONENTS_VARIATIONS_PLATFORM_FIELD_TRIALS_H_ |
| 7 | |
| 8 | #include "base/metrics/field_trial.h" |
| 9 | |
| 10 | namespace variations { |
| 11 | |
| 12 | // Infrastructure for setting up platform specific field trials. Chrome and |
| 13 | // WebView make use through their corresponding subclasses. |
| 14 | class PlatformFieldTrials { |
| 15 | public: |
Scott Violet | 14742de | 2018-01-09 17:44:55 | [diff] [blame] | 16 | PlatformFieldTrials() = default; |
| 17 | virtual ~PlatformFieldTrials() = default; |
Kyle Milka | 9ae0cdee | 2017-07-20 20:24:57 | [diff] [blame] | 18 | |
| 19 | // Set up field trials for a specific platform. |
| 20 | virtual void SetupFieldTrials() = 0; |
| 21 | |
| 22 | // Create field trials that will control feature list features. This should be |
| 23 | // called during the same timing window as |
| 24 | // FeatureList::AssociateReportingFieldTrial. |has_seed| indicates that the |
| 25 | // variations service used a seed to create field trials. This can be used to |
| 26 | // prevent associating a field trial with a feature that you expect to be |
| 27 | // controlled by the variations seed. |
| 28 | virtual void SetupFeatureControllingFieldTrials( |
| 29 | bool has_seed, |
| 30 | base::FeatureList* feature_list) = 0; |
| 31 | |
| 32 | private: |
| 33 | DISALLOW_COPY_AND_ASSIGN(PlatformFieldTrials); |
| 34 | }; |
| 35 | |
| 36 | } // namespace variations |
| 37 | |
| 38 | #endif // COMPONENTS_VARIATIONS_PLATFORM_FIELD_TRIALS_H_ |