blob: 1af2f68a2713fd856bf995993ad2cd7b1f8c5733 [file] [log] [blame]
Tomasz Wiszkowskid938a1112019-03-06 18:01:571// 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
manukc32a8eff2019-07-02 15:48:307#include "build/build_config.h"
8
Tomasz Wiszkowskid938a1112019-03-06 18:01:579namespace omnibox {
10
Tomasz Wiszkowski8a0e0dc42020-02-19 00:06:3711// Allows Omnibox to dynamically adjust number of offered suggestions to fill in
12// the space between Omnibox an the soft keyboard. The number of suggestions
13// shown will be no less than minimum for the platform (eg. 5 for Android).
14const base::Feature kAdaptiveSuggestionsCount{
15 "OmniboxAdaptiveSuggestionsCount", base::FEATURE_DISABLED_BY_DEFAULT};
16
Tomasz Wiszkowskid938a1112019-03-06 18:01:5717// Feature used to hide the scheme from steady state URLs displayed in the
18// toolbar. It is restored during editing.
19const base::Feature kHideFileUrlScheme {
20 "OmniboxUIExperimentHideFileUrlScheme",
21// Android and iOS don't have the File security chip, and therefore still
22// need to show the file scheme.
23#if defined(OS_ANDROID) || defined(OS_IOS)
24 base::FEATURE_DISABLED_BY_DEFAULT
25#else
26 base::FEATURE_ENABLED_BY_DEFAULT
27#endif
28};
29
30// Feature used to hide the scheme from steady state URLs displayed in the
31// toolbar. It is restored during editing.
Tommy C. Li7514ba82019-06-25 19:43:5332const base::Feature kHideSteadyStateUrlScheme{
33 "OmniboxUIExperimentHideSteadyStateUrlScheme",
34 base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5735
36// Feature used to hide trivial subdomains from steady state URLs displayed in
37// the toolbar. It is restored during editing.
Tommy C. Li7514ba82019-06-25 19:43:5338const base::Feature kHideSteadyStateUrlTrivialSubdomains{
39 "OmniboxUIExperimentHideSteadyStateUrlTrivialSubdomains",
40 base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5741
42// Feature used to hide the path, query and ref from steady state URLs
43// displayed in the toolbar. It is restored during editing.
44const base::Feature kHideSteadyStateUrlPathQueryAndRef {
45 "OmniboxUIExperimentHideSteadyStateUrlPathQueryAndRef",
46#if defined(OS_IOS)
47 base::FEATURE_ENABLED_BY_DEFAULT
48#else
49 base::FEATURE_DISABLED_BY_DEFAULT
50#endif
51};
52
53// Feature used to undo all omnibox elisions on a single click or focus action.
54const base::Feature kOneClickUnelide{"OmniboxOneClickUnelide",
55 base::FEATURE_DISABLED_BY_DEFAULT};
56
manukaddd3c42019-04-09 21:20:5957// Feature used to enable local entity suggestions. Similar to rich entities but
58// but location specific. E.g., typing 'starbucks near' could display the local
59// entity suggestion 'starbucks near disneyland \n starbucks * Anaheim, CA'.
60const base::Feature kOmniboxLocalEntitySuggestions{
61 "OmniboxLocalEntitySuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
62
Kevin Baileyb3e08732019-05-29 03:55:2563// Feature used to cap the number of URL-type matches shown within the
64// Omnibox. If enabled, the number of URL-type matches is limited (unless
65// there are no more non-URL matches available.) If enabled, there is a
66// companion parameter - OmniboxMaxURLMatches - which specifies the maximum
67// desired number of URL-type matches.
Kevin Bailey26238862019-10-31 22:08:1268const base::Feature kOmniboxMaxURLMatches {
69 "OmniboxMaxURLMatches",
70#if defined(OS_IOS) || defined(OS_ANDROID)
71 base::FEATURE_DISABLED_BY_DEFAULT
72#else
73 base::FEATURE_ENABLED_BY_DEFAULT
74#endif
75};
Kevin Baileyb3e08732019-05-29 03:55:2576
Tomasz Wiszkowskid938a1112019-03-06 18:01:5777// Feature used to enable entity suggestion images and enhanced presentation
78// showing more context and descriptive text about the entity.
79const base::Feature kOmniboxRichEntitySuggestions{
Justin Donnelly481a69c2019-05-03 20:41:4280 "OmniboxRichEntitySuggestions",
81#if defined(OS_IOS) || defined(OS_ANDROID)
82 base::FEATURE_DISABLED_BY_DEFAULT
83#else
84 base::FEATURE_ENABLED_BY_DEFAULT
85#endif
86};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5787
Tomasz Wiszkowskid938a1112019-03-06 18:01:5788// Feature used to enable swapping the rows on answers.
89const base::Feature kOmniboxReverseAnswers{"OmniboxReverseAnswers",
90 base::FEATURE_DISABLED_BY_DEFAULT};
91
Kevin Bailey7d918b92019-05-02 16:00:1492// Feature used to enable matching short words to bookmarks for suggestions.
93const base::Feature kOmniboxShortBookmarkSuggestions{
94 "OmniboxShortBookmarkSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
95
Tomasz Wiszkowskid938a1112019-03-06 18:01:5796// Feature used to force on the experiment of transmission of tail suggestions
97// from GWS to this client, currently testing for desktop.
98const base::Feature kOmniboxTailSuggestions{
99 "OmniboxTailSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
100
Kevin Bailey37bbf1d2019-08-21 19:23:55101// Feature that enables the tab-switch suggestions corresponding to an open
102// tab, for a button or dedicated suggestion. Enabled by default on Desktop
103// and iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57104const base::Feature kOmniboxTabSwitchSuggestions{
105 "OmniboxTabSwitchSuggestions",
Stepan Khapuginb09801662019-05-07 10:17:04106#if defined(OS_ANDROID)
Tomasz Wiszkowskid938a1112019-03-06 18:01:57107 base::FEATURE_DISABLED_BY_DEFAULT
108#else
109 base::FEATURE_ENABLED_BY_DEFAULT
110#endif
111};
112
Kevin Bailey37bbf1d2019-08-21 19:23:55113// Feature that enables tab-switch suggestions in their own row.
114const base::Feature kOmniboxTabSwitchSuggestionsDedicatedRow{
115 "OmniboxTabSwitchSuggestionsDedicatedRow",
116 base::FEATURE_DISABLED_BY_DEFAULT};
117
Tomasz Wiszkowskid938a1112019-03-06 18:01:57118// Feature used to enable various experiments on keyword mode, UI and
119// suggestions.
120const base::Feature kExperimentalKeywordMode{"OmniboxExperimentalKeywordMode",
121 base::FEATURE_DISABLED_BY_DEFAULT};
122
123// Feature used to enable Pedal suggestions.
124const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions",
125 base::FEATURE_DISABLED_BY_DEFAULT};
126
Tommy C. Lia2c75fb2019-04-08 20:22:34127// Feature used for UI that improves transparency of and control over omnibox
Tommy Li9d12b4be2019-09-12 19:21:41128// suggestions. This includes "Why this Suggestion?" and user controls to delete
129// personalized suggestions. This will be eventually enabled by default.
Tommy C. Lia2c75fb2019-04-08 20:22:34130const base::Feature kOmniboxSuggestionTransparencyOptions{
131 "OmniboxSuggestionTransparencyOptions", base::FEATURE_DISABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57132
Tomasz Wiszkowskid938a1112019-03-06 18:01:57133// Feature to enable clipboard provider to suggest copied text.
134const base::Feature kEnableClipboardProviderTextSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29135 "OmniboxEnableClipboardProviderTextSuggestions",
136#if defined(OS_IOS)
137 base::FEATURE_ENABLED_BY_DEFAULT
138#else
139 base::FEATURE_DISABLED_BY_DEFAULT
140#endif
141};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57142
143// Feature to enable clipboard provider to suggest searching for copied images.
144const base::Feature kEnableClipboardProviderImageSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29145 "OmniboxEnableClipboardProviderImageSuggestions",
146#if defined(OS_IOS)
147 base::FEATURE_ENABLED_BY_DEFAULT
148#else
149 base::FEATURE_DISABLED_BY_DEFAULT
150#endif
151};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57152
153// Feature to enable the search provider to send a request to the suggest
154// server on focus. This allows the suggest server to warm up, by, for
155// example, loading per-user models into memory. Having a per-user model
156// in memory allows the suggest server to respond more quickly with
157// personalized suggestions as the user types.
158const base::Feature kSearchProviderWarmUpOnFocus{
159 "OmniboxWarmUpSearchProviderOnFocus",
160#if defined(OS_IOS)
161 base::FEATURE_DISABLED_BY_DEFAULT
162#else
163 base::FEATURE_ENABLED_BY_DEFAULT
164#endif
165};
166
Tomasz Wiszkowskid938a1112019-03-06 18:01:57167// Feature used to display the title of the current URL match.
168const base::Feature kDisplayTitleForCurrentUrl{
169 "OmniboxDisplayTitleForCurrentUrl",
170#if !defined(OS_IOS)
171 base::FEATURE_ENABLED_BY_DEFAULT
172#else
173 base::FEATURE_DISABLED_BY_DEFAULT
174#endif
175};
176
177// Feature used for the max autocomplete matches UI experiment.
178const base::Feature kUIExperimentMaxAutocompleteMatches{
179 "OmniboxUIExperimentMaxAutocompleteMatches",
180 base::FEATURE_DISABLED_BY_DEFAULT};
181
182// Feature used to display the search terms instead of the URL in the Omnibox
183// when the user is on the search results page of the default search provider.
184const base::Feature kQueryInOmnibox{"QueryInOmnibox",
185 base::FEATURE_DISABLED_BY_DEFAULT};
186
Tomasz Wiszkowskid938a1112019-03-06 18:01:57187// Feature used to always swap the title and URL.
188const base::Feature kUIExperimentSwapTitleAndUrl{
189 "OmniboxUIExperimentSwapTitleAndUrl",
190#if defined(OS_IOS) || defined(OS_ANDROID)
191 base::FEATURE_DISABLED_BY_DEFAULT
192#else
193 base::FEATURE_ENABLED_BY_DEFAULT
194#endif
195};
196
Tomasz Wiszkowskid938a1112019-03-06 18:01:57197// Feature used to enable speculatively starting a service worker associated
198// with the destination of the default match when the user's input looks like a
199// query.
200const base::Feature kSpeculativeServiceWorkerStartOnQueryInput{
201 "OmniboxSpeculativeServiceWorkerStartOnQueryInput",
202 base::FEATURE_ENABLED_BY_DEFAULT
203};
204
205// Feature used to fetch document suggestions.
206const base::Feature kDocumentProvider{"OmniboxDocumentProvider",
207 base::FEATURE_DISABLED_BY_DEFAULT};
208
manuk4542e232019-09-11 19:27:35209// Feature used to autocomplete bookmark, history, and document suggestions when
210// the user input is a prefix of their titles, as opposed to their URLs.
211const base::Feature kAutocompleteTitles{"OmniboxAutocompleteTitles",
212 base::FEATURE_DISABLED_BY_DEFAULT};
213
Tomasz Wiszkowskid938a1112019-03-06 18:01:57214// Feature to use material design weather icons in the omnibox when displaying
215// weather answers.
216const base::Feature kOmniboxMaterialDesignWeatherIcons{
manuk9a2ed552019-09-09 23:45:44217 "OmniboxMaterialDesignWeatherIcons", base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57218
Patrick Noland2b4968b2019-06-27 14:50:26219// Returns whether IsInstantExtendedAPIEnabled should be ignored when deciding
220// the number of Google-provided search suggestions.
221const base::Feature kOmniboxDisableInstantExtendedLimit{
222 "OmniboxDisableInstantExtendedLimit", base::FEATURE_DISABLED_BY_DEFAULT};
223
Brandon Wylief8dd4e82019-07-11 16:39:57224// Show the search engine logo in the omnibox on Android (desktop already does
225// this).
226const base::Feature kOmniboxSearchEngineLogo{"OmniboxSearchEngineLogo",
227 base::FEATURE_DISABLED_BY_DEFAULT};
228
manukbf3c8ab2019-10-24 16:52:08229// Feature used to allow users to remove suggestions from clipboard.
230const base::Feature kOmniboxRemoveSuggestionsFromClipboard{
231 "OmniboxRemoveSuggestionsFromClipboard", base::FEATURE_DISABLED_BY_DEFAULT};
232
233// Feature to provide non personalized head search suggestion from a compact
234// on device model.
235const base::Feature kOnDeviceHeadProvider{"OmniboxOnDeviceHeadProvider",
236 base::FEATURE_DISABLED_BY_DEFAULT};
237
238// Feature to debounce drive requests from the document provider.
239const base::Feature kDebounceDocumentProvider{
240 "OmniboxDebounceDocumentProvider", base::FEATURE_DISABLED_BY_DEFAULT};
241
Tommy Li6390ecc2019-09-06 21:08:57242// Preserves the default match against change when providers return results
243// asynchronously. This prevents the default match from changing after the user
244// finishes typing. Without this feature, if the default match is updated right
245// when the user presses Enter, the user may go to a surprising destination.
246const base::Feature kOmniboxPreserveDefaultMatchAgainstAsyncUpdate{
247 "OmniboxPreserveDefaultMatchAgainstAsyncUpdate",
Tommy Li2b9db032020-03-02 22:12:14248 base::FEATURE_ENABLED_BY_DEFAULT};
Tommy Li6390ecc2019-09-06 21:08:57249
manuk7b89f6642019-11-08 19:25:24250// Demotes the relevance scores when comparing suggestions based on the
251// suggestion's |AutocompleteMatchType| and the user's |PageClassification|.
252// This feature's main job is to contain the DemoteByType parameter.
253const base::Feature kOmniboxDemoteByType{"OmniboxDemoteByType",
254 base::FEATURE_DISABLED_BY_DEFAULT};
255
Tommy C. Li090105512019-05-16 22:00:56256// Feature to configure on-focus suggestions provided by ZeroSuggestProvider.
Tommy C. Li414f22022019-06-07 23:46:22257// This feature's main job is to contain some field trial parameters such as:
258// - "ZeroSuggestVariant" configures the per-page-classification mode of
259// ZeroSuggestProvider.
Tommy C. Li090105512019-05-16 22:00:56260const base::Feature kOnFocusSuggestions{"OmniboxOnFocusSuggestions",
261 base::FEATURE_ENABLED_BY_DEFAULT};
262
Tomasz Wiszkowski947f6d0d2019-03-15 22:27:25263// Allow suggestions to be shown to the user on the New Tab Page upon focusing
264// URL bar (the omnibox).
265const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP",
266 base::FEATURE_DISABLED_BY_DEFAULT};
267
Moe Ahmadi4005ec92019-09-09 16:55:53268// Allow suggestions to be shown to the user on the New Tab Page upon focusing
269// the real search box.
270const base::Feature kZeroSuggestionsOnNTPRealbox{
271 "OmniboxZeroSuggestionsOnNTPRealbox", base::FEATURE_DISABLED_BY_DEFAULT};
272
Tommy Li1d03b9bf2019-09-23 23:46:34273// Allow on-focus query refinements to be shown on the default SERP.
274const base::Feature kZeroSuggestionsOnSERP{"OmniboxZeroSuggestionsOnSERP",
275 base::FEATURE_ENABLED_BY_DEFAULT};
276
Justin Donnellyf2703482019-10-24 21:42:15277// If enabled, changes the way Google-provided search suggestions are scored by
278// the backend. Note that this Feature is only used for triggering a server-
279// side experiment config that will send experiment IDs to the backend. It is
280// not referred to in any of the Chromium code.
281const base::Feature kOmniboxExperimentalSuggestScoring{
282 "OmniboxExperimentalSuggestScoring", base::FEATURE_DISABLED_BY_DEFAULT};
283
manukh3bb80c92020-01-22 00:19:46284// If disabled, terms with no wordstart matches disqualify the suggestion unless
285// they occur in the URL host. If enabled, terms with no wordstart matches are
286// allowed but not scored. E.g., both inputs 'java script' and 'java cript' will
287// match a suggestion titled 'javascript' and score equivalently.
manukh5ff0f582020-01-14 03:54:13288const base::Feature kHistoryQuickProviderAllowButDoNotScoreMidwordTerms{
289 "OmniboxHistoryQuickProviderAllowButDoNotScoreMidwordTerms",
290 base::FEATURE_DISABLED_BY_DEFAULT};
291
manukh3bb80c92020-01-22 00:19:46292// If disabled, midword matches are ignored except in the URL host, and input
293// terms with no wordstart matches are scored 0, resulting in an overall score
294// of 0. If enabled, midword matches are allowed and scored when they begin
295// immediately after the previous match ends. E.g. 'java script' will match a
296// suggestion titled 'javascript' but the input 'java cript' won't.
manukh5ff0f582020-01-14 03:54:13297const base::Feature kHistoryQuickProviderAllowMidwordContinuations{
298 "OmniboxHistoryQuickProviderAllowMidwordContinuations",
299 base::FEATURE_DISABLED_BY_DEFAULT};
300
Tomasz Wiszkowski70fb35f2020-02-27 00:39:19301// If enabled, shows slightly more compact suggestions, allowing the
302// kAdaptiveSuggestionsCount feature to fit more suggestions on screen.
303const base::Feature kCompactSuggestions{"OmniboxCompactSuggestions",
304 base::FEATURE_DISABLED_BY_DEFAULT};
305
Tommy Li7c2bf492019-10-22 19:34:23306// If enabled, shows a confirm dialog before removing search suggestions from
307// the omnibox. See ConfirmNtpSuggestionRemovals for the NTP equivalent.
308const base::Feature kConfirmOmniboxSuggestionRemovals{
309 "ConfirmOmniboxSuggestionRemovals", base::FEATURE_DISABLED_BY_DEFAULT};
310
Tomasz Wiszkowski70fb35f2020-02-27 00:39:19311// If enabled, defers keyboard popup when user highlights the omnibox until
312// the user taps the Omnibox again.
313extern const base::Feature kDeferredKeyboardPopup{
314 "OmniboxDeferredKeyboardPopup", base::FEATURE_DISABLED_BY_DEFAULT};
315
Kevin Bailey104e44492019-10-31 16:42:32316// Feature that enables not counting submatches towards the maximum
317// suggestion limit.
318const base::Feature kOmniboxLooseMaxLimitOnDedicatedRows{
319 "OmniboxLooseMaxLimitOnDedicatedRows", base::FEATURE_DISABLED_BY_DEFAULT};
320
Orin Jaworskifc174722020-01-29 00:32:22321// Feature that puts a single row of buttons on suggestions with actionable
322// elements like keywords, tab-switch buttons, and Pedals.
323const base::Feature kOmniboxSuggestionButtonRow{
324 "OmniboxSuggestionButtonRow", base::FEATURE_DISABLED_BY_DEFAULT};
325
326// If enabled, allows Tab and Shift+Tab to escape the focus out of the omnibox
327// popup. Otherwise, Tab infinitely loops between suggestions in the popup.
328const base::Feature kTabKeyCanEscapeOmniboxPopup{
329 "TabKeyCanEscapeOmniboxPopup", base::FEATURE_DISABLED_BY_DEFAULT};
330
Tommy Li1f1fc4a2020-01-31 21:02:07331// If enabled, uses WebUI to render the omnibox suggestions popup, similar to
332// how the NTP "fakebox" is implemented.
333const base::Feature kWebUIOmniboxPopup{"WebUIOmniboxPopup",
334 base::FEATURE_DISABLED_BY_DEFAULT};
335
Brandon Wylie1299ff82020-01-23 02:13:37336// When enabled, use Assistant for omnibox voice query recognition instead of
337// Android's built-in voice recognition service. Only works on Android.
338const base::Feature kOmniboxAssistantVoiceSearch{
339 "OmniboxAssistantVoiceSearch", base::FEATURE_DISABLED_BY_DEFAULT};
340
Tomasz Wiszkowskid938a1112019-03-06 18:01:57341} // namespace omnibox