blob: 2f9de04b0ed9955ef61525daf78f48c9ab5de4c1 [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{
manuk57c11852019-07-26 22:59:0562 "OmniboxGroupSuggestionsBySearchVsUrl",
63#if defined(OS_IOS) || defined(OS_ANDROID)
64 base::FEATURE_DISABLED_BY_DEFAULT
65#else
66 base::FEATURE_ENABLED_BY_DEFAULT
67#endif
68};
Kevin Bailey0f7d1592019-05-23 19:07:3569
manukaddd3c42019-04-09 21:20:5970// Feature used to enable local entity suggestions. Similar to rich entities but
71// but location specific. E.g., typing 'starbucks near' could display the local
72// entity suggestion 'starbucks near disneyland \n starbucks * Anaheim, CA'.
73const base::Feature kOmniboxLocalEntitySuggestions{
74 "OmniboxLocalEntitySuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
75
Kevin Baileyb3e08732019-05-29 03:55:2576// Feature used to cap the number of URL-type matches shown within the
77// Omnibox. If enabled, the number of URL-type matches is limited (unless
78// there are no more non-URL matches available.) If enabled, there is a
79// companion parameter - OmniboxMaxURLMatches - which specifies the maximum
80// desired number of URL-type matches.
Kevin Baileycd6889922019-05-30 17:22:5581const base::Feature kOmniboxMaxURLMatches{"OmniboxMaxURLMatches",
Kevin Baileyb3e08732019-05-29 03:55:2582 base::FEATURE_DISABLED_BY_DEFAULT};
83
Tomasz Wiszkowskid938a1112019-03-06 18:01:5784// Feature used to enable entity suggestion images and enhanced presentation
85// showing more context and descriptive text about the entity.
86const base::Feature kOmniboxRichEntitySuggestions{
Justin Donnelly481a69c2019-05-03 20:41:4287 "OmniboxRichEntitySuggestions",
88#if defined(OS_IOS) || defined(OS_ANDROID)
89 base::FEATURE_DISABLED_BY_DEFAULT
90#else
91 base::FEATURE_ENABLED_BY_DEFAULT
92#endif
93};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5794
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
Kevin Bailey37bbf1d2019-08-21 19:23:55108// Feature that enables the tab-switch suggestions corresponding to an open
109// tab, for a button or dedicated suggestion. Enabled by default on Desktop
110// and iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57111const base::Feature kOmniboxTabSwitchSuggestions{
112 "OmniboxTabSwitchSuggestions",
Stepan Khapuginb09801662019-05-07 10:17:04113#if defined(OS_ANDROID)
Tomasz Wiszkowskid938a1112019-03-06 18:01:57114 base::FEATURE_DISABLED_BY_DEFAULT
115#else
116 base::FEATURE_ENABLED_BY_DEFAULT
117#endif
118};
119
Kevin Bailey37bbf1d2019-08-21 19:23:55120// Feature that enables tab-switch suggestions in their own row.
121const base::Feature kOmniboxTabSwitchSuggestionsDedicatedRow{
122 "OmniboxTabSwitchSuggestionsDedicatedRow",
123 base::FEATURE_DISABLED_BY_DEFAULT};
124
Kevin Baileyc4e090c2019-07-11 16:42:11125// Feature that enables wrapping the Omnibox position between top and bottom.
126// The feature is enabled by default, but remains as a kill-switch.
127const base::Feature kOmniboxWrapPopupPosition{"OmniboxWrapPopupPosition",
128 base::FEATURE_ENABLED_BY_DEFAULT};
Kevin Baileyc9cd6cd2019-06-27 02:47:53129
Tomasz Wiszkowskid938a1112019-03-06 18:01:57130// Feature used to reverse the sense of the tab switch button. Selecting the
131// suggestion will switch to the tab, while the button will navigate
132// locally.
133const base::Feature kOmniboxReverseTabSwitchLogic{
134 "OmniboxReverseTabSwitchLogic", base::FEATURE_DISABLED_BY_DEFAULT};
135
136// Feature used to enable various experiments on keyword mode, UI and
137// suggestions.
138const base::Feature kExperimentalKeywordMode{"OmniboxExperimentalKeywordMode",
139 base::FEATURE_DISABLED_BY_DEFAULT};
140
141// Feature used to enable Pedal suggestions.
142const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions",
143 base::FEATURE_DISABLED_BY_DEFAULT};
144
Tommy C. Lia2c75fb2019-04-08 20:22:34145// Feature used for UI that improves transparency of and control over omnibox
Tommy Li9d12b4be2019-09-12 19:21:41146// suggestions. This includes "Why this Suggestion?" and user controls to delete
147// personalized suggestions. This will be eventually enabled by default.
Tommy C. Lia2c75fb2019-04-08 20:22:34148const base::Feature kOmniboxSuggestionTransparencyOptions{
149 "OmniboxSuggestionTransparencyOptions", base::FEATURE_DISABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57150
Tommy C. Li7af8664b2019-04-24 18:10:29151// Feature that shows an alternate separator before the description of
152// omnibox matches. In English, this changes the separator from '-' to '|'.
153const base::Feature kOmniboxAlternateMatchDescriptionSeparator{
154 "OmniboxAlternateMatchDescriptionSeparator",
155 base::FEATURE_DISABLED_BY_DEFAULT};
156
Tomasz Wiszkowskid938a1112019-03-06 18:01:57157// Feature to enable clipboard provider to suggest copied text.
158const base::Feature kEnableClipboardProviderTextSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29159 "OmniboxEnableClipboardProviderTextSuggestions",
160#if defined(OS_IOS)
161 base::FEATURE_ENABLED_BY_DEFAULT
162#else
163 base::FEATURE_DISABLED_BY_DEFAULT
164#endif
165};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57166
167// Feature to enable clipboard provider to suggest searching for copied images.
168const base::Feature kEnableClipboardProviderImageSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29169 "OmniboxEnableClipboardProviderImageSuggestions",
170#if defined(OS_IOS)
171 base::FEATURE_ENABLED_BY_DEFAULT
172#else
173 base::FEATURE_DISABLED_BY_DEFAULT
174#endif
175};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57176
177// Feature to enable the search provider to send a request to the suggest
178// server on focus. This allows the suggest server to warm up, by, for
179// example, loading per-user models into memory. Having a per-user model
180// in memory allows the suggest server to respond more quickly with
181// personalized suggestions as the user types.
182const base::Feature kSearchProviderWarmUpOnFocus{
183 "OmniboxWarmUpSearchProviderOnFocus",
184#if defined(OS_IOS)
185 base::FEATURE_DISABLED_BY_DEFAULT
186#else
187 base::FEATURE_ENABLED_BY_DEFAULT
188#endif
189};
190
Tomasz Wiszkowskid938a1112019-03-06 18:01:57191// Feature used to display the title of the current URL match.
192const base::Feature kDisplayTitleForCurrentUrl{
193 "OmniboxDisplayTitleForCurrentUrl",
194#if !defined(OS_IOS)
195 base::FEATURE_ENABLED_BY_DEFAULT
196#else
197 base::FEATURE_DISABLED_BY_DEFAULT
198#endif
199};
200
201// Feature used for the max autocomplete matches UI experiment.
202const base::Feature kUIExperimentMaxAutocompleteMatches{
203 "OmniboxUIExperimentMaxAutocompleteMatches",
204 base::FEATURE_DISABLED_BY_DEFAULT};
205
206// Feature used to display the search terms instead of the URL in the Omnibox
207// when the user is on the search results page of the default search provider.
208const base::Feature kQueryInOmnibox{"QueryInOmnibox",
209 base::FEATURE_DISABLED_BY_DEFAULT};
210
Tommy C. Li0001b822019-05-10 00:10:03211// Feature used for showing the URL suggestion favicons as a UI experiment.
212// Already launched on Desktop, and currently under development on Android.
213// This flag is not used on iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57214const base::Feature kUIExperimentShowSuggestionFavicons{
Tomasz Wiszkowski4af1f7352019-04-08 16:46:15215 "OmniboxUIExperimentShowSuggestionFavicons",
216#if defined(OS_ANDROID)
217 base::FEATURE_DISABLED_BY_DEFAULT
218#else
219 base::FEATURE_ENABLED_BY_DEFAULT
220#endif
221};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57222
223// Feature used to always swap the title and URL.
224const base::Feature kUIExperimentSwapTitleAndUrl{
225 "OmniboxUIExperimentSwapTitleAndUrl",
226#if defined(OS_IOS) || defined(OS_ANDROID)
227 base::FEATURE_DISABLED_BY_DEFAULT
228#else
229 base::FEATURE_ENABLED_BY_DEFAULT
230#endif
231};
232
Dan Beamc6f0d222019-04-26 00:38:31233// Shows the "Search Google or type a URL" omnibox placeholder even when the
234// caret (text edit cursor) is showing / when focused. views::Textfield works
235// this way, as does <input placeholder="">. Omnibox and the NTP's "fakebox"
236// are exceptions in this regard and this experiment makes this more consistent.
237const base::Feature kUIExperimentShowPlaceholderWhenCaretShowing{
238 "OmniboxUIExperimentShowPlaceholderWhenCaretShowing",
Tommy Lia4db41dc2019-08-13 21:57:00239 base::FEATURE_DISABLED_BY_DEFAULT};
Dan Beamc6f0d222019-04-26 00:38:31240
Tomasz Wiszkowskid938a1112019-03-06 18:01:57241// Feature used to enable speculatively starting a service worker associated
242// with the destination of the default match when the user's input looks like a
243// query.
244const base::Feature kSpeculativeServiceWorkerStartOnQueryInput{
245 "OmniboxSpeculativeServiceWorkerStartOnQueryInput",
246 base::FEATURE_ENABLED_BY_DEFAULT
247};
248
249// Feature used to fetch document suggestions.
250const base::Feature kDocumentProvider{"OmniboxDocumentProvider",
251 base::FEATURE_DISABLED_BY_DEFAULT};
252
manuk4542e232019-09-11 19:27:35253// Feature used to autocomplete bookmark, history, and document suggestions when
254// the user input is a prefix of their titles, as opposed to their URLs.
255const base::Feature kAutocompleteTitles{"OmniboxAutocompleteTitles",
256 base::FEATURE_DISABLED_BY_DEFAULT};
257
Tomasz Wiszkowskid938a1112019-03-06 18:01:57258// Feature to replace the standard ZeroSuggest with icons for most visited sites
259// and collections (bookmarks, history, recent tabs, reading list). Only
260// available on iOS.
261const base::Feature kOmniboxPopupShortcutIconsInZeroState{
262 "OmniboxPopupShortcutIconsInZeroState", base::FEATURE_DISABLED_BY_DEFAULT};
263
264// Feature to use material design weather icons in the omnibox when displaying
265// weather answers.
266const base::Feature kOmniboxMaterialDesignWeatherIcons{
manuk9a2ed552019-09-09 23:45:44267 "OmniboxMaterialDesignWeatherIcons", base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57268
Patrick Noland2b4968b2019-06-27 14:50:26269// Returns whether IsInstantExtendedAPIEnabled should be ignored when deciding
270// the number of Google-provided search suggestions.
271const base::Feature kOmniboxDisableInstantExtendedLimit{
272 "OmniboxDisableInstantExtendedLimit", base::FEATURE_DISABLED_BY_DEFAULT};
273
Brandon Wylief8dd4e82019-07-11 16:39:57274// Show the search engine logo in the omnibox on Android (desktop already does
275// this).
276const base::Feature kOmniboxSearchEngineLogo{"OmniboxSearchEngineLogo",
277 base::FEATURE_DISABLED_BY_DEFAULT};
278
Tommy Li6390ecc2019-09-06 21:08:57279// Exempts the default match from demotion-by-type.
280const base::Feature kOmniboxPreserveDefaultMatchScore {
281 "OmniboxPreserveDefaultMatchScore",
282#if defined(OS_IOS) || defined(OS_ANDROID)
283 base::FEATURE_DISABLED_BY_DEFAULT
284#else
285 base::FEATURE_ENABLED_BY_DEFAULT
286#endif
287};
288
289// Preserves the default match against change when providers return results
290// asynchronously. This prevents the default match from changing after the user
291// finishes typing. Without this feature, if the default match is updated right
292// when the user presses Enter, the user may go to a surprising destination.
293const base::Feature kOmniboxPreserveDefaultMatchAgainstAsyncUpdate{
294 "OmniboxPreserveDefaultMatchAgainstAsyncUpdate",
295 base::FEATURE_DISABLED_BY_DEFAULT};
296
Tommy C. Li090105512019-05-16 22:00:56297// Feature to configure on-focus suggestions provided by ZeroSuggestProvider.
Tommy C. Li414f22022019-06-07 23:46:22298// This feature's main job is to contain some field trial parameters such as:
299// - "ZeroSuggestVariant" configures the per-page-classification mode of
300// ZeroSuggestProvider.
Tommy C. Li090105512019-05-16 22:00:56301const base::Feature kOnFocusSuggestions{"OmniboxOnFocusSuggestions",
302 base::FEATURE_ENABLED_BY_DEFAULT};
303
Tomasz Wiszkowski947f6d0d2019-03-15 22:27:25304// Allow suggestions to be shown to the user on the New Tab Page upon focusing
305// URL bar (the omnibox).
306const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP",
307 base::FEATURE_DISABLED_BY_DEFAULT};
308
Moe Ahmadi4005ec92019-09-09 16:55:53309// Allow suggestions to be shown to the user on the New Tab Page upon focusing
310// the real search box.
311const base::Feature kZeroSuggestionsOnNTPRealbox{
312 "OmniboxZeroSuggestionsOnNTPRealbox", 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