blob: 921632094a9291e833cca519f8989f9b1ca9de8e [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 enable various experiments on keyword mode, UI and
126// suggestions.
127const base::Feature kExperimentalKeywordMode{"OmniboxExperimentalKeywordMode",
128 base::FEATURE_DISABLED_BY_DEFAULT};
129
130// Feature used to enable Pedal suggestions.
131const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions",
132 base::FEATURE_DISABLED_BY_DEFAULT};
133
Tommy C. Lia2c75fb2019-04-08 20:22:34134// Feature used for UI that improves transparency of and control over omnibox
Tommy Li9d12b4be2019-09-12 19:21:41135// suggestions. This includes "Why this Suggestion?" and user controls to delete
136// personalized suggestions. This will be eventually enabled by default.
Tommy C. Lia2c75fb2019-04-08 20:22:34137const base::Feature kOmniboxSuggestionTransparencyOptions{
138 "OmniboxSuggestionTransparencyOptions", base::FEATURE_DISABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57139
Tomasz Wiszkowskid938a1112019-03-06 18:01:57140// Feature to enable clipboard provider to suggest copied text.
141const base::Feature kEnableClipboardProviderTextSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29142 "OmniboxEnableClipboardProviderTextSuggestions",
143#if defined(OS_IOS)
144 base::FEATURE_ENABLED_BY_DEFAULT
145#else
146 base::FEATURE_DISABLED_BY_DEFAULT
147#endif
148};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57149
150// Feature to enable clipboard provider to suggest searching for copied images.
151const base::Feature kEnableClipboardProviderImageSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29152 "OmniboxEnableClipboardProviderImageSuggestions",
153#if defined(OS_IOS)
154 base::FEATURE_ENABLED_BY_DEFAULT
155#else
156 base::FEATURE_DISABLED_BY_DEFAULT
157#endif
158};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57159
160// Feature to enable the search provider to send a request to the suggest
161// server on focus. This allows the suggest server to warm up, by, for
162// example, loading per-user models into memory. Having a per-user model
163// in memory allows the suggest server to respond more quickly with
164// personalized suggestions as the user types.
165const base::Feature kSearchProviderWarmUpOnFocus{
166 "OmniboxWarmUpSearchProviderOnFocus",
167#if defined(OS_IOS)
168 base::FEATURE_DISABLED_BY_DEFAULT
169#else
170 base::FEATURE_ENABLED_BY_DEFAULT
171#endif
172};
173
Tomasz Wiszkowskid938a1112019-03-06 18:01:57174// Feature used to display the title of the current URL match.
175const base::Feature kDisplayTitleForCurrentUrl{
176 "OmniboxDisplayTitleForCurrentUrl",
177#if !defined(OS_IOS)
178 base::FEATURE_ENABLED_BY_DEFAULT
179#else
180 base::FEATURE_DISABLED_BY_DEFAULT
181#endif
182};
183
184// Feature used for the max autocomplete matches UI experiment.
185const base::Feature kUIExperimentMaxAutocompleteMatches{
186 "OmniboxUIExperimentMaxAutocompleteMatches",
187 base::FEATURE_DISABLED_BY_DEFAULT};
188
189// Feature used to display the search terms instead of the URL in the Omnibox
190// when the user is on the search results page of the default search provider.
191const base::Feature kQueryInOmnibox{"QueryInOmnibox",
192 base::FEATURE_DISABLED_BY_DEFAULT};
193
Tommy C. Li0001b822019-05-10 00:10:03194// Feature used for showing the URL suggestion favicons as a UI experiment.
195// Already launched on Desktop, and currently under development on Android.
196// This flag is not used on iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57197const base::Feature kUIExperimentShowSuggestionFavicons{
Tomasz Wiszkowski4af1f7352019-04-08 16:46:15198 "OmniboxUIExperimentShowSuggestionFavicons",
199#if defined(OS_ANDROID)
200 base::FEATURE_DISABLED_BY_DEFAULT
201#else
202 base::FEATURE_ENABLED_BY_DEFAULT
203#endif
204};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57205
206// Feature used to always swap the title and URL.
207const base::Feature kUIExperimentSwapTitleAndUrl{
208 "OmniboxUIExperimentSwapTitleAndUrl",
209#if defined(OS_IOS) || defined(OS_ANDROID)
210 base::FEATURE_DISABLED_BY_DEFAULT
211#else
212 base::FEATURE_ENABLED_BY_DEFAULT
213#endif
214};
215
Tomasz Wiszkowskid938a1112019-03-06 18:01:57216// Feature used to enable speculatively starting a service worker associated
217// with the destination of the default match when the user's input looks like a
218// query.
219const base::Feature kSpeculativeServiceWorkerStartOnQueryInput{
220 "OmniboxSpeculativeServiceWorkerStartOnQueryInput",
221 base::FEATURE_ENABLED_BY_DEFAULT
222};
223
224// Feature used to fetch document suggestions.
225const base::Feature kDocumentProvider{"OmniboxDocumentProvider",
226 base::FEATURE_DISABLED_BY_DEFAULT};
227
manuk4542e232019-09-11 19:27:35228// Feature used to autocomplete bookmark, history, and document suggestions when
229// the user input is a prefix of their titles, as opposed to their URLs.
230const base::Feature kAutocompleteTitles{"OmniboxAutocompleteTitles",
231 base::FEATURE_DISABLED_BY_DEFAULT};
232
Tomasz Wiszkowskid938a1112019-03-06 18:01:57233// Feature to replace the standard ZeroSuggest with icons for most visited sites
234// and collections (bookmarks, history, recent tabs, reading list). Only
235// available on iOS.
236const base::Feature kOmniboxPopupShortcutIconsInZeroState{
237 "OmniboxPopupShortcutIconsInZeroState", base::FEATURE_DISABLED_BY_DEFAULT};
238
239// Feature to use material design weather icons in the omnibox when displaying
240// weather answers.
241const base::Feature kOmniboxMaterialDesignWeatherIcons{
manuk9a2ed552019-09-09 23:45:44242 "OmniboxMaterialDesignWeatherIcons", base::FEATURE_ENABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57243
Patrick Noland2b4968b2019-06-27 14:50:26244// Returns whether IsInstantExtendedAPIEnabled should be ignored when deciding
245// the number of Google-provided search suggestions.
246const base::Feature kOmniboxDisableInstantExtendedLimit{
247 "OmniboxDisableInstantExtendedLimit", base::FEATURE_DISABLED_BY_DEFAULT};
248
Brandon Wylief8dd4e82019-07-11 16:39:57249// Show the search engine logo in the omnibox on Android (desktop already does
250// this).
251const base::Feature kOmniboxSearchEngineLogo{"OmniboxSearchEngineLogo",
252 base::FEATURE_DISABLED_BY_DEFAULT};
253
manukbf3c8ab2019-10-24 16:52:08254// Feature used to allow users to remove suggestions from clipboard.
255const base::Feature kOmniboxRemoveSuggestionsFromClipboard{
256 "OmniboxRemoveSuggestionsFromClipboard", base::FEATURE_DISABLED_BY_DEFAULT};
257
258// Feature to provide non personalized head search suggestion from a compact
259// on device model.
260const base::Feature kOnDeviceHeadProvider{"OmniboxOnDeviceHeadProvider",
261 base::FEATURE_DISABLED_BY_DEFAULT};
262
263// Feature to debounce drive requests from the document provider.
264const base::Feature kDebounceDocumentProvider{
265 "OmniboxDebounceDocumentProvider", base::FEATURE_DISABLED_BY_DEFAULT};
266
Tommy Li6390ecc2019-09-06 21:08:57267// Exempts the default match from demotion-by-type.
268const base::Feature kOmniboxPreserveDefaultMatchScore {
269 "OmniboxPreserveDefaultMatchScore",
Tomasz Wiszkowski650be1082019-09-19 15:13:08270#if defined(OS_IOS)
Tommy Li6390ecc2019-09-06 21:08:57271 base::FEATURE_DISABLED_BY_DEFAULT
272#else
273 base::FEATURE_ENABLED_BY_DEFAULT
274#endif
275};
276
277// Preserves the default match against change when providers return results
278// asynchronously. This prevents the default match from changing after the user
279// finishes typing. Without this feature, if the default match is updated right
280// when the user presses Enter, the user may go to a surprising destination.
281const base::Feature kOmniboxPreserveDefaultMatchAgainstAsyncUpdate{
282 "OmniboxPreserveDefaultMatchAgainstAsyncUpdate",
283 base::FEATURE_DISABLED_BY_DEFAULT};
284
Tommy C. Li090105512019-05-16 22:00:56285// Feature to configure on-focus suggestions provided by ZeroSuggestProvider.
Tommy C. Li414f22022019-06-07 23:46:22286// This feature's main job is to contain some field trial parameters such as:
287// - "ZeroSuggestVariant" configures the per-page-classification mode of
288// ZeroSuggestProvider.
Tommy C. Li090105512019-05-16 22:00:56289const base::Feature kOnFocusSuggestions{"OmniboxOnFocusSuggestions",
290 base::FEATURE_ENABLED_BY_DEFAULT};
291
Tomasz Wiszkowski947f6d0d2019-03-15 22:27:25292// Allow suggestions to be shown to the user on the New Tab Page upon focusing
293// URL bar (the omnibox).
294const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP",
295 base::FEATURE_DISABLED_BY_DEFAULT};
296
Moe Ahmadi4005ec92019-09-09 16:55:53297// Allow suggestions to be shown to the user on the New Tab Page upon focusing
298// the real search box.
299const base::Feature kZeroSuggestionsOnNTPRealbox{
300 "OmniboxZeroSuggestionsOnNTPRealbox", base::FEATURE_DISABLED_BY_DEFAULT};
301
Tommy Li1d03b9bf2019-09-23 23:46:34302// Allow on-focus query refinements to be shown on the default SERP.
303const base::Feature kZeroSuggestionsOnSERP{"OmniboxZeroSuggestionsOnSERP",
304 base::FEATURE_ENABLED_BY_DEFAULT};
305
Justin Donnellyf2703482019-10-24 21:42:15306// If enabled, changes the way Google-provided search suggestions are scored by
307// the backend. Note that this Feature is only used for triggering a server-
308// side experiment config that will send experiment IDs to the backend. It is
309// not referred to in any of the Chromium code.
310const base::Feature kOmniboxExperimentalSuggestScoring{
311 "OmniboxExperimentalSuggestScoring", base::FEATURE_DISABLED_BY_DEFAULT};
312
Tommy Li7c2bf492019-10-22 19:34:23313// If enabled, shows a confirm dialog before removing search suggestions from
314// the omnibox. See ConfirmNtpSuggestionRemovals for the NTP equivalent.
315const base::Feature kConfirmOmniboxSuggestionRemovals{
316 "ConfirmOmniboxSuggestionRemovals", base::FEATURE_DISABLED_BY_DEFAULT};
317
Kevin Bailey104e44492019-10-31 16:42:32318// Feature that enables not counting submatches towards the maximum
319// suggestion limit.
320const base::Feature kOmniboxLooseMaxLimitOnDedicatedRows{
321 "OmniboxLooseMaxLimitOnDedicatedRows", base::FEATURE_DISABLED_BY_DEFAULT};
322
Tomasz Wiszkowskid938a1112019-03-06 18:01:57323} // namespace omnibox