Commit 84f1ddcc authored by Robbie Gibson's avatar Robbie Gibson Committed by Chromium LUCI CQ

[iOS] Add flag for local ZPS experiment

Bug: 1056781
Change-Id: Ie7c1421b4e6767d6f9714f75f2317555045ff951
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2581920
Commit-Queue: Robbie Gibson <rkgibson@google.com>
Reviewed-by: default avatarTomasz Wiszkowski <ender@google.com>
Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835828}
parent 2c14389c
......@@ -3623,6 +3623,11 @@
"owners": [ "jdonnelly", "chrome-omnibox-team@google.com" ],
"expiry_milestone": 89
},
{
"name": "omnibox-local-history-zero-suggest",
"owners": ["rkgibson@google.com", "stkhapugin", "chrome-omnibox-team@google.com"],
"expiry_milestone": 92
},
{
"name": "omnibox-local-zero-suggest-frecency-ranking",
"owners": [ "mahmadi", "chrome-omnibox-team@google.com" ],
......
......@@ -58,17 +58,22 @@ base::string16 GetSearchTermsFromURL(const GURL& url,
// Whether zero suggest suggestions are allowed in the given context.
// Invoked early, confirms all the conditions for zero suggestions are met.
bool AllowLocalHistoryZeroSuggestSuggestions(const AutocompleteInput& input) {
// TODO: The default-enabling on Android predated the
// omnibox::kNewSearchFeatures flag, so Android is not gated by it. Because
// of that, the new kLocalHistoryZeroSuggest flag can't control Android
// behavior. Once the kNewSearchFeatures flag is removed,
// kLocalHistoryZeroSuggest can control the feature on all plattforms.
#if defined(OS_ANDROID) // Default-enabled on Android.
return true;
#else
if (!base::FeatureList::IsEnabled(omnibox::kNewSearchFeatures))
return false;
#endif
#if !defined(OS_IOS) // Enabled by default on Desktop if not disabled by
// kNewSearchFeatures.
return true;
#else
// Flag is default-enabled on Android and Desktop.
if (base::FeatureList::IsEnabled(omnibox::kLocalHistoryZeroSuggest)) {
return true;
}
const auto current_page_classification = input.current_page_classification();
// Reactive Zero-Prefix Suggestions (rZPS) and basically all remote ZPS on the
// NTP are expected to be displayed alongside local history zero-prefix
......@@ -81,12 +86,6 @@ bool AllowLocalHistoryZeroSuggestSuggestions(const AutocompleteInput& input) {
omnibox::kReactiveZeroSuggestionsOnNTPOmnibox)) {
return true;
}
// NTP Realbox.
if (current_page_classification == OmniboxEventProto::NTP_REALBOX &&
base::FeatureList::IsEnabled(
omnibox::kReactiveZeroSuggestionsOnNTPRealbox)) {
return true;
}
return false;
#endif
......
......@@ -80,7 +80,7 @@ class LocalHistoryZeroSuggestProviderTest
#if defined(OS_IOS) // Only needed for iOS.
scoped_feature_list_ = std::make_unique<base::test::ScopedFeatureList>();
scoped_feature_list_->InitAndEnableFeature(
omnibox::kReactiveZeroSuggestionsOnNTPRealbox);
omnibox::kLocalHistoryZeroSuggest);
#endif
// Add the fallback default search provider to the TemplateURLService so
......@@ -452,7 +452,7 @@ TEST_F(LocalHistoryZeroSuggestProviderTest, Ranking) {
// With frecency ranking disabled, more recent searches are ranked higher.
scoped_feature_list_ = std::make_unique<base::test::ScopedFeatureList>();
scoped_feature_list_->InitWithFeatures(
{omnibox::kReactiveZeroSuggestionsOnNTPRealbox}, // Enables the provider.
{omnibox::kLocalHistoryZeroSuggest}, // Enables the provider on iOS.
{omnibox::kOmniboxLocalZeroSuggestFrecencyRanking});
StartProviderAndWaitUntilDone();
......@@ -462,7 +462,7 @@ TEST_F(LocalHistoryZeroSuggestProviderTest, Ranking) {
// searches are just as frequent.
scoped_feature_list_ = std::make_unique<base::test::ScopedFeatureList>();
scoped_feature_list_->InitWithFeatures(
{omnibox::kReactiveZeroSuggestionsOnNTPRealbox, // Enables the provider.
{omnibox::kLocalHistoryZeroSuggest, // Enables the provider on iOS.
omnibox::kOmniboxLocalZeroSuggestFrecencyRanking},
{});
......@@ -492,8 +492,8 @@ TEST_F(LocalHistoryZeroSuggestProviderTest, Freshness) {
// Override the age threshold to 7 days.
scoped_feature_list_ = std::make_unique<base::test::ScopedFeatureList>();
scoped_feature_list_->InitWithFeaturesAndParameters(
{{omnibox::kReactiveZeroSuggestionsOnNTPRealbox, // Enables the provider.
{}},
{{omnibox::kLocalHistoryZeroSuggest, {}}, // Enables the provider on iOS.
{omnibox::kOmniboxLocalZeroSuggestAgeThreshold,
{{OmniboxFieldTrial::kOmniboxLocalZeroSuggestAgeThresholdParam, "7"}}}},
{});
......
......@@ -247,6 +247,10 @@ const base::Feature kReactiveZeroSuggestionsOnNTPRealbox{
"OmniboxReactiveZeroSuggestionsOnNTPRealbox",
base::FEATURE_DISABLED_BY_DEFAULT};
// Allows the LocalHistoryZeroSuggestProvider to use local search history.
const base::Feature kLocalHistoryZeroSuggest{
"LocalHistoryZeroSuggest", enabled_by_default_desktop_android};
// Features to provide non personalized head search suggestion from a compact
// on device model. More specifically, feature name with suffix Incognito /
// NonIncognito will only controls behaviors under incognito / non-incognito
......
......@@ -66,6 +66,7 @@ extern const base::Feature kOnFocusSuggestionsContextualWeb;
extern const base::Feature kOnFocusSuggestionsContextualWebOnContent;
extern const base::Feature kReactiveZeroSuggestionsOnNTPOmnibox;
extern const base::Feature kReactiveZeroSuggestionsOnNTPRealbox;
extern const base::Feature kLocalHistoryZeroSuggest;
// Related, kMaxZeroSuggestMatches.
// On Device Head Suggest.
......
......@@ -338,6 +338,10 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
omnibox::kUIExperimentMaxAutocompleteMatches,
kOmniboxUIMaxAutocompleteMatchesVariations,
"OmniboxUIMaxAutocompleteVariations")},
{"omnibox-local-history-zero-suggest",
flag_descriptions::kOmniboxLocalHistoryZeroSuggestName,
flag_descriptions::kOmniboxLocalHistoryZeroSuggestDescription,
flags_ui::kOsIos, FEATURE_VALUE_TYPE(omnibox::kLocalHistoryZeroSuggest)},
{"infobar-ui-reboot", flag_descriptions::kInfobarUIRebootName,
flag_descriptions::kInfobarUIRebootDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kIOSInfobarUIReboot)},
......
......@@ -334,6 +334,12 @@ const char kOmniboxOnFocusSuggestionsDescription[] =
"before the user has typed any input. This provides overrides for the "
"default suggestion locations.";
const char kOmniboxLocalHistoryZeroSuggestName[] =
"Omnibox local zero-prefix suggestions";
const char kOmniboxLocalHistoryZeroSuggestDescription[] =
"Configures the omnibox zero-prefix suggestion to use local search "
"history.";
const char kRefactoredNTPName[] = "Enables refactored new tab page";
const char kRefactoredNTPDescription[] =
"When enabled, the new tab page is replaced with the refactored version, "
......
......@@ -291,6 +291,17 @@ extern const char kOmniboxOnDeviceHeadSuggestionsNonIncognitoDescription[];
extern const char kOmniboxOnFocusSuggestionsName[];
extern const char kOmniboxOnFocusSuggestionsDescription[];
// Title and description for the flag to control Omnibox Local zero-prefix
// suggestions.
extern const char kOmniboxLocalHistoryZeroSuggestName[];
extern const char kOmniboxLocalHistoryZeroSuggestDescription[];
#if defined(__IPHONE_13_4)
// Title and description for the flag to enable pointer support on tablets.
extern const char kPointerSupportName[];
extern const char kPointerSupportDescription[];
#endif // defined(__IPHONE_13_4)
// Title and description for the flag that enables the refactored new tab page.
extern const char kRefactoredNTPName[];
extern const char kRefactoredNTPDescription[];
......
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