File: omnibox_features.cc

package info (click to toggle)
chromium 120.0.6099.224-1~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,112,112 kB
  • sloc: cpp: 32,907,025; ansic: 8,148,123; javascript: 3,679,536; python: 2,031,248; asm: 959,718; java: 804,675; xml: 617,256; sh: 111,417; objc: 100,835; perl: 88,443; cs: 53,032; makefile: 29,579; fortran: 24,137; php: 21,162; tcl: 21,147; sql: 20,809; ruby: 17,735; pascal: 12,864; yacc: 8,045; lisp: 3,388; lex: 1,323; ada: 727; awk: 329; jsp: 267; csh: 117; exp: 43; sed: 37
file content (549 lines) | stat: -rw-r--r-- 24,355 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/omnibox/common/omnibox_features.h"

#include "base/feature_list.h"
#include "build/build_config.h"
#include "ui/base/ui_base_features.h"

namespace omnibox {

constexpr auto enabled_by_default_desktop_only =
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
    base::FEATURE_DISABLED_BY_DEFAULT;
#else
    base::FEATURE_ENABLED_BY_DEFAULT;
#endif

constexpr auto enabled_by_default_android_only =
#if BUILDFLAG(IS_ANDROID)
    base::FEATURE_ENABLED_BY_DEFAULT;
#else
    base::FEATURE_DISABLED_BY_DEFAULT;
#endif

constexpr auto enabled_by_default_desktop_android =
#if BUILDFLAG(IS_IOS)
    base::FEATURE_DISABLED_BY_DEFAULT;
#else
    base::FEATURE_ENABLED_BY_DEFAULT;
#endif

const auto enabled_by_default_android_ios =
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
    base::FEATURE_ENABLED_BY_DEFAULT;
#else
    base::FEATURE_DISABLED_BY_DEFAULT;
#endif

// Feature to enable showing thumbnail in front of the Omnibox clipboard image
// search suggestion.
BASE_FEATURE(kImageSearchSuggestionThumbnail,
             "ImageSearchSuggestionThumbnail",
             enabled_by_default_android_only);

// Feature used to allow users to remove suggestions from clipboard.
BASE_FEATURE(kOmniboxRemoveSuggestionsFromClipboard,
             "OmniboxRemoveSuggestionsFromClipboard",
             enabled_by_default_android_only);

// When enabled, uses the grouping framework with zero prefix suggestions (i.e.
// autocomplete_grouper_sections.h) to limit and group (but not sort) matches.
BASE_FEATURE(kGroupingFrameworkForZPS,
             "OmniboxGroupingFrameworkForZPS",
             enabled_by_default_desktop_android);

// When enabled, uses the grouping framework with prefixed suggestions (i.e.
// autocomplete_grouper_sections.h) to limit and group (but not sort) matches.
BASE_FEATURE(kGroupingFrameworkForNonZPS,
             "OmniboxGroupingFrameworkForNonZPS",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Demotes the relevance scores when comparing suggestions based on the
// suggestion's |AutocompleteMatchType| and the user's |PageClassification|.
// This feature's main job is to contain the DemoteByType parameter.
BASE_FEATURE(kOmniboxDemoteByType,
             "OmniboxDemoteByType",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, deduping prefers non-shortcut provider matches, while still
// treating fuzzy provider matches as the least preferred.
BASE_FEATURE(kPreferNonShortcutMatchesWhenDeduping,
             "OmniboxPreferNonShortcutMatchesWhenDeduping",
             base::FEATURE_ENABLED_BY_DEFAULT);

// When disabled, when providers update their matches, the new set of matches
// are sorted and culled, then merged with the old matches, then sorted and
// culled again. When enabled, the first sort and cull is skipped.
BASE_FEATURE(kSingleSortAndCullPass,
             "OmniboxSingleSortAndCullPass",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Feature used to cap max zero suggestions shown according to the param
// OmniboxMaxZeroSuggestMatches. If omitted,
// OmniboxUIExperimentMaxAutocompleteMatches will be used instead. If present,
// OmniboxMaxZeroSuggestMatches will override
// OmniboxUIExperimentMaxAutocompleteMatches when |from_omnibox_focus| is true.
BASE_FEATURE(kMaxZeroSuggestMatches,
             "OmniboxMaxZeroSuggestMatches",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Feature used to cap max suggestions shown according to the params
// UIMaxAutocompleteMatches and UIMaxAutocompleteMatchesByProvider.
BASE_FEATURE(kUIExperimentMaxAutocompleteMatches,
             "OmniboxUIExperimentMaxAutocompleteMatches",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Feature used to cap the number of URL-type matches shown within the
// Omnibox. If enabled, the number of URL-type matches is limited (unless
// there are no more non-URL matches available.) If enabled, there is a
// companion parameter - OmniboxMaxURLMatches - which specifies the maximum
// desired number of URL-type matches.
BASE_FEATURE(kOmniboxMaxURLMatches,
             "OmniboxMaxURLMatches",
             base::FEATURE_ENABLED_BY_DEFAULT);

// Feature used to cap max suggestions to a dynamic limit based on how many URLs
// would be shown. E.g., show up to 10 suggestions if doing so would display no
// URLs; else show up to 8 suggestions if doing so would include 1 or more URLs.
BASE_FEATURE(kDynamicMaxAutocomplete,
             "OmniboxDynamicMaxAutocomplete",
             enabled_by_default_desktop_android);

// If enabled, takes the search intent query params into account for triggering
// switch to tab actions on matches.
BASE_FEATURE(kDisambiguateTabMatchingForEntitySuggestions,
             "DisambiguateTabMatchingForEntitySuggestions",
             base::FEATURE_ENABLED_BY_DEFAULT);

// Used to adjust the relevance for the local history zero-prefix suggestions.
// If enabled, the relevance is determined by this feature's companion
// parameter, OmniboxFieldTrial::kLocalHistoryZeroSuggestRelevanceScore.
BASE_FEATURE(kAdjustLocalHistoryZeroSuggestRelevanceScore,
             "AdjustLocalHistoryZeroSuggestRelevanceScore",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Enables on-clobber (i.e., when the user clears the whole omnibox text)
// zero-prefix suggestions on the Open Web, that are contextual to the current
// URL. Will only work if user is signed-in and syncing, or is otherwise
// eligible to send the current page URL to the suggest server.
BASE_FEATURE(kClobberTriggersContextualWebZeroSuggest,
             "OmniboxClobberTriggersContextualWebZeroSuggest",
             enabled_by_default_desktop_android);

// Enables on-clobber (i.e., when the user clears the whole omnibox text)
// zero-prefix suggestions on the SRP.
BASE_FEATURE(kClobberTriggersSRPZeroSuggest,
             "OmniboxClobberTriggersSRPZeroSuggest",
             enabled_by_default_desktop_android);

// Enables local history zero-prefix suggestions in every context in which the
// remote zero-prefix suggestions are enabled.
BASE_FEATURE(kLocalHistoryZeroSuggestBeyondNTP,
             "LocalHistoryZeroSuggestBeyondNTP",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, SearchProvider uses `normalized_term` instead of `term` from the
// `keyword_search_terms` table. `normalized_term` is the original search term
// in lower case with extra whitespace characters collapsed. To ensure
// suggestions from SearchProvider continue to get deduped with those from
// ShortcutsProvider, AutocompleteMatch::GURLToStrippedGURL uses the normalized
// term to build the destination URLs so they are identical despite case
// mismatches in the terms.
BASE_FEATURE(kNormalizeSearchSuggestions,
             "NormalizeSearchSuggestions",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Mainly used to enable sending INTERACTION_CLOBBER focus type for zero-prefix
// requests with an empty input on Web/SRP on Mobile. Enabled by default on
// Desktop because it is also used by Desktop in the cross-platform code in the
// OmniboxEditModel for triggering zero-suggest prefetching on Web/SRP.
BASE_FEATURE(kOmniboxOnClobberFocusTypeOnContent,
             "OmniboxOnClobberFocusTypeOnContent",
             enabled_by_default_desktop_android);

// If enabled, allows up to
// `OmniboxFieldTrial::kRealboxMaxPreviousSearchRelatedSuggestions` zero-prefix
// suggestions in the 2nd column of realbox.
BASE_FEATURE(kRealboxSecondaryZeroSuggest,
             "RealboxSecondaryZeroSuggest",
             enabled_by_default_desktop_only);

// If enabled, zero prefix suggestions will be stored using an in-memory caching
// service, instead of using the existing prefs-based cache.
BASE_FEATURE(kZeroSuggestInMemoryCaching,
             "ZeroSuggestInMemoryCaching",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Enables on-focus zero-prefix suggestions on the NTP for signed-out users.
BASE_FEATURE(kZeroSuggestOnNTPForSignedOutUsers,
             "OmniboxTrendingZeroPrefixSuggestionsOnNTP",
             enabled_by_default_desktop_android);

// Enables prefetching of the zero prefix suggestions for eligible users on NTP.
BASE_FEATURE(kZeroSuggestPrefetching,
             "ZeroSuggestPrefetching",
             base::FEATURE_ENABLED_BY_DEFAULT);

// Enables prefetching of the zero prefix suggestions for eligible users on SRP.
BASE_FEATURE(kZeroSuggestPrefetchingOnSRP,
             "ZeroSuggestPrefetchingOnSRP",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Enables prefetching of the zero prefix suggestions for eligible users on the
// Web (i.e. non-NTP and non-SRP URLs).
BASE_FEATURE(kZeroSuggestPrefetchingOnWeb,
             "ZeroSuggestPrefetchingOnWeb",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Enables storing successful query/match in the shortcut database.
// Desktop will populate db regardless of this feature.
// Android will not populate db regardless of this feature.
BASE_FEATURE(kOmniboxPopulateShortcutsDatabase,
             "OmniboxPopulateShortcutsDatabase",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Features to provide head and tail non personalized search suggestion from
// compact on device models. More specifically, feature name with suffix
// Incognito / NonIncognito  will only controls behaviors under incognito /
// non-incognito mode respectively.
BASE_FEATURE(kOnDeviceHeadProviderIncognito,
             "OmniboxOnDeviceHeadProviderIncognito",
             base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE(kOnDeviceHeadProviderNonIncognito,
             "OmniboxOnDeviceHeadProviderNonIncognito",
             base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE(kOnDeviceHeadProviderKorean,
             "OmniboxOnDeviceHeadProviderKorean",
             base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kOnDeviceTailModel,
             "OmniboxOnDeviceTailModel",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, the relevant AutocompleteProviders will store "title" data in
// AutocompleteMatch::contents and "URL" data in AutocompleteMatch::description
// for URL-based omnibox suggestions (see crbug.com/1202964 for more details).
BASE_FEATURE(kStoreTitleInContentsAndUrlInDescription,
             "OmniboxStoreTitleInContentsAndUrlInDescription",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Feature used to fetch document suggestions.
BASE_FEATURE(kDocumentProvider,
             "OmniboxDocumentProvider",
             enabled_by_default_desktop_only);

// If enabled, the 'Show Google Drive Suggestions' setting is removed and Drive
// suggestions are available to all clients who meet the other requirements.
BASE_FEATURE(kDocumentProviderNoSetting,
             "OmniboxDocumentProviderNoSetting",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, the requirement to be in an active Sync state is removed and
// Drive suggestions are available to all clients who meet the other
// requirements.
BASE_FEATURE(kDocumentProviderNoSyncRequirement,
             "OmniboxDocumentProviderNoSyncRequirement",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Feature to determine if the HQP should double as a domain provider by
// suggesting up to the provider limit for each of the user's highly visited
// domains.
BASE_FEATURE(kDomainSuggestions,
             "OmniboxDomainSuggestions",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Feature to determine if omnibox should use a pref based data collection
// consent helper instead of a history sync based one.
BASE_FEATURE(kPrefBasedDataCollectionConsentHelper,
             "PrefBasedDataCollectionConsentHelper",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Allows Omnibox to dynamically adjust number of offered suggestions to fill in
// the space between Omnibox and the soft keyboard. The number of suggestions
// shown will be no less than minimum for the platform (eg. 5 for Android).
BASE_FEATURE(kAdaptiveSuggestionsCount,
             "OmniboxAdaptiveSuggestionsCount",
             enabled_by_default_android_ios);

// If enabled, clipboard suggestion will not show the clipboard content until
// the user clicks the reveal button.
BASE_FEATURE(kClipboardSuggestionContentHidden,
             "ClipboardSuggestionContentHidden",
             enabled_by_default_android_only);

// If enabled, clipboard suggestion for distinct clip data will not show after
// first use.
BASE_FEATURE(kSuppressClipboardSuggestionAfterFirstUsed,
             "SuppressClipboardSuggestionAfterFirstUsed",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, company entity icons may be replaced by a search loupe.
BASE_FEATURE(kCompanyEntityIconAdjustment,
             "CompanyEntityIconAdjustment",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, uses the Chrome Refresh 2023 design's shape for action chips in
// the omnibox suggestion popup.
BASE_FEATURE(kCr2023ActionChips,
             "Cr2023ActionChips",
             base::FEATURE_ENABLED_BY_DEFAULT);

// If enabled, uses the Chrome Refresh 2023 design's icons for action chips in
// the omnibox suggestion popup.
BASE_FEATURE(kCr2023ActionChipsIcons,
             "Cr2023ActionChipsIcons",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, finance ticker answer from omnibox will reverse the color for
// stock ticker. only colors being swapped are those that represent "growth" and
// "loss" to represent colors red and green in a way that is appropriate for a
// given country/culture
BASE_FEATURE(kSuggestionAnswersColorReverse,
             "SuggestionAnswersColorReverse",
             base::FEATURE_ENABLED_BY_DEFAULT);

// If enabled, makes Most Visited Tiles a Horizontal render group.
// Horizontal render group decomposes aggregate suggestions (such as old Most
// Visited Tiles), expecting individual AutocompleteMatch entry for every
// element in the carousel.
BASE_FEATURE(kMostVisitedTilesHorizontalRenderGroup,
             "OmniboxMostVisitedTilesHorizontalRenderGroup",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, expands autocompletion to possibly (depending on params) include
// suggestion titles and non-prefixes as opposed to be restricted to URL
// prefixes. Will also adjust the location bar UI and omnibox text selection to
// accommodate the autocompletions.
BASE_FEATURE(kRichAutocompletion,
             "OmniboxRichAutocompletion",
             enabled_by_default_desktop_only);

// Feature used to enable Pedals in the NTP Realbox.
BASE_FEATURE(kNtpRealboxPedals,
             "NtpRealboxPedals",
             base::FEATURE_ENABLED_BY_DEFAULT);

// Feature used to enable the simplified actions UI design.
BASE_FEATURE(kOmniboxActionsUISimplification,
             "OmniboxActionsUISimplification",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Feature used to enable the new keyword mode behavior.
BASE_FEATURE(kOmniboxKeywordModeRefresh,
             "OmniboxKeywordModeRefresh",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Feature used to synchronize the toolbar's and status bar's color.
BASE_FEATURE(kOmniboxMatchToolbarAndStatusBarColor,
             "OmniboxMatchToolbarAndStatusBarColor",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, allows Search Ready Omnibox to populate original search query
// when the user presses the <edit> button on EditUrl suggestion.
BASE_FEATURE(kSearchReadyOmniboxAllowQueryEdit,
             "SearchReadyOmniboxAllowQueryEdit",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, appends Query Tiles to the Omnibox ZPS on New Tab Page.
BASE_FEATURE(kQueryTilesInZPSOnNTP,
             "OmniboxQueryTilesInZPSOnNTP",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, adds a grey square background to search icons, and makes answer
// icon square instead of round.
// TODO(manukh): Partially launched; still experimenting with
//  `OmniboxSquareSuggestIconWeather`. Clean up when that param launches and
//  reaches stable.
BASE_FEATURE(kSquareSuggestIcons,
             "OmniboxSquareIcons",
             base::FEATURE_ENABLED_BY_DEFAULT);

// If enabled, forces omnibox suggestion rows to be uniformly sized.
// TODO(manukh): Clean up feature code 9/12 when m117 reaches stable; we're
//   launching the rest of CR23 in m117.
BASE_FEATURE(kUniformRowHeight,
             "OmniboxUniformRowHeight",
             base::FEATURE_ENABLED_BY_DEFAULT);

// If enabled, shows the omnibox suggestions popup in WebUI.
BASE_FEATURE(kWebUIOmniboxPopup,
             "WebUIOmniboxPopup",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, Omnibox "expanded state" height is increased from 42 px to 44 px.
BASE_FEATURE(kExpandedStateHeight,
             "OmniboxExpandedStateHeight",
             base::FEATURE_ENABLED_BY_DEFAULT);

// If enabled, Omnibox "expanded state" corner radius is increased from 8px to
// 16px.
BASE_FEATURE(kExpandedStateShape,
             "OmniboxExpandedStateShape",
             base::FEATURE_ENABLED_BY_DEFAULT);

// If enabled, Omnibox "expanded state" colors are updated to match CR23
// guidelines.
BASE_FEATURE(kExpandedStateColors,
             "OmniboxExpandedStateColors",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, Omnibox "expanded state" icons are updated to match CR23
// guidelines.
BASE_FEATURE(kExpandedStateSuggestIcons,
             "OmniboxExpandedStateSuggestIcons",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, Omnibox "expanded state" layout is updated to match CR23
// guidelines.
BASE_FEATURE(kExpandedLayout,
             "OmniboxExpandedLayout",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, the shape of the "hover fill" that's rendered for Omnibox
// suggestions is updated to match CR23 guidelines.
BASE_FEATURE(kSuggestionHoverFillShape,
             "OmniboxSuggestionHoverFillShape",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, use Assistant for omnibox voice query recognition instead of
// Android's built-in voice recognition service. Only works on Android.
BASE_FEATURE(kOmniboxAssistantVoiceSearch,
             "OmniboxAssistantVoiceSearch",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, Omnibox LHS and RHS icons are updated to match CR23
// guidelines.
BASE_FEATURE(kOmniboxCR23SteadyStateIcons,
             "kOmniboxCR23SteadyStateIcons",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, Omnibox "steady state" background color is updated to match CR23
// guidelines.
BASE_FEATURE(kOmniboxSteadyStateBackgroundColor,
             "OmniboxSteadyStateBackgroundColor",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, Omnibox "steady state" height is increased from 28 dp to 34 dp to
// match CR23 guidelines.
// TODO(manukh): Clean up feature code 9/12 when m117 reaches stable; we're
//   launching the rest of CR23 in m117.
BASE_FEATURE(kOmniboxSteadyStateHeight,
             "OmniboxSteadyStateHeight",
             base::FEATURE_ENABLED_BY_DEFAULT);

// If enabled, Omnibox "steady state" text style is updated to match CR23
// guidelines.
BASE_FEATURE(kOmniboxSteadyStateTextStyle,
             "OmniboxSteadyStateTextStyle",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, Omnibox "steady state" text color is updated to match CR23
// guidelines.
BASE_FEATURE(kOmniboxSteadyStateTextColor,
             "OmniboxSteadyStateTextColor",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Enable new Omnibox & Suggestions visual style.
BASE_FEATURE(kOmniboxModernizeVisualUpdate,
             "OmniboxModernizeVisualUpdate",
             base::FEATURE_ENABLED_BY_DEFAULT);

// Android only flag that controls whether the new security indicator should be
// used, on non-Android platforms this is controlled through the
// ChromeRefresh2023 flag.
BASE_FEATURE(kUpdatedConnectionSecurityIndicators,
             "OmniboxUpdatedConnectionSecurityIndicators",
             base::FEATURE_ENABLED_BY_DEFAULT);

// Feature used to default typed navigations to use HTTPS instead of HTTP.
// This only applies to navigations that don't have a scheme such as
// "example.com". Presently, typing "example.com" in a clean browsing profile
// loads http://example.com. When this feature is enabled, it should load
// https://example.com instead, with fallback to http://example.com if
// necessary.
BASE_FEATURE(kDefaultTypedNavigationsToHttps,
             "OmniboxDefaultTypedNavigationsToHttps",
             base::FEATURE_ENABLED_BY_DEFAULT);

// Parameter name used to look up the delay before falling back to the HTTP URL
// while trying an HTTPS URL. The parameter is treated as a TimeDelta, so the
// unit must be included in the value as well (e.g. 3s for 3 seconds).
// - If the HTTPS load finishes successfully during this time, the timer is
//   cleared and no more work is done.
// - Otherwise, a new navigation to the the fallback HTTP URL is started.
const char kDefaultTypedNavigationsToHttpsTimeoutParam[] = "timeout";

// If enabled, Omnibox reports the Assisted Query Stats in the aqs= param in the
// Search Results Page URL.
BASE_FEATURE(kReportAssistedQueryStats,
             "OmniboxReportAssistedQueryStats",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, Omnibox reports the Searchbox Stats in the gs_lcrp= param in the
// Search Results Page URL.
BASE_FEATURE(kReportSearchboxStats,
             "OmniboxReportSearchboxStats",
             base::FEATURE_ENABLED_BY_DEFAULT);

// If enabled, logs Omnibox URL scoring signals to OmniboxEventProto for
// training the ML scoring models.
BASE_FEATURE(kLogUrlScoringSignals,
             "LogUrlScoringSignals",
             base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, runs the ML scoring model to assign new relevance scores to the
// URL suggestions and reranks them.
BASE_FEATURE(kMlUrlScoring, "MlUrlScoring", base::FEATURE_DISABLED_BY_DEFAULT);

// If enabled, appends additional Trending and Recent Search Related Queries to
// the suggestion list on the NTP and SRP.
BASE_FEATURE(kInspireMe, "OmniboxInspireMe", enabled_by_default_android_only);

// If enabled, creates Omnibox autocompete URL scoring model.
BASE_FEATURE(kUrlScoringModel,
             "UrlScoringModel",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Actions in Suggest is a data-driven feature; it's considered enabled when the
// data is available.
// The feature flag below helps us tune feature behaviors.
BASE_FEATURE(kActionsInSuggest,
             "OmniboxActionsInSuggest",
             base::FEATURE_ENABLED_BY_DEFAULT);

// If enabled, treats categorical suggestions just like the entity suggestions
// by reusing the `ACMatchType::SEARCH_SUGGEST_ENTITY` and reports the original
// `omnibox::TYPE_CATEGORICAL_QUERY` to the server.
BASE_FEATURE(kCategoricalSuggestions,
             "CategoricalSuggestions",
             base::FEATURE_ENABLED_BY_DEFAULT);

// If enabled, merges the suggestion subtypes for the remote suggestions and the
// local verbatim and history suggestion duplicates at the provider level. This
// is needed for omnibox::kCategoricalSuggestions to function correctly but is
// being controlled by a separate feature in case there are unintended side
// effects beyond the categorical suggestions.
BASE_FEATURE(kMergeSubtypes, "MergeSubtypes", base::FEATURE_ENABLED_BY_DEFAULT);

bool IsOmniboxCr23CustomizeGuardedFeatureEnabled(const base::Feature& feature) {
  if (!features::CustomizeChromeSupportsChromeRefresh2023()) {
    // Bail before checking any other feature flags so that associated studies
    // don't get activated.
    return false;
  }

  return features::GetChromeRefresh2023Level() ==
             features::ChromeRefresh2023Level::kLevel2 ||
         base::FeatureList::IsEnabled(feature);
}

// If enabled, sends a signal when a user touches down on a search suggestion to
// |SearchPrefetchService|. |SearchPrefetchService| will then prefetch
// suggestion iff the SearchNavigationPrefetch feature and "touch_down" param
// are enabled.
BASE_FEATURE(kOmniboxTouchDownTriggerForPrefetch,
             "OmniboxTouchDownTriggerForPrefetch",
             base::FEATURE_DISABLED_BY_DEFAULT);
}  // namespace omnibox