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 #include "chrome/browser/autocomplete/autocomplete_field_trial.h" | 5 #include "chrome/browser/autocomplete/autocomplete_field_trial.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
11 #include "chrome/common/metrics/variations/variation_ids.h" | 11 #include "chrome/common/metrics/variations/variation_ids.h" |
12 #include "chrome/common/metrics/variations/variations_util.h" | 12 #include "chrome/common/metrics/variations/variations_util.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 // Field trial names. | 16 // Field trial names. |
17 static const char kDisallowInlineHQPFieldTrialName[] = | 17 static const char kDisallowInlineHQPFieldTrialName[] = |
18 "OmniboxDisallowInlineHQP"; | 18 "OmniboxDisallowInlineHQP"; |
19 static const char kSuggestFieldTrialName[] = "OmniboxSearchSuggest"; | 19 static const char kSuggestFieldTrialName[] = "OmniboxSearchSuggest"; |
20 static const char kHQPNewScoringFieldTrialName[] = "OmniboxHQPNewScoring"; | 20 static const char kHQPNewScoringFieldTrialName[] = "OmniboxHQPNewScoring"; |
21 | 21 |
22 // Field trial experiment probabilities. | 22 // Field trial experiment probabilities. |
23 | 23 |
24 // For inline History Quick Provider field trial, put 10% ( = 10/100 ) | 24 // For inline History Quick Provider field trial, put 0% ( = 0/100 ) |
25 // of the users in the disallow-inline experiment group. | 25 // of the users in the disallow-inline experiment group. |
26 const base::FieldTrial::Probability kDisallowInlineHQPFieldTrialDivisor = 100; | 26 const base::FieldTrial::Probability kDisallowInlineHQPFieldTrialDivisor = 100; |
27 const base::FieldTrial::Probability | 27 const base::FieldTrial::Probability |
28 kDisallowInlineHQPFieldTrialExperimentFraction = 10; | 28 kDisallowInlineHQPFieldTrialExperimentFraction = 0; |
29 | 29 |
30 // For the search suggestion field trial, divide the people in the | 30 // For the search suggestion field trial, divide the people in the |
31 // trial into 20 equally-sized buckets. The suggest provider backend | 31 // trial into 20 equally-sized buckets. The suggest provider backend |
32 // will decide what behavior (if any) to change based on the group. | 32 // will decide what behavior (if any) to change based on the group. |
33 const int kSuggestFieldTrialNumberOfGroups = 20; | 33 const int kSuggestFieldTrialNumberOfGroups = 20; |
34 | 34 |
35 // For History Quick Provider new scoring field trial, put 25% ( = 25/100 ) | 35 // For History Quick Provider new scoring field trial, put 25% ( = 25/100 ) |
36 // of the users in the new scoring experiment group. | 36 // of the users in the new scoring experiment group. |
37 const base::FieldTrial::Probability kHQPNewScoringFieldTrialDivisor = 100; | 37 const base::FieldTrial::Probability kHQPNewScoringFieldTrialDivisor = 100; |
38 const base::FieldTrial::Probability | 38 const base::FieldTrial::Probability |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 bool AutocompleteFieldTrial::InHQPNewScoringFieldTrialExperimentGroup() { | 158 bool AutocompleteFieldTrial::InHQPNewScoringFieldTrialExperimentGroup() { |
159 if (!InHQPNewScoringFieldTrial()) | 159 if (!InHQPNewScoringFieldTrial()) |
160 return false; | 160 return false; |
161 | 161 |
162 // Return true if we're in the experiment group. | 162 // Return true if we're in the experiment group. |
163 const int group = base::FieldTrialList::FindValue( | 163 const int group = base::FieldTrialList::FindValue( |
164 kHQPNewScoringFieldTrialName); | 164 kHQPNewScoringFieldTrialName); |
165 return group == hqp_new_scoring_experiment_group; | 165 return group == hqp_new_scoring_experiment_group; |
166 } | 166 } |
OLD | NEW |