Implement HTMLDialog::GetExtraResult.
[chromium-blink-merge.git] / components / variations / processed_study.h
blobcdc1c7636823859ef53d35e49f9f5bccaddb4490
1 // Copyright 2013 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.
5 #ifndef COMPONENTS_VARIATIONS_PROCESSED_STUDY_H_
6 #define COMPONENTS_VARIATIONS_PROCESSED_STUDY_H_
8 #include <vector>
10 #include "base/metrics/field_trial.h"
12 namespace chrome_variations {
14 class Study;
16 // Wrapper over Study with extra information computed during pre-processing,
17 // such as whether the study is expired and its total probability.
18 class ProcessedStudy {
19 public:
20 ProcessedStudy();
21 ~ProcessedStudy();
23 bool Init(const Study* study, bool is_expired);
25 const Study* study() const { return study_; }
27 base::FieldTrial::Probability total_probability() const {
28 return total_probability_;
31 bool is_expired() const { return is_expired_; }
33 static bool ValidateAndAppendStudy(
34 const Study* study,
35 bool is_expired,
36 std::vector<ProcessedStudy>* processed_studies);
38 private:
39 // Corresponding Study object. Weak reference.
40 const Study* study_;
42 // Computed total group probability for the study.
43 base::FieldTrial::Probability total_probability_;
45 // Whether the study is expired.
46 bool is_expired_;
49 } // namespace chrome_variations
51 #endif // COMPONENTS_VARIATIONS_PROCESSED_STUDY_H_