| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VARIATIONS_UTIL_H_ | 5 #ifndef CHROME_COMMON_METRICS_VARIATIONS_VARIATIONS_UTIL_H_ |
| 6 #define CHROME_COMMON_METRICS_VARIATIONS_VARIATIONS_UTIL_H_ | 6 #define CHROME_COMMON_METRICS_VARIATIONS_VARIATIONS_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // unique string representations of ActiveGroupIds for each Field Trial that | 24 // unique string representations of ActiveGroupIds for each Field Trial that |
| 25 // has a chosen group. The strings are formatted as "<TrialName>-<GroupName>", | 25 // has a chosen group. The strings are formatted as "<TrialName>-<GroupName>", |
| 26 // with the names as hex strings. Field Trials for which a group has not been | 26 // with the names as hex strings. Field Trials for which a group has not been |
| 27 // chosen yet are NOT returned in this list. | 27 // chosen yet are NOT returned in this list. |
| 28 void GetFieldTrialActiveGroupIdsAsStrings(std::vector<std::string>* output); | 28 void GetFieldTrialActiveGroupIdsAsStrings(std::vector<std::string>* output); |
| 29 | 29 |
| 30 // Get the current set of chosen FieldTrial groups (aka variations) and send | 30 // Get the current set of chosen FieldTrial groups (aka variations) and send |
| 31 // them to the child process logging module so it can save it for crash dumps. | 31 // them to the child process logging module so it can save it for crash dumps. |
| 32 void SetChildProcessLoggingVariationList(); | 32 void SetChildProcessLoggingVariationList(); |
| 33 | 33 |
| 34 // Takes the list of active groups and builds the label for the ones that have | |
| 35 // Google Update VariationID associated with them. This will return an empty | |
| 36 // string if there are no such groups. | |
| 37 string16 BuildGoogleUpdateExperimentLabel( | |
| 38 const base::FieldTrial::ActiveGroups& active_groups); | |
| 39 | |
| 40 // Creates a final combined experiment labels string with |variation_labels| | |
| 41 // and |other_labels|, appropriately appending a separator based on their | |
| 42 // contents. It is assumed that |variation_labels| and |other_labels| do not | |
| 43 // have leading or trailing separators. | |
| 44 string16 CombineExperimentLabels(const string16& variation_labels, | |
| 45 const string16& other_labels); | |
| 46 | |
| 47 // Takes the value of experiment_labels from the registry and returns a valid | |
| 48 // experiment_labels string value containing only the labels that are not | |
| 49 // associated with Chrome Variations. | |
| 50 string16 ExtractNonVariationLabels(const string16& labels); | |
| 51 | |
| 52 // Expose some functions for testing. These functions just wrap functionality | 34 // Expose some functions for testing. These functions just wrap functionality |
| 53 // that is implemented above. | 35 // that is implemented above. |
| 54 namespace testing { | 36 namespace testing { |
| 55 | 37 |
| 56 // Clears all of the mapped associations. | 38 // Clears all of the mapped associations. |
| 57 void ClearAllVariationIDs(); | 39 void ClearAllVariationIDs(); |
| 58 | 40 |
| 59 void TestGetFieldTrialActiveGroupIds( | 41 void TestGetFieldTrialActiveGroupIds( |
| 60 const base::FieldTrial::ActiveGroups& active_groups, | 42 const base::FieldTrial::ActiveGroups& active_groups, |
| 61 std::vector<ActiveGroupId>* name_group_ids); | 43 std::vector<ActiveGroupId>* name_group_ids); |
| 62 | 44 |
| 63 } // namespace testing | 45 } // namespace testing |
| 64 | 46 |
| 65 } // namespace chrome_variations | 47 } // namespace chrome_variations |
| 66 | 48 |
| 67 #endif // CHROME_COMMON_METRICS_VARIATIONS_VARIATIONS_UTIL_H_ | 49 #endif // CHROME_COMMON_METRICS_VARIATIONS_VARIATIONS_UTIL_H_ |
| OLD | NEW |