Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "components/omnibox/common/omnibox_features.h" |
| 6 | |
manuk | c32a8eff | 2019-07-02 15:48:30 | [diff] [blame] | 7 | #include "build/build_config.h" |
| 8 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 9 | namespace omnibox { |
| 10 | |
manuk | 06717f9 | 2020-05-29 15:38:47 | [diff] [blame^] | 11 | const auto enabled_by_default_desktop_only = |
| 12 | #if defined(OS_ANDROID) || defined(OS_IOS) |
| 13 | base::FEATURE_DISABLED_BY_DEFAULT |
| 14 | #else |
| 15 | base::FEATURE_ENABLED_BY_DEFAULT |
| 16 | #endif |
| 17 | ; |
| 18 | |
Tomasz Wiszkowski | 8a0e0dc4 | 2020-02-19 00:06:37 | [diff] [blame] | 19 | // Allows Omnibox to dynamically adjust number of offered suggestions to fill in |
| 20 | // the space between Omnibox an the soft keyboard. The number of suggestions |
| 21 | // shown will be no less than minimum for the platform (eg. 5 for Android). |
| 22 | const base::Feature kAdaptiveSuggestionsCount{ |
| 23 | "OmniboxAdaptiveSuggestionsCount", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 24 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 25 | // Feature used to hide the scheme from steady state URLs displayed in the |
| 26 | // toolbar. It is restored during editing. |
manuk | 06717f9 | 2020-05-29 15:38:47 | [diff] [blame^] | 27 | const base::Feature kHideFileUrlScheme{ |
| 28 | "OmniboxUIExperimentHideFileUrlScheme", |
| 29 | // Android and iOS don't have the File security chip, and therefore still |
| 30 | // need to show the file scheme. |
| 31 | enabled_by_default_desktop_only}; |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 32 | |
| 33 | // Feature used to hide the scheme from steady state URLs displayed in the |
| 34 | // toolbar. It is restored during editing. |
Tommy C. Li | 7514ba8 | 2019-06-25 19:43:53 | [diff] [blame] | 35 | const base::Feature kHideSteadyStateUrlScheme{ |
| 36 | "OmniboxUIExperimentHideSteadyStateUrlScheme", |
| 37 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 38 | |
| 39 | // Feature used to hide trivial subdomains from steady state URLs displayed in |
| 40 | // the toolbar. It is restored during editing. |
Tommy C. Li | 7514ba8 | 2019-06-25 19:43:53 | [diff] [blame] | 41 | const base::Feature kHideSteadyStateUrlTrivialSubdomains{ |
| 42 | "OmniboxUIExperimentHideSteadyStateUrlTrivialSubdomains", |
| 43 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 44 | |
| 45 | // Feature used to hide the path, query and ref from steady state URLs |
| 46 | // displayed in the toolbar. It is restored during editing. |
| 47 | const base::Feature kHideSteadyStateUrlPathQueryAndRef { |
| 48 | "OmniboxUIExperimentHideSteadyStateUrlPathQueryAndRef", |
| 49 | #if defined(OS_IOS) |
| 50 | base::FEATURE_ENABLED_BY_DEFAULT |
| 51 | #else |
| 52 | base::FEATURE_DISABLED_BY_DEFAULT |
| 53 | #endif |
| 54 | }; |
| 55 | |
manuk | addd3c4 | 2019-04-09 21:20:59 | [diff] [blame] | 56 | // Feature used to enable local entity suggestions. Similar to rich entities but |
| 57 | // but location specific. E.g., typing 'starbucks near' could display the local |
| 58 | // entity suggestion 'starbucks near disneyland \n starbucks * Anaheim, CA'. |
| 59 | const base::Feature kOmniboxLocalEntitySuggestions{ |
| 60 | "OmniboxLocalEntitySuggestions", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 61 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 62 | // Feature used to enable swapping the rows on answers. |
| 63 | const base::Feature kOmniboxReverseAnswers{"OmniboxReverseAnswers", |
| 64 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 65 | |
Kevin Bailey | 7d918b9 | 2019-05-02 16:00:14 | [diff] [blame] | 66 | // Feature used to enable matching short words to bookmarks for suggestions. |
| 67 | const base::Feature kOmniboxShortBookmarkSuggestions{ |
| 68 | "OmniboxShortBookmarkSuggestions", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 69 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 70 | // Feature used to force on the experiment of transmission of tail suggestions |
| 71 | // from GWS to this client, currently testing for desktop. |
| 72 | const base::Feature kOmniboxTailSuggestions{ |
| 73 | "OmniboxTailSuggestions", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 74 | |
Kevin Bailey | 37bbf1d | 2019-08-21 19:23:55 | [diff] [blame] | 75 | // Feature that enables the tab-switch suggestions corresponding to an open |
| 76 | // tab, for a button or dedicated suggestion. Enabled by default on Desktop |
| 77 | // and iOS. |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 78 | const base::Feature kOmniboxTabSwitchSuggestions{ |
| 79 | "OmniboxTabSwitchSuggestions", |
Stepan Khapugin | b0980166 | 2019-05-07 10:17:04 | [diff] [blame] | 80 | #if defined(OS_ANDROID) |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 81 | base::FEATURE_DISABLED_BY_DEFAULT |
| 82 | #else |
| 83 | base::FEATURE_ENABLED_BY_DEFAULT |
| 84 | #endif |
| 85 | }; |
| 86 | |
Kevin Bailey | 37bbf1d | 2019-08-21 19:23:55 | [diff] [blame] | 87 | // Feature that enables tab-switch suggestions in their own row. |
| 88 | const base::Feature kOmniboxTabSwitchSuggestionsDedicatedRow{ |
| 89 | "OmniboxTabSwitchSuggestionsDedicatedRow", |
| 90 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 91 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 92 | // Feature used to enable various experiments on keyword mode, UI and |
| 93 | // suggestions. |
| 94 | const base::Feature kExperimentalKeywordMode{"OmniboxExperimentalKeywordMode", |
| 95 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 96 | |
| 97 | // Feature used to enable Pedal suggestions. |
| 98 | const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions", |
| 99 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 100 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 101 | // Feature to enable clipboard provider to suggest searching for copied images. |
| 102 | const base::Feature kEnableClipboardProviderImageSuggestions{ |
Robbie Gibson | 85cef318 | 2019-07-21 15:10:29 | [diff] [blame] | 103 | "OmniboxEnableClipboardProviderImageSuggestions", |
| 104 | #if defined(OS_IOS) |
| 105 | base::FEATURE_ENABLED_BY_DEFAULT |
| 106 | #else |
| 107 | base::FEATURE_DISABLED_BY_DEFAULT |
| 108 | #endif |
| 109 | }; |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 110 | |
| 111 | // Feature to enable the search provider to send a request to the suggest |
| 112 | // server on focus. This allows the suggest server to warm up, by, for |
| 113 | // example, loading per-user models into memory. Having a per-user model |
| 114 | // in memory allows the suggest server to respond more quickly with |
| 115 | // personalized suggestions as the user types. |
| 116 | const base::Feature kSearchProviderWarmUpOnFocus{ |
| 117 | "OmniboxWarmUpSearchProviderOnFocus", |
| 118 | #if defined(OS_IOS) |
| 119 | base::FEATURE_DISABLED_BY_DEFAULT |
| 120 | #else |
| 121 | base::FEATURE_ENABLED_BY_DEFAULT |
| 122 | #endif |
| 123 | }; |
| 124 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 125 | // Feature used to display the title of the current URL match. |
| 126 | const base::Feature kDisplayTitleForCurrentUrl{ |
| 127 | "OmniboxDisplayTitleForCurrentUrl", |
| 128 | #if !defined(OS_IOS) |
| 129 | base::FEATURE_ENABLED_BY_DEFAULT |
| 130 | #else |
| 131 | base::FEATURE_DISABLED_BY_DEFAULT |
| 132 | #endif |
| 133 | }; |
| 134 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 135 | // Feature used to display the search terms instead of the URL in the Omnibox |
| 136 | // when the user is on the search results page of the default search provider. |
| 137 | const base::Feature kQueryInOmnibox{"QueryInOmnibox", |
| 138 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 139 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 140 | // Feature used to always swap the title and URL. |
| 141 | const base::Feature kUIExperimentSwapTitleAndUrl{ |
| 142 | "OmniboxUIExperimentSwapTitleAndUrl", |
| 143 | #if defined(OS_IOS) || defined(OS_ANDROID) |
| 144 | base::FEATURE_DISABLED_BY_DEFAULT |
| 145 | #else |
| 146 | base::FEATURE_ENABLED_BY_DEFAULT |
| 147 | #endif |
| 148 | }; |
| 149 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 150 | // Feature used to enable speculatively starting a service worker associated |
| 151 | // with the destination of the default match when the user's input looks like a |
| 152 | // query. |
| 153 | const base::Feature kSpeculativeServiceWorkerStartOnQueryInput{ |
| 154 | "OmniboxSpeculativeServiceWorkerStartOnQueryInput", |
| 155 | base::FEATURE_ENABLED_BY_DEFAULT |
| 156 | }; |
| 157 | |
| 158 | // Feature used to fetch document suggestions. |
| 159 | const base::Feature kDocumentProvider{"OmniboxDocumentProvider", |
| 160 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 161 | |
manuk | 4542e23 | 2019-09-11 19:27:35 | [diff] [blame] | 162 | // Feature used to autocomplete bookmark, history, and document suggestions when |
| 163 | // the user input is a prefix of their titles, as opposed to their URLs. |
| 164 | const base::Feature kAutocompleteTitles{"OmniboxAutocompleteTitles", |
| 165 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 166 | |
Patrick Noland | 2b4968b | 2019-06-27 14:50:26 | [diff] [blame] | 167 | // Returns whether IsInstantExtendedAPIEnabled should be ignored when deciding |
| 168 | // the number of Google-provided search suggestions. |
| 169 | const base::Feature kOmniboxDisableInstantExtendedLimit{ |
Ender | 0c8b5b4 | 2020-05-26 22:52:51 | [diff] [blame] | 170 | "OmniboxDisableInstantExtendedLimit", |
| 171 | #if defined(OS_ANDROID) |
| 172 | base::FEATURE_ENABLED_BY_DEFAULT |
| 173 | #else |
| 174 | base::FEATURE_DISABLED_BY_DEFAULT |
| 175 | #endif |
| 176 | }; |
Patrick Noland | 2b4968b | 2019-06-27 14:50:26 | [diff] [blame] | 177 | |
Brandon Wylie | f8dd4e8 | 2019-07-11 16:39:57 | [diff] [blame] | 178 | // Show the search engine logo in the omnibox on Android (desktop already does |
| 179 | // this). |
| 180 | const base::Feature kOmniboxSearchEngineLogo{"OmniboxSearchEngineLogo", |
| 181 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 182 | |
manuk | bf3c8ab | 2019-10-24 16:52:08 | [diff] [blame] | 183 | // Feature used to allow users to remove suggestions from clipboard. |
| 184 | const base::Feature kOmniboxRemoveSuggestionsFromClipboard{ |
Gang Wu | 8f97836 | 2020-05-05 17:53:03 | [diff] [blame] | 185 | "OmniboxRemoveSuggestionsFromClipboard", |
| 186 | #if defined(OS_ANDROID) |
| 187 | base::FEATURE_ENABLED_BY_DEFAULT |
| 188 | #else |
| 189 | base::FEATURE_DISABLED_BY_DEFAULT |
| 190 | #endif |
| 191 | }; |
manuk | bf3c8ab | 2019-10-24 16:52:08 | [diff] [blame] | 192 | |
manuk | bf3c8ab | 2019-10-24 16:52:08 | [diff] [blame] | 193 | // Feature to debounce drive requests from the document provider. |
| 194 | const base::Feature kDebounceDocumentProvider{ |
| 195 | "OmniboxDebounceDocumentProvider", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 196 | |
Tommy Li | 6390ecc | 2019-09-06 21:08:57 | [diff] [blame] | 197 | // Preserves the default match against change when providers return results |
| 198 | // asynchronously. This prevents the default match from changing after the user |
| 199 | // finishes typing. Without this feature, if the default match is updated right |
| 200 | // when the user presses Enter, the user may go to a surprising destination. |
| 201 | const base::Feature kOmniboxPreserveDefaultMatchAgainstAsyncUpdate{ |
| 202 | "OmniboxPreserveDefaultMatchAgainstAsyncUpdate", |
Tommy Li | 2b9db03 | 2020-03-02 22:12:14 | [diff] [blame] | 203 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Tommy Li | 6390ecc | 2019-09-06 21:08:57 | [diff] [blame] | 204 | |
manuk | 7b89f664 | 2019-11-08 19:25:24 | [diff] [blame] | 205 | // Demotes the relevance scores when comparing suggestions based on the |
| 206 | // suggestion's |AutocompleteMatchType| and the user's |PageClassification|. |
| 207 | // This feature's main job is to contain the DemoteByType parameter. |
| 208 | const base::Feature kOmniboxDemoteByType{"OmniboxDemoteByType", |
| 209 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 210 | |
Justin Donnelly | 477e35e | 2020-04-02 14:40:00 | [diff] [blame] | 211 | // A special flag, enabled by default, that can be used to disable all new |
| 212 | // search features (e.g. zero suggest). |
| 213 | const base::Feature kNewSearchFeatures{"OmniboxNewSearchFeatures", |
| 214 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 215 | |
manuk | 89d7398 | 2020-05-12 01:17:34 | [diff] [blame] | 216 | // Feature used to cap max zero suggestions shown according to the param |
| 217 | // OmniboxMaxZeroSuggestMatches. If omitted, |
| 218 | // OmniboxUIExperimentMaxAutocompleteMatches will be used instead. If present, |
| 219 | // OmniboxMaxZeroSuggestMatches will override |
| 220 | // OmniboxUIExperimentMaxAutocompleteMatches when |from_omnibox_focus| is true. |
| 221 | const base::Feature kMaxZeroSuggestMatches{"OmniboxMaxZeroSuggestMatches", |
| 222 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 223 | |
manuk | 89d7398 | 2020-05-12 01:17:34 | [diff] [blame] | 224 | // Feature used to cap max suggestions shown according to the params |
| 225 | // UIMaxAutocompleteMatches and UIMaxAutocompleteMatchesByProvider. |
| 226 | const base::Feature kUIExperimentMaxAutocompleteMatches{ |
| 227 | "OmniboxUIExperimentMaxAutocompleteMatches", |
| 228 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 229 | |
Justin Donnelly | 444aa06 | 2020-05-14 23:27:20 | [diff] [blame] | 230 | // Feature used to cap the number of URL-type matches shown within the |
| 231 | // Omnibox. If enabled, the number of URL-type matches is limited (unless |
| 232 | // there are no more non-URL matches available.) If enabled, there is a |
| 233 | // companion parameter - OmniboxMaxURLMatches - which specifies the maximum |
| 234 | // desired number of URL-type matches. |
| 235 | const bool kOmniboxMaxURLMatchesEnabledByDefault = |
| 236 | #if defined(OS_IOS) || defined(OS_ANDROID) |
| 237 | false; |
| 238 | #else |
| 239 | true; |
| 240 | #endif |
| 241 | const base::Feature kOmniboxMaxURLMatches{ |
| 242 | "OmniboxMaxURLMatches", kOmniboxMaxURLMatchesEnabledByDefault |
| 243 | ? base::FEATURE_ENABLED_BY_DEFAULT |
| 244 | : base::FEATURE_DISABLED_BY_DEFAULT}; |
| 245 | |
Tommy Li | b4b3bb5b | 2020-05-01 02:34:56 | [diff] [blame] | 246 | // Feature that configures ZeroSuggestProvider using the "ZeroSuggestVariant" |
| 247 | // per-page-classification parameter. |
Tommy Li | 5578402 | 2020-04-28 20:58:18 | [diff] [blame] | 248 | // |
Tommy Li | b4b3bb5b | 2020-05-01 02:34:56 | [diff] [blame] | 249 | // Generally speaking - do NOT use this for future server-side experiments. |
| 250 | // Instead, create your a new narrowly scoped base::Feature for each experiment. |
| 251 | // |
| 252 | // Because our Field Trial system can only configure this base::Feature in a |
| 253 | // single study, and does not merge parameters, using this creates conflicts. |
Tommy C. Li | 09010551 | 2019-05-16 22:00:56 | [diff] [blame] | 254 | const base::Feature kOnFocusSuggestions{"OmniboxOnFocusSuggestions", |
| 255 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 256 | |
Tommy Li | 5578402 | 2020-04-28 20:58:18 | [diff] [blame] | 257 | // Enables on-focus suggestions on the Open Web, that are contextual to the |
| 258 | // current URL. Will only work if user is signed-in and syncing, or is |
| 259 | // otherwise eligible to send the current page URL to the suggest server. |
| 260 | const base::Feature kOnFocusSuggestionsContextualWeb{ |
| 261 | "OmniboxOnFocusSuggestionsContextualWeb", |
| 262 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 263 | |
Tommy Li | b4b3bb5b | 2020-05-01 02:34:56 | [diff] [blame] | 264 | // Enables Proactive ZeroSuggestions (PZPS) on the NTP, for the Omnibox and |
| 265 | // Realbox respectively. Note: enabling this feature merely makes |
| 266 | // ZeroSuggestProvider send the request. There are additional requirements, |
| 267 | // like the user being signed-in, and the suggest server having PZPS enabled. |
| 268 | const base::Feature kProactiveZeroSuggestionsOnNTPOmnibox{ |
| 269 | "OmniboxProactiveZeroSuggestionsOnNTPOmnibox", |
| 270 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 271 | const base::Feature kProactiveZeroSuggestionsOnNTPRealbox{ |
| 272 | "OmniboxProactiveZeroSuggestionsOnNTPRealbox", |
| 273 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 274 | |
Tomasz Wiszkowski | 947f6d0d | 2019-03-15 22:27:25 | [diff] [blame] | 275 | // Allow suggestions to be shown to the user on the New Tab Page upon focusing |
| 276 | // URL bar (the omnibox). |
| 277 | const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP", |
| 278 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 279 | |
Moe Ahmadi | 4005ec9 | 2019-09-09 16:55:53 | [diff] [blame] | 280 | // Allow suggestions to be shown to the user on the New Tab Page upon focusing |
| 281 | // the real search box. |
| 282 | const base::Feature kZeroSuggestionsOnNTPRealbox{ |
| 283 | "OmniboxZeroSuggestionsOnNTPRealbox", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 284 | |
Tommy Li | 1d03b9bf | 2019-09-23 23:46:34 | [diff] [blame] | 285 | // Allow on-focus query refinements to be shown on the default SERP. |
| 286 | const base::Feature kZeroSuggestionsOnSERP{"OmniboxZeroSuggestionsOnSERP", |
| 287 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 288 | |
Ce Chen | c8d803a | 2020-04-27 09:31:33 | [diff] [blame] | 289 | // Features to provide non personalized head search suggestion from a compact |
| 290 | // on device model. More specifically, feature name with suffix Incognito / |
| 291 | // NonIncognito will only controls behaviors under incognito / non-incognito |
| 292 | // mode respectively. |
| 293 | const base::Feature kOnDeviceHeadProviderIncognito{ |
| 294 | "OmniboxOnDeviceHeadProviderIncognito", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 295 | const base::Feature kOnDeviceHeadProviderNonIncognito{ |
| 296 | "OmniboxOnDeviceHeadProviderNonIncognito", |
| 297 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 298 | |
Justin Donnelly | f270348 | 2019-10-24 21:42:15 | [diff] [blame] | 299 | // If enabled, changes the way Google-provided search suggestions are scored by |
| 300 | // the backend. Note that this Feature is only used for triggering a server- |
| 301 | // side experiment config that will send experiment IDs to the backend. It is |
| 302 | // not referred to in any of the Chromium code. |
| 303 | const base::Feature kOmniboxExperimentalSuggestScoring{ |
| 304 | "OmniboxExperimentalSuggestScoring", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 305 | |
manukh | 3bb80c9 | 2020-01-22 00:19:46 | [diff] [blame] | 306 | // If disabled, terms with no wordstart matches disqualify the suggestion unless |
| 307 | // they occur in the URL host. If enabled, terms with no wordstart matches are |
| 308 | // allowed but not scored. E.g., both inputs 'java script' and 'java cript' will |
| 309 | // match a suggestion titled 'javascript' and score equivalently. |
manukh | 5ff0f58 | 2020-01-14 03:54:13 | [diff] [blame] | 310 | const base::Feature kHistoryQuickProviderAllowButDoNotScoreMidwordTerms{ |
| 311 | "OmniboxHistoryQuickProviderAllowButDoNotScoreMidwordTerms", |
manuk | 06717f9 | 2020-05-29 15:38:47 | [diff] [blame^] | 312 | enabled_by_default_desktop_only}; |
manukh | 5ff0f58 | 2020-01-14 03:54:13 | [diff] [blame] | 313 | |
manukh | 3bb80c9 | 2020-01-22 00:19:46 | [diff] [blame] | 314 | // If disabled, midword matches are ignored except in the URL host, and input |
| 315 | // terms with no wordstart matches are scored 0, resulting in an overall score |
| 316 | // of 0. If enabled, midword matches are allowed and scored when they begin |
| 317 | // immediately after the previous match ends. E.g. 'java script' will match a |
| 318 | // suggestion titled 'javascript' but the input 'java cript' won't. |
manukh | 5ff0f58 | 2020-01-14 03:54:13 | [diff] [blame] | 319 | const base::Feature kHistoryQuickProviderAllowMidwordContinuations{ |
| 320 | "OmniboxHistoryQuickProviderAllowMidwordContinuations", |
manuk | 06717f9 | 2020-05-29 15:38:47 | [diff] [blame^] | 321 | enabled_by_default_desktop_only}; |
manukh | 5ff0f58 | 2020-01-14 03:54:13 | [diff] [blame] | 322 | |
Tomasz Wiszkowski | 70fb35f | 2020-02-27 00:39:19 | [diff] [blame] | 323 | // If enabled, shows slightly more compact suggestions, allowing the |
| 324 | // kAdaptiveSuggestionsCount feature to fit more suggestions on screen. |
| 325 | const base::Feature kCompactSuggestions{"OmniboxCompactSuggestions", |
| 326 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 327 | |
Tomasz Wiszkowski | 70fb35f | 2020-02-27 00:39:19 | [diff] [blame] | 328 | // If enabled, defers keyboard popup when user highlights the omnibox until |
| 329 | // the user taps the Omnibox again. |
| 330 | extern const base::Feature kDeferredKeyboardPopup{ |
| 331 | "OmniboxDeferredKeyboardPopup", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 332 | |
manuk | 695f9d453 | 2020-03-18 19:22:08 | [diff] [blame] | 333 | // If enabled, expands autocompletion to possibly (depending on params) include |
| 334 | // suggestion titles and non-prefixes as opposed to be restricted to URL |
| 335 | // prefixes. Will also adjust the location bar UI and omnibox text selection to |
| 336 | // accommodate the autocompletions. |
| 337 | const base::Feature kRichAutocompletion{"OmniboxRichAutocompletion", |
| 338 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 339 | |
Kevin Bailey | 104e4449 | 2019-10-31 16:42:32 | [diff] [blame] | 340 | // Feature that enables not counting submatches towards the maximum |
| 341 | // suggestion limit. |
| 342 | const base::Feature kOmniboxLooseMaxLimitOnDedicatedRows{ |
| 343 | "OmniboxLooseMaxLimitOnDedicatedRows", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 344 | |
Orin Jaworski | fc17472 | 2020-01-29 00:32:22 | [diff] [blame] | 345 | // Feature that puts a single row of buttons on suggestions with actionable |
| 346 | // elements like keywords, tab-switch buttons, and Pedals. |
| 347 | const base::Feature kOmniboxSuggestionButtonRow{ |
| 348 | "OmniboxSuggestionButtonRow", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 349 | |
Filip Gorski | 927709ea | 2020-04-30 15:58:37 | [diff] [blame] | 350 | // Enables using an Android RecyclerView to render the suggestions dropdown |
| 351 | // instead of a ListView. |
| 352 | const base::Feature kOmniboxSuggestionsRecyclerView{ |
| 353 | "OmniboxSuggestionsRecyclerView", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 354 | |
Tomasz Wiszkowski | 5ec4f53 | 2020-05-19 21:28:10 | [diff] [blame] | 355 | // Allows long Omnibox suggestions to wrap around to next line. |
| 356 | const base::Feature kOmniboxSuggestionsWrapAround{ |
| 357 | "OmniboxSuggestionsWrapAround", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 358 | |
Tommy Li | 1f1fc4a | 2020-01-31 21:02:07 | [diff] [blame] | 359 | // If enabled, uses WebUI to render the omnibox suggestions popup, similar to |
| 360 | // how the NTP "fakebox" is implemented. |
| 361 | const base::Feature kWebUIOmniboxPopup{"WebUIOmniboxPopup", |
| 362 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 363 | |
Brandon Wylie | 1299ff8 | 2020-01-23 02:13:37 | [diff] [blame] | 364 | // When enabled, use Assistant for omnibox voice query recognition instead of |
| 365 | // Android's built-in voice recognition service. Only works on Android. |
| 366 | const base::Feature kOmniboxAssistantVoiceSearch{ |
| 367 | "OmniboxAssistantVoiceSearch", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 368 | |
Livvie Lin | 30a9f9d | 2020-03-17 19:45:19 | [diff] [blame] | 369 | // When enabled, provides an omnibox context menu option that prevents URL |
| 370 | // elisions. |
| 371 | const base::Feature kOmniboxContextMenuShowFullUrls{ |
| 372 | "OmniboxContextMenuShowFullUrls", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 373 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 374 | } // namespace omnibox |