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_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ | 5 #ifndef CHROME_BROWSER_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ |
6 #define CHROME_BROWSER_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ | 6 #define CHROME_BROWSER_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 // --------------------------------------------------------- | 88 // --------------------------------------------------------- |
89 // For the ZeroSuggestProvider field trial. | 89 // For the ZeroSuggestProvider field trial. |
90 | 90 |
91 // Returns whether the user is in any field trial where the | 91 // Returns whether the user is in any field trial where the |
92 // ZeroSuggestProvider should be used to get suggestions when the | 92 // ZeroSuggestProvider should be used to get suggestions when the |
93 // user clicks on the omnibox but has not typed anything yet. | 93 // user clicks on the omnibox but has not typed anything yet. |
94 static bool InZeroSuggestFieldTrial(); | 94 static bool InZeroSuggestFieldTrial(); |
95 | 95 |
96 // --------------------------------------------------------- | 96 // --------------------------------------------------------- |
97 // For the ShortcutsScoring field trial. | 97 // For the ShortcutsScoringMaxRelevance experiment that's part of the |
| 98 // bundled omnibox field trial. |
98 | 99 |
99 // If the field trial is active and the user is in an experiment | 100 // If the user is in an experiment group that, given the provided |
100 // group, extract from the experiment group name the maximum | 101 // |current_page_classification| context, changes the maximum relevance |
101 // relevance score ShortcutsProvider:: CalculateScore() can return. | 102 // ShortcutsProvider::CalculateScore() is supposed to assign, extract |
102 // Returns true on a successful extraction. If the extraction failed, | 103 // that maximum relevance score and put in in |max_relevance|. Returns |
103 // if the field trial is not active, etc., returns false. | 104 // true on a successful extraction. CalculateScore()'s return value is |
104 // CalculateScore()'s return value is a product of this maximum | 105 // a product of this maximum relevance score and some attenuating factors |
105 // relevance score and some attenuating factors that are all between | 106 // that are all between 0 and 1. (Note that Shortcuts results may have |
106 // 0 and 1. (Note that Shortcuts results may have their scores | 107 // their scores reduced later if the assigned score is higher than allowed |
107 // reduced later if the assigned score is higher than allowed for | 108 // for non-inlineable results. Shortcuts results are not allowed to be |
108 // non-inlineable results. Shortcuts results are not allowed to be | |
109 // inlined.) | 109 // inlined.) |
110 static bool ShortcutsScoringMaxRelevance(int* max_relevance); | 110 static bool ShortcutsScoringMaxRelevance( |
| 111 AutocompleteInput::PageClassification current_page_classification, |
| 112 int* max_relevance); |
111 | 113 |
112 // --------------------------------------------------------- | 114 // --------------------------------------------------------- |
113 // For the SearchHistory experiment that's part of the bundled omnibox | 115 // For the SearchHistory experiment that's part of the bundled omnibox |
114 // field trial. | 116 // field trial. |
115 | 117 |
116 // Returns true if the user is in the experiment group that, given the | 118 // Returns true if the user is in the experiment group that, given the |
117 // provided |current_page_classification| context, scores search history | 119 // provided |current_page_classification| context, scores search history |
118 // query suggestions less aggressively so that they don't inline. | 120 // query suggestions less aggressively so that they don't inline. |
119 static bool SearchHistoryPreventInlining( | 121 static bool SearchHistoryPreventInlining( |
120 AutocompleteInput::PageClassification current_page_classification); | 122 AutocompleteInput::PageClassification current_page_classification); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // prioritize different wildcard contexts, see the implementation. How to | 158 // prioritize different wildcard contexts, see the implementation. How to |
157 // interpret the value is left to the caller; this is rule-dependent. | 159 // interpret the value is left to the caller; this is rule-dependent. |
158 static std::string GetValueForRuleInContext( | 160 static std::string GetValueForRuleInContext( |
159 const std::string& rule, | 161 const std::string& rule, |
160 AutocompleteInput::PageClassification page_classification); | 162 AutocompleteInput::PageClassification page_classification); |
161 | 163 |
162 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); | 164 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); |
163 }; | 165 }; |
164 | 166 |
165 #endif // CHROME_BROWSER_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ | 167 #endif // CHROME_BROWSER_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ |
OLD | NEW |