blob: 89719d44592e6a53a0aa7587e9ff9cb33621bd32 [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
Kevin Bailey0f7d1592019-05-23 19:07:3558// This feature is used to have final suggestions within the Omnibox grouped
Kevin Bailey38305592019-05-24 16:55:3659// by major type. i.e. search types are first, followed by all others,
60// except for the default match which is unchanged in position.
61const base::Feature kOmniboxGroupSuggestionsBySearchVsUrl{
62 "OmniboxGroupSuggestionsBySearchVsUrl", base::FEATURE_DISABLED_BY_DEFAULT};
Kevin Bailey0f7d1592019-05-23 19:07:3563
manukaddd3c42019-04-09 21:20:5964// Feature used to enable local entity suggestions. Similar to rich entities but
65// but location specific. E.g., typing 'starbucks near' could display the local
66// entity suggestion 'starbucks near disneyland \n starbucks * Anaheim, CA'.
67const base::Feature kOmniboxLocalEntitySuggestions{
68 "OmniboxLocalEntitySuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
69
Kevin Baileyb3e08732019-05-29 03:55:2570// Feature used to cap the number of URL-type matches shown within the
71// Omnibox. If enabled, the number of URL-type matches is limited (unless
72// there are no more non-URL matches available.) If enabled, there is a
73// companion parameter - OmniboxMaxURLMatches - which specifies the maximum
74// desired number of URL-type matches.
Kevin Baileycd6889922019-05-30 17:22:5575const base::Feature kOmniboxMaxURLMatches{"OmniboxMaxURLMatches",
Kevin Baileyb3e08732019-05-29 03:55:2576 base::FEATURE_DISABLED_BY_DEFAULT};
77
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
89// Feature used to enable enhanced presentation showing larger images.
90// This is currently only used on Android.
91const base::Feature kOmniboxNewAnswerLayout{"OmniboxNewAnswerLayout",
92 base::FEATURE_DISABLED_BY_DEFAULT};
93
Kevin Baileyabf05d62019-05-15 17:29:5694const base::Feature kOmniboxPreserveDefaultMatchScore{
95 "OmniboxPreserveDefaultMatchScore", base::FEATURE_DISABLED_BY_DEFAULT};
96
Tomasz Wiszkowskid938a1112019-03-06 18:01:5797// Feature used to enable swapping the rows on answers.
98const base::Feature kOmniboxReverseAnswers{"OmniboxReverseAnswers",
99 base::FEATURE_DISABLED_BY_DEFAULT};
100
Kevin Bailey7d918b92019-05-02 16:00:14101// Feature used to enable matching short words to bookmarks for suggestions.
102const base::Feature kOmniboxShortBookmarkSuggestions{
103 "OmniboxShortBookmarkSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
104
Tomasz Wiszkowskid938a1112019-03-06 18:01:57105// Feature used to force on the experiment of transmission of tail suggestions
106// from GWS to this client, currently testing for desktop.
107const base::Feature kOmniboxTailSuggestions{
108 "OmniboxTailSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
109
Stepan Khapuginb09801662019-05-07 10:17:04110// Feature that enables the tab-switch button on suggestions corresponding to an
111// open tab. Enabled by default on Desktop and iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57112const base::Feature kOmniboxTabSwitchSuggestions{
113 "OmniboxTabSwitchSuggestions",
Stepan Khapuginb09801662019-05-07 10:17:04114#if defined(OS_ANDROID)
Tomasz Wiszkowskid938a1112019-03-06 18:01:57115 base::FEATURE_DISABLED_BY_DEFAULT
116#else
117 base::FEATURE_ENABLED_BY_DEFAULT
118#endif
119};
120
Kevin Baileyc4e090c2019-07-11 16:42:11121// Feature that enables wrapping the Omnibox position between top and bottom.
122// The feature is enabled by default, but remains as a kill-switch.
123const base::Feature kOmniboxWrapPopupPosition{"OmniboxWrapPopupPosition",
124 base::FEATURE_ENABLED_BY_DEFAULT};
Kevin Baileyc9cd6cd2019-06-27 02:47:53125
Tomasz Wiszkowskid938a1112019-03-06 18:01:57126// Feature used to reverse the sense of the tab switch button. Selecting the
127// suggestion will switch to the tab, while the button will navigate
128// locally.
129const base::Feature kOmniboxReverseTabSwitchLogic{
130 "OmniboxReverseTabSwitchLogic", base::FEATURE_DISABLED_BY_DEFAULT};
131
132// Feature used to enable various experiments on keyword mode, UI and
133// suggestions.
134const base::Feature kExperimentalKeywordMode{"OmniboxExperimentalKeywordMode",
135 base::FEATURE_DISABLED_BY_DEFAULT};
136
137// Feature used to enable Pedal suggestions.
138const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions",
139 base::FEATURE_DISABLED_BY_DEFAULT};
140
Tommy C. Lia2c75fb2019-04-08 20:22:34141// Feature used for UI that improves transparency of and control over omnibox
142// suggestions. This includes UI cues (like a clock icon for Search History
143// suggestions), as well as user controls to delete personalized suggestions.
144// This will be eventually enabled by default.
145const base::Feature kOmniboxSuggestionTransparencyOptions{
146 "OmniboxSuggestionTransparencyOptions", base::FEATURE_DISABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57147
Tommy C. Lie57096e92019-04-23 21:18:55148// Feature that shows UI cues to differentiate Search History matches from
149// other search suggestions provided by the default search provider. This
150// feature is a narrow subset of kOmniboxSuggestionTransparencyOptions.
151const base::Feature kOmniboxUICuesForSearchHistoryMatches{
Tommy C. Li20b1da2d2019-07-17 17:13:24152 "OmniboxUICuesForSearchHistoryMatches", base::FEATURE_ENABLED_BY_DEFAULT};
Tommy C. Lie57096e92019-04-23 21:18:55153
Tommy C. Li7af8664b2019-04-24 18:10:29154// Feature that shows an alternate separator before the description of
155// omnibox matches. In English, this changes the separator from '-' to '|'.
156const base::Feature kOmniboxAlternateMatchDescriptionSeparator{
157 "OmniboxAlternateMatchDescriptionSeparator",
158 base::FEATURE_DISABLED_BY_DEFAULT};
159
Tomasz Wiszkowskid938a1112019-03-06 18:01:57160// Feature to enable clipboard provider to suggest copied text.
161const base::Feature kEnableClipboardProviderTextSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29162 "OmniboxEnableClipboardProviderTextSuggestions",
163#if defined(OS_IOS)
164 base::FEATURE_ENABLED_BY_DEFAULT
165#else
166 base::FEATURE_DISABLED_BY_DEFAULT
167#endif
168};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57169
170// Feature to enable clipboard provider to suggest searching for copied images.
171const base::Feature kEnableClipboardProviderImageSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29172 "OmniboxEnableClipboardProviderImageSuggestions",
173#if defined(OS_IOS)
174 base::FEATURE_ENABLED_BY_DEFAULT
175#else
176 base::FEATURE_DISABLED_BY_DEFAULT
177#endif
178};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57179
180// Feature to enable the search provider to send a request to the suggest
181// server on focus. This allows the suggest server to warm up, by, for
182// example, loading per-user models into memory. Having a per-user model
183// in memory allows the suggest server to respond more quickly with
184// personalized suggestions as the user types.
185const base::Feature kSearchProviderWarmUpOnFocus{
186 "OmniboxWarmUpSearchProviderOnFocus",
187#if defined(OS_IOS)
188 base::FEATURE_DISABLED_BY_DEFAULT
189#else
190 base::FEATURE_ENABLED_BY_DEFAULT
191#endif
192};
193
Tomasz Wiszkowskid938a1112019-03-06 18:01:57194// Feature used to display the title of the current URL match.
195const base::Feature kDisplayTitleForCurrentUrl{
196 "OmniboxDisplayTitleForCurrentUrl",
197#if !defined(OS_IOS)
198 base::FEATURE_ENABLED_BY_DEFAULT
199#else
200 base::FEATURE_DISABLED_BY_DEFAULT
201#endif
202};
203
204// Feature used for the max autocomplete matches UI experiment.
205const base::Feature kUIExperimentMaxAutocompleteMatches{
206 "OmniboxUIExperimentMaxAutocompleteMatches",
207 base::FEATURE_DISABLED_BY_DEFAULT};
208
209// Feature used to display the search terms instead of the URL in the Omnibox
210// when the user is on the search results page of the default search provider.
211const base::Feature kQueryInOmnibox{"QueryInOmnibox",
212 base::FEATURE_DISABLED_BY_DEFAULT};
213
Tommy C. Li0001b822019-05-10 00:10:03214// Feature used for showing the URL suggestion favicons as a UI experiment.
215// Already launched on Desktop, and currently under development on Android.
216// This flag is not used on iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57217const base::Feature kUIExperimentShowSuggestionFavicons{
Tomasz Wiszkowski4af1f7352019-04-08 16:46:15218 "OmniboxUIExperimentShowSuggestionFavicons",
219#if defined(OS_ANDROID)
220 base::FEATURE_DISABLED_BY_DEFAULT
221#else
222 base::FEATURE_ENABLED_BY_DEFAULT
223#endif
224};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57225
226// Feature used to always swap the title and URL.
227const base::Feature kUIExperimentSwapTitleAndUrl{
228 "OmniboxUIExperimentSwapTitleAndUrl",
229#if defined(OS_IOS) || defined(OS_ANDROID)
230 base::FEATURE_DISABLED_BY_DEFAULT
231#else
232 base::FEATURE_ENABLED_BY_DEFAULT
233#endif
234};
235
236// Feature used for the vertical margin UI experiment, currently only used on
237// desktop platforms.
238const base::Feature kUIExperimentVerticalMargin{
239 "OmniboxUIExperimentVerticalMargin", base::FEATURE_DISABLED_BY_DEFAULT};
240
Tommy C. Lie35fb6b2019-04-30 16:29:54241// Feature used to limit the vertical margin UI experiment to non-touch
242// devices only. Has no effect if kUIExperimentVerticalMargin is not enabled.
243const base::Feature kUIExperimentVerticalMarginLimitToNonTouchOnly{
244 "OmniboxUIExperimentVerticalMarginLimitToNonTouchOnly",
245 base::FEATURE_DISABLED_BY_DEFAULT};
246
Dan Beamc6f0d222019-04-26 00:38:31247// Shows the "Search Google or type a URL" omnibox placeholder even when the
248// caret (text edit cursor) is showing / when focused. views::Textfield works
249// this way, as does <input placeholder="">. Omnibox and the NTP's "fakebox"
250// are exceptions in this regard and this experiment makes this more consistent.
251const base::Feature kUIExperimentShowPlaceholderWhenCaretShowing{
252 "OmniboxUIExperimentShowPlaceholderWhenCaretShowing",
Tommy C. Li20b1da2d2019-07-17 17:13:24253 base::FEATURE_ENABLED_BY_DEFAULT};
Dan Beamc6f0d222019-04-26 00:38:31254
Tomasz Wiszkowskid938a1112019-03-06 18:01:57255// Feature used to enable speculatively starting a service worker associated
256// with the destination of the default match when the user's input looks like a
257// query.
258const base::Feature kSpeculativeServiceWorkerStartOnQueryInput{
259 "OmniboxSpeculativeServiceWorkerStartOnQueryInput",
260 base::FEATURE_ENABLED_BY_DEFAULT
261};
262
263// Feature used to fetch document suggestions.
264const base::Feature kDocumentProvider{"OmniboxDocumentProvider",
265 base::FEATURE_DISABLED_BY_DEFAULT};
266
267// Feature used to dedupe Google Drive URLs between different formats.
268// OmniboxDocumentProvider arms may wish to enable this, though it may also be
269// run on its own.
manukc32a8eff2019-07-02 15:48:30270const base::Feature kDedupeGoogleDriveURLs {
271 "OmniboxDedupeGoogleDriveURLs",
272#if defined(OS_IOS) || defined(OS_ANDROID)
273 base::FEATURE_DISABLED_BY_DEFAULT
274#else
275 base::FEATURE_ENABLED_BY_DEFAULT
276#endif
277};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57278
279// Feature to replace the standard ZeroSuggest with icons for most visited sites
280// and collections (bookmarks, history, recent tabs, reading list). Only
281// available on iOS.
282const base::Feature kOmniboxPopupShortcutIconsInZeroState{
283 "OmniboxPopupShortcutIconsInZeroState", base::FEATURE_DISABLED_BY_DEFAULT};
284
285// Feature to use material design weather icons in the omnibox when displaying
286// weather answers.
287const base::Feature kOmniboxMaterialDesignWeatherIcons{
288 "OmniboxMaterialDesignWeatherIcons", base::FEATURE_DISABLED_BY_DEFAULT};
289
Patrick Noland2b4968b2019-06-27 14:50:26290// Returns whether IsInstantExtendedAPIEnabled should be ignored when deciding
291// the number of Google-provided search suggestions.
292const base::Feature kOmniboxDisableInstantExtendedLimit{
293 "OmniboxDisableInstantExtendedLimit", base::FEATURE_DISABLED_BY_DEFAULT};
294
Brandon Wylief8dd4e82019-07-11 16:39:57295// Show the search engine logo in the omnibox on Android (desktop already does
296// this).
297const base::Feature kOmniboxSearchEngineLogo{"OmniboxSearchEngineLogo",
298 base::FEATURE_DISABLED_BY_DEFAULT};
299
Tommy C. Li090105512019-05-16 22:00:56300// Feature to configure on-focus suggestions provided by ZeroSuggestProvider.
Tommy C. Li414f22022019-06-07 23:46:22301// This feature's main job is to contain some field trial parameters such as:
302// - "ZeroSuggestVariant" configures the per-page-classification mode of
303// ZeroSuggestProvider.
304// - "CustomEndpointURL" configures a custom endpoint for remote suggestions.
305// - "CustomEndpointExperimentID" sends an id number to the custom endpoint.
Tommy C. Li090105512019-05-16 22:00:56306const base::Feature kOnFocusSuggestions{"OmniboxOnFocusSuggestions",
307 base::FEATURE_ENABLED_BY_DEFAULT};
308
Tomasz Wiszkowski947f6d0d2019-03-15 22:27:25309// Allow suggestions to be shown to the user on the New Tab Page upon focusing
310// URL bar (the omnibox).
311const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP",
312 base::FEATURE_DISABLED_BY_DEFAULT};
313
Ce Chen20af01c2019-07-02 19:16:36314// Feature to provide non personalized head search suggestion from a compact
315// on device model.
316const base::Feature kOnDeviceHeadProvider{"OmniboxOnDeviceHeadProvider",
317 base::FEATURE_DISABLED_BY_DEFAULT};
318
Tomasz Wiszkowskid938a1112019-03-06 18:01:57319} // namespace omnibox