Chromium Code Reviews| 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_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_FIELD_TRIAL_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_FIELD_TRIAL_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_FIELD_TRIAL_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_FIELD_TRIAL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 | 11 |
| 12 // This class manages the Autocomplete field trials. | 12 // This class manages the Autocomplete field trials. |
| 13 class AutocompleteFieldTrial { | 13 class AutocompleteFieldTrial { |
| 14 public: | 14 public: |
| 15 // Creates the static field trial groups. | 15 // Creates the static field trial groups. |
| 16 // *** MUST NOT BE CALLED MORE THAN ONCE. *** | 16 // *** MUST NOT BE CALLED MORE THAN ONCE. *** |
| 17 static void ActivateStaticTrials(); | 17 static void ActivateStaticTrials(); |
| 18 | 18 |
| 19 // Activates all dynamic field trials. The main difference between | 19 // Activates all dynamic field trials. The main difference between |
| 20 // the autocomplete dynamic and static field trials is that the former | 20 // the autocomplete dynamic and static field trials is that the former |
| 21 // don't require any code changes on the Chrome side as they are controlled | 21 // don't require any code changes on the Chrome side as they are controlled |
| 22 // on the server side. Chrome binary simply propagates all necessary | 22 // on the server side. Chrome binary simply propagates all necessary |
| 23 // information through the X-Chrome-Variations header. | 23 // information through the X-Chrome-Variations header. |
| 24 // This method, unlike ActivateStaticTrials(), may be called multiple times. | 24 // This method, unlike ActivateStaticTrials(), may be called multiple times. |
| 25 static void ActivateDynamicTrials(); | 25 static void ActivateDynamicTrials(); |
| 26 | 26 |
| 27 // Returns a bitmap containing AutocompleteProvider::Type values | |
| 28 // that should be disabled in AutocompleteController. | |
| 29 // This method simply goes over all autocomplete dynamic field trial groups | |
| 30 // and looks for "ProvidersDisabled_NNN" substring in the group name | |
| 31 // (NNN is an integer corresponding to a bitmap mask). The final result is | |
| 32 // all found bitmap masks OR-ed together. | |
|
Mark P
2013/02/11 21:13:34
"all found". ick.
please rephrase
Bart N.
2013/02/11 21:42:12
Ooops. Fixed.
| |
| 33 static int GetDisabledProviderTypes(); | |
| 34 | |
| 27 // --------------------------------------------------------- | 35 // --------------------------------------------------------- |
| 28 // For the inline History Quick Provider field trial. | 36 // For the inline History Quick Provider field trial. |
| 29 | 37 |
| 30 // Returns whether the user is in any field trial group for this | 38 // Returns whether the user is in any field trial group for this |
| 31 // field trial. False indicates that the field trial wasn't | 39 // field trial. False indicates that the field trial wasn't |
| 32 // successfully created for some reason. | 40 // successfully created for some reason. |
| 33 static bool InDisallowInlineHQPFieldTrial(); | 41 static bool InDisallowInlineHQPFieldTrial(); |
| 34 | 42 |
| 35 // Returns whether the user should get the experiment setup or | 43 // Returns whether the user should get the experiment setup or |
| 36 // the default setup for this field trial. The experiment | 44 // the default setup for this field trial. The experiment |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 | 117 |
| 110 // Returns whether we should ignore all mid-word matches in | 118 // Returns whether we should ignore all mid-word matches in |
| 111 // HistoryQuick provider. | 119 // HistoryQuick provider. |
| 112 static bool InHQPOnlyCountMatchesAtWordBoundariesFieldTrialExperimentGroup(); | 120 static bool InHQPOnlyCountMatchesAtWordBoundariesFieldTrialExperimentGroup(); |
| 113 | 121 |
| 114 private: | 122 private: |
| 115 DISALLOW_IMPLICIT_CONSTRUCTORS(AutocompleteFieldTrial); | 123 DISALLOW_IMPLICIT_CONSTRUCTORS(AutocompleteFieldTrial); |
| 116 }; | 124 }; |
| 117 | 125 |
| 118 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_FIELD_TRIAL_H_ | 126 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_FIELD_TRIAL_H_ |
| OLD | NEW |