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 group names like "ProvidersDisabled_NNN" where NNN is |
| 31 // an integer corresponding to a bitmap mask. All extracted bitmaps |
| 32 // are OR-ed together and returned as the final result. |
| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 128 |
121 // Returns whether HistoryQuick provider should allow breaking the | 129 // Returns whether HistoryQuick provider should allow breaking the |
122 // omnibox input string at cursor position. | 130 // omnibox input string at cursor position. |
123 static bool InHQPUseCursorPositionFieldTrialExperimentGroup(); | 131 static bool InHQPUseCursorPositionFieldTrialExperimentGroup(); |
124 | 132 |
125 private: | 133 private: |
126 DISALLOW_IMPLICIT_CONSTRUCTORS(AutocompleteFieldTrial); | 134 DISALLOW_IMPLICIT_CONSTRUCTORS(AutocompleteFieldTrial); |
127 }; | 135 }; |
128 | 136 |
129 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_FIELD_TRIAL_H_ | 137 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_FIELD_TRIAL_H_ |
OLD | NEW |