| 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 #ifndef CHROME_COMMON_METRICS_VARIATIONS_EXPERIMENT_LABELS_H_ | 5 #ifndef CHROME_COMMON_VARIATIONS_EXPERIMENT_LABELS_H_ |
| 6 #define CHROME_COMMON_METRICS_VARIATIONS_EXPERIMENT_LABELS_H_ | 6 #define CHROME_COMMON_VARIATIONS_EXPERIMENT_LABELS_H_ |
| 7 | 7 |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 | 10 |
| 11 namespace chrome_variations { | 11 namespace chrome_variations { |
| 12 | 12 |
| 13 // Takes the list of active groups and builds the label for the ones that have | 13 // Takes the list of active groups and builds the label for the ones that have |
| 14 // Google Update VariationID associated with them. This will return an empty | 14 // Google Update VariationID associated with them. This will return an empty |
| 15 // string if there are no such groups. | 15 // string if there are no such groups. |
| 16 base::string16 BuildGoogleUpdateExperimentLabel( | 16 base::string16 BuildGoogleUpdateExperimentLabel( |
| 17 const base::FieldTrial::ActiveGroups& active_groups); | 17 const base::FieldTrial::ActiveGroups& active_groups); |
| 18 | 18 |
| 19 // Creates a final combined experiment labels string with |variation_labels| | 19 // Creates a final combined experiment labels string with |variation_labels| |
| 20 // and |other_labels|, appropriately appending a separator based on their | 20 // and |other_labels|, appropriately appending a separator based on their |
| 21 // contents. It is assumed that |variation_labels| and |other_labels| do not | 21 // contents. It is assumed that |variation_labels| and |other_labels| do not |
| 22 // have leading or trailing separators. | 22 // have leading or trailing separators. |
| 23 base::string16 CombineExperimentLabels(const base::string16& variation_labels, | 23 base::string16 CombineExperimentLabels(const base::string16& variation_labels, |
| 24 const base::string16& other_labels); | 24 const base::string16& other_labels); |
| 25 | 25 |
| 26 // Takes the value of experiment_labels from the registry and returns a valid | 26 // Takes the value of experiment_labels from the registry and returns a valid |
| 27 // experiment_labels string value containing only the labels that are not | 27 // experiment_labels string value containing only the labels that are not |
| 28 // associated with Chrome Variations. | 28 // associated with Chrome Variations. |
| 29 base::string16 ExtractNonVariationLabels(const base::string16& labels); | 29 base::string16 ExtractNonVariationLabels(const base::string16& labels); |
| 30 | 30 |
| 31 } // namespace chrome_variations | 31 } // namespace chrome_variations |
| 32 | 32 |
| 33 #endif // CHROME_COMMON_METRICS_VARIATIONS_EXPERIMENT_LABELS_H_ | 33 #endif // CHROME_COMMON_VARIATIONS_EXPERIMENT_LABELS_H_ |
| OLD | NEW |