| 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 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // get ingrained, users tend to learn that a particular suggestion is | 49 // get ingrained, users tend to learn that a particular suggestion is |
| 50 // at a particular spot in the drop-down--we're going to make these | 50 // at a particular spot in the drop-down--we're going to make these |
| 51 // field trials sticky. We want users to stay in them once assigned | 51 // field trials sticky. We want users to stay in them once assigned |
| 52 // so they have a better experience and also so we don't get weird | 52 // so they have a better experience and also so we don't get weird |
| 53 // effects as omnibox ranking keeps changing and users learn they can't | 53 // effects as omnibox ranking keeps changing and users learn they can't |
| 54 // trust the omnibox. Hence, to create the field trials we require | 54 // trust the omnibox. Hence, to create the field trials we require |
| 55 // that field trials can be made sticky. | 55 // that field trials can be made sticky. |
| 56 if (base::FieldTrialList::IsOneTimeRandomizationEnabled()) { // sticky trials | 56 if (base::FieldTrialList::IsOneTimeRandomizationEnabled()) { // sticky trials |
| 57 // Create aggressive History URL Provider field trial. | 57 // Create aggressive History URL Provider field trial. |
| 58 // Make it expire on August 1, 2012. | 58 // Make it expire on August 1, 2012. |
| 59 scoped_refptr<base::FieldTrial> trial(new base::FieldTrial( | 59 scoped_refptr<base::FieldTrial> trial(base::FieldTrial::CreateInstance( |
| 60 kAggressiveHUPFieldTrialName, kAggressiveHUPFieldTrialDivisor, | 60 kAggressiveHUPFieldTrialName, kAggressiveHUPFieldTrialDivisor, |
| 61 "Standard", 2012, 8, 1)); | 61 "Standard", 2012, 8, 1)); |
| 62 trial->UseOneTimeRandomization(); | 62 trial->UseOneTimeRandomization(); |
| 63 aggressive_hup_experiment_group = trial->AppendGroup("Aggressive", | 63 aggressive_hup_experiment_group = trial->AppendGroup("Aggressive", |
| 64 kAggressiveHUPFieldTrialExperimentFraction); | 64 kAggressiveHUPFieldTrialExperimentFraction); |
| 65 | 65 |
| 66 // Create inline History Quick Provider field trial. | 66 // Create inline History Quick Provider field trial. |
| 67 // Make it expire on November 8, 2012. | 67 // Make it expire on November 8, 2012. |
| 68 trial = new base::FieldTrial( | 68 trial = base::FieldTrial::CreateInstance( |
| 69 kDisallowInlineHQPFieldTrialName, kDisallowInlineHQPFieldTrialDivisor, | 69 kDisallowInlineHQPFieldTrialName, kDisallowInlineHQPFieldTrialDivisor, |
| 70 "Standard", 2012, 11, 8); | 70 "Standard", 2012, 11, 8); |
| 71 trial->UseOneTimeRandomization(); | 71 trial->UseOneTimeRandomization(); |
| 72 disallow_inline_hqp_experiment_group = trial->AppendGroup("DisallowInline", | 72 disallow_inline_hqp_experiment_group = trial->AppendGroup("DisallowInline", |
| 73 kDisallowInlineHQPFieldTrialExperimentFraction); | 73 kDisallowInlineHQPFieldTrialExperimentFraction); |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 | 76 |
| 77 bool AutocompleteFieldTrial::InAggressiveHUPFieldTrial() { | 77 bool AutocompleteFieldTrial::InAggressiveHUPFieldTrial() { |
| 78 return base::FieldTrialList::TrialExists(kAggressiveHUPFieldTrialName); | 78 return base::FieldTrialList::TrialExists(kAggressiveHUPFieldTrialName); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 94 | 94 |
| 95 bool AutocompleteFieldTrial::InDisallowInlineHQPFieldTrialExperimentGroup() { | 95 bool AutocompleteFieldTrial::InDisallowInlineHQPFieldTrialExperimentGroup() { |
| 96 if (!base::FieldTrialList::TrialExists(kDisallowInlineHQPFieldTrialName)) | 96 if (!base::FieldTrialList::TrialExists(kDisallowInlineHQPFieldTrialName)) |
| 97 return false; | 97 return false; |
| 98 | 98 |
| 99 // Return true if we're in the experiment group. | 99 // Return true if we're in the experiment group. |
| 100 const int group = base::FieldTrialList::FindValue( | 100 const int group = base::FieldTrialList::FindValue( |
| 101 kDisallowInlineHQPFieldTrialName); | 101 kDisallowInlineHQPFieldTrialName); |
| 102 return group == disallow_inline_hqp_experiment_group; | 102 return group == disallow_inline_hqp_experiment_group; |
| 103 } | 103 } |
| OLD | NEW |