blob: efe2b83120c63c3e595b5051860cec60c9d11e30 [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
11// Feature used to hide the scheme from steady state URLs displayed in the
12// toolbar. It is restored during editing.
13const base::Feature kHideFileUrlScheme {
14 "OmniboxUIExperimentHideFileUrlScheme",
15// Android and iOS don't have the File security chip, and therefore still
16// need to show the file scheme.
17#if defined(OS_ANDROID) || defined(OS_IOS)
18 base::FEATURE_DISABLED_BY_DEFAULT
19#else
20 base::FEATURE_ENABLED_BY_DEFAULT
21#endif
22};
23
24// Feature used to hide the scheme from steady state URLs displayed in the
25// toolbar. It is restored during editing.
Tommy C. Li7514ba82019-06-25 19:43:5326const base::Feature kHideSteadyStateUrlScheme{
27 "OmniboxUIExperimentHideSteadyStateUrlScheme",
28 base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5729
30// Feature used to hide trivial subdomains from steady state URLs displayed in
31// the toolbar. It is restored during editing.
Tommy C. Li7514ba82019-06-25 19:43:5332const base::Feature kHideSteadyStateUrlTrivialSubdomains{
33 "OmniboxUIExperimentHideSteadyStateUrlTrivialSubdomains",
34 base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5735
36// Feature used to hide the path, query and ref from steady state URLs
37// displayed in the toolbar. It is restored during editing.
38const base::Feature kHideSteadyStateUrlPathQueryAndRef {
39 "OmniboxUIExperimentHideSteadyStateUrlPathQueryAndRef",
40#if defined(OS_IOS)
41 base::FEATURE_ENABLED_BY_DEFAULT
42#else
43 base::FEATURE_DISABLED_BY_DEFAULT
44#endif
45};
46
47// Feature used to undo all omnibox elisions on a single click or focus action.
48const base::Feature kOneClickUnelide{"OmniboxOneClickUnelide",
49 base::FEATURE_DISABLED_BY_DEFAULT};
50
Christopher Thompsonc26ef302019-06-07 01:55:4551// This feature simplifies the security indiciator UI for https:// pages.
52// The default behavior is to show no verbose text for EV pages. When disabled,
53// the verbose EV indicator text will be displayed.
Tomasz Wiszkowskid938a1112019-03-06 18:01:5754// This feature is used for EV UI removal experiment (https://crbug.com/803501).
55const base::Feature kSimplifyHttpsIndicator{"SimplifyHttpsIndicator",
Christopher Thompsonc26ef302019-06-07 01:55:4556 base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5757
manukaddd3c42019-04-09 21:20:5958// Feature used to enable local entity suggestions. Similar to rich entities but
59// but location specific. E.g., typing 'starbucks near' could display the local
60// entity suggestion 'starbucks near disneyland \n starbucks * Anaheim, CA'.
61const base::Feature kOmniboxLocalEntitySuggestions{
62 "OmniboxLocalEntitySuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
63
Kevin Baileyb3e08732019-05-29 03:55:2564// Feature used to cap the number of URL-type matches shown within the
65// Omnibox. If enabled, the number of URL-type matches is limited (unless
66// there are no more non-URL matches available.) If enabled, there is a
67// companion parameter - OmniboxMaxURLMatches - which specifies the maximum
68// desired number of URL-type matches.
Kevin Bailey26238862019-10-31 22:08:1269const base::Feature kOmniboxMaxURLMatches {
70 "OmniboxMaxURLMatches",
71#if defined(OS_IOS) || defined(OS_ANDROID)
72 base::FEATURE_DISABLED_BY_DEFAULT
73#else
74 base::FEATURE_ENABLED_BY_DEFAULT
75#endif
76};
Kevin Baileyb3e08732019-05-29 03:55:2577
Tomasz Wiszkowskid938a1112019-03-06 18:01:5778// Feature used to enable entity suggestion images and enhanced presentation
79// showing more context and descriptive text about the entity.
80const base::Feature kOmniboxRichEntitySuggestions{
Justin Donnelly481a69c2019-05-03 20:41:4281 "OmniboxRichEntitySuggestions",
82#if defined(OS_IOS) || defined(OS_ANDROID)
83 base::FEATURE_DISABLED_BY_DEFAULT
84#else
85 base::FEATURE_ENABLED_BY_DEFAULT
86#endif
87};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5788
Tomasz Wiszkowskid938a1112019-03-06 18:01:5789// Feature used to enable swapping the rows on answers.
90const base::Feature kOmniboxReverseAnswers{"OmniboxReverseAnswers",
91 base::FEATURE_DISABLED_BY_DEFAULT};
92
Kevin Bailey7d918b92019-05-02 16:00:1493// Feature used to enable matching short words to bookmarks for suggestions.
94const base::Feature kOmniboxShortBookmarkSuggestions{
95 "OmniboxShortBookmarkSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
96
Tomasz Wiszkowskid938a1112019-03-06 18:01:5797// Feature used to force on the experiment of transmission of tail suggestions
98// from GWS to this client, currently testing for desktop.
99const base::Feature kOmniboxTailSuggestions{
100 "OmniboxTailSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
101
Kevin Bailey37bbf1d2019-08-21 19:23:55102// Feature that enables the tab-switch suggestions corresponding to an open
103// tab, for a button or dedicated suggestion. Enabled by default on Desktop
104// and iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57105const base::Feature kOmniboxTabSwitchSuggestions{
106 "OmniboxTabSwitchSuggestions",
Stepan Khapuginb09801662019-05-07 10:17:04107#if defined(OS_ANDROID)
Tomasz Wiszkowskid938a1112019-03-06 18:01:57108 base::FEATURE_DISABLED_BY_DEFAULT
109#else
110 base::FEATURE_ENABLED_BY_DEFAULT
111#endif
112};
113
Kevin Bailey37bbf1d2019-08-21 19:23:55114// Feature that enables tab-switch suggestions in their own row.
115const base::Feature kOmniboxTabSwitchSuggestionsDedicatedRow{
116 "OmniboxTabSwitchSuggestionsDedicatedRow",
117 base::FEATURE_DISABLED_BY_DEFAULT};
118
Tomasz Wiszkowskid938a1112019-03-06 18:01:57119// Feature used to enable various experiments on keyword mode, UI and
120// suggestions.
121const base::Feature kExperimentalKeywordMode{"OmniboxExperimentalKeywordMode",
122 base::FEATURE_DISABLED_BY_DEFAULT};
123
124// Feature used to enable Pedal suggestions.
125const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions",
126 base::FEATURE_DISABLED_BY_DEFAULT};
127
Tommy C. Lia2c75fb2019-04-08 20:22:34128// Feature used for UI that improves transparency of and control over omnibox
Tommy Li9d12b4be2019-09-12 19:21:41129// suggestions. This includes "Why this Suggestion?" and user controls to delete
130// personalized suggestions. This will be eventually enabled by default.
Tommy C. Lia2c75fb2019-04-08 20:22:34131const base::Feature kOmniboxSuggestionTransparencyOptions{
132 "OmniboxSuggestionTransparencyOptions", base::FEATURE_DISABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57133
Tomasz Wiszkowskid938a1112019-03-06 18:01:57134// Feature to enable clipboard provider to suggest copied text.
135const base::Feature kEnableClipboardProviderTextSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29136 "OmniboxEnableClipboardProviderTextSuggestions",
137#if defined(OS_IOS)
138 base::FEATURE_ENABLED_BY_DEFAULT
139#else
140 base::FEATURE_DISABLED_BY_DEFAULT
141#endif
142};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57143
144// Feature to enable clipboard provider to suggest searching for copied images.
145const base::Feature kEnableClipboardProviderImageSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29146 "OmniboxEnableClipboardProviderImageSuggestions",
147#if defined(OS_IOS)
148 base::FEATURE_ENABLED_BY_DEFAULT
149#else
150 base::FEATURE_DISABLED_BY_DEFAULT
151#endif
152};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57153
154// Feature to enable the search provider to send a request to the suggest
155// server on focus. This allows the suggest server to warm up, by, for
156// example, loading per-user models into memory. Having a per-user model
157// in memory allows the suggest server to respond more quickly with
158// personalized suggestions as the user types.
159const base::Feature kSearchProviderWarmUpOnFocus{
160 "OmniboxWarmUpSearchProviderOnFocus",
161#if defined(OS_IOS)
162 base::FEATURE_DISABLED_BY_DEFAULT
163#else
164 base::FEATURE_ENABLED_BY_DEFAULT
165#endif
166};
167
Tomasz Wiszkowskid938a1112019-03-06 18:01:57168// Feature used to display the title of the current URL match.
169const base::Feature kDisplayTitleForCurrentUrl{
170 "OmniboxDisplayTitleForCurrentUrl",
171#if !defined(OS_IOS)
172 base::FEATURE_ENABLED_BY_DEFAULT
173#else
174 base::FEATURE_DISABLED_BY_DEFAULT
175#endif
176};
177
178// Feature used for the max autocomplete matches UI experiment.
179const base::Feature kUIExperimentMaxAutocompleteMatches{
180 "OmniboxUIExperimentMaxAutocompleteMatches",
181 base::FEATURE_DISABLED_BY_DEFAULT};
182
183// Feature used to display the search terms instead of the URL in the Omnibox
184// when the user is on the search results page of the default search provider.
185const base::Feature kQueryInOmnibox{"QueryInOmnibox",
186 base::FEATURE_DISABLED_BY_DEFAULT};
187
Tommy C. Li0001b822019-05-10 00:10:03188// Feature used for showing the URL suggestion favicons as a UI experiment.
189// Already launched on Desktop, and currently under development on Android.
190// This flag is not used on iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57191const base::Feature kUIExperimentShowSuggestionFavicons{
Tomasz Wiszkowski4af1f7352019-04-08 16:46:15192 "OmniboxUIExperimentShowSuggestionFavicons",
193#if defined(OS_ANDROID)
194 base::FEATURE_DISABLED_BY_DEFAULT
195#else
196 base::FEATURE_ENABLED_BY_DEFAULT
197#endif
198};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57199
200// Feature used to always swap the title and URL.
201const base::Feature kUIExperimentSwapTitleAndUrl{
202 "OmniboxUIExperimentSwapTitleAndUrl",
203#if defined(OS_IOS) || defined(OS_ANDROID)
204 base::FEATURE_DISABLED_BY_DEFAULT
205#else
206 base::FEATURE_ENABLED_BY_DEFAULT
207#endif
208};
209
Tomasz Wiszkowskid938a1112019-03-06 18:01:57210// Feature used to enable speculatively starting a service worker associated
211// with the destination of the default match when the user's input looks like a
212// query.
213const base::Feature kSpeculativeServiceWorkerStartOnQueryInput{
214 "OmniboxSpeculativeServiceWorkerStartOnQueryInput",
215 base::FEATURE_ENABLED_BY_DEFAULT
216};
217
218// Feature used to fetch document suggestions.
219const base::Feature kDocumentProvider{"OmniboxDocumentProvider",
220 base::FEATURE_DISABLED_BY_DEFAULT};
221
manuk4542e232019-09-11 19:27:35222// Feature used to autocomplete bookmark, history, and document suggestions when
223// the user input is a prefix of their titles, as opposed to their URLs.
224const base::Feature kAutocompleteTitles{"OmniboxAutocompleteTitles",
225 base::FEATURE_DISABLED_BY_DEFAULT};
226
Tomasz Wiszkowskid938a1112019-03-06 18:01:57227// Feature to use material design weather icons in the omnibox when displaying
228// weather answers.
229const base::Feature kOmniboxMaterialDesignWeatherIcons{
manuk9a2ed552019-09-09 23:45:44230 "OmniboxMaterialDesignWeatherIcons", base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57231
Patrick Noland2b4968b2019-06-27 14:50:26232// Returns whether IsInstantExtendedAPIEnabled should be ignored when deciding
233// the number of Google-provided search suggestions.
234const base::Feature kOmniboxDisableInstantExtendedLimit{
235 "OmniboxDisableInstantExtendedLimit", base::FEATURE_DISABLED_BY_DEFAULT};
236
Brandon Wylief8dd4e82019-07-11 16:39:57237// Show the search engine logo in the omnibox on Android (desktop already does
238// this).
239const base::Feature kOmniboxSearchEngineLogo{"OmniboxSearchEngineLogo",
240 base::FEATURE_DISABLED_BY_DEFAULT};
241
manukbf3c8ab2019-10-24 16:52:08242// Feature used to allow users to remove suggestions from clipboard.
243const base::Feature kOmniboxRemoveSuggestionsFromClipboard{
244 "OmniboxRemoveSuggestionsFromClipboard", base::FEATURE_DISABLED_BY_DEFAULT};
245
246// Feature to provide non personalized head search suggestion from a compact
247// on device model.
248const base::Feature kOnDeviceHeadProvider{"OmniboxOnDeviceHeadProvider",
249 base::FEATURE_DISABLED_BY_DEFAULT};
250
251// Feature to debounce drive requests from the document provider.
252const base::Feature kDebounceDocumentProvider{
253 "OmniboxDebounceDocumentProvider", base::FEATURE_DISABLED_BY_DEFAULT};
254
Tommy Li6390ecc2019-09-06 21:08:57255// Preserves the default match against change when providers return results
256// asynchronously. This prevents the default match from changing after the user
257// finishes typing. Without this feature, if the default match is updated right
258// when the user presses Enter, the user may go to a surprising destination.
259const base::Feature kOmniboxPreserveDefaultMatchAgainstAsyncUpdate{
260 "OmniboxPreserveDefaultMatchAgainstAsyncUpdate",
261 base::FEATURE_DISABLED_BY_DEFAULT};
262
manuk7b89f6642019-11-08 19:25:24263// Demotes the relevance scores when comparing suggestions based on the
264// suggestion's |AutocompleteMatchType| and the user's |PageClassification|.
265// This feature's main job is to contain the DemoteByType parameter.
266const base::Feature kOmniboxDemoteByType{"OmniboxDemoteByType",
267 base::FEATURE_DISABLED_BY_DEFAULT};
268
Tommy C. Li090105512019-05-16 22:00:56269// Feature to configure on-focus suggestions provided by ZeroSuggestProvider.
Tommy C. Li414f22022019-06-07 23:46:22270// This feature's main job is to contain some field trial parameters such as:
271// - "ZeroSuggestVariant" configures the per-page-classification mode of
272// ZeroSuggestProvider.
Tommy C. Li090105512019-05-16 22:00:56273const base::Feature kOnFocusSuggestions{"OmniboxOnFocusSuggestions",
274 base::FEATURE_ENABLED_BY_DEFAULT};
275
Tomasz Wiszkowski947f6d0d2019-03-15 22:27:25276// Allow suggestions to be shown to the user on the New Tab Page upon focusing
277// URL bar (the omnibox).
278const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP",
279 base::FEATURE_DISABLED_BY_DEFAULT};
280
Moe Ahmadi4005ec92019-09-09 16:55:53281// Allow suggestions to be shown to the user on the New Tab Page upon focusing
282// the real search box.
283const base::Feature kZeroSuggestionsOnNTPRealbox{
284 "OmniboxZeroSuggestionsOnNTPRealbox", base::FEATURE_DISABLED_BY_DEFAULT};
285
Tommy Li1d03b9bf2019-09-23 23:46:34286// Allow on-focus query refinements to be shown on the default SERP.
287const base::Feature kZeroSuggestionsOnSERP{"OmniboxZeroSuggestionsOnSERP",
288 base::FEATURE_ENABLED_BY_DEFAULT};
289
Justin Donnellyf2703482019-10-24 21:42:15290// 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.
294const base::Feature kOmniboxExperimentalSuggestScoring{
295 "OmniboxExperimentalSuggestScoring", base::FEATURE_DISABLED_BY_DEFAULT};
296
manukh3bb80c92020-01-22 00:19:46297// 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.
manukh5ff0f582020-01-14 03:54:13301const base::Feature kHistoryQuickProviderAllowButDoNotScoreMidwordTerms{
302 "OmniboxHistoryQuickProviderAllowButDoNotScoreMidwordTerms",
303 base::FEATURE_DISABLED_BY_DEFAULT};
304
manukh3bb80c92020-01-22 00:19:46305// 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.
manukh5ff0f582020-01-14 03:54:13310const base::Feature kHistoryQuickProviderAllowMidwordContinuations{
311 "OmniboxHistoryQuickProviderAllowMidwordContinuations",
312 base::FEATURE_DISABLED_BY_DEFAULT};
313
Tommy Li7c2bf492019-10-22 19:34:23314// If enabled, shows a confirm dialog before removing search suggestions from
315// the omnibox. See ConfirmNtpSuggestionRemovals for the NTP equivalent.
316const base::Feature kConfirmOmniboxSuggestionRemovals{
317 "ConfirmOmniboxSuggestionRemovals", base::FEATURE_DISABLED_BY_DEFAULT};
318
Kevin Bailey104e44492019-10-31 16:42:32319// Feature that enables not counting submatches towards the maximum
320// suggestion limit.
321const base::Feature kOmniboxLooseMaxLimitOnDedicatedRows{
322 "OmniboxLooseMaxLimitOnDedicatedRows", base::FEATURE_DISABLED_BY_DEFAULT};
323
Orin Jaworskifc174722020-01-29 00:32:22324// Feature that puts a single row of buttons on suggestions with actionable
325// elements like keywords, tab-switch buttons, and Pedals.
326const base::Feature kOmniboxSuggestionButtonRow{
327 "OmniboxSuggestionButtonRow", base::FEATURE_DISABLED_BY_DEFAULT};
328
329// If enabled, allows Tab and Shift+Tab to escape the focus out of the omnibox
330// popup. Otherwise, Tab infinitely loops between suggestions in the popup.
331const base::Feature kTabKeyCanEscapeOmniboxPopup{
332 "TabKeyCanEscapeOmniboxPopup", base::FEATURE_DISABLED_BY_DEFAULT};
333
Tommy Li1f1fc4a2020-01-31 21:02:07334// If enabled, uses WebUI to render the omnibox suggestions popup, similar to
335// how the NTP "fakebox" is implemented.
336const base::Feature kWebUIOmniboxPopup{"WebUIOmniboxPopup",
337 base::FEATURE_DISABLED_BY_DEFAULT};
338
Brandon Wylie1299ff82020-01-23 02:13:37339// When enabled, use Assistant for omnibox voice query recognition instead of
340// Android's built-in voice recognition service. Only works on Android.
341const base::Feature kOmniboxAssistantVoiceSearch{
342 "OmniboxAssistantVoiceSearch", base::FEATURE_DISABLED_BY_DEFAULT};
343
Tomasz Wiszkowskid938a1112019-03-06 18:01:57344} // namespace omnibox