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" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 const Study_Experiment& experiment = study.experiment(i); | 108 const Study_Experiment& experiment = study.experiment(i); |
109 if (experiment.has_forcing_flag() && | 109 if (experiment.has_forcing_flag() && |
110 command_line->HasSwitch(experiment.forcing_flag())) { | 110 command_line->HasSwitch(experiment.forcing_flag())) { |
111 scoped_refptr<base::FieldTrial> trial( | 111 scoped_refptr<base::FieldTrial> trial( |
112 base::FieldTrialList::CreateFieldTrial(study.name(), | 112 base::FieldTrialList::CreateFieldTrial(study.name(), |
113 experiment.name())); | 113 experiment.name())); |
114 // If |trial| is NULL, then there might already be a trial forced to a | 114 // If |trial| is NULL, then there might already be a trial forced to a |
115 // different group (e.g. via --force-fieldtrials). Break out of the loop, | 115 // different group (e.g. via --force-fieldtrials). Break out of the loop, |
116 // but don't return, so that variation ids and params for the selected | 116 // but don't return, so that variation ids and params for the selected |
117 // group will still be picked up. | 117 // group will still be picked up. |
118 if (!trial) | 118 if (!trial.get()) |
119 break; | 119 break; |
120 | 120 |
121 RegisterExperimentParams(study, experiment); | 121 RegisterExperimentParams(study, experiment); |
122 RegisterVariationIds(experiment, study.name()); | 122 RegisterVariationIds(experiment, study.name()); |
123 if (study.activation_type() == Study_ActivationType_ACTIVATION_AUTO) { | 123 if (study.activation_type() == Study_ActivationType_ACTIVATION_AUTO) { |
124 trial->group(); | 124 trial->group(); |
125 // UI Strings can only be overridden from ACTIVATION_AUTO experiments. | 125 // UI Strings can only be overridden from ACTIVATION_AUTO experiments. |
126 ApplyUIStringOverrides(experiment, override_callback); | 126 ApplyUIStringOverrides(experiment, override_callback); |
127 } | 127 } |
128 | 128 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // The field trial was defined from |study|, so the active experiment's name | 187 // The field trial was defined from |study|, so the active experiment's name |
188 // must be in the |study|. | 188 // must be in the |study|. |
189 DCHECK_NE(-1, experiment_index); | 189 DCHECK_NE(-1, experiment_index); |
190 | 190 |
191 ApplyUIStringOverrides(study.experiment(experiment_index), | 191 ApplyUIStringOverrides(study.experiment(experiment_index), |
192 override_callback); | 192 override_callback); |
193 } | 193 } |
194 } | 194 } |
195 | 195 |
196 } // namespace variations | 196 } // namespace variations |
OLD | NEW |