blob: 4f669361417d707b3deb2354bad1885b427dfdb8 [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
146// suggestions. This includes UI cues (like a clock icon for Search History
147// suggestions), as well as user controls to delete personalized suggestions.
148// This will be eventually enabled by default.
149const base::Feature kOmniboxSuggestionTransparencyOptions{
150 "OmniboxSuggestionTransparencyOptions", base::FEATURE_DISABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57151
Tommy C. Lie57096e92019-04-23 21:18:55152// Feature that shows UI cues to differentiate Search History matches from
153// other search suggestions provided by the default search provider. This
154// feature is a narrow subset of kOmniboxSuggestionTransparencyOptions.
155const base::Feature kOmniboxUICuesForSearchHistoryMatches{
Tommy C. Li20b1da2d2019-07-17 17:13:24156 "OmniboxUICuesForSearchHistoryMatches", base::FEATURE_ENABLED_BY_DEFAULT};
Tommy C. Lie57096e92019-04-23 21:18:55157
Tommy C. Li7af8664b2019-04-24 18:10:29158// Feature that shows an alternate separator before the description of
159// omnibox matches. In English, this changes the separator from '-' to '|'.
160const base::Feature kOmniboxAlternateMatchDescriptionSeparator{
161 "OmniboxAlternateMatchDescriptionSeparator",
162 base::FEATURE_DISABLED_BY_DEFAULT};
163
Tomasz Wiszkowskid938a1112019-03-06 18:01:57164// Feature to enable clipboard provider to suggest copied text.
165const base::Feature kEnableClipboardProviderTextSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29166 "OmniboxEnableClipboardProviderTextSuggestions",
167#if defined(OS_IOS)
168 base::FEATURE_ENABLED_BY_DEFAULT
169#else
170 base::FEATURE_DISABLED_BY_DEFAULT
171#endif
172};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57173
174// Feature to enable clipboard provider to suggest searching for copied images.
175const base::Feature kEnableClipboardProviderImageSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29176 "OmniboxEnableClipboardProviderImageSuggestions",
177#if defined(OS_IOS)
178 base::FEATURE_ENABLED_BY_DEFAULT
179#else
180 base::FEATURE_DISABLED_BY_DEFAULT
181#endif
182};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57183
184// Feature to enable the search provider to send a request to the suggest
185// server on focus. This allows the suggest server to warm up, by, for
186// example, loading per-user models into memory. Having a per-user model
187// in memory allows the suggest server to respond more quickly with
188// personalized suggestions as the user types.
189const base::Feature kSearchProviderWarmUpOnFocus{
190 "OmniboxWarmUpSearchProviderOnFocus",
191#if defined(OS_IOS)
192 base::FEATURE_DISABLED_BY_DEFAULT
193#else
194 base::FEATURE_ENABLED_BY_DEFAULT
195#endif
196};
197
Tomasz Wiszkowskid938a1112019-03-06 18:01:57198// Feature used to display the title of the current URL match.
199const base::Feature kDisplayTitleForCurrentUrl{
200 "OmniboxDisplayTitleForCurrentUrl",
201#if !defined(OS_IOS)
202 base::FEATURE_ENABLED_BY_DEFAULT
203#else
204 base::FEATURE_DISABLED_BY_DEFAULT
205#endif
206};
207
208// Feature used for the max autocomplete matches UI experiment.
209const base::Feature kUIExperimentMaxAutocompleteMatches{
210 "OmniboxUIExperimentMaxAutocompleteMatches",
211 base::FEATURE_DISABLED_BY_DEFAULT};
212
213// Feature used to display the search terms instead of the URL in the Omnibox
214// when the user is on the search results page of the default search provider.
215const base::Feature kQueryInOmnibox{"QueryInOmnibox",
216 base::FEATURE_DISABLED_BY_DEFAULT};
217
Tommy C. Li0001b822019-05-10 00:10:03218// Feature used for showing the URL suggestion favicons as a UI experiment.
219// Already launched on Desktop, and currently under development on Android.
220// This flag is not used on iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57221const base::Feature kUIExperimentShowSuggestionFavicons{
Tomasz Wiszkowski4af1f7352019-04-08 16:46:15222 "OmniboxUIExperimentShowSuggestionFavicons",
223#if defined(OS_ANDROID)
224 base::FEATURE_DISABLED_BY_DEFAULT
225#else
226 base::FEATURE_ENABLED_BY_DEFAULT
227#endif
228};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57229
230// Feature used to always swap the title and URL.
231const base::Feature kUIExperimentSwapTitleAndUrl{
232 "OmniboxUIExperimentSwapTitleAndUrl",
233#if defined(OS_IOS) || defined(OS_ANDROID)
234 base::FEATURE_DISABLED_BY_DEFAULT
235#else
236 base::FEATURE_ENABLED_BY_DEFAULT
237#endif
238};
239
Dan Beamc6f0d222019-04-26 00:38:31240// Shows the "Search Google or type a URL" omnibox placeholder even when the
241// caret (text edit cursor) is showing / when focused. views::Textfield works
242// this way, as does <input placeholder="">. Omnibox and the NTP's "fakebox"
243// are exceptions in this regard and this experiment makes this more consistent.
244const base::Feature kUIExperimentShowPlaceholderWhenCaretShowing{
245 "OmniboxUIExperimentShowPlaceholderWhenCaretShowing",
Tommy Lia4db41dc2019-08-13 21:57:00246 base::FEATURE_DISABLED_BY_DEFAULT};
Dan Beamc6f0d222019-04-26 00:38:31247
Tomasz Wiszkowskid938a1112019-03-06 18:01:57248// Feature used to enable speculatively starting a service worker associated
249// with the destination of the default match when the user's input looks like a
250// query.
251const base::Feature kSpeculativeServiceWorkerStartOnQueryInput{
252 "OmniboxSpeculativeServiceWorkerStartOnQueryInput",
253 base::FEATURE_ENABLED_BY_DEFAULT
254};
255
256// Feature used to fetch document suggestions.
257const base::Feature kDocumentProvider{"OmniboxDocumentProvider",
258 base::FEATURE_DISABLED_BY_DEFAULT};
259
manuk4542e232019-09-11 19:27:35260// Feature used to autocomplete bookmark, history, and document suggestions when
261// the user input is a prefix of their titles, as opposed to their URLs.
262const base::Feature kAutocompleteTitles{"OmniboxAutocompleteTitles",
263 base::FEATURE_DISABLED_BY_DEFAULT};
264
Tomasz Wiszkowskid938a1112019-03-06 18:01:57265// Feature to replace the standard ZeroSuggest with icons for most visited sites
266// and collections (bookmarks, history, recent tabs, reading list). Only
267// available on iOS.
268const base::Feature kOmniboxPopupShortcutIconsInZeroState{
269 "OmniboxPopupShortcutIconsInZeroState", base::FEATURE_DISABLED_BY_DEFAULT};
270
271// Feature to use material design weather icons in the omnibox when displaying
272// weather answers.
273const base::Feature kOmniboxMaterialDesignWeatherIcons{
manuk9a2ed552019-09-09 23:45:44274 "OmniboxMaterialDesignWeatherIcons", base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57275
Patrick Noland2b4968b2019-06-27 14:50:26276// Returns whether IsInstantExtendedAPIEnabled should be ignored when deciding
277// the number of Google-provided search suggestions.
278const base::Feature kOmniboxDisableInstantExtendedLimit{
279 "OmniboxDisableInstantExtendedLimit", base::FEATURE_DISABLED_BY_DEFAULT};
280
Brandon Wylief8dd4e82019-07-11 16:39:57281// Show the search engine logo in the omnibox on Android (desktop already does
282// this).
283const base::Feature kOmniboxSearchEngineLogo{"OmniboxSearchEngineLogo",
284 base::FEATURE_DISABLED_BY_DEFAULT};
285
Tommy Li6390ecc2019-09-06 21:08:57286// Exempts the default match from demotion-by-type.
287const base::Feature kOmniboxPreserveDefaultMatchScore {
288 "OmniboxPreserveDefaultMatchScore",
289#if defined(OS_IOS) || defined(OS_ANDROID)
290 base::FEATURE_DISABLED_BY_DEFAULT
291#else
292 base::FEATURE_ENABLED_BY_DEFAULT
293#endif
294};
295
296// Preserves the default match against change when providers return results
297// asynchronously. This prevents the default match from changing after the user
298// finishes typing. Without this feature, if the default match is updated right
299// when the user presses Enter, the user may go to a surprising destination.
300const base::Feature kOmniboxPreserveDefaultMatchAgainstAsyncUpdate{
301 "OmniboxPreserveDefaultMatchAgainstAsyncUpdate",
302 base::FEATURE_DISABLED_BY_DEFAULT};
303
Tommy C. Li090105512019-05-16 22:00:56304// Feature to configure on-focus suggestions provided by ZeroSuggestProvider.
Tommy C. Li414f22022019-06-07 23:46:22305// This feature's main job is to contain some field trial parameters such as:
306// - "ZeroSuggestVariant" configures the per-page-classification mode of
307// ZeroSuggestProvider.
Tommy C. Li090105512019-05-16 22:00:56308const base::Feature kOnFocusSuggestions{"OmniboxOnFocusSuggestions",
309 base::FEATURE_ENABLED_BY_DEFAULT};
310
Tomasz Wiszkowski947f6d0d2019-03-15 22:27:25311// Allow suggestions to be shown to the user on the New Tab Page upon focusing
312// URL bar (the omnibox).
313const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP",
314 base::FEATURE_DISABLED_BY_DEFAULT};
315
Moe Ahmadi4005ec92019-09-09 16:55:53316// Allow suggestions to be shown to the user on the New Tab Page upon focusing
317// the real search box.
318const base::Feature kZeroSuggestionsOnNTPRealbox{
319 "OmniboxZeroSuggestionsOnNTPRealbox", base::FEATURE_DISABLED_BY_DEFAULT};
320
Ce Chen20af01c2019-07-02 19:16:36321// Feature to provide non personalized head search suggestion from a compact
322// on device model.
323const base::Feature kOnDeviceHeadProvider{"OmniboxOnDeviceHeadProvider",
324 base::FEATURE_DISABLED_BY_DEFAULT};
325
Tomasz Wiszkowskid938a1112019-03-06 18:01:57326} // namespace omnibox