blob: 873ac9f5480c8657cd47b5ec87b4ddbf3f042160 [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.
24const 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};
32
33// Feature used to hide trivial subdomains from steady state URLs displayed in
34// the toolbar. It is restored during editing.
35const 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};
43
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
59// This feature simplifies the security indiciator UI for https:// pages. The
60// exact UI treatment is dependent on the parameter 'treatment' which can have
61// the following value:
62// - 'ev-to-secure': Show the "Secure" chip for pages with an EV certificate.
63// - 'secure-to-lock': Show only the lock icon for non-EV https:// pages.
64// - 'both-to-lock': Show only the lock icon for all https:// pages.
65// - 'keep-secure-chip': Show the old "Secure" chip for non-EV https:// pages.
66// The default behavior is the same as 'secure-to-lock'.
67// This feature is used for EV UI removal experiment (https://crbug.com/803501).
68const base::Feature kSimplifyHttpsIndicator{"SimplifyHttpsIndicator",
69 base::FEATURE_DISABLED_BY_DEFAULT};
70
71// Feature used to enable entity suggestion images and enhanced presentation
72// showing more context and descriptive text about the entity.
73const base::Feature kOmniboxRichEntitySuggestions{
74 "OmniboxRichEntitySuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
75
76// Feature used to enable enhanced presentation showing larger images.
77// This is currently only used on Android.
78const base::Feature kOmniboxNewAnswerLayout{"OmniboxNewAnswerLayout",
79 base::FEATURE_DISABLED_BY_DEFAULT};
80
81// Feature used to enable swapping the rows on answers.
82const base::Feature kOmniboxReverseAnswers{"OmniboxReverseAnswers",
83 base::FEATURE_DISABLED_BY_DEFAULT};
84
85// 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
124// Feature to enable clipboard provider to suggest copied text.
125const base::Feature kEnableClipboardProviderTextSuggestions{
126 "OmniboxEnableClipboardProviderTextSuggestions",
127 base::FEATURE_DISABLED_BY_DEFAULT};
128
129// Feature to enable clipboard provider to suggest searching for copied images.
130const base::Feature kEnableClipboardProviderImageSuggestions{
131 "OmniboxEnableClipboardProviderImageSuggestions",
132 base::FEATURE_DISABLED_BY_DEFAULT};
133
134// Feature to enable the search provider to send a request to the suggest
135// server on focus. This allows the suggest server to warm up, by, for
136// example, loading per-user models into memory. Having a per-user model
137// in memory allows the suggest server to respond more quickly with
138// personalized suggestions as the user types.
139const base::Feature kSearchProviderWarmUpOnFocus{
140 "OmniboxWarmUpSearchProviderOnFocus",
141#if defined(OS_IOS)
142 base::FEATURE_DISABLED_BY_DEFAULT
143#else
144 base::FEATURE_ENABLED_BY_DEFAULT
145#endif
146};
147
148// Feature used for the Zero Suggest Redirect to Chrome Field Trial.
149const base::Feature kZeroSuggestRedirectToChrome{
150 "ZeroSuggestRedirectToChrome", base::FEATURE_DISABLED_BY_DEFAULT};
151
152// Feature used to display the title of the current URL match.
153const base::Feature kDisplayTitleForCurrentUrl{
154 "OmniboxDisplayTitleForCurrentUrl",
155#if !defined(OS_IOS)
156 base::FEATURE_ENABLED_BY_DEFAULT
157#else
158 base::FEATURE_DISABLED_BY_DEFAULT
159#endif
160};
161
162// Feature used for the max autocomplete matches UI experiment.
163const base::Feature kUIExperimentMaxAutocompleteMatches{
164 "OmniboxUIExperimentMaxAutocompleteMatches",
165 base::FEATURE_DISABLED_BY_DEFAULT};
166
167// Feature used to display the search terms instead of the URL in the Omnibox
168// when the user is on the search results page of the default search provider.
169const base::Feature kQueryInOmnibox{"QueryInOmnibox",
170 base::FEATURE_DISABLED_BY_DEFAULT};
171
172// Feature used for showing the URL suggestion favicons as a UI experiment,
173// currently only used on desktop platforms.
174const base::Feature kUIExperimentShowSuggestionFavicons{
Tomasz Wiszkowski4af1f7352019-04-08 16:46:15175 "OmniboxUIExperimentShowSuggestionFavicons",
176#if defined(OS_ANDROID)
177 base::FEATURE_DISABLED_BY_DEFAULT
178#else
179 base::FEATURE_ENABLED_BY_DEFAULT
180#endif
181};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57182
183// Feature used to always swap the title and URL.
184const base::Feature kUIExperimentSwapTitleAndUrl{
185 "OmniboxUIExperimentSwapTitleAndUrl",
186#if defined(OS_IOS) || defined(OS_ANDROID)
187 base::FEATURE_DISABLED_BY_DEFAULT
188#else
189 base::FEATURE_ENABLED_BY_DEFAULT
190#endif
191};
192
193// Feature used for the vertical margin UI experiment, currently only used on
194// desktop platforms.
195const base::Feature kUIExperimentVerticalMargin{
196 "OmniboxUIExperimentVerticalMargin", base::FEATURE_DISABLED_BY_DEFAULT};
197
198// Feature used to color "blue" the generic search icon and search terms.
199// Technically, this makes the search icon and search terms match the color of
200// Omnibox link text, which is blue by convention.
201const base::Feature kUIExperimentBlueSearchLoopAndSearchQuery{
202 "OmniboxUIExperimentBlueSearchLoopAndSearchQuery",
203 base::FEATURE_DISABLED_BY_DEFAULT};
204
205// Feature used to change the color of text in navigation suggestions. It
206// changes title text from black to blue, and URL text from blue to gray.
207const base::Feature kUIExperimentBlueTitlesAndGrayUrlsOnPageSuggestions{
208 "OmniboxUIExperimentBlueTitlesAndGrayUrlsOnPageSuggestions",
209 base::FEATURE_DISABLED_BY_DEFAULT};
210
211// Feature used to change the color of text in navigation suggestions. It
212// changes title text from black to blue.
213const base::Feature kUIExperimentBlueTitlesOnPageSuggestions{
214 "OmniboxUIExperimentBlueTitlesOnPageSuggestions",
215 base::FEATURE_DISABLED_BY_DEFAULT};
216
217// Feature used to show a " - Google Search", " - Bing Search", etc. suffix on
218// all search suggestions instead of just the first one in each cluster.
219const base::Feature kUIExperimentShowSuffixOnAllSearchSuggestions{
220 "OmniboxUIExperimentShowSuffixOnAllSearchSuggestions",
221 base::FEATURE_DISABLED_BY_DEFAULT};
222
223// Feature used to show a white background in the omnibox while it's unfocused.
224// More technically, with this flag on, it uses the same background color as
225// the results popup (conventionally white).
226const base::Feature kUIExperimentWhiteBackgroundOnBlur{
227 "OmniboxUIExperimentWhiteBackgroundOnBlur",
228 base::FEATURE_DISABLED_BY_DEFAULT};
229
230// Feature used to show a generic vector icon for omnibox search instead of the
231// search engine favicon.
232//
233// This feature flag's string has a typo: "Omnibox" => "Ominbox".
234// Do not correct this typo, because this misspelled string is being used
235// as-is in field trials.
236const base::Feature kUIExperimentUseGenericSearchEngineIcon{
237 "OminboxUIExperimentUseGenericSearchEngineIcon",
238 base::FEATURE_DISABLED_BY_DEFAULT};
239
240// Feature used to bold the "user text" part of search suggestions instead
241// of the "autocomplete" part. For example, if the user typed "point reyes",
242// and the search suggestion was "point reyes weather", this feature makes
243// the "point reyes" part of the suggestion bold, instead of "weather".
244const base::Feature kUIExperimentBoldUserTextOnSearchSuggestions{
245 "OmniboxUIExperimentBoldUserTextOnSearchSuggestions",
246 base::FEATURE_DISABLED_BY_DEFAULT};
247
248// Feature used to unbold suggestion text.
249const base::Feature kUIExperimentUnboldSuggestionText{
250 "OmniboxUIExperimentUnboldSuggestionText",
251 base::FEATURE_DISABLED_BY_DEFAULT};
252
253// Feature used to enable speculatively starting a service worker associated
254// with the destination of the default match when the user's input looks like a
255// query.
256const base::Feature kSpeculativeServiceWorkerStartOnQueryInput{
257 "OmniboxSpeculativeServiceWorkerStartOnQueryInput",
258 base::FEATURE_ENABLED_BY_DEFAULT
259};
260
261// Feature used to fetch document suggestions.
262const base::Feature kDocumentProvider{"OmniboxDocumentProvider",
263 base::FEATURE_DISABLED_BY_DEFAULT};
264
265// Feature used to dedupe Google Drive URLs between different formats.
266// OmniboxDocumentProvider arms may wish to enable this, though it may also be
267// run on its own.
268const base::Feature kDedupeGoogleDriveURLs{"OmniboxDedupeGoogleDriveURLs",
269 base::FEATURE_DISABLED_BY_DEFAULT};
270
271// Feature to replace the standard ZeroSuggest with icons for most visited sites
272// and collections (bookmarks, history, recent tabs, reading list). Only
273// available on iOS.
274const base::Feature kOmniboxPopupShortcutIconsInZeroState{
275 "OmniboxPopupShortcutIconsInZeroState", base::FEATURE_DISABLED_BY_DEFAULT};
276
277// Feature to use material design weather icons in the omnibox when displaying
278// weather answers.
279const base::Feature kOmniboxMaterialDesignWeatherIcons{
280 "OmniboxMaterialDesignWeatherIcons", base::FEATURE_DISABLED_BY_DEFAULT};
281
Tomasz Wiszkowski947f6d0d2019-03-15 22:27:25282// Allow suggestions to be shown to the user on the New Tab Page upon focusing
283// URL bar (the omnibox).
284const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP",
285 base::FEATURE_DISABLED_BY_DEFAULT};
286
Tomasz Wiszkowskid938a1112019-03-06 18:01:57287} // namespace omnibox