| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 variation_id); | 47 variation_id); |
| 48 } | 48 } |
| 49 if (experiment.has_google_web_trigger_experiment_id()) { | 49 if (experiment.has_google_web_trigger_experiment_id()) { |
| 50 const VariationID variation_id = | 50 const VariationID variation_id = |
| 51 static_cast<VariationID>(experiment.google_web_trigger_experiment_id()); | 51 static_cast<VariationID>(experiment.google_web_trigger_experiment_id()); |
| 52 AssociateGoogleVariationIDForce(GOOGLE_WEB_PROPERTIES_TRIGGER, | 52 AssociateGoogleVariationIDForce(GOOGLE_WEB_PROPERTIES_TRIGGER, |
| 53 trial_name, | 53 trial_name, |
| 54 experiment.name(), | 54 experiment.name(), |
| 55 variation_id); | 55 variation_id); |
| 56 } | 56 } |
| 57 if (experiment.has_google_update_experiment_id()) { | |
| 58 const VariationID variation_id = | |
| 59 static_cast<VariationID>(experiment.google_update_experiment_id()); | |
| 60 AssociateGoogleVariationIDForce(GOOGLE_UPDATE_SERVICE, | |
| 61 trial_name, | |
| 62 experiment.name(), | |
| 63 variation_id); | |
| 64 } | |
| 65 if (experiment.has_chrome_sync_experiment_id()) { | 57 if (experiment.has_chrome_sync_experiment_id()) { |
| 66 const VariationID variation_id = | 58 const VariationID variation_id = |
| 67 static_cast<VariationID>(experiment.chrome_sync_experiment_id()); | 59 static_cast<VariationID>(experiment.chrome_sync_experiment_id()); |
| 68 AssociateGoogleVariationIDForce(CHROME_SYNC_SERVICE, | 60 AssociateGoogleVariationIDForce(CHROME_SYNC_SERVICE, |
| 69 trial_name, | 61 trial_name, |
| 70 experiment.name(), | 62 experiment.name(), |
| 71 variation_id); | 63 variation_id); |
| 72 } | 64 } |
| 73 } | 65 } |
| 74 | 66 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 CreateTrialFromStudy(filtered_studies[i], override_callback, | 191 CreateTrialFromStudy(filtered_studies[i], override_callback, |
| 200 low_entropy_provider, feature_list); | 192 low_entropy_provider, feature_list); |
| 201 } | 193 } |
| 202 | 194 |
| 203 // static | 195 // static |
| 204 bool VariationsSeedProcessor::ShouldStudyUseLowEntropy(const Study& study) { | 196 bool VariationsSeedProcessor::ShouldStudyUseLowEntropy(const Study& study) { |
| 205 for (int i = 0; i < study.experiment_size(); ++i) { | 197 for (int i = 0; i < study.experiment_size(); ++i) { |
| 206 const Study_Experiment& experiment = study.experiment(i); | 198 const Study_Experiment& experiment = study.experiment(i); |
| 207 if (experiment.has_google_web_experiment_id() || | 199 if (experiment.has_google_web_experiment_id() || |
| 208 experiment.has_google_web_trigger_experiment_id() || | 200 experiment.has_google_web_trigger_experiment_id() || |
| 209 experiment.has_google_update_experiment_id() || | |
| 210 experiment.has_chrome_sync_experiment_id()) { | 201 experiment.has_chrome_sync_experiment_id()) { |
| 211 return true; | 202 return true; |
| 212 } | 203 } |
| 213 } | 204 } |
| 214 return false; | 205 return false; |
| 215 } | 206 } |
| 216 | 207 |
| 217 void VariationsSeedProcessor::CreateTrialFromStudy( | 208 void VariationsSeedProcessor::CreateTrialFromStudy( |
| 218 const ProcessedStudy& processed_study, | 209 const ProcessedStudy& processed_study, |
| 219 const UIStringOverrideCallback& override_callback, | 210 const UIStringOverrideCallback& override_callback, |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 // The field trial was defined from |study|, so the active experiment's name | 323 // The field trial was defined from |study|, so the active experiment's name |
| 333 // must be in the |study|. | 324 // must be in the |study|. |
| 334 DCHECK_NE(-1, experiment_index); | 325 DCHECK_NE(-1, experiment_index); |
| 335 | 326 |
| 336 ApplyUIStringOverrides(study.experiment(experiment_index), | 327 ApplyUIStringOverrides(study.experiment(experiment_index), |
| 337 override_callback); | 328 override_callback); |
| 338 } | 329 } |
| 339 } | 330 } |
| 340 | 331 |
| 341 } // namespace variations | 332 } // namespace variations |
| OLD | NEW |