blob: d922a4fe55e9b4e823b29b58fa853a1f5f279bad [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. Li8967c492019-04-22 19:40:0224const 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. Li8967c492019-04-22 19:40:0230const 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
49// This feature simplifies the security indiciator UI for https:// pages. The
50// exact UI treatment is dependent on the parameter 'treatment' which can have
51// the following value:
52// - 'ev-to-secure': Show the "Secure" chip for pages with an EV certificate.
53// - 'secure-to-lock': Show only the lock icon for non-EV https:// pages.
54// - 'both-to-lock': Show only the lock icon for all https:// pages.
55// - 'keep-secure-chip': Show the old "Secure" chip for non-EV https:// pages.
56// The default behavior is the same as 'secure-to-lock'.
57// This feature is used for EV UI removal experiment (https://crbug.com/803501).
58const base::Feature kSimplifyHttpsIndicator{"SimplifyHttpsIndicator",
59 base::FEATURE_DISABLED_BY_DEFAULT};
60
manukaddd3c42019-04-09 21:20:5961// Feature used to enable local entity suggestions. Similar to rich entities but
62// but location specific. E.g., typing 'starbucks near' could display the local
63// entity suggestion 'starbucks near disneyland \n starbucks * Anaheim, CA'.
64const base::Feature kOmniboxLocalEntitySuggestions{
65 "OmniboxLocalEntitySuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
66
Tomasz Wiszkowskid938a1112019-03-06 18:01:5767// Feature used to enable entity suggestion images and enhanced presentation
68// showing more context and descriptive text about the entity.
69const base::Feature kOmniboxRichEntitySuggestions{
Justin Donnelly481a69c2019-05-03 20:41:4270 "OmniboxRichEntitySuggestions",
71#if defined(OS_IOS) || defined(OS_ANDROID)
72 base::FEATURE_DISABLED_BY_DEFAULT
73#else
74 base::FEATURE_ENABLED_BY_DEFAULT
75#endif
76};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5777
78// Feature used to enable enhanced presentation showing larger images.
79// This is currently only used on Android.
80const base::Feature kOmniboxNewAnswerLayout{"OmniboxNewAnswerLayout",
81 base::FEATURE_DISABLED_BY_DEFAULT};
82
83// Feature used to enable swapping the rows on answers.
84const base::Feature kOmniboxReverseAnswers{"OmniboxReverseAnswers",
85 base::FEATURE_DISABLED_BY_DEFAULT};
86
Kevin Bailey7d918b92019-05-02 16:00:1487// Feature used to enable matching short words to bookmarks for suggestions.
88const base::Feature kOmniboxShortBookmarkSuggestions{
89 "OmniboxShortBookmarkSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
90
Tomasz Wiszkowskid938a1112019-03-06 18:01:5791// Feature used to force on the experiment of transmission of tail suggestions
92// from GWS to this client, currently testing for desktop.
93const base::Feature kOmniboxTailSuggestions{
94 "OmniboxTailSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
95
96// Feature used to force on the experiment of showing a button for suggestions
97// whose URL is open in another tab, with the ability to switch to that tab,
98// currently only used on desktop and iOS platforms.
99const base::Feature kOmniboxTabSwitchSuggestions{
100 "OmniboxTabSwitchSuggestions",
101#if defined(OS_IOS) || defined(OS_ANDROID)
102 base::FEATURE_DISABLED_BY_DEFAULT
103#else
104 base::FEATURE_ENABLED_BY_DEFAULT
105#endif
106};
107
108// Feature used to reverse the sense of the tab switch button. Selecting the
109// suggestion will switch to the tab, while the button will navigate
110// locally.
111const base::Feature kOmniboxReverseTabSwitchLogic{
112 "OmniboxReverseTabSwitchLogic", base::FEATURE_DISABLED_BY_DEFAULT};
113
114// Feature used to enable various experiments on keyword mode, UI and
115// suggestions.
116const base::Feature kExperimentalKeywordMode{"OmniboxExperimentalKeywordMode",
117 base::FEATURE_DISABLED_BY_DEFAULT};
118
119// Feature used to enable Pedal suggestions.
120const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions",
121 base::FEATURE_DISABLED_BY_DEFAULT};
122
Tommy C. Lia2c75fb2019-04-08 20:22:34123// Feature used for UI that improves transparency of and control over omnibox
124// suggestions. This includes UI cues (like a clock icon for Search History
125// suggestions), as well as user controls to delete personalized suggestions.
126// This will be eventually enabled by default.
127const base::Feature kOmniboxSuggestionTransparencyOptions{
128 "OmniboxSuggestionTransparencyOptions", base::FEATURE_DISABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57129
Tommy C. Lie57096e92019-04-23 21:18:55130// Feature that shows UI cues to differentiate Search History matches from
131// other search suggestions provided by the default search provider. This
132// feature is a narrow subset of kOmniboxSuggestionTransparencyOptions.
133const base::Feature kOmniboxUICuesForSearchHistoryMatches{
134 "OmniboxUICuesForSearchHistoryMatches", base::FEATURE_DISABLED_BY_DEFAULT};
135
Tommy C. Li7af8664b2019-04-24 18:10:29136// Feature that shows an alternate separator before the description of
137// omnibox matches. In English, this changes the separator from '-' to '|'.
138const base::Feature kOmniboxAlternateMatchDescriptionSeparator{
139 "OmniboxAlternateMatchDescriptionSeparator",
140 base::FEATURE_DISABLED_BY_DEFAULT};
141
Tomasz Wiszkowskid938a1112019-03-06 18:01:57142// Feature to enable clipboard provider to suggest copied text.
143const base::Feature kEnableClipboardProviderTextSuggestions{
144 "OmniboxEnableClipboardProviderTextSuggestions",
145 base::FEATURE_DISABLED_BY_DEFAULT};
146
147// Feature to enable clipboard provider to suggest searching for copied images.
148const base::Feature kEnableClipboardProviderImageSuggestions{
149 "OmniboxEnableClipboardProviderImageSuggestions",
150 base::FEATURE_DISABLED_BY_DEFAULT};
151
152// Feature to enable the search provider to send a request to the suggest
153// server on focus. This allows the suggest server to warm up, by, for
154// example, loading per-user models into memory. Having a per-user model
155// in memory allows the suggest server to respond more quickly with
156// personalized suggestions as the user types.
157const base::Feature kSearchProviderWarmUpOnFocus{
158 "OmniboxWarmUpSearchProviderOnFocus",
159#if defined(OS_IOS)
160 base::FEATURE_DISABLED_BY_DEFAULT
161#else
162 base::FEATURE_ENABLED_BY_DEFAULT
163#endif
164};
165
166// Feature used for the Zero Suggest Redirect to Chrome Field Trial.
167const base::Feature kZeroSuggestRedirectToChrome{
168 "ZeroSuggestRedirectToChrome", base::FEATURE_DISABLED_BY_DEFAULT};
169
170// Feature used to display the title of the current URL match.
171const base::Feature kDisplayTitleForCurrentUrl{
172 "OmniboxDisplayTitleForCurrentUrl",
173#if !defined(OS_IOS)
174 base::FEATURE_ENABLED_BY_DEFAULT
175#else
176 base::FEATURE_DISABLED_BY_DEFAULT
177#endif
178};
179
180// Feature used for the max autocomplete matches UI experiment.
181const base::Feature kUIExperimentMaxAutocompleteMatches{
182 "OmniboxUIExperimentMaxAutocompleteMatches",
183 base::FEATURE_DISABLED_BY_DEFAULT};
184
185// Feature used to display the search terms instead of the URL in the Omnibox
186// when the user is on the search results page of the default search provider.
187const base::Feature kQueryInOmnibox{"QueryInOmnibox",
188 base::FEATURE_DISABLED_BY_DEFAULT};
189
190// Feature used for showing the URL suggestion favicons as a UI experiment,
191// currently only used on desktop platforms.
192const base::Feature kUIExperimentShowSuggestionFavicons{
Tomasz Wiszkowski4af1f7352019-04-08 16:46:15193 "OmniboxUIExperimentShowSuggestionFavicons",
194#if defined(OS_ANDROID)
195 base::FEATURE_DISABLED_BY_DEFAULT
196#else
197 base::FEATURE_ENABLED_BY_DEFAULT
198#endif
199};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57200
201// Feature used to always swap the title and URL.
202const base::Feature kUIExperimentSwapTitleAndUrl{
203 "OmniboxUIExperimentSwapTitleAndUrl",
204#if defined(OS_IOS) || defined(OS_ANDROID)
205 base::FEATURE_DISABLED_BY_DEFAULT
206#else
207 base::FEATURE_ENABLED_BY_DEFAULT
208#endif
209};
210
211// Feature used for the vertical margin UI experiment, currently only used on
212// desktop platforms.
213const base::Feature kUIExperimentVerticalMargin{
214 "OmniboxUIExperimentVerticalMargin", base::FEATURE_DISABLED_BY_DEFAULT};
215
Tommy C. Lie35fb6b2019-04-30 16:29:54216// Feature used to limit the vertical margin UI experiment to non-touch
217// devices only. Has no effect if kUIExperimentVerticalMargin is not enabled.
218const base::Feature kUIExperimentVerticalMarginLimitToNonTouchOnly{
219 "OmniboxUIExperimentVerticalMarginLimitToNonTouchOnly",
220 base::FEATURE_DISABLED_BY_DEFAULT};
221
Tomasz Wiszkowskid938a1112019-03-06 18:01:57222// Feature used to color "blue" the generic search icon and search terms.
223// Technically, this makes the search icon and search terms match the color of
224// Omnibox link text, which is blue by convention.
225const base::Feature kUIExperimentBlueSearchLoopAndSearchQuery{
226 "OmniboxUIExperimentBlueSearchLoopAndSearchQuery",
227 base::FEATURE_DISABLED_BY_DEFAULT};
228
229// Feature used to change the color of text in navigation suggestions. It
230// changes title text from black to blue, and URL text from blue to gray.
231const base::Feature kUIExperimentBlueTitlesAndGrayUrlsOnPageSuggestions{
232 "OmniboxUIExperimentBlueTitlesAndGrayUrlsOnPageSuggestions",
233 base::FEATURE_DISABLED_BY_DEFAULT};
234
235// Feature used to change the color of text in navigation suggestions. It
236// changes title text from black to blue.
237const base::Feature kUIExperimentBlueTitlesOnPageSuggestions{
238 "OmniboxUIExperimentBlueTitlesOnPageSuggestions",
239 base::FEATURE_DISABLED_BY_DEFAULT};
240
241// Feature used to show a " - Google Search", " - Bing Search", etc. suffix on
242// all search suggestions instead of just the first one in each cluster.
243const base::Feature kUIExperimentShowSuffixOnAllSearchSuggestions{
244 "OmniboxUIExperimentShowSuffixOnAllSearchSuggestions",
245 base::FEATURE_DISABLED_BY_DEFAULT};
246
247// Feature used to show a white background in the omnibox while it's unfocused.
248// More technically, with this flag on, it uses the same background color as
249// the results popup (conventionally white).
250const base::Feature kUIExperimentWhiteBackgroundOnBlur{
251 "OmniboxUIExperimentWhiteBackgroundOnBlur",
252 base::FEATURE_DISABLED_BY_DEFAULT};
253
254// Feature used to show a generic vector icon for omnibox search instead of the
255// search engine favicon.
256//
257// This feature flag's string has a typo: "Omnibox" => "Ominbox".
258// Do not correct this typo, because this misspelled string is being used
259// as-is in field trials.
260const base::Feature kUIExperimentUseGenericSearchEngineIcon{
261 "OminboxUIExperimentUseGenericSearchEngineIcon",
262 base::FEATURE_DISABLED_BY_DEFAULT};
263
264// Feature used to bold the "user text" part of search suggestions instead
265// of the "autocomplete" part. For example, if the user typed "point reyes",
266// and the search suggestion was "point reyes weather", this feature makes
267// the "point reyes" part of the suggestion bold, instead of "weather".
268const base::Feature kUIExperimentBoldUserTextOnSearchSuggestions{
269 "OmniboxUIExperimentBoldUserTextOnSearchSuggestions",
270 base::FEATURE_DISABLED_BY_DEFAULT};
271
272// Feature used to unbold suggestion text.
273const base::Feature kUIExperimentUnboldSuggestionText{
274 "OmniboxUIExperimentUnboldSuggestionText",
275 base::FEATURE_DISABLED_BY_DEFAULT};
276
Dan Beamc6f0d222019-04-26 00:38:31277// Shows the "Search Google or type a URL" omnibox placeholder even when the
278// caret (text edit cursor) is showing / when focused. views::Textfield works
279// this way, as does <input placeholder="">. Omnibox and the NTP's "fakebox"
280// are exceptions in this regard and this experiment makes this more consistent.
281const base::Feature kUIExperimentShowPlaceholderWhenCaretShowing{
282 "OmniboxUIExperimentShowPlaceholderWhenCaretShowing",
283 base::FEATURE_DISABLED_BY_DEFAULT};
284
Tomasz Wiszkowskid938a1112019-03-06 18:01:57285// Feature used to enable speculatively starting a service worker associated
286// with the destination of the default match when the user's input looks like a
287// query.
288const base::Feature kSpeculativeServiceWorkerStartOnQueryInput{
289 "OmniboxSpeculativeServiceWorkerStartOnQueryInput",
290 base::FEATURE_ENABLED_BY_DEFAULT
291};
292
293// Feature used to fetch document suggestions.
294const base::Feature kDocumentProvider{"OmniboxDocumentProvider",
295 base::FEATURE_DISABLED_BY_DEFAULT};
296
297// Feature used to dedupe Google Drive URLs between different formats.
298// OmniboxDocumentProvider arms may wish to enable this, though it may also be
299// run on its own.
300const base::Feature kDedupeGoogleDriveURLs{"OmniboxDedupeGoogleDriveURLs",
301 base::FEATURE_DISABLED_BY_DEFAULT};
302
303// Feature to replace the standard ZeroSuggest with icons for most visited sites
304// and collections (bookmarks, history, recent tabs, reading list). Only
305// available on iOS.
306const base::Feature kOmniboxPopupShortcutIconsInZeroState{
307 "OmniboxPopupShortcutIconsInZeroState", base::FEATURE_DISABLED_BY_DEFAULT};
308
309// Feature to use material design weather icons in the omnibox when displaying
310// weather answers.
311const base::Feature kOmniboxMaterialDesignWeatherIcons{
312 "OmniboxMaterialDesignWeatherIcons", base::FEATURE_DISABLED_BY_DEFAULT};
313
Tomasz Wiszkowski947f6d0d2019-03-15 22:27:25314// Allow suggestions to be shown to the user on the New Tab Page upon focusing
315// URL bar (the omnibox).
316const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP",
317 base::FEATURE_DISABLED_BY_DEFAULT};
318
Tomasz Wiszkowskid938a1112019-03-06 18:01:57319} // namespace omnibox