blob: d2dc995d0b9b316c819d54d0310e5a8f5562c756 [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
7namespace omnibox {
8
9// Feature used to hide the scheme from steady state URLs displayed in the
10// toolbar. It is restored during editing.
11const base::Feature kHideFileUrlScheme {
12 "OmniboxUIExperimentHideFileUrlScheme",
13// Android and iOS don't have the File security chip, and therefore still
14// need to show the file scheme.
15#if defined(OS_ANDROID) || defined(OS_IOS)
16 base::FEATURE_DISABLED_BY_DEFAULT
17#else
18 base::FEATURE_ENABLED_BY_DEFAULT
19#endif
20};
21
22// Feature used to hide the scheme from steady state URLs displayed in the
23// toolbar. It is restored during editing.
Tommy C. Li7514ba82019-06-25 19:43:5324const base::Feature kHideSteadyStateUrlScheme{
25 "OmniboxUIExperimentHideSteadyStateUrlScheme",
26 base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5727
28// Feature used to hide trivial subdomains from steady state URLs displayed in
29// the toolbar. It is restored during editing.
Tommy C. Li7514ba82019-06-25 19:43:5330const base::Feature kHideSteadyStateUrlTrivialSubdomains{
31 "OmniboxUIExperimentHideSteadyStateUrlTrivialSubdomains",
32 base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5733
34// Feature used to hide the path, query and ref from steady state URLs
35// displayed in the toolbar. It is restored during editing.
36const base::Feature kHideSteadyStateUrlPathQueryAndRef {
37 "OmniboxUIExperimentHideSteadyStateUrlPathQueryAndRef",
38#if defined(OS_IOS)
39 base::FEATURE_ENABLED_BY_DEFAULT
40#else
41 base::FEATURE_DISABLED_BY_DEFAULT
42#endif
43};
44
45// Feature used to undo all omnibox elisions on a single click or focus action.
46const base::Feature kOneClickUnelide{"OmniboxOneClickUnelide",
47 base::FEATURE_DISABLED_BY_DEFAULT};
48
Christopher Thompsonc26ef302019-06-07 01:55:4549// This feature simplifies the security indiciator UI for https:// pages.
50// The default behavior is to show no verbose text for EV pages. When disabled,
51// the verbose EV indicator text will be displayed.
Tomasz Wiszkowskid938a1112019-03-06 18:01:5752// This feature is used for EV UI removal experiment (https://crbug.com/803501).
53const base::Feature kSimplifyHttpsIndicator{"SimplifyHttpsIndicator",
Christopher Thompsonc26ef302019-06-07 01:55:4554 base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5755
Kevin Bailey0f7d1592019-05-23 19:07:3556// This feature is used to have final suggestions within the Omnibox grouped
Kevin Bailey38305592019-05-24 16:55:3657// by major type. i.e. search types are first, followed by all others,
58// except for the default match which is unchanged in position.
59const base::Feature kOmniboxGroupSuggestionsBySearchVsUrl{
60 "OmniboxGroupSuggestionsBySearchVsUrl", base::FEATURE_DISABLED_BY_DEFAULT};
Kevin Bailey0f7d1592019-05-23 19:07:3561
manukaddd3c42019-04-09 21:20:5962// Feature used to enable local entity suggestions. Similar to rich entities but
63// but location specific. E.g., typing 'starbucks near' could display the local
64// entity suggestion 'starbucks near disneyland \n starbucks * Anaheim, CA'.
65const base::Feature kOmniboxLocalEntitySuggestions{
66 "OmniboxLocalEntitySuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
67
Kevin Baileyb3e08732019-05-29 03:55:2568// Feature used to cap the number of URL-type matches shown within the
69// Omnibox. If enabled, the number of URL-type matches is limited (unless
70// there are no more non-URL matches available.) If enabled, there is a
71// companion parameter - OmniboxMaxURLMatches - which specifies the maximum
72// desired number of URL-type matches.
Kevin Baileycd6889922019-05-30 17:22:5573const base::Feature kOmniboxMaxURLMatches{"OmniboxMaxURLMatches",
Kevin Baileyb3e08732019-05-29 03:55:2574 base::FEATURE_DISABLED_BY_DEFAULT};
75
Tomasz Wiszkowskid938a1112019-03-06 18:01:5776// Feature used to enable entity suggestion images and enhanced presentation
77// showing more context and descriptive text about the entity.
78const base::Feature kOmniboxRichEntitySuggestions{
Justin Donnelly481a69c2019-05-03 20:41:4279 "OmniboxRichEntitySuggestions",
80#if defined(OS_IOS) || defined(OS_ANDROID)
81 base::FEATURE_DISABLED_BY_DEFAULT
82#else
83 base::FEATURE_ENABLED_BY_DEFAULT
84#endif
85};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5786
87// Feature used to enable enhanced presentation showing larger images.
88// This is currently only used on Android.
89const base::Feature kOmniboxNewAnswerLayout{"OmniboxNewAnswerLayout",
90 base::FEATURE_DISABLED_BY_DEFAULT};
91
Kevin Baileyabf05d62019-05-15 17:29:5692const base::Feature kOmniboxPreserveDefaultMatchScore{
93 "OmniboxPreserveDefaultMatchScore", base::FEATURE_DISABLED_BY_DEFAULT};
94
Tomasz Wiszkowskid938a1112019-03-06 18:01:5795// Feature used to enable swapping the rows on answers.
96const base::Feature kOmniboxReverseAnswers{"OmniboxReverseAnswers",
97 base::FEATURE_DISABLED_BY_DEFAULT};
98
Kevin Bailey7d918b92019-05-02 16:00:1499// Feature used to enable matching short words to bookmarks for suggestions.
100const base::Feature kOmniboxShortBookmarkSuggestions{
101 "OmniboxShortBookmarkSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
102
Tomasz Wiszkowskid938a1112019-03-06 18:01:57103// Feature used to force on the experiment of transmission of tail suggestions
104// from GWS to this client, currently testing for desktop.
105const base::Feature kOmniboxTailSuggestions{
106 "OmniboxTailSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
107
Stepan Khapuginb09801662019-05-07 10:17:04108// Feature that enables the tab-switch button on suggestions corresponding to an
109// open tab. Enabled by default on Desktop and iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57110const base::Feature kOmniboxTabSwitchSuggestions{
111 "OmniboxTabSwitchSuggestions",
Stepan Khapuginb09801662019-05-07 10:17:04112#if defined(OS_ANDROID)
Tomasz Wiszkowskid938a1112019-03-06 18:01:57113 base::FEATURE_DISABLED_BY_DEFAULT
114#else
115 base::FEATURE_ENABLED_BY_DEFAULT
116#endif
117};
118
Kevin Baileyc9cd6cd2019-06-27 02:47:53119// Feature that enables wrapping the Omnibox position between top and
120// bottom.
121const base::Feature kOmniboxWrapPopupPosition{
122 "OmniboxWrapPopupPosition", base::FEATURE_DISABLED_BY_DEFAULT};
123
Tomasz Wiszkowskid938a1112019-03-06 18:01:57124// Feature used to reverse the sense of the tab switch button. Selecting the
125// suggestion will switch to the tab, while the button will navigate
126// locally.
127const base::Feature kOmniboxReverseTabSwitchLogic{
128 "OmniboxReverseTabSwitchLogic", base::FEATURE_DISABLED_BY_DEFAULT};
129
130// Feature used to enable various experiments on keyword mode, UI and
131// suggestions.
132const base::Feature kExperimentalKeywordMode{"OmniboxExperimentalKeywordMode",
133 base::FEATURE_DISABLED_BY_DEFAULT};
134
135// Feature used to enable Pedal suggestions.
136const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions",
137 base::FEATURE_DISABLED_BY_DEFAULT};
138
Tommy C. Lia2c75fb2019-04-08 20:22:34139// Feature used for UI that improves transparency of and control over omnibox
140// suggestions. This includes UI cues (like a clock icon for Search History
141// suggestions), as well as user controls to delete personalized suggestions.
142// This will be eventually enabled by default.
143const base::Feature kOmniboxSuggestionTransparencyOptions{
144 "OmniboxSuggestionTransparencyOptions", base::FEATURE_DISABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57145
Tommy C. Lie57096e92019-04-23 21:18:55146// Feature that shows UI cues to differentiate Search History matches from
147// other search suggestions provided by the default search provider. This
148// feature is a narrow subset of kOmniboxSuggestionTransparencyOptions.
149const base::Feature kOmniboxUICuesForSearchHistoryMatches{
150 "OmniboxUICuesForSearchHistoryMatches", base::FEATURE_DISABLED_BY_DEFAULT};
151
Tommy C. Li7af8664b2019-04-24 18:10:29152// Feature that shows an alternate separator before the description of
153// omnibox matches. In English, this changes the separator from '-' to '|'.
154const base::Feature kOmniboxAlternateMatchDescriptionSeparator{
155 "OmniboxAlternateMatchDescriptionSeparator",
156 base::FEATURE_DISABLED_BY_DEFAULT};
157
Tomasz Wiszkowskid938a1112019-03-06 18:01:57158// Feature to enable clipboard provider to suggest copied text.
159const base::Feature kEnableClipboardProviderTextSuggestions{
160 "OmniboxEnableClipboardProviderTextSuggestions",
161 base::FEATURE_DISABLED_BY_DEFAULT};
162
163// Feature to enable clipboard provider to suggest searching for copied images.
164const base::Feature kEnableClipboardProviderImageSuggestions{
165 "OmniboxEnableClipboardProviderImageSuggestions",
166 base::FEATURE_DISABLED_BY_DEFAULT};
167
168// Feature to enable the search provider to send a request to the suggest
169// server on focus. This allows the suggest server to warm up, by, for
170// example, loading per-user models into memory. Having a per-user model
171// in memory allows the suggest server to respond more quickly with
172// personalized suggestions as the user types.
173const base::Feature kSearchProviderWarmUpOnFocus{
174 "OmniboxWarmUpSearchProviderOnFocus",
175#if defined(OS_IOS)
176 base::FEATURE_DISABLED_BY_DEFAULT
177#else
178 base::FEATURE_ENABLED_BY_DEFAULT
179#endif
180};
181
Tomasz Wiszkowskid938a1112019-03-06 18:01:57182// Feature used to display the title of the current URL match.
183const base::Feature kDisplayTitleForCurrentUrl{
184 "OmniboxDisplayTitleForCurrentUrl",
185#if !defined(OS_IOS)
186 base::FEATURE_ENABLED_BY_DEFAULT
187#else
188 base::FEATURE_DISABLED_BY_DEFAULT
189#endif
190};
191
192// Feature used for the max autocomplete matches UI experiment.
193const base::Feature kUIExperimentMaxAutocompleteMatches{
194 "OmniboxUIExperimentMaxAutocompleteMatches",
195 base::FEATURE_DISABLED_BY_DEFAULT};
196
197// Feature used to display the search terms instead of the URL in the Omnibox
198// when the user is on the search results page of the default search provider.
199const base::Feature kQueryInOmnibox{"QueryInOmnibox",
200 base::FEATURE_DISABLED_BY_DEFAULT};
201
Tommy C. Li0001b822019-05-10 00:10:03202// Feature used for showing the URL suggestion favicons as a UI experiment.
203// Already launched on Desktop, and currently under development on Android.
204// This flag is not used on iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57205const base::Feature kUIExperimentShowSuggestionFavicons{
Tomasz Wiszkowski4af1f7352019-04-08 16:46:15206 "OmniboxUIExperimentShowSuggestionFavicons",
207#if defined(OS_ANDROID)
208 base::FEATURE_DISABLED_BY_DEFAULT
209#else
210 base::FEATURE_ENABLED_BY_DEFAULT
211#endif
212};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57213
214// Feature used to always swap the title and URL.
215const base::Feature kUIExperimentSwapTitleAndUrl{
216 "OmniboxUIExperimentSwapTitleAndUrl",
217#if defined(OS_IOS) || defined(OS_ANDROID)
218 base::FEATURE_DISABLED_BY_DEFAULT
219#else
220 base::FEATURE_ENABLED_BY_DEFAULT
221#endif
222};
223
224// Feature used for the vertical margin UI experiment, currently only used on
225// desktop platforms.
226const base::Feature kUIExperimentVerticalMargin{
227 "OmniboxUIExperimentVerticalMargin", base::FEATURE_DISABLED_BY_DEFAULT};
228
Tommy C. Lie35fb6b2019-04-30 16:29:54229// Feature used to limit the vertical margin UI experiment to non-touch
230// devices only. Has no effect if kUIExperimentVerticalMargin is not enabled.
231const base::Feature kUIExperimentVerticalMarginLimitToNonTouchOnly{
232 "OmniboxUIExperimentVerticalMarginLimitToNonTouchOnly",
233 base::FEATURE_DISABLED_BY_DEFAULT};
234
Dan Beamc6f0d222019-04-26 00:38:31235// Shows the "Search Google or type a URL" omnibox placeholder even when the
236// caret (text edit cursor) is showing / when focused. views::Textfield works
237// this way, as does <input placeholder="">. Omnibox and the NTP's "fakebox"
238// are exceptions in this regard and this experiment makes this more consistent.
239const base::Feature kUIExperimentShowPlaceholderWhenCaretShowing{
240 "OmniboxUIExperimentShowPlaceholderWhenCaretShowing",
241 base::FEATURE_DISABLED_BY_DEFAULT};
242
Tomasz Wiszkowskid938a1112019-03-06 18:01:57243// Feature used to enable speculatively starting a service worker associated
244// with the destination of the default match when the user's input looks like a
245// query.
246const base::Feature kSpeculativeServiceWorkerStartOnQueryInput{
247 "OmniboxSpeculativeServiceWorkerStartOnQueryInput",
248 base::FEATURE_ENABLED_BY_DEFAULT
249};
250
251// Feature used to fetch document suggestions.
252const base::Feature kDocumentProvider{"OmniboxDocumentProvider",
253 base::FEATURE_DISABLED_BY_DEFAULT};
254
255// Feature used to dedupe Google Drive URLs between different formats.
256// OmniboxDocumentProvider arms may wish to enable this, though it may also be
257// run on its own.
258const base::Feature kDedupeGoogleDriveURLs{"OmniboxDedupeGoogleDriveURLs",
259 base::FEATURE_DISABLED_BY_DEFAULT};
260
261// Feature to replace the standard ZeroSuggest with icons for most visited sites
262// and collections (bookmarks, history, recent tabs, reading list). Only
263// available on iOS.
264const base::Feature kOmniboxPopupShortcutIconsInZeroState{
265 "OmniboxPopupShortcutIconsInZeroState", base::FEATURE_DISABLED_BY_DEFAULT};
266
267// Feature to use material design weather icons in the omnibox when displaying
268// weather answers.
269const base::Feature kOmniboxMaterialDesignWeatherIcons{
270 "OmniboxMaterialDesignWeatherIcons", base::FEATURE_DISABLED_BY_DEFAULT};
271
Patrick Noland2b4968b2019-06-27 14:50:26272// Returns whether IsInstantExtendedAPIEnabled should be ignored when deciding
273// the number of Google-provided search suggestions.
274const base::Feature kOmniboxDisableInstantExtendedLimit{
275 "OmniboxDisableInstantExtendedLimit", base::FEATURE_DISABLED_BY_DEFAULT};
276
Tommy C. Li090105512019-05-16 22:00:56277// Feature to configure on-focus suggestions provided by ZeroSuggestProvider.
Tommy C. Li414f22022019-06-07 23:46:22278// This feature's main job is to contain some field trial parameters such as:
279// - "ZeroSuggestVariant" configures the per-page-classification mode of
280// ZeroSuggestProvider.
281// - "CustomEndpointURL" configures a custom endpoint for remote suggestions.
282// - "CustomEndpointExperimentID" sends an id number to the custom endpoint.
Tommy C. Li090105512019-05-16 22:00:56283const base::Feature kOnFocusSuggestions{"OmniboxOnFocusSuggestions",
284 base::FEATURE_ENABLED_BY_DEFAULT};
285
Tomasz Wiszkowski947f6d0d2019-03-15 22:27:25286// Allow suggestions to be shown to the user on the New Tab Page upon focusing
287// URL bar (the omnibox).
288const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP",
289 base::FEATURE_DISABLED_BY_DEFAULT};
290
Tomasz Wiszkowskid938a1112019-03-06 18:01:57291} // namespace omnibox