Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: components/variations/variations_seed_processor.cc

Issue 412943002: Move variations component code to variations namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/variations/variations_seed_processor.h ('k') | components/variations/variations_seed_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698