[omnibox] Use "OmniboxOnFocusSuggestions" base::Feature for ZeroSuggest
For historic reasons, ZeroSuggestProvider is configured via a field
trial param "ZeroSuggestVariant" that hangs off of a fixed field trial
name: "OmniboxBundledExperimentV1".
This CL migrates to using a "ZeroSuggestVariant" param that hangs off
a new base::Feature called "OmniboxOnFocusSuggestions". This feature
is Enabled by default. It's not really meant to be disabled, just a
place to store the variant parameter.
This has two main advantages:
1) Can configure ZeroSuggestProvider outside of the bundled experiment.
2) Can potentially change the mode with a multi-value option using
chrome://flags.
Bug: 963173
Change-Id: Ib3bbb2bb352017c0e70e03c30a96ca58ba736825
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1612401
Reviewed-by: Mark Pearson <[email protected]>
Commit-Queue: Tommy Li <[email protected]>
Cr-Commit-Position: refs/heads/master@{#660594}
diff --git a/components/omnibox/common/omnibox_features.cc b/components/omnibox/common/omnibox_features.cc
index f18ec04..7821bc40 100644
--- a/components/omnibox/common/omnibox_features.cc
+++ b/components/omnibox/common/omnibox_features.cc
@@ -175,20 +175,6 @@
#endif
};
-// Feature used for the Zero Suggest Redirect to Chrome Field Trial.
-//
-// This feature is *enabled* in order to *disable* all forms of suggestions
-// based on the URL on-focus (whether from "redirect to Chrome" or the
-// default suggest server). The actual disabling of redirect to Chrome
-// suggestions happens in contextual_suggestions_service.cc. See comments
-// by kDefaultExperimentalServerAddress.
-//
-// If this feature were not enabled, Chrome would use the default suggest
-// server for suggestions based on the current URL on focus. There is no
-// code in Chrome to disable that, so that why we took this route.
-const base::Feature kZeroSuggestRedirectToChrome{
- "ZeroSuggestRedirectToChrome", base::FEATURE_ENABLED_BY_DEFAULT};
-
// Feature used to display the title of the current URL match.
const base::Feature kDisplayTitleForCurrentUrl{
"OmniboxDisplayTitleForCurrentUrl",
@@ -334,6 +320,26 @@
const base::Feature kOmniboxMaterialDesignWeatherIcons{
"OmniboxMaterialDesignWeatherIcons", base::FEATURE_DISABLED_BY_DEFAULT};
+// Feature to configure on-focus suggestions provided by ZeroSuggestProvider.
+// This feature's main job is to contain the "ZeroSuggestVariant" field trial
+// parameter, which configures the global mode of ZeroSuggestProvider.
+const base::Feature kOnFocusSuggestions{"OmniboxOnFocusSuggestions",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+
+// Feature used for the Zero Suggest Redirect to Chrome Field Trial.
+//
+// This feature is *enabled* in order to *disable* all forms of suggestions
+// based on the URL on-focus (whether from "redirect to Chrome" or the
+// default suggest server). The actual disabling of redirect to Chrome
+// suggestions happens in contextual_suggestions_service.cc. See comments
+// by kDefaultExperimentalServerAddress.
+//
+// If this feature were not enabled, Chrome would use the default suggest
+// server for suggestions based on the current URL on focus. There is no
+// code in Chrome to disable that, so that why we took this route.
+const base::Feature kZeroSuggestRedirectToChrome{
+ "ZeroSuggestRedirectToChrome", base::FEATURE_ENABLED_BY_DEFAULT};
+
// Allow suggestions to be shown to the user on the New Tab Page upon focusing
// URL bar (the omnibox).
const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP",