| 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 #include "components/variations/variations_seed_processor.h" | 5 #include "components/variations/variations_seed_processor.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "components/variations/processed_study.h" | 13 #include "components/variations/processed_study.h" |
| 14 #include "components/variations/study_filtering.h" | 14 #include "components/variations/study_filtering.h" |
| 15 #include "components/variations/variations_associated_data.h" | 15 #include "components/variations/variations_associated_data.h" |
| 16 | 16 |
| 17 namespace chrome_variations { | 17 namespace variations { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // Associates the variations params of |experiment|, if present. | 21 // Associates the variations params of |experiment|, if present. |
| 22 void RegisterExperimentParams(const Study& study, | 22 void RegisterExperimentParams(const Study& study, |
| 23 const Study_Experiment& experiment) { | 23 const Study_Experiment& experiment) { |
| 24 std::map<std::string, std::string> params; | 24 std::map<std::string, std::string> params; |
| 25 for (int i = 0; i < experiment.param_size(); ++i) { | 25 for (int i = 0; i < experiment.param_size(); ++i) { |
| 26 if (experiment.param(i).has_name() && experiment.param(i).has_value()) | 26 if (experiment.param(i).has_name() && experiment.param(i).has_value()) |
| 27 params[experiment.param(i).name()] = experiment.param(i).value(); | 27 params[experiment.param(i).name()] = experiment.param(i).value(); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 // The field trial was defined from |study|, so the active experiment's name | 180 // The field trial was defined from |study|, so the active experiment's name |
| 181 // must be in the |study|. | 181 // must be in the |study|. |
| 182 DCHECK_NE(-1, experiment_index); | 182 DCHECK_NE(-1, experiment_index); |
| 183 | 183 |
| 184 ApplyUIStringOverrides(study.experiment(experiment_index), | 184 ApplyUIStringOverrides(study.experiment(experiment_index), |
| 185 override_callback); | 185 override_callback); |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 | 188 |
| 189 } // namespace chrome_variations | 189 } // namespace variations |
| OLD | NEW |