| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 RegisterVariationIds(experiment, study.name()); | 274 RegisterVariationIds(experiment, study.name()); |
| 275 | 275 |
| 276 has_overrides = has_overrides || experiment.override_ui_string_size() > 0; | 276 has_overrides = has_overrides || experiment.override_ui_string_size() > 0; |
| 277 if (experiment.feature_association().enable_feature_size() != 0 || | 277 if (experiment.feature_association().enable_feature_size() != 0 || |
| 278 experiment.feature_association().disable_feature_size() != 0) { | 278 experiment.feature_association().disable_feature_size() != 0) { |
| 279 enables_or_disables_features = true; | 279 enables_or_disables_features = true; |
| 280 } | 280 } |
| 281 } | 281 } |
| 282 | 282 |
| 283 trial->SetForced(); | 283 trial->SetForced(); |
| 284 if (processed_study.is_expired()) |
| 285 trial->Disable(); |
| 284 | 286 |
| 285 if (enables_or_disables_features) | 287 if (enables_or_disables_features) |
| 286 RegisterFeatureOverrides(processed_study, trial.get(), feature_list); | 288 RegisterFeatureOverrides(processed_study, trial.get(), feature_list); |
| 287 | 289 |
| 288 if (processed_study.is_expired()) { | 290 if (study.activation_type() == Study_ActivationType_ACTIVATION_AUTO) { |
| 289 trial->Disable(); | |
| 290 } else if (study.activation_type() == Study_ActivationType_ACTIVATION_AUTO) { | |
| 291 const std::string& group_name = trial->group_name(); | 291 const std::string& group_name = trial->group_name(); |
| 292 | 292 |
| 293 // Don't try to apply overrides if none of the experiments in this study had | 293 // Don't try to apply overrides if none of the experiments in this study had |
| 294 // any. | 294 // any. |
| 295 if (!has_overrides) | 295 if (!has_overrides) |
| 296 return; | 296 return; |
| 297 | 297 |
| 298 // UI Strings can only be overridden from ACTIVATION_AUTO experiments. | 298 // UI Strings can only be overridden from ACTIVATION_AUTO experiments. |
| 299 int experiment_index = processed_study.GetExperimentIndexByName(group_name); | 299 int experiment_index = processed_study.GetExperimentIndexByName(group_name); |
| 300 | 300 |
| 301 // The field trial was defined from |study|, so the active experiment's name | 301 // The field trial was defined from |study|, so the active experiment's name |
| 302 // must be in the |study|. | 302 // must be in the |study|. |
| 303 DCHECK_NE(-1, experiment_index); | 303 DCHECK_NE(-1, experiment_index); |
| 304 | 304 |
| 305 ApplyUIStringOverrides(study.experiment(experiment_index), | 305 ApplyUIStringOverrides(study.experiment(experiment_index), |
| 306 override_callback); | 306 override_callback); |
| 307 } | 307 } |
| 308 } | 308 } |
| 309 | 309 |
| 310 } // namespace variations | 310 } // namespace variations |
| OLD | NEW |