Commit 6390eccd authored by Tommy Li's avatar Tommy Li Committed by Commit Bot

[omnibox] Add base::Feature to preserve default match during async pass

This CL just adds a base::Feature meant to preserve the default match
against async updates.

This is to fix inline autocompletes being "taken away" by the
AutocompleteController asynchronous passes, and therefore causing
indeterminate behavior depending on when the user exactly pressed
Enter.

Bug: 398135
Change-Id: Ie8fe3b87a2516f568bf8907f30338bc4f315a9b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1789744
Commit-Queue: Tommy Li <tommycli@chromium.org>
Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694412}
parent 533eae19
......@@ -92,15 +92,6 @@ const base::Feature kOmniboxRichEntitySuggestions{
#endif
};
const base::Feature kOmniboxPreserveDefaultMatchScore{
"OmniboxPreserveDefaultMatchScore",
#if defined(OS_IOS) || defined(OS_ANDROID)
base::FEATURE_DISABLED_BY_DEFAULT
#else
base::FEATURE_ENABLED_BY_DEFAULT
#endif
};
// Feature used to enable swapping the rows on answers.
const base::Feature kOmniboxReverseAnswers{"OmniboxReverseAnswers",
base::FEATURE_DISABLED_BY_DEFAULT};
......@@ -287,6 +278,24 @@ const base::Feature kOmniboxDisableInstantExtendedLimit{
const base::Feature kOmniboxSearchEngineLogo{"OmniboxSearchEngineLogo",
base::FEATURE_DISABLED_BY_DEFAULT};
// Exempts the default match from demotion-by-type.
const base::Feature kOmniboxPreserveDefaultMatchScore {
"OmniboxPreserveDefaultMatchScore",
#if defined(OS_IOS) || defined(OS_ANDROID)
base::FEATURE_DISABLED_BY_DEFAULT
#else
base::FEATURE_ENABLED_BY_DEFAULT
#endif
};
// Preserves the default match against change when providers return results
// asynchronously. This prevents the default match from changing after the user
// finishes typing. Without this feature, if the default match is updated right
// when the user presses Enter, the user may go to a surprising destination.
const base::Feature kOmniboxPreserveDefaultMatchAgainstAsyncUpdate{
"OmniboxPreserveDefaultMatchAgainstAsyncUpdate",
base::FEATURE_DISABLED_BY_DEFAULT};
// Feature to configure on-focus suggestions provided by ZeroSuggestProvider.
// This feature's main job is to contain some field trial parameters such as:
// - "ZeroSuggestVariant" configures the per-page-classification mode of
......
......@@ -32,7 +32,6 @@ extern const base::Feature kOmniboxPedalSuggestions;
extern const base::Feature kOmniboxSuggestionTransparencyOptions;
extern const base::Feature kOmniboxUICuesForSearchHistoryMatches;
extern const base::Feature kOmniboxAlternateMatchDescriptionSeparator;
extern const base::Feature kOmniboxPreserveDefaultMatchScore;
extern const base::Feature kEnableClipboardProviderTextSuggestions;
extern const base::Feature kEnableClipboardProviderImageSuggestions;
extern const base::Feature kSearchProviderWarmUpOnFocus;
......@@ -50,6 +49,11 @@ extern const base::Feature kOmniboxMaterialDesignWeatherIcons;
extern const base::Feature kOmniboxDisableInstantExtendedLimit;
extern const base::Feature kOmniboxSearchEngineLogo;
// Flags that affect the "twiddle" step of AutocompleteResult, i.e. SortAndCull.
// TODO(tommycli): There are more flags above that belong in this category.
extern const base::Feature kOmniboxPreserveDefaultMatchScore;
extern const base::Feature kOmniboxPreserveDefaultMatchAgainstAsyncUpdate;
// On-Focus Suggestions a.k.a. ZeroSuggest.
extern const base::Feature kOnFocusSuggestions;
extern const base::Feature kZeroSuggestionsOnNTP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment