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