blob: 3a7f64238f03a4c5355d0b2c29bd12ca3459de8d [file] [log] [blame]
Kyle Milka9ae0cdee2017-07-20 20:24:571// 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
10namespace variations {
11
12// Infrastructure for setting up platform specific field trials. Chrome and
13// WebView make use through their corresponding subclasses.
14class PlatformFieldTrials {
15 public:
Scott Violet14742de2018-01-09 17:44:5516 PlatformFieldTrials() = default;
17 virtual ~PlatformFieldTrials() = default;
Kyle Milka9ae0cdee2017-07-20 20:24:5718
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_