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