blob: 35afa1b3eb66cd283efed3cc66401ca61b6a4953 [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 Lifc8ae9f2019-05-06 16:55:1424const base::Feature kHideSteadyStateUrlScheme {
25 "OmniboxUIExperimentHideSteadyStateUrlScheme",
26#if defined(OS_IOS)
27 base::FEATURE_ENABLED_BY_DEFAULT
28#else
29 base::FEATURE_DISABLED_BY_DEFAULT
30#endif
31};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5732
33// Feature used to hide trivial subdomains from steady state URLs displayed in
34// the toolbar. It is restored during editing.
Tommy Lifc8ae9f2019-05-06 16:55:1435const base::Feature kHideSteadyStateUrlTrivialSubdomains {
36 "OmniboxUIExperimentHideSteadyStateUrlTrivialSubdomains",
37#if defined(OS_IOS)
38 base::FEATURE_ENABLED_BY_DEFAULT
39#else
40 base::FEATURE_DISABLED_BY_DEFAULT
41#endif
42};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5743
44// Feature used to hide the path, query and ref from steady state URLs
45// displayed in the toolbar. It is restored during editing.
46const base::Feature kHideSteadyStateUrlPathQueryAndRef {
47 "OmniboxUIExperimentHideSteadyStateUrlPathQueryAndRef",
48#if defined(OS_IOS)
49 base::FEATURE_ENABLED_BY_DEFAULT
50#else
51 base::FEATURE_DISABLED_BY_DEFAULT
52#endif
53};
54
55// Feature used to undo all omnibox elisions on a single click or focus action.
56const base::Feature kOneClickUnelide{"OmniboxOneClickUnelide",
57 base::FEATURE_DISABLED_BY_DEFAULT};
58
Christopher Thompsonc26ef302019-06-07 01:55:4559// This feature simplifies the security indiciator UI for https:// pages.
60// The default behavior is to show no verbose text for EV pages. When disabled,
61// the verbose EV indicator text will be displayed.
Tomasz Wiszkowskid938a1112019-03-06 18:01:5762// This feature is used for EV UI removal experiment (https://crbug.com/803501).
63const base::Feature kSimplifyHttpsIndicator{"SimplifyHttpsIndicator",
Christopher Thompsonc26ef302019-06-07 01:55:4564 base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5765
Kevin Bailey0f7d1592019-05-23 19:07:3566// This feature is used to have final suggestions within the Omnibox grouped
Kevin Bailey38305592019-05-24 16:55:3667// by major type. i.e. search types are first, followed by all others,
68// except for the default match which is unchanged in position.
69const base::Feature kOmniboxGroupSuggestionsBySearchVsUrl{
70 "OmniboxGroupSuggestionsBySearchVsUrl", base::FEATURE_DISABLED_BY_DEFAULT};
Kevin Bailey0f7d1592019-05-23 19:07:3571
manukaddd3c42019-04-09 21:20:5972// Feature used to enable local entity suggestions. Similar to rich entities but
73// but location specific. E.g., typing 'starbucks near' could display the local
74// entity suggestion 'starbucks near disneyland \n starbucks * Anaheim, CA'.
75const base::Feature kOmniboxLocalEntitySuggestions{
76 "OmniboxLocalEntitySuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
77
Kevin Baileyb3e08732019-05-29 03:55:2578// Feature used to cap the number of URL-type matches shown within the
79// Omnibox. If enabled, the number of URL-type matches is limited (unless
80// there are no more non-URL matches available.) If enabled, there is a
81// companion parameter - OmniboxMaxURLMatches - which specifies the maximum
82// desired number of URL-type matches.
Kevin Baileycd6889922019-05-30 17:22:5583const base::Feature kOmniboxMaxURLMatches{"OmniboxMaxURLMatches",
Kevin Baileyb3e08732019-05-29 03:55:2584 base::FEATURE_DISABLED_BY_DEFAULT};
85
Tomasz Wiszkowskid938a1112019-03-06 18:01:5786// Feature used to enable entity suggestion images and enhanced presentation
87// showing more context and descriptive text about the entity.
88const base::Feature kOmniboxRichEntitySuggestions{
Justin Donnelly481a69c2019-05-03 20:41:4289 "OmniboxRichEntitySuggestions",
90#if defined(OS_IOS) || defined(OS_ANDROID)
91 base::FEATURE_DISABLED_BY_DEFAULT
92#else
93 base::FEATURE_ENABLED_BY_DEFAULT
94#endif
95};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5796
97// Feature used to enable enhanced presentation showing larger images.
98// This is currently only used on Android.
99const base::Feature kOmniboxNewAnswerLayout{"OmniboxNewAnswerLayout",
100 base::FEATURE_DISABLED_BY_DEFAULT};
101
Kevin Baileyabf05d62019-05-15 17:29:56102const base::Feature kOmniboxPreserveDefaultMatchScore{
103 "OmniboxPreserveDefaultMatchScore", base::FEATURE_DISABLED_BY_DEFAULT};
104
Tomasz Wiszkowskid938a1112019-03-06 18:01:57105// Feature used to enable swapping the rows on answers.
106const base::Feature kOmniboxReverseAnswers{"OmniboxReverseAnswers",
107 base::FEATURE_DISABLED_BY_DEFAULT};
108
Kevin Bailey7d918b92019-05-02 16:00:14109// Feature used to enable matching short words to bookmarks for suggestions.
110const base::Feature kOmniboxShortBookmarkSuggestions{
111 "OmniboxShortBookmarkSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
112
Tomasz Wiszkowskid938a1112019-03-06 18:01:57113// Feature used to force on the experiment of transmission of tail suggestions
114// from GWS to this client, currently testing for desktop.
115const base::Feature kOmniboxTailSuggestions{
116 "OmniboxTailSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
117
Stepan Khapuginb09801662019-05-07 10:17:04118// Feature that enables the tab-switch button on suggestions corresponding to an
119// open tab. Enabled by default on Desktop and iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57120const base::Feature kOmniboxTabSwitchSuggestions{
121 "OmniboxTabSwitchSuggestions",
Stepan Khapuginb09801662019-05-07 10:17:04122#if defined(OS_ANDROID)
Tomasz Wiszkowskid938a1112019-03-06 18:01:57123 base::FEATURE_DISABLED_BY_DEFAULT
124#else
125 base::FEATURE_ENABLED_BY_DEFAULT
126#endif
127};
128
129// Feature used to reverse the sense of the tab switch button. Selecting the
130// suggestion will switch to the tab, while the button will navigate
131// locally.
132const base::Feature kOmniboxReverseTabSwitchLogic{
133 "OmniboxReverseTabSwitchLogic", base::FEATURE_DISABLED_BY_DEFAULT};
134
135// Feature used to enable various experiments on keyword mode, UI and
136// suggestions.
137const base::Feature kExperimentalKeywordMode{"OmniboxExperimentalKeywordMode",
138 base::FEATURE_DISABLED_BY_DEFAULT};
139
140// Feature used to enable Pedal suggestions.
141const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions",
142 base::FEATURE_DISABLED_BY_DEFAULT};
143
Tommy C. Lia2c75fb2019-04-08 20:22:34144// Feature used for UI that improves transparency of and control over omnibox
145// suggestions. This includes UI cues (like a clock icon for Search History
146// suggestions), as well as user controls to delete personalized suggestions.
147// This will be eventually enabled by default.
148const base::Feature kOmniboxSuggestionTransparencyOptions{
149 "OmniboxSuggestionTransparencyOptions", base::FEATURE_DISABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57150
Tommy C. Lie57096e92019-04-23 21:18:55151// Feature that shows UI cues to differentiate Search History matches from
152// other search suggestions provided by the default search provider. This
153// feature is a narrow subset of kOmniboxSuggestionTransparencyOptions.
154const base::Feature kOmniboxUICuesForSearchHistoryMatches{
155 "OmniboxUICuesForSearchHistoryMatches", base::FEATURE_DISABLED_BY_DEFAULT};
156
Tommy C. Li7af8664b2019-04-24 18:10:29157// Feature that shows an alternate separator before the description of
158// omnibox matches. In English, this changes the separator from '-' to '|'.
159const base::Feature kOmniboxAlternateMatchDescriptionSeparator{
160 "OmniboxAlternateMatchDescriptionSeparator",
161 base::FEATURE_DISABLED_BY_DEFAULT};
162
Tomasz Wiszkowskid938a1112019-03-06 18:01:57163// Feature to enable clipboard provider to suggest copied text.
164const base::Feature kEnableClipboardProviderTextSuggestions{
165 "OmniboxEnableClipboardProviderTextSuggestions",
166 base::FEATURE_DISABLED_BY_DEFAULT};
167
168// Feature to enable clipboard provider to suggest searching for copied images.
169const base::Feature kEnableClipboardProviderImageSuggestions{
170 "OmniboxEnableClipboardProviderImageSuggestions",
171 base::FEATURE_DISABLED_BY_DEFAULT};
172
173// Feature to enable the search provider to send a request to the suggest
174// server on focus. This allows the suggest server to warm up, by, for
175// example, loading per-user models into memory. Having a per-user model
176// in memory allows the suggest server to respond more quickly with
177// personalized suggestions as the user types.
178const base::Feature kSearchProviderWarmUpOnFocus{
179 "OmniboxWarmUpSearchProviderOnFocus",
180#if defined(OS_IOS)
181 base::FEATURE_DISABLED_BY_DEFAULT
182#else
183 base::FEATURE_ENABLED_BY_DEFAULT
184#endif
185};
186
Tomasz Wiszkowskid938a1112019-03-06 18:01:57187// Feature used to display the title of the current URL match.
188const base::Feature kDisplayTitleForCurrentUrl{
189 "OmniboxDisplayTitleForCurrentUrl",
190#if !defined(OS_IOS)
191 base::FEATURE_ENABLED_BY_DEFAULT
192#else
193 base::FEATURE_DISABLED_BY_DEFAULT
194#endif
195};
196
197// Feature used for the max autocomplete matches UI experiment.
198const base::Feature kUIExperimentMaxAutocompleteMatches{
199 "OmniboxUIExperimentMaxAutocompleteMatches",
200 base::FEATURE_DISABLED_BY_DEFAULT};
201
202// Feature used to display the search terms instead of the URL in the Omnibox
203// when the user is on the search results page of the default search provider.
204const base::Feature kQueryInOmnibox{"QueryInOmnibox",
205 base::FEATURE_DISABLED_BY_DEFAULT};
206
Tommy C. Li0001b822019-05-10 00:10:03207// Feature used for showing the URL suggestion favicons as a UI experiment.
208// Already launched on Desktop, and currently under development on Android.
209// This flag is not used on iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57210const base::Feature kUIExperimentShowSuggestionFavicons{
Tomasz Wiszkowski4af1f7352019-04-08 16:46:15211 "OmniboxUIExperimentShowSuggestionFavicons",
212#if defined(OS_ANDROID)
213 base::FEATURE_DISABLED_BY_DEFAULT
214#else
215 base::FEATURE_ENABLED_BY_DEFAULT
216#endif
217};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57218
219// Feature used to always swap the title and URL.
220const base::Feature kUIExperimentSwapTitleAndUrl{
221 "OmniboxUIExperimentSwapTitleAndUrl",
222#if defined(OS_IOS) || defined(OS_ANDROID)
223 base::FEATURE_DISABLED_BY_DEFAULT
224#else
225 base::FEATURE_ENABLED_BY_DEFAULT
226#endif
227};
228
229// Feature used for the vertical margin UI experiment, currently only used on
230// desktop platforms.
231const base::Feature kUIExperimentVerticalMargin{
232 "OmniboxUIExperimentVerticalMargin", base::FEATURE_DISABLED_BY_DEFAULT};
233
Tommy C. Lie35fb6b2019-04-30 16:29:54234// Feature used to limit the vertical margin UI experiment to non-touch
235// devices only. Has no effect if kUIExperimentVerticalMargin is not enabled.
236const base::Feature kUIExperimentVerticalMarginLimitToNonTouchOnly{
237 "OmniboxUIExperimentVerticalMarginLimitToNonTouchOnly",
238 base::FEATURE_DISABLED_BY_DEFAULT};
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",
246 base::FEATURE_DISABLED_BY_DEFAULT};
247
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
260// Feature used to dedupe Google Drive URLs between different formats.
261// OmniboxDocumentProvider arms may wish to enable this, though it may also be
262// run on its own.
263const base::Feature kDedupeGoogleDriveURLs{"OmniboxDedupeGoogleDriveURLs",
264 base::FEATURE_DISABLED_BY_DEFAULT};
265
266// Feature to replace the standard ZeroSuggest with icons for most visited sites
267// and collections (bookmarks, history, recent tabs, reading list). Only
268// available on iOS.
269const base::Feature kOmniboxPopupShortcutIconsInZeroState{
270 "OmniboxPopupShortcutIconsInZeroState", base::FEATURE_DISABLED_BY_DEFAULT};
271
272// Feature to use material design weather icons in the omnibox when displaying
273// weather answers.
274const base::Feature kOmniboxMaterialDesignWeatherIcons{
275 "OmniboxMaterialDesignWeatherIcons", base::FEATURE_DISABLED_BY_DEFAULT};
276
Tommy C. Li090105512019-05-16 22:00:56277// Feature to configure on-focus suggestions provided by ZeroSuggestProvider.
278// This feature's main job is to contain the "ZeroSuggestVariant" field trial
279// parameter, which configures the global mode of ZeroSuggestProvider.
280const base::Feature kOnFocusSuggestions{"OmniboxOnFocusSuggestions",
281 base::FEATURE_ENABLED_BY_DEFAULT};
282
Tommy C. Li0099c852019-05-31 23:05:37283// Feature used to specify a custom endpoint URL for on-focus suggestions that
284// are sourced via RPC.
Tommy C. Li090105512019-05-16 22:00:56285//
286// This feature is *enabled* in order to *disable* all forms of suggestions
287// based on the URL on-focus (whether from "redirect to Chrome" or the
288// default suggest server). The actual disabling of redirect to Chrome
289// suggestions happens in contextual_suggestions_service.cc. See comments
290// by kDefaultExperimentalServerAddress.
291//
292// If this feature were not enabled, Chrome would use the default suggest
293// server for suggestions based on the current URL on focus. There is no
294// code in Chrome to disable that, so that why we took this route.
Tommy C. Li0099c852019-05-31 23:05:37295const base::Feature kOnFocusSuggestionsCustomEndpoint{
296 "OmniboxOnFocusSuggestionsCustomEndpoint",
297 base::FEATURE_ENABLED_BY_DEFAULT};
Tommy C. Li090105512019-05-16 22:00:56298
Tomasz Wiszkowski947f6d0d2019-03-15 22:27:25299// Allow suggestions to be shown to the user on the New Tab Page upon focusing
300// URL bar (the omnibox).
301const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP",
302 base::FEATURE_DISABLED_BY_DEFAULT};
303
Tomasz Wiszkowskid938a1112019-03-06 18:01:57304} // namespace omnibox