blob: 4ea9be9aa94a134f4941f2239b847b08b1d34d5e [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
manukc32a8eff2019-07-02 15:48:307#include "build/build_config.h"
8
Tomasz Wiszkowskid938a1112019-03-06 18:01:579namespace omnibox {
10
11// Feature used to hide the scheme from steady state URLs displayed in the
12// toolbar. It is restored during editing.
13const base::Feature kHideFileUrlScheme {
14 "OmniboxUIExperimentHideFileUrlScheme",
15// Android and iOS don't have the File security chip, and therefore still
16// need to show the file scheme.
17#if defined(OS_ANDROID) || defined(OS_IOS)
18 base::FEATURE_DISABLED_BY_DEFAULT
19#else
20 base::FEATURE_ENABLED_BY_DEFAULT
21#endif
22};
23
24// Feature used to hide the scheme from steady state URLs displayed in the
25// toolbar. It is restored during editing.
Tommy C. Li7514ba82019-06-25 19:43:5326const base::Feature kHideSteadyStateUrlScheme{
27 "OmniboxUIExperimentHideSteadyStateUrlScheme",
28 base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5729
30// Feature used to hide trivial subdomains from steady state URLs displayed in
31// the toolbar. It is restored during editing.
Tommy C. Li7514ba82019-06-25 19:43:5332const base::Feature kHideSteadyStateUrlTrivialSubdomains{
33 "OmniboxUIExperimentHideSteadyStateUrlTrivialSubdomains",
34 base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5735
36// Feature used to hide the path, query and ref from steady state URLs
37// displayed in the toolbar. It is restored during editing.
38const base::Feature kHideSteadyStateUrlPathQueryAndRef {
39 "OmniboxUIExperimentHideSteadyStateUrlPathQueryAndRef",
40#if defined(OS_IOS)
41 base::FEATURE_ENABLED_BY_DEFAULT
42#else
43 base::FEATURE_DISABLED_BY_DEFAULT
44#endif
45};
46
47// Feature used to undo all omnibox elisions on a single click or focus action.
48const base::Feature kOneClickUnelide{"OmniboxOneClickUnelide",
49 base::FEATURE_DISABLED_BY_DEFAULT};
50
Christopher Thompsonc26ef302019-06-07 01:55:4551// This feature simplifies the security indiciator UI for https:// pages.
52// The default behavior is to show no verbose text for EV pages. When disabled,
53// the verbose EV indicator text will be displayed.
Tomasz Wiszkowskid938a1112019-03-06 18:01:5754// This feature is used for EV UI removal experiment (https://crbug.com/803501).
55const base::Feature kSimplifyHttpsIndicator{"SimplifyHttpsIndicator",
Christopher Thompsonc26ef302019-06-07 01:55:4556 base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5757
Kevin Bailey0f7d1592019-05-23 19:07:3558// This feature is used to have final suggestions within the Omnibox grouped
Kevin Bailey38305592019-05-24 16:55:3659// by major type. i.e. search types are first, followed by all others,
60// except for the default match which is unchanged in position.
61const base::Feature kOmniboxGroupSuggestionsBySearchVsUrl{
manuk57c11852019-07-26 22:59:0562 "OmniboxGroupSuggestionsBySearchVsUrl",
Tomasz Wiszkowski650be1082019-09-19 15:13:0863#if defined(OS_IOS)
manuk57c11852019-07-26 22:59:0564 base::FEATURE_DISABLED_BY_DEFAULT
65#else
66 base::FEATURE_ENABLED_BY_DEFAULT
67#endif
68};
Kevin Bailey0f7d1592019-05-23 19:07:3569
manukaddd3c42019-04-09 21:20:5970// Feature used to enable local entity suggestions. Similar to rich entities but
71// but location specific. E.g., typing 'starbucks near' could display the local
72// entity suggestion 'starbucks near disneyland \n starbucks * Anaheim, CA'.
73const base::Feature kOmniboxLocalEntitySuggestions{
74 "OmniboxLocalEntitySuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
75
Kevin Baileyb3e08732019-05-29 03:55:2576// Feature used to cap the number of URL-type matches shown within the
77// Omnibox. If enabled, the number of URL-type matches is limited (unless
78// there are no more non-URL matches available.) If enabled, there is a
79// companion parameter - OmniboxMaxURLMatches - which specifies the maximum
80// desired number of URL-type matches.
Kevin Baileycd6889922019-05-30 17:22:5581const base::Feature kOmniboxMaxURLMatches{"OmniboxMaxURLMatches",
Kevin Baileyb3e08732019-05-29 03:55:2582 base::FEATURE_DISABLED_BY_DEFAULT};
83
Tomasz Wiszkowskid938a1112019-03-06 18:01:5784// Feature used to enable entity suggestion images and enhanced presentation
85// showing more context and descriptive text about the entity.
86const base::Feature kOmniboxRichEntitySuggestions{
Justin Donnelly481a69c2019-05-03 20:41:4287 "OmniboxRichEntitySuggestions",
88#if defined(OS_IOS) || defined(OS_ANDROID)
89 base::FEATURE_DISABLED_BY_DEFAULT
90#else
91 base::FEATURE_ENABLED_BY_DEFAULT
92#endif
93};
Tomasz Wiszkowskid938a1112019-03-06 18:01:5794
Tomasz Wiszkowskid938a1112019-03-06 18:01:5795// Feature used to enable swapping the rows on answers.
96const base::Feature kOmniboxReverseAnswers{"OmniboxReverseAnswers",
97 base::FEATURE_DISABLED_BY_DEFAULT};
98
Kevin Bailey7d918b92019-05-02 16:00:1499// Feature used to enable matching short words to bookmarks for suggestions.
100const base::Feature kOmniboxShortBookmarkSuggestions{
101 "OmniboxShortBookmarkSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
102
Tomasz Wiszkowskid938a1112019-03-06 18:01:57103// Feature used to force on the experiment of transmission of tail suggestions
104// from GWS to this client, currently testing for desktop.
105const base::Feature kOmniboxTailSuggestions{
106 "OmniboxTailSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
107
Kevin Bailey37bbf1d2019-08-21 19:23:55108// Feature that enables the tab-switch suggestions corresponding to an open
109// tab, for a button or dedicated suggestion. Enabled by default on Desktop
110// and iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57111const base::Feature kOmniboxTabSwitchSuggestions{
112 "OmniboxTabSwitchSuggestions",
Stepan Khapuginb09801662019-05-07 10:17:04113#if defined(OS_ANDROID)
Tomasz Wiszkowskid938a1112019-03-06 18:01:57114 base::FEATURE_DISABLED_BY_DEFAULT
115#else
116 base::FEATURE_ENABLED_BY_DEFAULT
117#endif
118};
119
Kevin Bailey37bbf1d2019-08-21 19:23:55120// Feature that enables tab-switch suggestions in their own row.
121const base::Feature kOmniboxTabSwitchSuggestionsDedicatedRow{
122 "OmniboxTabSwitchSuggestionsDedicatedRow",
123 base::FEATURE_DISABLED_BY_DEFAULT};
124
Tomasz Wiszkowskid938a1112019-03-06 18:01:57125// Feature used to reverse the sense of the tab switch button. Selecting the
126// suggestion will switch to the tab, while the button will navigate
127// locally.
128const base::Feature kOmniboxReverseTabSwitchLogic{
129 "OmniboxReverseTabSwitchLogic", base::FEATURE_DISABLED_BY_DEFAULT};
130
131// Feature used to enable various experiments on keyword mode, UI and
132// suggestions.
133const base::Feature kExperimentalKeywordMode{"OmniboxExperimentalKeywordMode",
134 base::FEATURE_DISABLED_BY_DEFAULT};
135
136// Feature used to enable Pedal suggestions.
137const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions",
138 base::FEATURE_DISABLED_BY_DEFAULT};
139
Tommy C. Lia2c75fb2019-04-08 20:22:34140// Feature used for UI that improves transparency of and control over omnibox
Tommy Li9d12b4be2019-09-12 19:21:41141// suggestions. This includes "Why this Suggestion?" and user controls to delete
142// personalized suggestions. This will be eventually enabled by default.
Tommy C. Lia2c75fb2019-04-08 20:22:34143const base::Feature kOmniboxSuggestionTransparencyOptions{
144 "OmniboxSuggestionTransparencyOptions", base::FEATURE_DISABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57145
Tomasz Wiszkowskid938a1112019-03-06 18:01:57146// Feature to enable clipboard provider to suggest copied text.
147const base::Feature kEnableClipboardProviderTextSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29148 "OmniboxEnableClipboardProviderTextSuggestions",
149#if defined(OS_IOS)
150 base::FEATURE_ENABLED_BY_DEFAULT
151#else
152 base::FEATURE_DISABLED_BY_DEFAULT
153#endif
154};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57155
156// Feature to enable clipboard provider to suggest searching for copied images.
157const base::Feature kEnableClipboardProviderImageSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29158 "OmniboxEnableClipboardProviderImageSuggestions",
159#if defined(OS_IOS)
160 base::FEATURE_ENABLED_BY_DEFAULT
161#else
162 base::FEATURE_DISABLED_BY_DEFAULT
163#endif
164};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57165
166// Feature to enable the search provider to send a request to the suggest
167// server on focus. This allows the suggest server to warm up, by, for
168// example, loading per-user models into memory. Having a per-user model
169// in memory allows the suggest server to respond more quickly with
170// personalized suggestions as the user types.
171const base::Feature kSearchProviderWarmUpOnFocus{
172 "OmniboxWarmUpSearchProviderOnFocus",
173#if defined(OS_IOS)
174 base::FEATURE_DISABLED_BY_DEFAULT
175#else
176 base::FEATURE_ENABLED_BY_DEFAULT
177#endif
178};
179
Tomasz Wiszkowskid938a1112019-03-06 18:01:57180// Feature used to display the title of the current URL match.
181const base::Feature kDisplayTitleForCurrentUrl{
182 "OmniboxDisplayTitleForCurrentUrl",
183#if !defined(OS_IOS)
184 base::FEATURE_ENABLED_BY_DEFAULT
185#else
186 base::FEATURE_DISABLED_BY_DEFAULT
187#endif
188};
189
190// Feature used for the max autocomplete matches UI experiment.
191const base::Feature kUIExperimentMaxAutocompleteMatches{
192 "OmniboxUIExperimentMaxAutocompleteMatches",
193 base::FEATURE_DISABLED_BY_DEFAULT};
194
195// Feature used to display the search terms instead of the URL in the Omnibox
196// when the user is on the search results page of the default search provider.
197const base::Feature kQueryInOmnibox{"QueryInOmnibox",
198 base::FEATURE_DISABLED_BY_DEFAULT};
199
Tommy C. Li0001b822019-05-10 00:10:03200// Feature used for showing the URL suggestion favicons as a UI experiment.
201// Already launched on Desktop, and currently under development on Android.
202// This flag is not used on iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57203const base::Feature kUIExperimentShowSuggestionFavicons{
Tomasz Wiszkowski4af1f7352019-04-08 16:46:15204 "OmniboxUIExperimentShowSuggestionFavicons",
205#if defined(OS_ANDROID)
206 base::FEATURE_DISABLED_BY_DEFAULT
207#else
208 base::FEATURE_ENABLED_BY_DEFAULT
209#endif
210};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57211
212// Feature used to always swap the title and URL.
213const base::Feature kUIExperimentSwapTitleAndUrl{
214 "OmniboxUIExperimentSwapTitleAndUrl",
215#if defined(OS_IOS) || defined(OS_ANDROID)
216 base::FEATURE_DISABLED_BY_DEFAULT
217#else
218 base::FEATURE_ENABLED_BY_DEFAULT
219#endif
220};
221
Tomasz Wiszkowskid938a1112019-03-06 18:01:57222// Feature used to enable speculatively starting a service worker associated
223// with the destination of the default match when the user's input looks like a
224// query.
225const base::Feature kSpeculativeServiceWorkerStartOnQueryInput{
226 "OmniboxSpeculativeServiceWorkerStartOnQueryInput",
227 base::FEATURE_ENABLED_BY_DEFAULT
228};
229
230// Feature used to fetch document suggestions.
231const base::Feature kDocumentProvider{"OmniboxDocumentProvider",
232 base::FEATURE_DISABLED_BY_DEFAULT};
233
manuk4542e232019-09-11 19:27:35234// Feature used to autocomplete bookmark, history, and document suggestions when
235// the user input is a prefix of their titles, as opposed to their URLs.
236const base::Feature kAutocompleteTitles{"OmniboxAutocompleteTitles",
237 base::FEATURE_DISABLED_BY_DEFAULT};
238
Tomasz Wiszkowskid938a1112019-03-06 18:01:57239// Feature to replace the standard ZeroSuggest with icons for most visited sites
240// and collections (bookmarks, history, recent tabs, reading list). Only
241// available on iOS.
242const base::Feature kOmniboxPopupShortcutIconsInZeroState{
243 "OmniboxPopupShortcutIconsInZeroState", base::FEATURE_DISABLED_BY_DEFAULT};
244
245// Feature to use material design weather icons in the omnibox when displaying
246// weather answers.
247const base::Feature kOmniboxMaterialDesignWeatherIcons{
manuk9a2ed552019-09-09 23:45:44248 "OmniboxMaterialDesignWeatherIcons", base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57249
Patrick Noland2b4968b2019-06-27 14:50:26250// Returns whether IsInstantExtendedAPIEnabled should be ignored when deciding
251// the number of Google-provided search suggestions.
252const base::Feature kOmniboxDisableInstantExtendedLimit{
253 "OmniboxDisableInstantExtendedLimit", base::FEATURE_DISABLED_BY_DEFAULT};
254
Brandon Wylief8dd4e82019-07-11 16:39:57255// Show the search engine logo in the omnibox on Android (desktop already does
256// this).
257const base::Feature kOmniboxSearchEngineLogo{"OmniboxSearchEngineLogo",
258 base::FEATURE_DISABLED_BY_DEFAULT};
259
manukbf3c8ab2019-10-24 16:52:08260// Feature used to allow users to remove suggestions from clipboard.
261const base::Feature kOmniboxRemoveSuggestionsFromClipboard{
262 "OmniboxRemoveSuggestionsFromClipboard", base::FEATURE_DISABLED_BY_DEFAULT};
263
264// Feature to provide non personalized head search suggestion from a compact
265// on device model.
266const base::Feature kOnDeviceHeadProvider{"OmniboxOnDeviceHeadProvider",
267 base::FEATURE_DISABLED_BY_DEFAULT};
268
269// Feature to debounce drive requests from the document provider.
270const base::Feature kDebounceDocumentProvider{
271 "OmniboxDebounceDocumentProvider", base::FEATURE_DISABLED_BY_DEFAULT};
272
Tommy Li6390ecc2019-09-06 21:08:57273// Exempts the default match from demotion-by-type.
274const base::Feature kOmniboxPreserveDefaultMatchScore {
275 "OmniboxPreserveDefaultMatchScore",
Tomasz Wiszkowski650be1082019-09-19 15:13:08276#if defined(OS_IOS)
Tommy Li6390ecc2019-09-06 21:08:57277 base::FEATURE_DISABLED_BY_DEFAULT
278#else
279 base::FEATURE_ENABLED_BY_DEFAULT
280#endif
281};
282
283// Preserves the default match against change when providers return results
284// asynchronously. This prevents the default match from changing after the user
285// finishes typing. Without this feature, if the default match is updated right
286// when the user presses Enter, the user may go to a surprising destination.
287const base::Feature kOmniboxPreserveDefaultMatchAgainstAsyncUpdate{
288 "OmniboxPreserveDefaultMatchAgainstAsyncUpdate",
289 base::FEATURE_DISABLED_BY_DEFAULT};
290
Tommy C. Li090105512019-05-16 22:00:56291// Feature to configure on-focus suggestions provided by ZeroSuggestProvider.
Tommy C. Li414f22022019-06-07 23:46:22292// This feature's main job is to contain some field trial parameters such as:
293// - "ZeroSuggestVariant" configures the per-page-classification mode of
294// ZeroSuggestProvider.
Tommy C. Li090105512019-05-16 22:00:56295const base::Feature kOnFocusSuggestions{"OmniboxOnFocusSuggestions",
296 base::FEATURE_ENABLED_BY_DEFAULT};
297
Tomasz Wiszkowski947f6d0d2019-03-15 22:27:25298// Allow suggestions to be shown to the user on the New Tab Page upon focusing
299// URL bar (the omnibox).
300const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP",
301 base::FEATURE_DISABLED_BY_DEFAULT};
302
Moe Ahmadi4005ec92019-09-09 16:55:53303// Allow suggestions to be shown to the user on the New Tab Page upon focusing
304// the real search box.
305const base::Feature kZeroSuggestionsOnNTPRealbox{
306 "OmniboxZeroSuggestionsOnNTPRealbox", base::FEATURE_DISABLED_BY_DEFAULT};
307
Tommy Li1d03b9bf2019-09-23 23:46:34308// Allow on-focus query refinements to be shown on the default SERP.
309const base::Feature kZeroSuggestionsOnSERP{"OmniboxZeroSuggestionsOnSERP",
310 base::FEATURE_ENABLED_BY_DEFAULT};
311
Tommy Li7c2bf492019-10-22 19:34:23312// If enabled, shows a confirm dialog before removing search suggestions from
313// the omnibox. See ConfirmNtpSuggestionRemovals for the NTP equivalent.
314const base::Feature kConfirmOmniboxSuggestionRemovals{
315 "ConfirmOmniboxSuggestionRemovals", base::FEATURE_DISABLED_BY_DEFAULT};
316
Tomasz Wiszkowskid938a1112019-03-06 18:01:57317} // namespace omnibox