| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ |
| 6 #define COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 // Do not change these values as they need to be in sync with values | 127 // Do not change these values as they need to be in sync with values |
| 128 // specified in experiment configs on the variations server. | 128 // specified in experiment configs on the variations server. |
| 129 enum EmphasizeTitlesCondition { | 129 enum EmphasizeTitlesCondition { |
| 130 EMPHASIZE_WHEN_NONEMPTY = 0, | 130 EMPHASIZE_WHEN_NONEMPTY = 0, |
| 131 EMPHASIZE_WHEN_TITLE_MATCHES = 1, | 131 EMPHASIZE_WHEN_TITLE_MATCHES = 1, |
| 132 EMPHASIZE_WHEN_ONLY_TITLE_MATCHES = 2, | 132 EMPHASIZE_WHEN_ONLY_TITLE_MATCHES = 2, |
| 133 EMPHASIZE_NEVER = 3 | 133 EMPHASIZE_NEVER = 3 |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 struct ContextualZeroSuggest { |
| 137 enum Type { |
| 138 NOT_SET = 0, |
| 139 COOCCURENCE_PAGE = 1, |
| 140 HIVEMIND_URL = 2, |
| 141 LOCAL_STORE_MAP = 3, |
| 142 LOCAL_STORE_WEBPAGE = 4, |
| 143 LOCAL_STORE_RESERVATION = 5, |
| 144 MOVIE_REVIEW = 6, |
| 145 MOVIE_SHOWTIME = 7, |
| 146 ON_THE_NEWS = 8, |
| 147 POPULAR_DOMAINS = 9, |
| 148 SIMILAR_PAGES = 10, |
| 149 TOP_ENTITY_INFO = 11, |
| 150 OTHER = 12, |
| 151 NUM_TYPES, |
| 152 }; |
| 153 |
| 154 // Converts |type| to a string representation. |
| 155 static std::string ToString(const Type& type); |
| 156 |
| 157 // Converts |type| from a string representation to Type. |
| 158 static Type FromString(const std::string& type); |
| 159 |
| 160 // Records the given type to the |
| 161 // ZeroSuggest.ContextualSuggestType.SuggestionProvided histogram. |
| 162 static void RecordTypeAsProvided(const std::string& type); |
| 163 |
| 164 // Records the given type to the |
| 165 // ZeroSuggest.ContextualSuggestType.SuggestionUsed histogram. |
| 166 static void RecordTypeAsUsed(const std::string& type); |
| 167 }; |
| 168 |
| 136 // --------------------------------------------------------- | 169 // --------------------------------------------------------- |
| 137 // For any experiment that's part of the bundled omnibox field trial. | 170 // For any experiment that's part of the bundled omnibox field trial. |
| 138 | 171 |
| 139 // Returns a bitmap containing AutocompleteProvider::Type values | 172 // Returns a bitmap containing AutocompleteProvider::Type values |
| 140 // that should be disabled in AutocompleteController. | 173 // that should be disabled in AutocompleteController. |
| 141 static int GetDisabledProviderTypes(); | 174 static int GetDisabledProviderTypes(); |
| 142 | 175 |
| 143 // Returns whether the user is in any dynamic field trial where the | 176 // Returns whether the user is in any dynamic field trial where the |
| 144 // group has a the prefix |group_prefix|. | 177 // group has a the prefix |group_prefix|. |
| 145 static bool HasDynamicFieldTrialGroupPrefix(const char *group_prefix); | 178 static bool HasDynamicFieldTrialGroupPrefix(const char *group_prefix); |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 // prioritize different wildcard contexts, see the implementation. How to | 541 // prioritize different wildcard contexts, see the implementation. How to |
| 509 // interpret the value is left to the caller; this is rule-dependent. | 542 // interpret the value is left to the caller; this is rule-dependent. |
| 510 static std::string GetValueForRuleInContext( | 543 static std::string GetValueForRuleInContext( |
| 511 const std::string& rule, | 544 const std::string& rule, |
| 512 metrics::OmniboxEventProto::PageClassification page_classification); | 545 metrics::OmniboxEventProto::PageClassification page_classification); |
| 513 | 546 |
| 514 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); | 547 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); |
| 515 }; | 548 }; |
| 516 | 549 |
| 517 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ | 550 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ |
| OLD | NEW |