blob: 4faf829acd50650f993bf89a3f7626c13d2ad2a8 [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
81// Feature used to force on the experiment of transmission of tail suggestions
82// from GWS to this client, currently testing for desktop.
83const base::Feature kOmniboxTailSuggestions{
84 "OmniboxTailSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
85
86// Feature used to force on the experiment of showing a button for suggestions
87// whose URL is open in another tab, with the ability to switch to that tab,
88// currently only used on desktop and iOS platforms.
89const base::Feature kOmniboxTabSwitchSuggestions{
90 "OmniboxTabSwitchSuggestions",
91#if defined(OS_IOS) || defined(OS_ANDROID)
92 base::FEATURE_DISABLED_BY_DEFAULT
93#else
94 base::FEATURE_ENABLED_BY_DEFAULT
95#endif
96};
97
98// Feature used to reverse the sense of the tab switch button. Selecting the
99// suggestion will switch to the tab, while the button will navigate
100// locally.
101const base::Feature kOmniboxReverseTabSwitchLogic{
102 "OmniboxReverseTabSwitchLogic", base::FEATURE_DISABLED_BY_DEFAULT};
103
104// Feature used to enable various experiments on keyword mode, UI and
105// suggestions.
106const base::Feature kExperimentalKeywordMode{"OmniboxExperimentalKeywordMode",
107 base::FEATURE_DISABLED_BY_DEFAULT};
108
109// Feature used to enable Pedal suggestions.
110const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions",
111 base::FEATURE_DISABLED_BY_DEFAULT};
112
Tommy C. Lia2c75fb2019-04-08 20:22:34113// Feature used for UI that improves transparency of and control over omnibox
114// suggestions. This includes UI cues (like a clock icon for Search History
115// suggestions), as well as user controls to delete personalized suggestions.
116// This will be eventually enabled by default.
117const base::Feature kOmniboxSuggestionTransparencyOptions{
118 "OmniboxSuggestionTransparencyOptions", base::FEATURE_DISABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57119
Tommy C. Lie57096e92019-04-23 21:18:55120// Feature that shows UI cues to differentiate Search History matches from
121// other search suggestions provided by the default search provider. This
122// feature is a narrow subset of kOmniboxSuggestionTransparencyOptions.
123const base::Feature kOmniboxUICuesForSearchHistoryMatches{
124 "OmniboxUICuesForSearchHistoryMatches", base::FEATURE_DISABLED_BY_DEFAULT};
125
Tomasz Wiszkowskid938a1112019-03-06 18:01:57126// Feature to enable clipboard provider to suggest copied text.
127const base::Feature kEnableClipboardProviderTextSuggestions{
128 "OmniboxEnableClipboardProviderTextSuggestions",
129 base::FEATURE_DISABLED_BY_DEFAULT};
130
131// Feature to enable clipboard provider to suggest searching for copied images.
132const base::Feature kEnableClipboardProviderImageSuggestions{
133 "OmniboxEnableClipboardProviderImageSuggestions",
134 base::FEATURE_DISABLED_BY_DEFAULT};
135
136// Feature to enable the search provider to send a request to the suggest
137// server on focus. This allows the suggest server to warm up, by, for
138// example, loading per-user models into memory. Having a per-user model
139// in memory allows the suggest server to respond more quickly with
140// personalized suggestions as the user types.
141const base::Feature kSearchProviderWarmUpOnFocus{
142 "OmniboxWarmUpSearchProviderOnFocus",
143#if defined(OS_IOS)
144 base::FEATURE_DISABLED_BY_DEFAULT
145#else
146 base::FEATURE_ENABLED_BY_DEFAULT
147#endif
148};
149
150// Feature used for the Zero Suggest Redirect to Chrome Field Trial.
151const base::Feature kZeroSuggestRedirectToChrome{
152 "ZeroSuggestRedirectToChrome", base::FEATURE_DISABLED_BY_DEFAULT};
153
154// Feature used to display the title of the current URL match.
155const base::Feature kDisplayTitleForCurrentUrl{
156 "OmniboxDisplayTitleForCurrentUrl",
157#if !defined(OS_IOS)
158 base::FEATURE_ENABLED_BY_DEFAULT
159#else
160 base::FEATURE_DISABLED_BY_DEFAULT
161#endif
162};
163
164// Feature used for the max autocomplete matches UI experiment.
165const base::Feature kUIExperimentMaxAutocompleteMatches{
166 "OmniboxUIExperimentMaxAutocompleteMatches",
167 base::FEATURE_DISABLED_BY_DEFAULT};
168
169// Feature used to display the search terms instead of the URL in the Omnibox
170// when the user is on the search results page of the default search provider.
171const base::Feature kQueryInOmnibox{"QueryInOmnibox",
172 base::FEATURE_DISABLED_BY_DEFAULT};
173
174// Feature used for showing the URL suggestion favicons as a UI experiment,
175// currently only used on desktop platforms.
176const base::Feature kUIExperimentShowSuggestionFavicons{
Tomasz Wiszkowski4af1f7352019-04-08 16:46:15177 "OmniboxUIExperimentShowSuggestionFavicons",
178#if defined(OS_ANDROID)
179 base::FEATURE_DISABLED_BY_DEFAULT
180#else
181 base::FEATURE_ENABLED_BY_DEFAULT
182#endif
183};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57184
185// Feature used to always swap the title and URL.
186const base::Feature kUIExperimentSwapTitleAndUrl{
187 "OmniboxUIExperimentSwapTitleAndUrl",
188#if defined(OS_IOS) || defined(OS_ANDROID)
189 base::FEATURE_DISABLED_BY_DEFAULT
190#else
191 base::FEATURE_ENABLED_BY_DEFAULT
192#endif
193};
194
195// Feature used for the vertical margin UI experiment, currently only used on
196// desktop platforms.
197const base::Feature kUIExperimentVerticalMargin{
198 "OmniboxUIExperimentVerticalMargin", base::FEATURE_DISABLED_BY_DEFAULT};
199
200// Feature used to color "blue" the generic search icon and search terms.
201// Technically, this makes the search icon and search terms match the color of
202// Omnibox link text, which is blue by convention.
203const base::Feature kUIExperimentBlueSearchLoopAndSearchQuery{
204 "OmniboxUIExperimentBlueSearchLoopAndSearchQuery",
205 base::FEATURE_DISABLED_BY_DEFAULT};
206
207// Feature used to change the color of text in navigation suggestions. It
208// changes title text from black to blue, and URL text from blue to gray.
209const base::Feature kUIExperimentBlueTitlesAndGrayUrlsOnPageSuggestions{
210 "OmniboxUIExperimentBlueTitlesAndGrayUrlsOnPageSuggestions",
211 base::FEATURE_DISABLED_BY_DEFAULT};
212
213// Feature used to change the color of text in navigation suggestions. It
214// changes title text from black to blue.
215const base::Feature kUIExperimentBlueTitlesOnPageSuggestions{
216 "OmniboxUIExperimentBlueTitlesOnPageSuggestions",
217 base::FEATURE_DISABLED_BY_DEFAULT};
218
219// Feature used to show a " - Google Search", " - Bing Search", etc. suffix on
220// all search suggestions instead of just the first one in each cluster.
221const base::Feature kUIExperimentShowSuffixOnAllSearchSuggestions{
222 "OmniboxUIExperimentShowSuffixOnAllSearchSuggestions",
223 base::FEATURE_DISABLED_BY_DEFAULT};
224
225// Feature used to show a white background in the omnibox while it's unfocused.
226// More technically, with this flag on, it uses the same background color as
227// the results popup (conventionally white).
228const base::Feature kUIExperimentWhiteBackgroundOnBlur{
229 "OmniboxUIExperimentWhiteBackgroundOnBlur",
230 base::FEATURE_DISABLED_BY_DEFAULT};
231
232// Feature used to show a generic vector icon for omnibox search instead of the
233// search engine favicon.
234//
235// This feature flag's string has a typo: "Omnibox" => "Ominbox".
236// Do not correct this typo, because this misspelled string is being used
237// as-is in field trials.
238const base::Feature kUIExperimentUseGenericSearchEngineIcon{
239 "OminboxUIExperimentUseGenericSearchEngineIcon",
240 base::FEATURE_DISABLED_BY_DEFAULT};
241
242// Feature used to bold the "user text" part of search suggestions instead
243// of the "autocomplete" part. For example, if the user typed "point reyes",
244// and the search suggestion was "point reyes weather", this feature makes
245// the "point reyes" part of the suggestion bold, instead of "weather".
246const base::Feature kUIExperimentBoldUserTextOnSearchSuggestions{
247 "OmniboxUIExperimentBoldUserTextOnSearchSuggestions",
248 base::FEATURE_DISABLED_BY_DEFAULT};
249
250// Feature used to unbold suggestion text.
251const base::Feature kUIExperimentUnboldSuggestionText{
252 "OmniboxUIExperimentUnboldSuggestionText",
253 base::FEATURE_DISABLED_BY_DEFAULT};
254
255// Feature used to enable speculatively starting a service worker associated
256// with the destination of the default match when the user's input looks like a
257// query.
258const base::Feature kSpeculativeServiceWorkerStartOnQueryInput{
259 "OmniboxSpeculativeServiceWorkerStartOnQueryInput",
260 base::FEATURE_ENABLED_BY_DEFAULT
261};
262
263// Feature used to fetch document suggestions.
264const base::Feature kDocumentProvider{"OmniboxDocumentProvider",
265 base::FEATURE_DISABLED_BY_DEFAULT};
266
267// Feature used to dedupe Google Drive URLs between different formats.
268// OmniboxDocumentProvider arms may wish to enable this, though it may also be
269// run on its own.
270const base::Feature kDedupeGoogleDriveURLs{"OmniboxDedupeGoogleDriveURLs",
271 base::FEATURE_DISABLED_BY_DEFAULT};
272
273// Feature to replace the standard ZeroSuggest with icons for most visited sites
274// and collections (bookmarks, history, recent tabs, reading list). Only
275// available on iOS.
276const base::Feature kOmniboxPopupShortcutIconsInZeroState{
277 "OmniboxPopupShortcutIconsInZeroState", base::FEATURE_DISABLED_BY_DEFAULT};
278
279// Feature to use material design weather icons in the omnibox when displaying
280// weather answers.
281const base::Feature kOmniboxMaterialDesignWeatherIcons{
282 "OmniboxMaterialDesignWeatherIcons", base::FEATURE_DISABLED_BY_DEFAULT};
283
Tomasz Wiszkowski947f6d0d2019-03-15 22:27:25284// Allow suggestions to be shown to the user on the New Tab Page upon focusing
285// URL bar (the omnibox).
286const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP",
287 base::FEATURE_DISABLED_BY_DEFAULT};
288
Tomasz Wiszkowskid938a1112019-03-06 18:01:57289} // namespace omnibox