| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_VARIATIONS_VARIATIONS_SEED_PROCESSOR_H_ | 5 #ifndef COMPONENTS_VARIATIONS_VARIATIONS_SEED_PROCESSOR_H_ |
| 6 #define COMPONENTS_VARIATIONS_VARIATIONS_SEED_PROCESSOR_H_ | 6 #define COMPONENTS_VARIATIONS_VARIATIONS_SEED_PROCESSOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/metrics/field_trial.h" | 14 #include "base/metrics/field_trial.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "base/version.h" | 17 #include "base/version.h" |
| 18 #include "components/variations/proto/study.pb.h" | 18 #include "components/variations/proto/study.pb.h" |
| 19 #include "components/variations/proto/variations_seed.pb.h" | 19 #include "components/variations/proto/variations_seed.pb.h" |
| 20 | 20 |
| 21 namespace chrome_variations { | 21 namespace variations { |
| 22 | 22 |
| 23 class ProcessedStudy; | 23 class ProcessedStudy; |
| 24 | 24 |
| 25 // Helper class to instantiate field trials from a variations seed. | 25 // Helper class to instantiate field trials from a variations seed. |
| 26 class VariationsSeedProcessor { | 26 class VariationsSeedProcessor { |
| 27 public: | 27 public: |
| 28 typedef base::Callback<void(uint32_t, const base::string16&)> | 28 typedef base::Callback<void(uint32_t, const base::string16&)> |
| 29 UIStringOverrideCallback; | 29 UIStringOverrideCallback; |
| 30 | 30 |
| 31 VariationsSeedProcessor(); | 31 VariationsSeedProcessor(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 bool AllowVariationIdWithForcingFlag(const Study& study); | 68 bool AllowVariationIdWithForcingFlag(const Study& study); |
| 69 | 69 |
| 70 // Creates and registers a field trial from the |processed_study| data. | 70 // Creates and registers a field trial from the |processed_study| data. |
| 71 // Disables the trial if |processed_study.is_expired| is true. | 71 // Disables the trial if |processed_study.is_expired| is true. |
| 72 void CreateTrialFromStudy(const ProcessedStudy& processed_study, | 72 void CreateTrialFromStudy(const ProcessedStudy& processed_study, |
| 73 const UIStringOverrideCallback& override_callback); | 73 const UIStringOverrideCallback& override_callback); |
| 74 | 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(VariationsSeedProcessor); | 75 DISALLOW_COPY_AND_ASSIGN(VariationsSeedProcessor); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 } // namespace chrome_variations | 78 } // namespace variations |
| 79 | 79 |
| 80 #endif // COMPONENTS_VARIATIONS_VARIATIONS_SEED_PROCESSOR_H_ | 80 #endif // COMPONENTS_VARIATIONS_VARIATIONS_SEED_PROCESSOR_H_ |
| OLD | NEW |