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) |
Filip Gorski | 87f159400 | 2020-08-18 21:07:55 | [diff] [blame] | 13 | base::FEATURE_DISABLED_BY_DEFAULT; |
manuk | 06717f9 | 2020-05-29 15:38:47 | [diff] [blame] | 14 | #else |
Filip Gorski | 87f159400 | 2020-08-18 21:07:55 | [diff] [blame] | 15 | base::FEATURE_ENABLED_BY_DEFAULT; |
manuk | 06717f9 | 2020-05-29 15:38:47 | [diff] [blame] | 16 | #endif |
Filip Gorski | 87f159400 | 2020-08-18 21:07:55 | [diff] [blame] | 17 | |
| 18 | const auto enabled_by_default_android_only = |
| 19 | #if defined(OS_ANDROID) |
| 20 | base::FEATURE_ENABLED_BY_DEFAULT; |
| 21 | #else |
| 22 | base::FEATURE_DISABLED_BY_DEFAULT; |
| 23 | #endif |
| 24 | |
| 25 | const auto enabled_by_default_ios_only = |
| 26 | #if defined(OS_IOS) |
| 27 | base::FEATURE_ENABLED_BY_DEFAULT; |
| 28 | #else |
| 29 | base::FEATURE_DISABLED_BY_DEFAULT; |
| 30 | #endif |
| 31 | |
| 32 | const auto enabled_by_default_desktop_android = |
| 33 | #if defined(OS_IOS) |
| 34 | base::FEATURE_DISABLED_BY_DEFAULT; |
| 35 | #else |
| 36 | base::FEATURE_ENABLED_BY_DEFAULT; |
| 37 | #endif |
| 38 | |
| 39 | const auto enabled_by_default_desktop_ios = |
| 40 | #if defined(OS_ANDROID) |
| 41 | base::FEATURE_DISABLED_BY_DEFAULT; |
| 42 | #else |
| 43 | base::FEATURE_ENABLED_BY_DEFAULT; |
| 44 | #endif |
manuk | 06717f9 | 2020-05-29 15:38:47 | [diff] [blame] | 45 | |
Justin Donnelly | ca2d5b2 | 2020-09-03 19:37:50 | [diff] [blame] | 46 | const auto enabled_by_default_android_ios = |
| 47 | #if defined(OS_ANDROID) || defined(OS_IOS) |
| 48 | base::FEATURE_ENABLED_BY_DEFAULT; |
| 49 | #else |
| 50 | base::FEATURE_DISABLED_BY_DEFAULT; |
| 51 | #endif |
| 52 | |
Tomasz Wiszkowski | 8a0e0dc4 | 2020-02-19 00:06:37 | [diff] [blame] | 53 | // Allows Omnibox to dynamically adjust number of offered suggestions to fill in |
| 54 | // the space between Omnibox an the soft keyboard. The number of suggestions |
| 55 | // shown will be no less than minimum for the platform (eg. 5 for Android). |
| 56 | const base::Feature kAdaptiveSuggestionsCount{ |
| 57 | "OmniboxAdaptiveSuggestionsCount", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 58 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 59 | // Feature used to hide the scheme from steady state URLs displayed in the |
| 60 | // toolbar. It is restored during editing. |
manuk | 06717f9 | 2020-05-29 15:38:47 | [diff] [blame] | 61 | const base::Feature kHideFileUrlScheme{ |
| 62 | "OmniboxUIExperimentHideFileUrlScheme", |
| 63 | // Android and iOS don't have the File security chip, and therefore still |
| 64 | // need to show the file scheme. |
| 65 | enabled_by_default_desktop_only}; |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 66 | |
Kevin Bailey | 7d918b9 | 2019-05-02 16:00:14 | [diff] [blame] | 67 | // Feature used to enable matching short words to bookmarks for suggestions. |
| 68 | const base::Feature kOmniboxShortBookmarkSuggestions{ |
| 69 | "OmniboxShortBookmarkSuggestions", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 70 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 71 | // Feature used to force on the experiment of transmission of tail suggestions |
| 72 | // from GWS to this client, currently testing for desktop. |
Filip Gorski | 87f159400 | 2020-08-18 21:07:55 | [diff] [blame] | 73 | const base::Feature kOmniboxTailSuggestions{"OmniboxTailSuggestions", |
| 74 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 75 | |
Kevin Bailey | 37bbf1d | 2019-08-21 19:23:55 | [diff] [blame] | 76 | // Feature that enables the tab-switch suggestions corresponding to an open |
| 77 | // tab, for a button or dedicated suggestion. Enabled by default on Desktop |
| 78 | // and iOS. |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 79 | const base::Feature kOmniboxTabSwitchSuggestions{ |
Filip Gorski | 87f159400 | 2020-08-18 21:07:55 | [diff] [blame] | 80 | "OmniboxTabSwitchSuggestions", enabled_by_default_desktop_ios}; |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 81 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 82 | // Feature used to enable various experiments on keyword mode, UI and |
| 83 | // suggestions. |
| 84 | const base::Feature kExperimentalKeywordMode{"OmniboxExperimentalKeywordMode", |
| 85 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 86 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 87 | // Feature to enable clipboard provider to suggest searching for copied images. |
| 88 | const base::Feature kEnableClipboardProviderImageSuggestions{ |
Filip Gorski | 87f159400 | 2020-08-18 21:07:55 | [diff] [blame] | 89 | "OmniboxEnableClipboardProviderImageSuggestions", |
| 90 | enabled_by_default_ios_only}; |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 91 | |
| 92 | // Feature to enable the search provider to send a request to the suggest |
| 93 | // server on focus. This allows the suggest server to warm up, by, for |
| 94 | // example, loading per-user models into memory. Having a per-user model |
| 95 | // in memory allows the suggest server to respond more quickly with |
| 96 | // personalized suggestions as the user types. |
| 97 | const base::Feature kSearchProviderWarmUpOnFocus{ |
Filip Gorski | 87f159400 | 2020-08-18 21:07:55 | [diff] [blame] | 98 | "OmniboxWarmUpSearchProviderOnFocus", enabled_by_default_desktop_android}; |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 99 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 100 | // Feature used to display the title of the current URL match. |
| 101 | const base::Feature kDisplayTitleForCurrentUrl{ |
Filip Gorski | 87f159400 | 2020-08-18 21:07:55 | [diff] [blame] | 102 | "OmniboxDisplayTitleForCurrentUrl", enabled_by_default_desktop_android}; |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 103 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 104 | // Feature used to always swap the title and URL. |
| 105 | const base::Feature kUIExperimentSwapTitleAndUrl{ |
Filip Gorski | 87f159400 | 2020-08-18 21:07:55 | [diff] [blame] | 106 | "OmniboxUIExperimentSwapTitleAndUrl", enabled_by_default_desktop_only}; |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 107 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 108 | // Feature used to enable speculatively starting a service worker associated |
| 109 | // with the destination of the default match when the user's input looks like a |
| 110 | // query. |
| 111 | const base::Feature kSpeculativeServiceWorkerStartOnQueryInput{ |
Filip Gorski | 87f159400 | 2020-08-18 21:07:55 | [diff] [blame] | 112 | "OmniboxSpeculativeServiceWorkerStartOnQueryInput", |
| 113 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 114 | |
| 115 | // Feature used to fetch document suggestions. |
| 116 | const base::Feature kDocumentProvider{"OmniboxDocumentProvider", |
| 117 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 118 | |
Patrick Noland | 2b4968b | 2019-06-27 14:50:26 | [diff] [blame] | 119 | // Returns whether IsInstantExtendedAPIEnabled should be ignored when deciding |
| 120 | // the number of Google-provided search suggestions. |
| 121 | const base::Feature kOmniboxDisableInstantExtendedLimit{ |
Justin Donnelly | ca2d5b2 | 2020-09-03 19:37:50 | [diff] [blame] | 122 | "OmniboxDisableInstantExtendedLimit", enabled_by_default_android_ios}; |
Patrick Noland | 2b4968b | 2019-06-27 14:50:26 | [diff] [blame] | 123 | |
Brandon Wylie | f8dd4e8 | 2019-07-11 16:39:57 | [diff] [blame] | 124 | // Show the search engine logo in the omnibox on Android (desktop already does |
| 125 | // this). |
| 126 | const base::Feature kOmniboxSearchEngineLogo{"OmniboxSearchEngineLogo", |
Brandon Wylie | e480f825 | 2020-07-28 19:25:01 | [diff] [blame] | 127 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Brandon Wylie | f8dd4e8 | 2019-07-11 16:39:57 | [diff] [blame] | 128 | |
manuk | bf3c8ab | 2019-10-24 16:52:08 | [diff] [blame] | 129 | // Feature used to allow users to remove suggestions from clipboard. |
| 130 | const base::Feature kOmniboxRemoveSuggestionsFromClipboard{ |
Filip Gorski | 87f159400 | 2020-08-18 21:07:55 | [diff] [blame] | 131 | "OmniboxRemoveSuggestionsFromClipboard", enabled_by_default_android_only}; |
manuk | bf3c8ab | 2019-10-24 16:52:08 | [diff] [blame] | 132 | |
manuk | bf3c8ab | 2019-10-24 16:52:08 | [diff] [blame] | 133 | // Feature to debounce drive requests from the document provider. |
| 134 | const base::Feature kDebounceDocumentProvider{ |
| 135 | "OmniboxDebounceDocumentProvider", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 136 | |
manuk | 7b89f664 | 2019-11-08 19:25:24 | [diff] [blame] | 137 | // Demotes the relevance scores when comparing suggestions based on the |
| 138 | // suggestion's |AutocompleteMatchType| and the user's |PageClassification|. |
| 139 | // This feature's main job is to contain the DemoteByType parameter. |
| 140 | const base::Feature kOmniboxDemoteByType{"OmniboxDemoteByType", |
| 141 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 142 | |
Justin Donnelly | 477e35e | 2020-04-02 14:40:00 | [diff] [blame] | 143 | // A special flag, enabled by default, that can be used to disable all new |
| 144 | // search features (e.g. zero suggest). |
| 145 | const base::Feature kNewSearchFeatures{"OmniboxNewSearchFeatures", |
| 146 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 147 | |
manukh | 7a2bc53 | 2020-09-08 15:52:25 | [diff] [blame] | 148 | // Feature used to reduce entity latency by sharing a decoder. Param values will |
| 149 | // configure other optimizations as well. |
| 150 | const base::Feature kEntitySuggestionsReduceLatency{ |
| 151 | "OmniboxEntitySuggestionsReduceLatency", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 152 | |
manuk | 89d7398 | 2020-05-12 01:17:34 | [diff] [blame] | 153 | // Feature used to cap max zero suggestions shown according to the param |
| 154 | // OmniboxMaxZeroSuggestMatches. If omitted, |
| 155 | // OmniboxUIExperimentMaxAutocompleteMatches will be used instead. If present, |
| 156 | // OmniboxMaxZeroSuggestMatches will override |
| 157 | // OmniboxUIExperimentMaxAutocompleteMatches when |from_omnibox_focus| is true. |
| 158 | const base::Feature kMaxZeroSuggestMatches{"OmniboxMaxZeroSuggestMatches", |
| 159 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 160 | |
manuk | 89d7398 | 2020-05-12 01:17:34 | [diff] [blame] | 161 | // Feature used to cap max suggestions shown according to the params |
| 162 | // UIMaxAutocompleteMatches and UIMaxAutocompleteMatchesByProvider. |
| 163 | const base::Feature kUIExperimentMaxAutocompleteMatches{ |
| 164 | "OmniboxUIExperimentMaxAutocompleteMatches", |
| 165 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 166 | |
Justin Donnelly | 444aa06 | 2020-05-14 23:27:20 | [diff] [blame] | 167 | // Feature used to cap the number of URL-type matches shown within the |
| 168 | // Omnibox. If enabled, the number of URL-type matches is limited (unless |
| 169 | // there are no more non-URL matches available.) If enabled, there is a |
| 170 | // companion parameter - OmniboxMaxURLMatches - which specifies the maximum |
| 171 | // desired number of URL-type matches. |
| 172 | const bool kOmniboxMaxURLMatchesEnabledByDefault = |
| 173 | #if defined(OS_IOS) || defined(OS_ANDROID) |
| 174 | false; |
| 175 | #else |
| 176 | true; |
| 177 | #endif |
| 178 | const base::Feature kOmniboxMaxURLMatches{ |
| 179 | "OmniboxMaxURLMatches", kOmniboxMaxURLMatchesEnabledByDefault |
| 180 | ? base::FEATURE_ENABLED_BY_DEFAULT |
| 181 | : base::FEATURE_DISABLED_BY_DEFAULT}; |
| 182 | |
manuk | 4e2979d | 2020-07-08 23:29:28 | [diff] [blame] | 183 | // Feature used to cap max suggestions to a dynamic limit based on how many URLs |
| 184 | // would be shown. E.g., show up to 10 suggestions if doing so would display no |
| 185 | // URLs; else show up to 8 suggestions if doing so would include 1 or more URLs. |
| 186 | const base::Feature kDynamicMaxAutocomplete{"OmniboxDynamicMaxAutocomplete", |
| 187 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 188 | |
manukh | d187041 | 2020-09-15 03:42:14 | [diff] [blame] | 189 | // Feature used to enable bubbling URL suggestions above search suggestions |
| 190 | // after grouping if 2 conditions are met: |
| 191 | // 1) There must be a sufficient score gap between the adjacent searches. |
| 192 | // 2) There must be a sufficient buffer between the URL and search scores. |
| 193 | const base::Feature kBubbleUrlSuggestions{"OmniboxBubbleUrlSuggestions", |
| 194 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 195 | |
Tommy Li | 354a0e4 | 2020-07-30 16:46:14 | [diff] [blame] | 196 | // If enabled, when the user clears the whole omnibox text (i.e. via Backspace), |
Tommy Li | 19e27ede | 2020-08-14 22:52:40 | [diff] [blame] | 197 | // Chrome will request remote ZeroSuggest suggestions for the OTHER page |
| 198 | // classification (contextual web). |
| 199 | const base::Feature kClobberTriggersContextualWebZeroSuggest{ |
| 200 | "OmniboxClobberTriggersContextualWebZeroSuggest", |
| 201 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Tommy Li | 354a0e4 | 2020-07-30 16:46:14 | [diff] [blame] | 202 | |
Moe Ahmadi | 72c8e81 | 2020-07-10 21:34:23 | [diff] [blame] | 203 | // Used to adjust the age threshold since the last visit in order to consider a |
| 204 | // normalized keyword search term as a zero-prefix suggestion. If disabled, the |
| 205 | // default value of history::kLowQualityMatchAgeLimitInDays is used. If enabled, |
| 206 | // the age threshold is determined by this feature's companion parameter, |
| 207 | // OmniboxFieldTrial::kOmniboxLocalZeroSuggestAgeThresholdParam. |
| 208 | const base::Feature kOmniboxLocalZeroSuggestAgeThreshold{ |
| 209 | "OmniboxLocalZeroSuggestAgeThreshold", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 210 | |
Moe Ahmadi | 5482326 | 2020-10-13 03:00:41 | [diff] [blame] | 211 | // If enabled, enables local zero-prefix suggestions for signed in users. |
| 212 | // Local zero-prefix suggestions are enabled for signed in users by default. We |
| 213 | // will be experimenting with DISABLING this behavior. |
| 214 | const base::Feature kOmniboxLocalZeroSuggestForAuthenticatedUsers{ |
| 215 | "OmniboxLocalZeroSuggestForAuthenticatedUsers", |
| 216 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 217 | |
Moe Ahmadi | 064dbcd | 2020-08-20 01:53:31 | [diff] [blame] | 218 | // If enabled, ranks the local zero-prefix suggestions based on frecency |
| 219 | // (combined frequency and recency). |
| 220 | const base::Feature kOmniboxLocalZeroSuggestFrecencyRanking{ |
| 221 | "OmniboxLocalZeroSuggestFrecencyRanking", |
| 222 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 223 | |
| 224 | // Used to force enable/disable trending zero-prefix suggestions on the NTP |
| 225 | // (Omnibox and NTP realbox). This feature triggers a server-side behavior only |
| 226 | // and has no direct impact on the client behavior. |
| 227 | const base::Feature kOmniboxTrendingZeroPrefixSuggestionsOnNTP{ |
| 228 | "OmniboxTrendingZeroPrefixSuggestionsOnNTP", |
| 229 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 230 | |
Tommy Li | b4b3bb5b | 2020-05-01 02:34:56 | [diff] [blame] | 231 | // Feature that configures ZeroSuggestProvider using the "ZeroSuggestVariant" |
| 232 | // per-page-classification parameter. |
Tommy Li | 5578402 | 2020-04-28 20:58:18 | [diff] [blame] | 233 | // |
Tommy Li | b4b3bb5b | 2020-05-01 02:34:56 | [diff] [blame] | 234 | // Generally speaking - do NOT use this for future server-side experiments. |
| 235 | // Instead, create your a new narrowly scoped base::Feature for each experiment. |
| 236 | // |
| 237 | // Because our Field Trial system can only configure this base::Feature in a |
| 238 | // single study, and does not merge parameters, using this creates conflicts. |
Tommy C. Li | 09010551 | 2019-05-16 22:00:56 | [diff] [blame] | 239 | const base::Feature kOnFocusSuggestions{"OmniboxOnFocusSuggestions", |
| 240 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 241 | |
Tommy Li | 5578402 | 2020-04-28 20:58:18 | [diff] [blame] | 242 | // Enables on-focus suggestions on the Open Web, that are contextual to the |
| 243 | // current URL. Will only work if user is signed-in and syncing, or is |
| 244 | // otherwise eligible to send the current page URL to the suggest server. |
Tommy Li | e0a3a99 | 2020-05-29 21:32:05 | [diff] [blame] | 245 | // |
| 246 | // There's multiple flags here for multiple backend configurations: |
| 247 | // - Default (search queries) |
| 248 | // - On-Content Suggestions |
Tommy Li | 5578402 | 2020-04-28 20:58:18 | [diff] [blame] | 249 | const base::Feature kOnFocusSuggestionsContextualWeb{ |
| 250 | "OmniboxOnFocusSuggestionsContextualWeb", |
| 251 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Tommy Li | e0a3a99 | 2020-05-29 21:32:05 | [diff] [blame] | 252 | const base::Feature kOnFocusSuggestionsContextualWebOnContent{ |
| 253 | "OmniboxOnFocusSuggestionsContextualWebOnContent", |
| 254 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Tommy Li | 5578402 | 2020-04-28 20:58:18 | [diff] [blame] | 255 | |
Moe Ahmadi | 31147bc | 2020-06-02 19:07:56 | [diff] [blame] | 256 | // Enables Reactive Zero-Prefix Suggestions (rZPS) on the NTP, for the Omnibox |
| 257 | // and Realbox respectively. Note: enabling this feature merely makes |
Tommy Li | b4b3bb5b | 2020-05-01 02:34:56 | [diff] [blame] | 258 | // ZeroSuggestProvider send the request. There are additional requirements, |
Moe Ahmadi | 31147bc | 2020-06-02 19:07:56 | [diff] [blame] | 259 | // like the user being signed-in, and the suggest server having rZPS enabled. |
| 260 | const base::Feature kReactiveZeroSuggestionsOnNTPOmnibox{ |
| 261 | "OmniboxReactiveZeroSuggestionsOnNTPOmnibox", |
Tommy Li | b4b3bb5b | 2020-05-01 02:34:56 | [diff] [blame] | 262 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Moe Ahmadi | 31147bc | 2020-06-02 19:07:56 | [diff] [blame] | 263 | const base::Feature kReactiveZeroSuggestionsOnNTPRealbox{ |
| 264 | "OmniboxReactiveZeroSuggestionsOnNTPRealbox", |
Tommy Li | b4b3bb5b | 2020-05-01 02:34:56 | [diff] [blame] | 265 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 266 | |
Tomasz Wiszkowski | 947f6d0d | 2019-03-15 22:27:25 | [diff] [blame] | 267 | // Allow suggestions to be shown to the user on the New Tab Page upon focusing |
| 268 | // URL bar (the omnibox). |
| 269 | const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP", |
Moe Ahmadi | 55b0f57c | 2020-08-15 01:20:03 | [diff] [blame] | 270 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Tomasz Wiszkowski | 947f6d0d | 2019-03-15 22:27:25 | [diff] [blame] | 271 | |
Moe Ahmadi | 4005ec9 | 2019-09-09 16:55:53 | [diff] [blame] | 272 | // Allow suggestions to be shown to the user on the New Tab Page upon focusing |
| 273 | // the real search box. |
| 274 | const base::Feature kZeroSuggestionsOnNTPRealbox{ |
Moe Ahmadi | 55b0f57c | 2020-08-15 01:20:03 | [diff] [blame] | 275 | "OmniboxZeroSuggestionsOnNTPRealbox", base::FEATURE_ENABLED_BY_DEFAULT}; |
Moe Ahmadi | 4005ec9 | 2019-09-09 16:55:53 | [diff] [blame] | 276 | |
Tommy Li | 1d03b9bf | 2019-09-23 23:46:34 | [diff] [blame] | 277 | // Allow on-focus query refinements to be shown on the default SERP. |
| 278 | const base::Feature kZeroSuggestionsOnSERP{"OmniboxZeroSuggestionsOnSERP", |
| 279 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 280 | |
Ce Chen | c8d803a | 2020-04-27 09:31:33 | [diff] [blame] | 281 | // Features to provide non personalized head search suggestion from a compact |
| 282 | // on device model. More specifically, feature name with suffix Incognito / |
| 283 | // NonIncognito will only controls behaviors under incognito / non-incognito |
| 284 | // mode respectively. |
| 285 | const base::Feature kOnDeviceHeadProviderIncognito{ |
| 286 | "OmniboxOnDeviceHeadProviderIncognito", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 287 | const base::Feature kOnDeviceHeadProviderNonIncognito{ |
Ce Chen | c5ff8bcf | 2020-09-21 02:29:18 | [diff] [blame] | 288 | "OmniboxOnDeviceHeadProviderNonIncognito", enabled_by_default_android_ios}; |
Ce Chen | c8d803a | 2020-04-27 09:31:33 | [diff] [blame] | 289 | |
Justin Donnelly | f270348 | 2019-10-24 21:42:15 | [diff] [blame] | 290 | // If enabled, changes the way Google-provided search suggestions are scored by |
| 291 | // the backend. Note that this Feature is only used for triggering a server- |
| 292 | // side experiment config that will send experiment IDs to the backend. It is |
| 293 | // not referred to in any of the Chromium code. |
| 294 | const base::Feature kOmniboxExperimentalSuggestScoring{ |
| 295 | "OmniboxExperimentalSuggestScoring", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 296 | |
manukh | 3bb80c9 | 2020-01-22 00:19:46 | [diff] [blame] | 297 | // If disabled, terms with no wordstart matches disqualify the suggestion unless |
| 298 | // they occur in the URL host. If enabled, terms with no wordstart matches are |
| 299 | // allowed but not scored. E.g., both inputs 'java script' and 'java cript' will |
| 300 | // match a suggestion titled 'javascript' and score equivalently. |
manukh | 5ff0f58 | 2020-01-14 03:54:13 | [diff] [blame] | 301 | const base::Feature kHistoryQuickProviderAllowButDoNotScoreMidwordTerms{ |
| 302 | "OmniboxHistoryQuickProviderAllowButDoNotScoreMidwordTerms", |
manuk | 8f1b1e1a | 2020-07-28 22:02:13 | [diff] [blame] | 303 | base::FEATURE_ENABLED_BY_DEFAULT}; |
manukh | 5ff0f58 | 2020-01-14 03:54:13 | [diff] [blame] | 304 | |
manukh | 3bb80c9 | 2020-01-22 00:19:46 | [diff] [blame] | 305 | // If disabled, midword matches are ignored except in the URL host, and input |
| 306 | // terms with no wordstart matches are scored 0, resulting in an overall score |
| 307 | // of 0. If enabled, midword matches are allowed and scored when they begin |
| 308 | // immediately after the previous match ends. E.g. 'java script' will match a |
| 309 | // suggestion titled 'javascript' but the input 'java cript' won't. |
manukh | 5ff0f58 | 2020-01-14 03:54:13 | [diff] [blame] | 310 | const base::Feature kHistoryQuickProviderAllowMidwordContinuations{ |
| 311 | "OmniboxHistoryQuickProviderAllowMidwordContinuations", |
manuk | 8f1b1e1a | 2020-07-28 22:02:13 | [diff] [blame] | 312 | base::FEATURE_ENABLED_BY_DEFAULT}; |
manukh | 5ff0f58 | 2020-01-14 03:54:13 | [diff] [blame] | 313 | |
manukh | 61e78251 | 2020-10-01 17:33:45 | [diff] [blame] | 314 | // If enabled, inputs may match bookmark paths. These path matches won't |
| 315 | // contribute to scoring. E.g. 'planets jupiter' can suggest a bookmark titled |
| 316 | // 'Jupiter' with URL 'en.wikipedia.org/wiki/Jupiter' located in a path |
| 317 | // containing 'planet.' |
| 318 | const base::Feature kBookmarkPaths{"OmniboxBookmarkPaths", |
| 319 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 320 | |
Tomasz Wiszkowski | 70fb35f | 2020-02-27 00:39:19 | [diff] [blame] | 321 | // If enabled, shows slightly more compact suggestions, allowing the |
| 322 | // kAdaptiveSuggestionsCount feature to fit more suggestions on screen. |
| 323 | const base::Feature kCompactSuggestions{"OmniboxCompactSuggestions", |
| 324 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 325 | |
Tomasz Wiszkowski | 70fb35f | 2020-02-27 00:39:19 | [diff] [blame] | 326 | // If enabled, defers keyboard popup when user highlights the omnibox until |
| 327 | // the user taps the Omnibox again. |
| 328 | extern const base::Feature kDeferredKeyboardPopup{ |
| 329 | "OmniboxDeferredKeyboardPopup", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 330 | |
Filip Gorski | b116dee | 2020-08-20 14:12:10 | [diff] [blame] | 331 | // If enbaled, frequently visited sites are presented in form of a single row |
| 332 | // with a carousel of tiles, instead of one URL per row. |
| 333 | extern const base::Feature kMostVisitedTiles{"OmniboxMostVisitedTiles", |
| 334 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 335 | |
manuk | 695f9d453 | 2020-03-18 19:22:08 | [diff] [blame] | 336 | // If enabled, expands autocompletion to possibly (depending on params) include |
| 337 | // suggestion titles and non-prefixes as opposed to be restricted to URL |
| 338 | // prefixes. Will also adjust the location bar UI and omnibox text selection to |
| 339 | // accommodate the autocompletions. |
| 340 | const base::Feature kRichAutocompletion{"OmniboxRichAutocompletion", |
| 341 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 342 | |
Tomasz Wiszkowski | 457253d3 | 2020-08-18 01:37:26 | [diff] [blame] | 343 | // Feature that enables Search Ready Omnibox in incognito. |
Filip Gorski | 0527984 | 2020-06-12 12:49:02 | [diff] [blame] | 344 | const base::Feature kOmniboxSearchReadyIncognito{ |
| 345 | "OmniboxSearchReadyIncognito", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 346 | |
Orin Jaworski | fc17472 | 2020-01-29 00:32:22 | [diff] [blame] | 347 | // Feature that puts a single row of buttons on suggestions with actionable |
| 348 | // elements like keywords, tab-switch buttons, and Pedals. |
| 349 | const base::Feature kOmniboxSuggestionButtonRow{ |
| 350 | "OmniboxSuggestionButtonRow", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 351 | |
Justin Donnelly | 5726ecf | 2020-08-14 00:53:52 | [diff] [blame] | 352 | // Feature used to enable Pedal suggestions. |
| 353 | const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions", |
| 354 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 355 | |
| 356 | // Feature used to enable the keyword search button. |
| 357 | const base::Feature kOmniboxKeywordSearchButton{ |
| 358 | "OmniboxKeywordSearchButton", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 359 | |
Angela Yoeurng | 8155263 | 2020-09-22 23:52:14 | [diff] [blame] | 360 | // Enables new UI changes indicating focus and hover states. |
| 361 | const base::Feature kOmniboxRefinedFocusState{ |
| 362 | "OmniboxRefinedFocusState", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 363 | |
Filip Gorski | 927709ea | 2020-04-30 15:58:37 | [diff] [blame] | 364 | // Enables using an Android RecyclerView to render the suggestions dropdown |
| 365 | // instead of a ListView. |
| 366 | const base::Feature kOmniboxSuggestionsRecyclerView{ |
Filip Gorski | eb6dbc8 | 2020-08-18 20:53:12 | [diff] [blame] | 367 | "OmniboxSuggestionsRecyclerView", base::FEATURE_ENABLED_BY_DEFAULT}; |
Filip Gorski | 927709ea | 2020-04-30 15:58:37 | [diff] [blame] | 368 | |
Tomasz Wiszkowski | 5ec4f53 | 2020-05-19 21:28:10 | [diff] [blame] | 369 | // Allows long Omnibox suggestions to wrap around to next line. |
| 370 | const base::Feature kOmniboxSuggestionsWrapAround{ |
| 371 | "OmniboxSuggestionsWrapAround", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 372 | |
Tommy Li | 1f1fc4a | 2020-01-31 21:02:07 | [diff] [blame] | 373 | // If enabled, uses WebUI to render the omnibox suggestions popup, similar to |
| 374 | // how the NTP "fakebox" is implemented. |
| 375 | const base::Feature kWebUIOmniboxPopup{"WebUIOmniboxPopup", |
| 376 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 377 | |
Brandon Wylie | 1299ff8 | 2020-01-23 02:13:37 | [diff] [blame] | 378 | // When enabled, use Assistant for omnibox voice query recognition instead of |
| 379 | // Android's built-in voice recognition service. Only works on Android. |
| 380 | const base::Feature kOmniboxAssistantVoiceSearch{ |
| 381 | "OmniboxAssistantVoiceSearch", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 382 | |
Emily Stark | 4bca290ac | 2020-06-29 21:02:30 | [diff] [blame] | 383 | // Feature used to reveal the path, query and ref from steady state URLs |
| 384 | // on hover. |
| 385 | const base::Feature kRevealSteadyStateUrlPathQueryAndRefOnHover{ |
| 386 | "OmniboxUIExperimentRevealSteadyStateUrlPathQueryAndRefOnHover", |
| 387 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 388 | |
| 389 | // Feature used to hide the path, query and ref from steady state URLs |
| 390 | // on interaction with the page. |
| 391 | const base::Feature kHideSteadyStateUrlPathQueryAndRefOnInteraction{ |
| 392 | "OmniboxUIExperimentHideSteadyStateUrlPathQueryAndRefOnInteraction", |
| 393 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 394 | |
Joe DeBlasio | 6d5806e1 | 2020-08-06 17:27:18 | [diff] [blame] | 395 | // Feature used to possibly elide not just the path, query, and ref from steady |
| 396 | // state URLs, but also subdomains beyond the registrable domain, depending on |
| 397 | // whether the hostname fails lookalike checks. Has no effect unless |
Emily Stark | 4bca290ac | 2020-06-29 21:02:30 | [diff] [blame] | 398 | // kRevealSteadyStateUrlPathQueryAndRefOnHover and/or |
| 399 | // kHideSteadyStateUrlPathQueryAndRefOnInteraction are enabled. |
Joe DeBlasio | 6d5806e1 | 2020-08-06 17:27:18 | [diff] [blame] | 400 | const base::Feature kMaybeElideToRegistrableDomain{ |
Emily Stark | 4bca290ac | 2020-06-29 21:02:30 | [diff] [blame] | 401 | "OmniboxUIExperimentElideToRegistrableDomain", |
| 402 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 403 | |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 404 | } // namespace omnibox |