blob: b0ce734eb124dc7dc8073690b20301fdd05553c1 [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",
63#if defined(OS_IOS) || defined(OS_ANDROID)
64 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
Kevin Baileyabf05d62019-05-15 17:29:5695const base::Feature kOmniboxPreserveDefaultMatchScore{
manuk57c11852019-07-26 22:59:0596 "OmniboxPreserveDefaultMatchScore",
97#if defined(OS_IOS) || defined(OS_ANDROID)
98 base::FEATURE_DISABLED_BY_DEFAULT
99#else
100 base::FEATURE_ENABLED_BY_DEFAULT
101#endif
102};
Kevin Baileyabf05d62019-05-15 17:29:56103
Tomasz Wiszkowskid938a1112019-03-06 18:01:57104// Feature used to enable swapping the rows on answers.
105const base::Feature kOmniboxReverseAnswers{"OmniboxReverseAnswers",
106 base::FEATURE_DISABLED_BY_DEFAULT};
107
Kevin Bailey7d918b92019-05-02 16:00:14108// Feature used to enable matching short words to bookmarks for suggestions.
109const base::Feature kOmniboxShortBookmarkSuggestions{
110 "OmniboxShortBookmarkSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
111
Tomasz Wiszkowskid938a1112019-03-06 18:01:57112// Feature used to force on the experiment of transmission of tail suggestions
113// from GWS to this client, currently testing for desktop.
114const base::Feature kOmniboxTailSuggestions{
115 "OmniboxTailSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
116
Stepan Khapuginb09801662019-05-07 10:17:04117// Feature that enables the tab-switch button on suggestions corresponding to an
118// open tab. Enabled by default on Desktop and iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57119const base::Feature kOmniboxTabSwitchSuggestions{
120 "OmniboxTabSwitchSuggestions",
Stepan Khapuginb09801662019-05-07 10:17:04121#if defined(OS_ANDROID)
Tomasz Wiszkowskid938a1112019-03-06 18:01:57122 base::FEATURE_DISABLED_BY_DEFAULT
123#else
124 base::FEATURE_ENABLED_BY_DEFAULT
125#endif
126};
127
Kevin Baileyc4e090c2019-07-11 16:42:11128// Feature that enables wrapping the Omnibox position between top and bottom.
129// The feature is enabled by default, but remains as a kill-switch.
130const base::Feature kOmniboxWrapPopupPosition{"OmniboxWrapPopupPosition",
131 base::FEATURE_ENABLED_BY_DEFAULT};
Kevin Baileyc9cd6cd2019-06-27 02:47:53132
Tomasz Wiszkowskid938a1112019-03-06 18:01:57133// Feature used to reverse the sense of the tab switch button. Selecting the
134// suggestion will switch to the tab, while the button will navigate
135// locally.
136const base::Feature kOmniboxReverseTabSwitchLogic{
137 "OmniboxReverseTabSwitchLogic", base::FEATURE_DISABLED_BY_DEFAULT};
138
139// Feature used to enable various experiments on keyword mode, UI and
140// suggestions.
141const base::Feature kExperimentalKeywordMode{"OmniboxExperimentalKeywordMode",
142 base::FEATURE_DISABLED_BY_DEFAULT};
143
144// Feature used to enable Pedal suggestions.
145const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions",
146 base::FEATURE_DISABLED_BY_DEFAULT};
147
Tommy C. Lia2c75fb2019-04-08 20:22:34148// Feature used for UI that improves transparency of and control over omnibox
149// suggestions. This includes UI cues (like a clock icon for Search History
150// suggestions), as well as user controls to delete personalized suggestions.
151// This will be eventually enabled by default.
152const base::Feature kOmniboxSuggestionTransparencyOptions{
153 "OmniboxSuggestionTransparencyOptions", base::FEATURE_DISABLED_BY_DEFAULT};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57154
Tommy C. Lie57096e92019-04-23 21:18:55155// Feature that shows UI cues to differentiate Search History matches from
156// other search suggestions provided by the default search provider. This
157// feature is a narrow subset of kOmniboxSuggestionTransparencyOptions.
158const base::Feature kOmniboxUICuesForSearchHistoryMatches{
Tommy C. Li20b1da2d2019-07-17 17:13:24159 "OmniboxUICuesForSearchHistoryMatches", base::FEATURE_ENABLED_BY_DEFAULT};
Tommy C. Lie57096e92019-04-23 21:18:55160
Tommy C. Li7af8664b2019-04-24 18:10:29161// Feature that shows an alternate separator before the description of
162// omnibox matches. In English, this changes the separator from '-' to '|'.
163const base::Feature kOmniboxAlternateMatchDescriptionSeparator{
164 "OmniboxAlternateMatchDescriptionSeparator",
165 base::FEATURE_DISABLED_BY_DEFAULT};
166
Tomasz Wiszkowskid938a1112019-03-06 18:01:57167// Feature to enable clipboard provider to suggest copied text.
168const base::Feature kEnableClipboardProviderTextSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29169 "OmniboxEnableClipboardProviderTextSuggestions",
170#if defined(OS_IOS)
171 base::FEATURE_ENABLED_BY_DEFAULT
172#else
173 base::FEATURE_DISABLED_BY_DEFAULT
174#endif
175};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57176
177// Feature to enable clipboard provider to suggest searching for copied images.
178const base::Feature kEnableClipboardProviderImageSuggestions{
Robbie Gibson85cef3182019-07-21 15:10:29179 "OmniboxEnableClipboardProviderImageSuggestions",
180#if defined(OS_IOS)
181 base::FEATURE_ENABLED_BY_DEFAULT
182#else
183 base::FEATURE_DISABLED_BY_DEFAULT
184#endif
185};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57186
187// Feature to enable the search provider to send a request to the suggest
188// server on focus. This allows the suggest server to warm up, by, for
189// example, loading per-user models into memory. Having a per-user model
190// in memory allows the suggest server to respond more quickly with
191// personalized suggestions as the user types.
192const base::Feature kSearchProviderWarmUpOnFocus{
193 "OmniboxWarmUpSearchProviderOnFocus",
194#if defined(OS_IOS)
195 base::FEATURE_DISABLED_BY_DEFAULT
196#else
197 base::FEATURE_ENABLED_BY_DEFAULT
198#endif
199};
200
Tomasz Wiszkowskid938a1112019-03-06 18:01:57201// Feature used to display the title of the current URL match.
202const base::Feature kDisplayTitleForCurrentUrl{
203 "OmniboxDisplayTitleForCurrentUrl",
204#if !defined(OS_IOS)
205 base::FEATURE_ENABLED_BY_DEFAULT
206#else
207 base::FEATURE_DISABLED_BY_DEFAULT
208#endif
209};
210
211// Feature used for the max autocomplete matches UI experiment.
212const base::Feature kUIExperimentMaxAutocompleteMatches{
213 "OmniboxUIExperimentMaxAutocompleteMatches",
214 base::FEATURE_DISABLED_BY_DEFAULT};
215
216// Feature used to display the search terms instead of the URL in the Omnibox
217// when the user is on the search results page of the default search provider.
218const base::Feature kQueryInOmnibox{"QueryInOmnibox",
219 base::FEATURE_DISABLED_BY_DEFAULT};
220
Tommy C. Li0001b822019-05-10 00:10:03221// Feature used for showing the URL suggestion favicons as a UI experiment.
222// Already launched on Desktop, and currently under development on Android.
223// This flag is not used on iOS.
Tomasz Wiszkowskid938a1112019-03-06 18:01:57224const base::Feature kUIExperimentShowSuggestionFavicons{
Tomasz Wiszkowski4af1f7352019-04-08 16:46:15225 "OmniboxUIExperimentShowSuggestionFavicons",
226#if defined(OS_ANDROID)
227 base::FEATURE_DISABLED_BY_DEFAULT
228#else
229 base::FEATURE_ENABLED_BY_DEFAULT
230#endif
231};
Tomasz Wiszkowskid938a1112019-03-06 18:01:57232
233// Feature used to always swap the title and URL.
234const base::Feature kUIExperimentSwapTitleAndUrl{
235 "OmniboxUIExperimentSwapTitleAndUrl",
236#if defined(OS_IOS) || defined(OS_ANDROID)
237 base::FEATURE_DISABLED_BY_DEFAULT
238#else
239 base::FEATURE_ENABLED_BY_DEFAULT
240#endif
241};
242
Dan Beamc6f0d222019-04-26 00:38:31243// Shows the "Search Google or type a URL" omnibox placeholder even when the
244// caret (text edit cursor) is showing / when focused. views::Textfield works
245// this way, as does <input placeholder="">. Omnibox and the NTP's "fakebox"
246// are exceptions in this regard and this experiment makes this more consistent.
247const base::Feature kUIExperimentShowPlaceholderWhenCaretShowing{
248 "OmniboxUIExperimentShowPlaceholderWhenCaretShowing",
Tommy Lia4db41dc2019-08-13 21:57:00249 base::FEATURE_DISABLED_BY_DEFAULT};
Dan Beamc6f0d222019-04-26 00:38:31250
Tomasz Wiszkowskid938a1112019-03-06 18:01:57251// Feature used to enable speculatively starting a service worker associated
252// with the destination of the default match when the user's input looks like a
253// query.
254const base::Feature kSpeculativeServiceWorkerStartOnQueryInput{
255 "OmniboxSpeculativeServiceWorkerStartOnQueryInput",
256 base::FEATURE_ENABLED_BY_DEFAULT
257};
258
259// Feature used to fetch document suggestions.
260const base::Feature kDocumentProvider{"OmniboxDocumentProvider",
261 base::FEATURE_DISABLED_BY_DEFAULT};
262
Tomasz Wiszkowskid938a1112019-03-06 18:01:57263// Feature to replace the standard ZeroSuggest with icons for most visited sites
264// and collections (bookmarks, history, recent tabs, reading list). Only
265// available on iOS.
266const base::Feature kOmniboxPopupShortcutIconsInZeroState{
267 "OmniboxPopupShortcutIconsInZeroState", base::FEATURE_DISABLED_BY_DEFAULT};
268
269// Feature to use material design weather icons in the omnibox when displaying
270// weather answers.
271const base::Feature kOmniboxMaterialDesignWeatherIcons{
272 "OmniboxMaterialDesignWeatherIcons", base::FEATURE_DISABLED_BY_DEFAULT};
273
Patrick Noland2b4968b2019-06-27 14:50:26274// Returns whether IsInstantExtendedAPIEnabled should be ignored when deciding
275// the number of Google-provided search suggestions.
276const base::Feature kOmniboxDisableInstantExtendedLimit{
277 "OmniboxDisableInstantExtendedLimit", base::FEATURE_DISABLED_BY_DEFAULT};
278
Brandon Wylief8dd4e82019-07-11 16:39:57279// Show the search engine logo in the omnibox on Android (desktop already does
280// this).
281const base::Feature kOmniboxSearchEngineLogo{"OmniboxSearchEngineLogo",
282 base::FEATURE_DISABLED_BY_DEFAULT};
283
Tommy C. Li090105512019-05-16 22:00:56284// Feature to configure on-focus suggestions provided by ZeroSuggestProvider.
Tommy C. Li414f22022019-06-07 23:46:22285// This feature's main job is to contain some field trial parameters such as:
286// - "ZeroSuggestVariant" configures the per-page-classification mode of
287// ZeroSuggestProvider.
288// - "CustomEndpointURL" configures a custom endpoint for remote suggestions.
289// - "CustomEndpointExperimentID" sends an id number to the custom endpoint.
Tommy C. Li090105512019-05-16 22:00:56290const base::Feature kOnFocusSuggestions{"OmniboxOnFocusSuggestions",
291 base::FEATURE_ENABLED_BY_DEFAULT};
292
Tomasz Wiszkowski947f6d0d2019-03-15 22:27:25293// Allow suggestions to be shown to the user on the New Tab Page upon focusing
294// URL bar (the omnibox).
295const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP",
296 base::FEATURE_DISABLED_BY_DEFAULT};
297
Ce Chen20af01c2019-07-02 19:16:36298// Feature to provide non personalized head search suggestion from a compact
299// on device model.
300const base::Feature kOnDeviceHeadProvider{"OmniboxOnDeviceHeadProvider",
301 base::FEATURE_DISABLED_BY_DEFAULT};
302
Tomasz Wiszkowskid938a1112019-03-06 18:01:57303} // namespace omnibox