[omnibox] Cleans up searchbox stats logging migration features and flags
omnibox searchbox stats logging migration was launched in m117.
OBSOLETE_HISTOGRAM[Omnibox.AssistedQueryStats.Length]=Deprecated.
Bug: 1247846
Change-Id: I2b404a8e316df03cf36da755848c4bb9a8e8b34f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5083999
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Reviewed-by: Patrick Noland <pnoland@chromium.org>
Reviewed-by: manuk hovanesian <manukh@chromium.org>
Reviewed-by: Justin Donnelly <jdonnelly@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1234964}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 33c426e..1c6a121 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -6138,16 +6138,6 @@
flag_descriptions::kOmniboxOnClobberFocusTypeOnContentDescription, kOsAll,
FEATURE_VALUE_TYPE(omnibox::kOmniboxOnClobberFocusTypeOnContent)},
- {"omnibox-report-assisted-query-stats",
- flag_descriptions::kOmniboxReportAssistedQueryStatsName,
- flag_descriptions::kOmniboxReportAssistedQueryStatsDescription, kOsAll,
- FEATURE_VALUE_TYPE(omnibox::kReportAssistedQueryStats)},
-
- {"omnibox-report-searchbox-stats",
- flag_descriptions::kOmniboxReportSearchboxStatsName,
- flag_descriptions::kOmniboxReportSearchboxStatsDescription, kOsAll,
- FEATURE_VALUE_TYPE(omnibox::kReportSearchboxStats)},
-
{"omnibox-zero-suggest-prefetching",
flag_descriptions::kOmniboxZeroSuggestPrefetchingName,
flag_descriptions::kOmniboxZeroSuggestPrefetchingDescription, kOsAll,
diff --git a/chrome/browser/android/omnibox/autocomplete_controller_android.cc b/chrome/browser/android/omnibox/autocomplete_controller_android.cc
index 291313e..831097f 100644
--- a/chrome/browser/android/omnibox/autocomplete_controller_android.cc
+++ b/chrome/browser/android/omnibox/autocomplete_controller_android.cc
@@ -416,13 +416,13 @@
}
ScopedJavaLocalRef<jobject> AutocompleteControllerAndroid::
- UpdateMatchDestinationURLWithAdditionalAssistedQueryStats(
+ UpdateMatchDestinationURLWithAdditionalSearchboxStats(
JNIEnv* env,
uintptr_t match_ptr,
jlong elapsed_time_since_input_change) {
auto* match = reinterpret_cast<AutocompleteMatch*>(match_ptr);
autocomplete_controller_
- ->UpdateMatchDestinationURLWithAdditionalAssistedQueryStats(
+ ->UpdateMatchDestinationURLWithAdditionalSearchboxStats(
base::Milliseconds(elapsed_time_since_input_change), match);
return url::GURLAndroid::FromNativeGURL(env, match->destination_url);
}
diff --git a/chrome/browser/android/omnibox/autocomplete_controller_android.h b/chrome/browser/android/omnibox/autocomplete_controller_android.h
index d7f6072..14dda07 100644
--- a/chrome/browser/android/omnibox/autocomplete_controller_android.h
+++ b/chrome/browser/android/omnibox/autocomplete_controller_android.h
@@ -77,7 +77,7 @@
void DeleteMatch(JNIEnv* env, uintptr_t match_ptr);
void DeleteMatchElement(JNIEnv* env, uintptr_t match_ptr, jint element_index);
base::android::ScopedJavaLocalRef<jobject>
- UpdateMatchDestinationURLWithAdditionalAssistedQueryStats(
+ UpdateMatchDestinationURLWithAdditionalSearchboxStats(
JNIEnv* env,
uintptr_t match_ptr,
jlong elapsed_time_since_input_change);
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index c5d7f99..a7eeebf 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -2486,18 +2486,6 @@
"Pre-warms the Android Omnibox's RecyclerView pool by inflating "
"views before the omnibox is focused.";
-const char kOmniboxReportAssistedQueryStatsName[] =
- "Omnibox Assisted Query Stats param";
-const char kOmniboxReportAssistedQueryStatsDescription[] =
- "Enables reporting the Assisted Query Stats param in search destination "
- "URLs originated from the Omnibox.";
-
-const char kOmniboxReportSearchboxStatsName[] =
- "Omnibox Searchbox Stats proto param";
-const char kOmniboxReportSearchboxStatsDescription[] =
- "Enables reporting the serialized Searchbox Stats proto param in search "
- "destination URLs originated from the Omnibox.";
-
const char kOmniboxZeroSuggestPrefetchingName[] =
"Omnibox Zero Prefix Suggestion Prefetching on NTP";
const char kOmniboxZeroSuggestPrefetchingDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index bfdbda1..505b03a 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -1479,12 +1479,6 @@
extern const char kOmniboxZeroSuggestPrefetchingName[];
extern const char kOmniboxZeroSuggestPrefetchingDescription[];
-extern const char kOmniboxReportAssistedQueryStatsName[];
-extern const char kOmniboxReportAssistedQueryStatsDescription[];
-
-extern const char kOmniboxReportSearchboxStatsName[];
-extern const char kOmniboxReportSearchboxStatsDescription[];
-
extern const char kOmniboxZeroSuggestPrefetchingOnSRPName[];
extern const char kOmniboxZeroSuggestPrefetchingOnSRPDescription[];
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteController.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteController.java
index 04f7f2b..ed0bc1bb 100644
--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteController.java
+++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteController.java
@@ -350,8 +350,8 @@
}
/**
- * Updates AQS/SBS parameters on the selected match that we will navigate to and returns the
- * updated URL.
+ * Updates searchbox stats parameters on the selected match that we will navigate to and
+ * returns the updated URL.
*
* @param match the AutocompleteMatch object to get the updated destination URL for
* @param elapsedTimeSinceInputChange the number of ms between the time the user started typing
@@ -364,7 +364,7 @@
if (!hasValidNativeObjectRef(match, VerificationPoint.UPDATE_MATCH)) return null;
return AutocompleteControllerJni.get()
- .updateMatchDestinationURLWithAdditionalAssistedQueryStats(
+ .updateMatchDestinationURLWithAdditionalSearchboxStats(
mNativeController, match.getNativeObjectRef(), elapsedTimeSinceInputChange);
}
@@ -434,7 +434,7 @@
void deleteMatch(long nativeAutocompleteControllerAndroid, long nativeAutocompleteMatch);
- GURL updateMatchDestinationURLWithAdditionalAssistedQueryStats(
+ GURL updateMatchDestinationURLWithAdditionalSearchboxStats(
long nativeAutocompleteControllerAndroid,
long nativeAutocompleteMatch,
long elapsedTimeSinceInputChange);
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java
index 385a7cd..a254beb 100644
--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java
+++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java
@@ -708,8 +708,8 @@
/**
* Updates the URL we will navigate to from suggestion, if needed. This will update the search
- * URL to be of the corpus type if query in the omnibox is displayed and update aqs= parameter
- * on regular web search URLs.
+ * URL to be of the corpus type if query in the omnibox is displayed and update gs_lcrp=
+ * parameter on regular web search URLs.
*
* @param suggestion The chosen omnibox suggestion.
* @param matchIndex The index of the chosen omnibox suggestion.
diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc
index feea66a..de00fb15 100644
--- a/components/omnibox/browser/autocomplete_controller.cc
+++ b/components/omnibox/browser/autocomplete_controller.cc
@@ -214,7 +214,7 @@
// TYPE_ON_DEVICE_HEAD, set the subtype accordingly.
if (match.provider) {
if (match.provider->type() == AutocompleteProvider::TYPE_ZERO_SUGGEST) {
- // Make sure changes here are reflected in UpdateAssistedQueryStats()
+ // Make sure changes here are reflected in UpdateSearchboxStats()
// below in which the zero-prefix suggestions are counted.
// We abuse this subtype and use it to for zero-suggest suggestions that
// aren't personalized by the server. That is, it indicates either
@@ -239,7 +239,7 @@
AutocompleteProvider::TYPE_ON_DEVICE_HEAD) {
// This subtype indicates a match from an on-device head provider.
subtypes->emplace(omnibox::SUBTYPE_SUGGEST_2G_LITE);
- // Make sure changes here are reflected in UpdateAssistedQueryStats()
+ // Make sure changes here are reflected in UpdateSearchboxStats()
// below in which the zero-prefix suggestions are counted.
} else if (match.provider->type() ==
AutocompleteProvider::TYPE_ZERO_SUGGEST_LOCAL_HISTORY) {
@@ -683,30 +683,25 @@
}
void AutocompleteController::
- UpdateMatchDestinationURLWithAdditionalAssistedQueryStats(
+ UpdateMatchDestinationURLWithAdditionalSearchboxStats(
base::TimeDelta query_formulation_time,
AutocompleteMatch* match) const {
TRACE_EVENT0("omnibox",
"AutocompleteController::"
- "UpdateMatchDestinationURLWithAdditionalAssistedQueryStats");
- // The assisted_query_stats is expected to have been previously set when this
+ "UpdateMatchDestinationURLWithAdditionalSearchboxStats");
+ // The searchbox_stats is expected to have been previously set when this
// method is called. If that is not the case, this method is being called by
- // mistake and assisted_query_stats (and searchbox_stats) should not be
- // updated with additional information.
+ // mistake and searchbox_stats should not be updated with additional
+ // information.
if (!match->search_terms_args ||
- match->search_terms_args->assisted_query_stats.empty()) {
- return;
- }
-
- if (match->search_terms_args->searchbox_stats.ByteSizeLong() == 0) {
- NOTREACHED() << "searchbox_stats must be set when assisted_query_stats is.";
+ match->search_terms_args->searchbox_stats.ByteSizeLong() == 0) {
return;
}
// Append the query formulation time (time from when the user first typed a
// character into the omnibox to when the user selected a query), whether
- // a field trial has triggered, and the current page classification to the AQS
- // parameter.
+ // a field trial has triggered, and the current page classification to the
+ // searchbox stats parameter.
bool search_feature_triggered =
triggered_feature_service_->GetFeatureTriggeredInSession(
metrics::OmniboxEventProto_Feature_REMOTE_SEARCH_FEATURE) ||
@@ -715,19 +710,16 @@
const std::string experiment_stats = base::StringPrintf(
"%" PRId64 "j%dj%d", query_formulation_time.InMilliseconds(),
search_feature_triggered, input_.current_page_classification());
- match->search_terms_args->assisted_query_stats += "." + experiment_stats;
// TODO(crbug.com/1247846): experiment_stats is a deprecated field. We should
- // however continue to report it for parity with what gets reported in aqs=,
- // and for the downstream consumers that expect this field. Once gs_lcrp=
- // fully replaces aqs=, Chrome should start logging the substitute fields and
+ // however continue to report it for the downstream consumers that expect this
+ // field. Eventually Chrome should start logging the substitute fields and
// the downstream consumers should migrate to using those fields before we
// can stop logging this deprecated field.
match->search_terms_args->searchbox_stats.set_experiment_stats(
experiment_stats);
- // Append the ExperimentStatsV2 to the AQS parameter to be logged in
- // searchbox_stats.proto's experiment_stats_v2 field.
- std::vector<std::string> experiment_stats_v2_strings;
+ // Append the ExperimentStatsV2 to the searchbox stats parameter to be logged
+ // in searchbox_stats.proto's experiment_stats_v2 field.
if (zero_suggest_provider_) {
for (const auto& experiment_stat_v2 :
zero_suggest_provider_->experiment_stats_v2s()) {
@@ -736,10 +728,6 @@
// suggestion type/subtype pairs to be delimited with commas instead.
std::string value = experiment_stat_v2.string_value();
std::replace(value.begin(), value.end(), ':', ',');
- // The SearchboxStats logging flow expects experiment stats type and value
- // to be delimited with 'i'.
- experiment_stats_v2_strings.push_back(
- base::NumberToString(experiment_stat_v2.type_int()) + "i" + value);
auto* reported_experiment_stats_v2 =
match->search_terms_args->searchbox_stats.add_experiment_stats_v2();
reported_experiment_stats_v2->set_type_int(experiment_stat_v2.type_int());
@@ -757,18 +745,9 @@
omnibox_position_stat.type_int());
reported_experiment_stats_v2->set_int_value(
omnibox_position_stat.int_value());
- experiment_stats_v2_strings.push_back(
- base::NumberToString(omnibox_position_stat.type_int()) + "i" +
- base::NumberToString(omnibox_position_stat.int_value()));
}
#endif
- if (!experiment_stats_v2_strings.empty()) {
- // 'j' is used as a delimiter between individual experiment stat entries.
- match->search_terms_args->assisted_query_stats +=
- "." + base::JoinString(experiment_stats_v2_strings, "j");
- }
-
SetMatchDestinationURL(match);
}
@@ -1107,7 +1086,7 @@
UpdateKeywordDescriptions(&internal_result_);
UpdateAssociatedKeywords(&internal_result_);
- UpdateAssistedQueryStats(&internal_result_);
+ UpdateSearchboxStats(&internal_result_);
UpdateTailSuggestPrefix(&internal_result_);
MaybeRemoveCompanyEntityImages(&internal_result_);
MaybeCleanSuggestionsForKeywordMode(input_, &internal_result_);
@@ -1316,8 +1295,7 @@
}
}
-void AutocompleteController::UpdateAssistedQueryStats(
- AutocompleteResult* result) {
+void AutocompleteController::UpdateSearchboxStats(AutocompleteResult* result) {
using omnibox::metrics::ChromeSearchboxStats;
if (result->empty())
@@ -1326,7 +1304,6 @@
ChromeSearchboxStats searchbox_stats;
searchbox_stats.set_client_name("chrome");
- // Build the impressions string (the AQS part after ".").
int count = 0;
int num_zero_prefix_suggestions_shown = 0;
absl::optional<omnibox::SuggestType> last_type;
@@ -1414,7 +1391,7 @@
searchbox_stats.set_zero_prefix_enabled(num_zero_prefix_suggestions_shown >
0);
- // Go over all matches and set AQS if the match supports it.
+ // Go over all matches and set searchbox stats if the match supports it.
for (size_t index = 0; index < result->size(); ++index) {
AutocompleteMatch* match = result->match_at(index);
const TemplateURL* template_url =
@@ -1424,7 +1401,6 @@
match->search_terms_args->searchbox_stats = searchbox_stats;
- std::string selected_position;
// Prevent trivial suggestions from getting credit for being selected.
if (!match->IsTrivialAutocompletion()) {
match_position = match_index_to_position[index];
@@ -1439,8 +1415,6 @@
match->search_terms_args->searchbox_stats.mutable_assisted_query_info()
->MergeFrom(*selected_suggestion);
- selected_position = base::StringPrintf("%" PRIuS, match_position);
-
// Reconstruct AQS for items sharing the slot (e.g. elements in the
// carousel).
if (match_index_belongs_to_horizontal_render_group[index]) {
@@ -1448,11 +1422,8 @@
match->suggest_type, match->subtypes, 1);
}
}
- match->search_terms_args->assisted_query_stats =
- base::StringPrintf("chrome.%s.%s", selected_position.c_str(),
- base::JoinString(aqs, "j").c_str());
- // Duplicate AQS/SBS for eligible ActionsInSuggest.
+ // Duplicate searchbox stats for eligible ActionsInSuggest.
// TODO(1418077): rather than computing the `action_uri`, keep the
// updated search_terms_args, and apply the query formulation time the
// moment the action is selected.
@@ -1468,8 +1439,6 @@
search_terms_args.searchbox_stats.mutable_assisted_query_info()
->MergeFrom(
match->search_terms_args->searchbox_stats.assisted_query_info());
- search_terms_args.assisted_query_stats =
- match->search_terms_args->assisted_query_stats;
action_in_suggest->action_info.set_action_uri(
ComputeURLFromSearchTermsArgs(
diff --git a/components/omnibox/browser/autocomplete_controller.h b/components/omnibox/browser/autocomplete_controller.h
index 64696ea..db7071f 100644
--- a/components/omnibox/browser/autocomplete_controller.h
+++ b/components/omnibox/browser/autocomplete_controller.h
@@ -189,12 +189,12 @@
// content; see |OmniboxEditModel::user_input_in_progress_|.
void ResetSession();
- // Updates the destination URL for the given match with the final AQS
- // parameter using additional information otherwise not available at initial
- // construction time iff the provider's TemplateURL supports assisted query
+ // Updates the destination URL for the given match with the final searchbox
+ // stats parameter using additional information otherwise not available at
+ // initial construction time iff the provider's TemplateURL supports searchbox
// stats.
// This method should be called right before the user navigates to the match.
- void UpdateMatchDestinationURLWithAdditionalAssistedQueryStats(
+ void UpdateMatchDestinationURLWithAdditionalSearchboxStats(
base::TimeDelta query_formulation_time,
AutocompleteMatch* match) const;
@@ -257,7 +257,7 @@
FilterMatchesForInstantKeywordWithBareAt);
FRIEND_TEST_ALL_PREFIXES(AutocompleteProviderTest,
RedundantKeywordsIgnoredInResult);
- FRIEND_TEST_ALL_PREFIXES(AutocompleteProviderTest, UpdateAssistedQueryStats);
+ FRIEND_TEST_ALL_PREFIXES(AutocompleteProviderTest, UpdateSearchboxStats);
FRIEND_TEST_ALL_PREFIXES(AutocompleteProviderPrefetchTest,
SupportedProvider_NonPrefetch);
FRIEND_TEST_ALL_PREFIXES(AutocompleteProviderPrefetchTest,
@@ -350,9 +350,9 @@
// Pack matches show their URLs as descriptions instead of the provider name.
void UpdateKeywordDescriptions(AutocompleteResult* result);
- // For each AutocompleteMatch in `result`, updates the assisted query stats
- // iff the provider's TemplateURL supports it.
- void UpdateAssistedQueryStats(AutocompleteResult* result);
+ // For each AutocompleteMatch in `result`, updates the searchbox stats iff the
+ // provider's TemplateURL supports it.
+ void UpdateSearchboxStats(AutocompleteResult* result);
// Update the tail suggestions' `tail_suggest_common_prefix`.
void UpdateTailSuggestPrefix(AutocompleteResult* result);
diff --git a/components/omnibox/browser/autocomplete_match.h b/components/omnibox/browser/autocomplete_match.h
index 7af4d29c..f2de7b3 100644
--- a/components/omnibox/browser/autocomplete_match.h
+++ b/components/omnibox/browser/autocomplete_match.h
@@ -847,8 +847,8 @@
bool from_previous = false;
// Optional search terms args. If present,
- // AutocompleteController::UpdateAssistedQueryStats() will incorporate this
- // data with additional data it calculates and pass the completed struct to
+ // AutocompleteController::UpdateSearchboxStats() will incorporate this data
+ // with additional data it calculates and pass the completed struct to
// TemplateURLRef::ReplaceSearchTerms() to reset the match's |destination_url|
// after the complete set of matches in the AutocompleteResult has been chosen
// and sorted. Most providers will leave this as NULL, which will cause the
diff --git a/components/omnibox/browser/autocomplete_provider_unittest.cc b/components/omnibox/browser/autocomplete_provider_unittest.cc
index c91fffd..ee7f1890 100644
--- a/components/omnibox/browser/autocomplete_provider_unittest.cc
+++ b/components/omnibox/browser/autocomplete_provider_unittest.cc
@@ -348,10 +348,9 @@
std::vector<absl::optional<omnibox::GroupId>> suggestion_group_ids;
};
- struct AssistedQueryStatsTestData {
+ struct SearchboxStatsTestData {
const AutocompleteMatch::Type match_type;
absl::optional<omnibox::GroupId> group_id;
- const std::string expected_aqs;
const omnibox::metrics::ChromeSearchboxStats expected_searchbox_stats;
omnibox::SuggestType type;
base::flat_set<omnibox::SuggestSubtype> subtypes;
@@ -384,9 +383,8 @@
void UpdateResultsWithSuggestionGroupsTestData(
const SuggestionGroupsTestData& test_data);
- void RunAssistedQueryStatsTest(
- const AssistedQueryStatsTestData* aqs_test_data,
- size_t size);
+ void RunSearchboxStatsTest(const SearchboxStatsTestData* sbs_test_data,
+ size_t size);
void RunQuery(const std::string& query, bool allow_exact_keyword_match);
@@ -484,7 +482,7 @@
// don't rely on kResultsPerProvided and default relevance ordering
// (B > A).
RegisterTemplateURL(kTestTemplateURLKeyword,
- "http://aqs/{searchTerms}/{google:assistedQueryStats}");
+ "http://foo/{searchTerms}/{google:assistedQueryStats}");
AutocompleteController::Providers providers;
@@ -638,36 +636,33 @@
result_.GroupAndDemoteMatchesInGroups();
}
-void AutocompleteProviderTest::RunAssistedQueryStatsTest(
- const AssistedQueryStatsTestData* aqs_test_data,
+void AutocompleteProviderTest::RunSearchboxStatsTest(
+ const SearchboxStatsTestData* sbs_test_data,
size_t size) {
// Prepare input.
const size_t kMaxRelevance = 1000;
ACMatches matches;
for (size_t i = 0; i < size; ++i) {
AutocompleteMatch match(nullptr, kMaxRelevance - i, false,
- aqs_test_data[i].match_type);
- match.suggestion_group_id = aqs_test_data[i].group_id;
+ sbs_test_data[i].match_type);
+ match.suggestion_group_id = sbs_test_data[i].group_id;
match.allowed_to_be_default_match = true;
match.keyword = kTestTemplateURLKeyword;
match.search_terms_args =
std::make_unique<TemplateURLRef::SearchTermsArgs>(std::u16string());
- match.suggest_type = aqs_test_data[i].type;
- match.subtypes = aqs_test_data[i].subtypes;
+ match.suggest_type = sbs_test_data[i].type;
+ match.subtypes = sbs_test_data[i].subtypes;
matches.push_back(match);
}
result_.Reset();
result_.AppendMatches(matches);
result_.MergeSuggestionGroupsMap(omnibox::BuildDefaultGroups());
- // Update AQS.
- controller_->UpdateAssistedQueryStats(&result_);
+ // Update Searchbox stats.
+ controller_->UpdateSearchboxStats(&result_);
// Verify data.
for (size_t i = 0; i < size; ++i) {
- EXPECT_EQ(aqs_test_data[i].expected_aqs,
- result_.match_at(i)->search_terms_args->assisted_query_stats);
-
std::string serialized_searchbox_stats;
result_.match_at(i)->search_terms_args->searchbox_stats.SerializeToString(
&serialized_searchbox_stats);
@@ -676,7 +671,7 @@
base::Base64UrlEncodePolicy::OMIT_PADDING,
&encoded_searchbox_stats);
std::string expected_serialized_searchbox_stats;
- aqs_test_data[i].expected_searchbox_stats.SerializeToString(
+ sbs_test_data[i].expected_searchbox_stats.SerializeToString(
&expected_serialized_searchbox_stats);
std::string expected_encoded_searchbox_stats;
base::Base64UrlEncode(expected_serialized_searchbox_stats,
@@ -733,7 +728,7 @@
GURL AutocompleteProviderTest::GetDestinationURL(
AutocompleteMatch& match,
base::TimeDelta query_formulation_time) const {
- controller_->UpdateMatchDestinationURLWithAdditionalAssistedQueryStats(
+ controller_->UpdateMatchDestinationURLWithAdditionalSearchboxStats(
query_formulation_time, &match);
return match.destination_url;
}
@@ -754,8 +749,8 @@
EXPECT_EQ(provider2, result_.default_match()->provider);
}
-// Tests assisted query stats.
-TEST_F(AutocompleteProviderTest, AssistedQueryStats) {
+// Tests searchbox stats.
+TEST_F(AutocompleteProviderTest, SearchboxStats) {
ResetControllerWithTestProviders(false, nullptr, nullptr);
RunTest();
@@ -764,15 +759,18 @@
result_.size());
// Now, check the results from the second provider, as they should not have
- // assisted query stats set.
+ // searchbox stats set.
for (size_t i = 0; i < kResultsPerProvider; ++i) {
- EXPECT_TRUE(
- result_.match_at(i)->search_terms_args->assisted_query_stats.empty());
+ EXPECT_EQ(
+ 0u,
+ result_.match_at(i)->search_terms_args->searchbox_stats.ByteSizeLong());
}
- // The first provider has a test keyword, so AQS should be non-empty.
+ // The first provider has a test keyword, so the searchbox stats should be
+ // non-empty.
for (size_t i = kResultsPerProvider; i < result_.size(); ++i) {
- EXPECT_FALSE(
- result_.match_at(i)->search_terms_args->assisted_query_stats.empty());
+ EXPECT_NE(
+ 0u,
+ result_.match_at(i)->search_terms_args->searchbox_stats.ByteSizeLong());
}
}
@@ -1015,7 +1013,7 @@
}
}
-TEST_F(AutocompleteProviderTest, UpdateAssistedQueryStats) {
+TEST_F(AutocompleteProviderTest, UpdateSearchboxStats) {
ResetControllerWithTestProviders(false, nullptr, nullptr);
base::test::ScopedFeatureList feature_list;
@@ -1023,16 +1021,15 @@
{
omnibox::metrics::ChromeSearchboxStats searchbox_stats;
- AssistedQueryStatsTestData test_data[] = {
+ SearchboxStatsTestData test_data[] = {
// MSVC doesn't support zero-length arrays, so supply some dummy data.
{AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED,
{/* GroupID */},
- "",
searchbox_stats,
omnibox::TYPE_NATIVE_CHROME}};
SCOPED_TRACE("No matches");
// Note: We pass 0 here to ignore the dummy data above.
- RunAssistedQueryStatsTest(test_data, 0);
+ RunSearchboxStatsTest(test_data, 0);
}
// Note: See suggest.proto for the types and subtypes referenced below.
@@ -1047,14 +1044,13 @@
available_suggestion->set_type(omnibox::TYPE_NATIVE_CHROME);
available_suggestion->add_subtypes(omnibox::SUBTYPE_OMNIBOX_ECHO_SEARCH);
- AssistedQueryStatsTestData test_data[] = {
+ SearchboxStatsTestData test_data[] = {
{AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED,
{/* GroupID */},
- "chrome..69i57",
searchbox_stats,
omnibox::TYPE_NATIVE_CHROME}};
SCOPED_TRACE("One match");
- RunAssistedQueryStatsTest(test_data, std::size(test_data));
+ RunSearchboxStatsTest(test_data, std::size(test_data));
}
{
@@ -1069,15 +1065,14 @@
auto* assisted_query_info = searchbox_stats.mutable_assisted_query_info();
assisted_query_info->MergeFrom(searchbox_stats.available_suggestions(0));
- AssistedQueryStatsTestData test_data[] = {
+ SearchboxStatsTestData test_data[] = {
{AutocompleteMatchType::SEARCH_SUGGEST_ENTITY,
{/* GroupID */},
- "chrome.0.46i39",
searchbox_stats,
omnibox::TYPE_ENTITY,
{omnibox::SUBTYPE_PERSONAL}}};
SCOPED_TRACE("One match with provider populated subtypes");
- RunAssistedQueryStatsTest(test_data, std::size(test_data));
+ RunSearchboxStatsTest(test_data, std::size(test_data));
}
{
@@ -1098,28 +1093,25 @@
auto* assisted_query_info = searchbox_stats.mutable_assisted_query_info();
assisted_query_info->MergeFrom(searchbox_stats.available_suggestions(0));
- AssistedQueryStatsTestData test_data[] = {
+ SearchboxStatsTestData test_data[] = {
{AutocompleteMatchType::SEARCH_SUGGEST,
{omnibox::GROUP_MOBILE_MOST_VISITED},
- "chrome.0.0i724",
searchbox_stats,
omnibox::TYPE_QUERY,
{omnibox::SUBTYPE_ZERO_PREFIX_LOCAL_FREQUENT_QUERIES}},
{AutocompleteMatchType::SEARCH_SUGGEST,
{omnibox::GROUP_MOBILE_MOST_VISITED},
- "chrome.0.0i724",
searchbox_stats,
omnibox::TYPE_QUERY,
{omnibox::SUBTYPE_ZERO_PREFIX_LOCAL_FREQUENT_QUERIES}},
{AutocompleteMatchType::SEARCH_SUGGEST,
{omnibox::GROUP_MOBILE_MOST_VISITED},
- "chrome.0.0i724",
searchbox_stats,
omnibox::TYPE_QUERY,
{omnibox::SUBTYPE_ZERO_PREFIX_LOCAL_FREQUENT_QUERIES}},
};
SCOPED_TRACE("Multiple matches in horizontal render group");
- RunAssistedQueryStatsTest(test_data, std::size(test_data));
+ RunSearchboxStatsTest(test_data, std::size(test_data));
}
{
@@ -1161,43 +1153,38 @@
assisted_query_info = stats_2.mutable_assisted_query_info();
assisted_query_info->MergeFrom(searchbox_stats.available_suggestions(2));
- AssistedQueryStatsTestData test_data[] = {
+ SearchboxStatsTestData test_data[] = {
// Entity Suggestion
{AutocompleteMatchType::SEARCH_SUGGEST_ENTITY,
{/* GroupID */},
- "chrome.0.46i362j0i724j46i362",
stats_0,
omnibox::TYPE_ENTITY,
{omnibox::SUBTYPE_ZERO_PREFIX}},
// Three horizontally rendered tiles
{AutocompleteMatchType::SEARCH_SUGGEST,
{omnibox::GROUP_MOBILE_MOST_VISITED},
- "chrome.1.46i362j0i724j46i362",
stats_1,
omnibox::TYPE_QUERY,
{omnibox::SUBTYPE_ZERO_PREFIX_LOCAL_FREQUENT_QUERIES}},
{AutocompleteMatchType::SEARCH_SUGGEST,
{omnibox::GROUP_MOBILE_MOST_VISITED},
- "chrome.1.46i362j0i451j46i362",
stats_1,
omnibox::TYPE_QUERY,
{omnibox::SUBTYPE_ZERO_PREFIX_LOCAL_FREQUENT_URLS}},
{AutocompleteMatchType::SEARCH_SUGGEST,
{omnibox::GROUP_MOBILE_MOST_VISITED},
- "chrome.1.46i362j0i450j46i362",
stats_1,
omnibox::TYPE_QUERY,
{omnibox::SUBTYPE_ZERO_PREFIX_LOCAL_HISTORY}},
// Entity suggestion.
{AutocompleteMatchType::SEARCH_SUGGEST_ENTITY,
{/* GroupID */},
- "chrome.2.46i362j0i450j46i362",
stats_2,
omnibox::TYPE_ENTITY,
{omnibox::SUBTYPE_ZERO_PREFIX}},
};
SCOPED_TRACE("Multiple matches with horizontal render group");
- RunAssistedQueryStatsTest(test_data, std::size(test_data));
+ RunSearchboxStatsTest(test_data, std::size(test_data));
}
{
@@ -1260,10 +1247,9 @@
// This test confirms that repetitive subtype information is being
// properly handled and reported as the same suggestion type.
- AssistedQueryStatsTestData test_data[] = {
+ SearchboxStatsTestData test_data[] = {
{AutocompleteMatchType::SEARCH_SUGGEST,
{/* GroupID */},
- "chrome.0.0i39i143i362j46i39i143j185i39i143j46i39i143i362j46i39i143",
searchbox_stats_0,
omnibox::TYPE_QUERY,
{omnibox::SUBTYPE_PERSONAL, omnibox::SUBTYPE_TRENDS,
@@ -1272,13 +1258,11 @@
// repeated subtype match.
{AutocompleteMatchType::SEARCH_SUGGEST_ENTITY,
{/* GroupID */},
- "chrome.1.0i39i143i362j46i39i143j185i39i143j46i39i143i362j46i39i143",
searchbox_stats_1,
omnibox::TYPE_ENTITY,
{omnibox::SUBTYPE_PERSONAL, omnibox::SUBTYPE_TRENDS}},
{AutocompleteMatchType::SEARCH_SUGGEST_ENTITY,
{/* GroupID */},
- "chrome.2.0i39i143i362j46i39i143j185i39i143j46i39i143i362j46i39i143",
searchbox_stats_2,
omnibox::TYPE_CATEGORICAL_QUERY,
{omnibox::SUBTYPE_PERSONAL, omnibox::SUBTYPE_TRENDS,
@@ -1287,7 +1271,6 @@
// it comes with additional subtype information (42).
{AutocompleteMatchType::SEARCH_SUGGEST_ENTITY,
{/* GroupID */},
- "chrome.3.0i39i143i362j46i39i143j185i39i143j46i39i143i362j46i39i143",
searchbox_stats_3,
omnibox::TYPE_ENTITY,
{omnibox::SUBTYPE_PERSONAL, omnibox::SUBTYPE_TRENDS,
@@ -1296,13 +1279,12 @@
// because these items are not adjacent.
{AutocompleteMatchType::SEARCH_SUGGEST_ENTITY,
{/* GroupID */},
- "chrome.4.0i39i143i362j46i39i143j185i39i143j46i39i143i362j46i39i143",
searchbox_stats_4,
omnibox::TYPE_ENTITY,
{omnibox::SUBTYPE_PERSONAL, omnibox::SUBTYPE_TRENDS}},
};
SCOPED_TRACE("Complex set of matches with repetitive subtypes");
- RunAssistedQueryStatsTest(test_data, std::size(test_data));
+ RunSearchboxStatsTest(test_data, std::size(test_data));
}
// This test confirms that selection of trivial suggestions does not get
@@ -1386,150 +1368,56 @@
assisted_query_info = searchbox_stats_7.mutable_assisted_query_info();
assisted_query_info->MergeFrom(searchbox_stats.available_suggestions(7));
- AssistedQueryStatsTestData test_data[] = {
+ SearchboxStatsTestData test_data[] = {
{AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED,
{/* GroupID */},
- "chrome..69i57j69i58j5i64l2j0i362j0i362i450j0i362i451j69i59",
searchbox_stats_0,
omnibox::TYPE_NATIVE_CHROME},
{AutocompleteMatchType::URL_WHAT_YOU_TYPED,
{/* GroupID */},
- "chrome..69i57j69i58j5i64l2j0i362j0i362i450j0i362i451j69i59",
searchbox_stats_1,
omnibox::TYPE_NATIVE_CHROME},
{AutocompleteMatchType::NAVSUGGEST,
{/* GroupID */},
- "chrome.2.69i57j69i58j5i64l2j0i362j0i362i450j0i362i451j69i59",
searchbox_stats_2,
omnibox::TYPE_NAVIGATION},
{AutocompleteMatchType::NAVSUGGEST,
{/* GroupID */},
- "chrome.3.69i57j69i58j5i64l2j0i362j0i362i450j0i362i451j69i59",
searchbox_stats_3,
omnibox::TYPE_NAVIGATION},
{AutocompleteMatchType::SEARCH_SUGGEST,
{/* GroupID */},
- "chrome.4.69i57j69i58j5i64l2j0i362j0i362i450j0i362i451j69i59",
searchbox_stats_4,
omnibox::TYPE_QUERY,
{omnibox::SUBTYPE_ZERO_PREFIX}},
{AutocompleteMatchType::SEARCH_SUGGEST,
{/* GroupID */},
- "chrome.5.69i57j69i58j5i64l2j0i362j0i362i450j0i362i451j69i59",
searchbox_stats_5,
omnibox::TYPE_QUERY,
{omnibox::SUBTYPE_ZERO_PREFIX,
omnibox::SUBTYPE_ZERO_PREFIX_LOCAL_HISTORY}},
{AutocompleteMatchType::SEARCH_SUGGEST,
{/* GroupID */},
- "chrome.6.69i57j69i58j5i64l2j0i362j0i362i450j0i362i451j69i59",
searchbox_stats_6,
omnibox::TYPE_QUERY,
{omnibox::SUBTYPE_ZERO_PREFIX,
omnibox::SUBTYPE_ZERO_PREFIX_LOCAL_FREQUENT_URLS}},
{AutocompleteMatchType::SEARCH_HISTORY,
{/* GroupID */},
- "chrome.7.69i57j69i58j5i64l2j0i362j0i362i450j0i362i451j69i59",
searchbox_stats_7,
omnibox::TYPE_NATIVE_CHROME},
};
SCOPED_TRACE("Trivial and zero-prefix matches");
- RunAssistedQueryStatsTest(test_data, std::size(test_data));
+ RunSearchboxStatsTest(test_data, std::size(test_data));
}
}
-TEST_F(AutocompleteProviderTest, GetDestinationURL_AssistedQueryStatsOnly) {
+TEST_F(AutocompleteProviderTest, GetDestinationURL) {
ResetControllerWithKeywordAndSearchProviders();
- base::test::ScopedFeatureList feature_list;
- feature_list.InitWithFeatures({omnibox::kReportAssistedQueryStats},
- {omnibox::kReportSearchboxStats});
-
- // For the destination URL to have aqs parameters for query formulation time
- // and the field trial triggered bit, many conditions need to be satisfied.
- AutocompleteMatch match(nullptr, 1100, false,
- AutocompleteMatchType::SEARCH_SUGGEST);
- GURL url(GetDestinationURL(match, base::Milliseconds(2456)));
- EXPECT_TRUE(url.path().empty());
-
- // The protocol needs to be https.
- RegisterTemplateURL(kTestTemplateURLKeyword,
- "https://aqs/{searchTerms}/{google:assistedQueryStats}");
- url = GetDestinationURL(match, base::Milliseconds(2456));
- EXPECT_TRUE(url.path().empty());
-
- // There needs to be a keyword provider.
- match.keyword = kTestTemplateURLKeyword;
- url = GetDestinationURL(match, base::Milliseconds(2456));
- EXPECT_TRUE(url.path().empty());
-
- // search_terms_args needs to be set.
- match.search_terms_args =
- std::make_unique<TemplateURLRef::SearchTermsArgs>(std::u16string());
- url = GetDestinationURL(match, base::Milliseconds(2456));
- EXPECT_TRUE(url.path().empty());
-
- // Both assisted_query_stats and searchbox_stats need to have been set.
- match.search_terms_args->assisted_query_stats =
- "chrome.0.69i57j69i58j5l2j0l3j69i59";
- match.search_terms_args->searchbox_stats.set_client_name("chrome");
- url = GetDestinationURL(match, base::Milliseconds(2456));
- EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j0j0&", url.path());
-
- // Test field trial triggered bit set.
- match.search_terms_args->assisted_query_stats =
- "chrome.0.69i57j69i58j5l2j0l3j69i59";
- set_remote_search_feature_triggered_in_session(true);
- url = GetDestinationURL(match, base::Milliseconds(2456));
- EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j1j0&", url.path());
-
- // Test page classification set.
- match.search_terms_args->assisted_query_stats =
- "chrome.0.69i57j69i58j5l2j0l3j69i59";
- set_current_page_classification(metrics::OmniboxEventProto::OTHER);
- set_remote_search_feature_triggered_in_session(false);
- url = GetDestinationURL(match, base::Milliseconds(2456));
- EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j0j4&", url.path());
-
- // Test page classification and field trial triggered set.
- match.search_terms_args->assisted_query_stats =
- "chrome.0.69i57j69i58j5l2j0l3j69i59";
- set_remote_search_feature_triggered_in_session(true);
- url = GetDestinationURL(match, base::Milliseconds(2456));
- EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j1j4&", url.path());
-
- // Test experiment stats set.
- match.search_terms_args->assisted_query_stats =
- "chrome.0.69i57j69i58j5l2j0l3j69i59";
- omnibox::metrics::ChromeSearchboxStats::ExperimentStatsV2 experiment_stats_v2;
- experiment_stats_v2.set_type_int(10001);
- experiment_stats_v2.set_string_value("0:67");
- add_zero_suggest_provider_experiment_stats_v2(experiment_stats_v2);
- url = GetDestinationURL(match, base::Milliseconds(2456));
- EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j1j4.10001i0,67&",
- url.path());
-
- match.search_terms_args->assisted_query_stats =
- "chrome.0.69i57j69i58j5l2j0l3j69i59";
- experiment_stats_v2.set_type_int(10001);
- experiment_stats_v2.set_string_value("54:67");
- add_zero_suggest_provider_experiment_stats_v2(experiment_stats_v2);
- url = GetDestinationURL(match, base::Milliseconds(2456));
- EXPECT_EQ(
- "//"
- "aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j1j4.10001i0,67j10001i54,67&",
- url.path());
-}
-
-TEST_F(AutocompleteProviderTest, GetDestinationURL_SearchboxStatsOnly) {
- ResetControllerWithKeywordAndSearchProviders();
-
- base::test::ScopedFeatureList feature_list;
- feature_list.InitWithFeatures({omnibox::kReportSearchboxStats},
- {omnibox::kReportAssistedQueryStats});
-
- // For the destination URL to have aqs parameters for query formulation time
- // and the field trial triggered bit, many conditions need to be satisfied.
+ // For the destination URL to have searchbox stats parameters for query
+ // formulation time and the field trial triggered bit, many conditions need
+ // to be satisfied.
AutocompleteMatch match(nullptr, 1100, false,
AutocompleteMatchType::SEARCH_SUGGEST);
GURL url(GetDestinationURL(match, base::Milliseconds(2456)));
@@ -1552,9 +1440,7 @@
url = GetDestinationURL(match, base::Milliseconds(2456));
EXPECT_TRUE(url.path().empty());
- // Both assisted_query_stats and searchbox_stats need to have been set.
- match.search_terms_args->assisted_query_stats =
- "chrome.0.69i57j69i58j5l2j0l3j69i59";
+ // searchbox_stats need to have been set.
match.search_terms_args->searchbox_stats.set_client_name("chrome");
url = GetDestinationURL(match, base::Milliseconds(2456));
EXPECT_EQ("//gs_lcrp=EgZjaHJvbWXSAQgyNDU2ajBqMA&", url.path());
@@ -1677,54 +1563,6 @@
}
}
-TEST_F(AutocompleteProviderTest,
- GetDestinationURL_AssistedQueryStatsAndSearchboxStats) {
- ResetControllerWithKeywordAndSearchProviders();
-
- base::test::ScopedFeatureList feature_list;
- feature_list.InitWithFeatures(
- {omnibox::kReportSearchboxStats, omnibox::kReportAssistedQueryStats}, {});
-
- // For the destination URL to have aqs parameters for query formulation time
- // and the field trial triggered bit, many conditions need to be satisfied.
- AutocompleteMatch match(nullptr, 1100, false,
- AutocompleteMatchType::SEARCH_SUGGEST);
- GURL url(GetDestinationURL(match, base::Milliseconds(2456)));
- EXPECT_TRUE(url.path().empty());
-
- // The protocol needs to be https.
- RegisterTemplateURL(kTestTemplateURLKeyword,
- "https://foo/{searchTerms}/{google:assistedQueryStats}");
- url = GetDestinationURL(match, base::Milliseconds(2456));
- EXPECT_TRUE(url.path().empty());
-
- // There needs to be a keyword provider.
- match.keyword = kTestTemplateURLKeyword;
- url = GetDestinationURL(match, base::Milliseconds(2456));
- EXPECT_TRUE(url.path().empty());
-
- // search_terms_args needs to be set.
- match.search_terms_args =
- std::make_unique<TemplateURLRef::SearchTermsArgs>(std::u16string());
- url = GetDestinationURL(match, base::Milliseconds(2456));
- EXPECT_TRUE(url.path().empty());
-
- // If assisted_query_stats is not set, searchbox_stats is not reported either.
- match.search_terms_args->searchbox_stats.set_client_name("chrome");
- url = GetDestinationURL(match, base::Milliseconds(2456));
- EXPECT_TRUE(url.path().empty());
-
- // Both assisted_query_stats and searchbox_stats need to have been set.
- match.search_terms_args->assisted_query_stats =
- "chrome.0.69i57j69i58j5l2j0l3j69i59";
- url = GetDestinationURL(match, base::Milliseconds(2456));
- EXPECT_EQ(
- "//"
- "gs_lcrp=EgZjaHJvbWXSAQgyNDU2ajBqMA&aqs=chrome.0."
- "69i57j69i58j5l2j0l3j69i59.2456j0j0&",
- url.path());
-}
-
TEST_F(AutocompleteProviderTest, ClassifyAllMatchesInString) {
ResetControllerWithKeywordAndSearchProviders();
@@ -1964,7 +1802,7 @@
public:
AutocompleteProviderPrefetchTest() {
RegisterTemplateURL(kTestTemplateURLKeyword,
- "http://aqs/{searchTerms}/{google:assistedQueryStats}");
+ "http://foo/{searchTerms}/{google:assistedQueryStats}");
// Create an empty controller.
ResetControllerWithType(0);
provider_listener_ =
diff --git a/components/omnibox/browser/omnibox_edit_model.cc b/components/omnibox/browser/omnibox_edit_model.cc
index 13c750d..95744c5 100644
--- a/components/omnibox/browser/omnibox_edit_model.cc
+++ b/components/omnibox/browser/omnibox_edit_model.cc
@@ -2324,7 +2324,7 @@
base::TimeDelta elapsed_time_since_user_first_modified_omnibox(
now - time_user_first_modified_omnibox_);
controller_->autocomplete_controller()
- ->UpdateMatchDestinationURLWithAdditionalAssistedQueryStats(
+ ->UpdateMatchDestinationURLWithAdditionalSearchboxStats(
elapsed_time_since_user_first_modified_omnibox, &match);
GURL destination_url = action ? action->getUrl() : match.destination_url;
diff --git a/components/omnibox/common/omnibox_features.cc b/components/omnibox/common/omnibox_features.cc
index d8faf4e..9698aba 100644
--- a/components/omnibox/common/omnibox_features.cc
+++ b/components/omnibox/common/omnibox_features.cc
@@ -462,18 +462,6 @@
// - 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,
diff --git a/components/omnibox/common/omnibox_features.h b/components/omnibox/common/omnibox_features.h
index b7aac550e7..f92fc0b2 100644
--- a/components/omnibox/common/omnibox_features.h
+++ b/components/omnibox/common/omnibox_features.h
@@ -130,10 +130,6 @@
BASE_DECLARE_FEATURE(kDefaultTypedNavigationsToHttps);
extern const char kDefaultTypedNavigationsToHttpsTimeoutParam[];
-// Omnibox Logging.
-BASE_DECLARE_FEATURE(kReportAssistedQueryStats);
-BASE_DECLARE_FEATURE(kReportSearchboxStats);
-
// Omnibox ML scoring.
BASE_DECLARE_FEATURE(kLogUrlScoringSignals);
BASE_DECLARE_FEATURE(kMlUrlScoring);
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc
index a186173..9ced20b1 100644
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -230,7 +230,6 @@
res += base::trace_event::EstimateMemoryUsage(search_terms);
res += base::trace_event::EstimateMemoryUsage(original_query);
- res += base::trace_event::EstimateMemoryUsage(assisted_query_stats);
res += base::trace_event::EstimateMemoryUsage(current_page_url);
res += base::trace_event::EstimateMemoryUsage(session_token);
res += base::trace_event::EstimateMemoryUsage(prefetch_query);
@@ -1090,48 +1089,17 @@
DCHECK(!replacement.is_post_param);
const size_t searchbox_stats_size =
search_terms_args.searchbox_stats.ByteSizeLong();
- if (!search_terms_args.assisted_query_stats.empty()) {
- DCHECK(searchbox_stats_size > 0)
- << "searchbox_stats must be set when assisted_query_stats is.";
- // Get the base URL without substituting AQS and gs_lcrp to avoid
- // infinite recursion and unwanted replacement respectively. We need
- // the URL to find out if it meets all AQS requirements (e.g. HTTPS
- // protocol check). See TemplateURLRef::SearchTermsArgs for more
- // details.
- SearchTermsArgs sanitized_search_terms_args(search_terms_args);
- sanitized_search_terms_args.assisted_query_stats.clear();
- // Clear the proto. Its empty state has a serialized size of zero.
- sanitized_search_terms_args.searchbox_stats.Clear();
- GURL base_url(ReplaceSearchTerms(sanitized_search_terms_args,
- search_terms_data, nullptr));
- if (base_url.SchemeIsCryptographic() &&
- base::FeatureList::IsEnabled(
- omnibox::kReportAssistedQueryStats)) {
- HandleReplacement("aqs", search_terms_args.assisted_query_stats,
- replacement, &url);
- base::UmaHistogramCounts1000(
- "Omnibox.AssistedQueryStats.Length",
- static_cast<int>(
- search_terms_args.assisted_query_stats.length()));
- }
- }
-
if (searchbox_stats_size > 0) {
- DCHECK(!search_terms_args.assisted_query_stats.empty())
- << "assisted_query_stats must be set when searchbox_stats is.";
- // Get the base URL without substituting gs_lcrp and AQS to avoid
- // infinite recursion and unwanted replacement respectively. We need
- // the URL to find out if it meets all gs_lcrp requirements (e.g.
- // HTTPS protocol check). See TemplateURLRef::SearchTermsArgs for more
- // details.
+ // Get the base URL without substituting gs_lcrp to avoid infinite
+ // recursion and unwanted replacement respectively. We need the URL to
+ // find out if it meets all gs_lcrp requirements (e.g. HTTPS protocol
+ // check). See TemplateURLRef::SearchTermsArgs for more details.
SearchTermsArgs sanitized_search_terms_args(search_terms_args);
- sanitized_search_terms_args.assisted_query_stats.clear();
// Clear the proto. Its empty state has a serialized size of zero.
sanitized_search_terms_args.searchbox_stats.Clear();
GURL base_url(ReplaceSearchTerms(sanitized_search_terms_args,
search_terms_data, nullptr));
- if (base_url.SchemeIsCryptographic() &&
- base::FeatureList::IsEnabled(omnibox::kReportSearchboxStats)) {
+ if (base_url.SchemeIsCryptographic()) {
TRACE_EVENT0(
"omnibox",
"TemplateURLRef::HandleReplacement:serialize_searchbox_stats");
@@ -1213,7 +1181,7 @@
case GOOGLE_ORIGINAL_QUERY_FOR_SUGGESTION:
DCHECK(!replacement.is_post_param);
if (search_terms_args.accepted_suggestion >= 0 ||
- !search_terms_args.assisted_query_stats.empty()) {
+ search_terms_args.searchbox_stats.ByteSizeLong() > 0) {
HandleReplacement("oq", base::UTF16ToUTF8(encoded_original_query),
replacement, &url);
}
diff --git a/components/search_engines/template_url.h b/components/search_engines/template_url.h
index 0a0b727..4229af47 100644
--- a/components/search_engines/template_url.h
+++ b/components/search_engines/template_url.h
@@ -199,14 +199,6 @@
metrics::OmniboxFocusType focus_type =
metrics::OmniboxFocusType::INTERACTION_DEFAULT;
- // The optional assisted query stats, aka AQS, used for logging purposes.
- // This string contains impressions of all autocomplete matches shown
- // at the query submission time. For privacy reasons, we require the
- // search provider to support HTTPS protocol in order to receive the AQS
- // param.
- // For more details, see go/chrome-suggest-logging.
- std::string assisted_query_stats;
-
// The optional searchbox stats, reported as gs_lcrp for logging purposes.
// This proto message contains information such as impressions of all
// autocomplete matches shown at the query submission time.
diff --git a/components/search_engines/template_url_unittest.cc b/components/search_engines/template_url_unittest.cc
index d3d5f378..f84f478 100644
--- a/components/search_engines/template_url_unittest.cc
+++ b/components/search_engines/template_url_unittest.cc
@@ -658,71 +658,9 @@
}
}
-// Tests replacing assisted query stats (AQS) in various scenarios.
-TEST_F(TemplateURLTest, ReplaceAssistedQueryStats) {
- base::HistogramTester histogram_tester;
- base::test::ScopedFeatureList feature_list;
- feature_list.InitWithFeatures({omnibox::kReportAssistedQueryStats},
- {omnibox::kReportSearchboxStats});
-
- omnibox::metrics::ChromeSearchboxStats searchbox_stats;
- searchbox_stats.set_client_name("chrome");
- searchbox_stats.set_zero_prefix_enabled(true);
-
- struct TestData {
- const std::u16string search_term;
- const std::string aqs;
- const omnibox::metrics::ChromeSearchboxStats searchbox_stats;
- const std::string base_url;
- const std::string url;
- const std::string expected_result;
- } test_data[] = {
- // HTTPS and non-empty gs_lcrp and non-empty AQS: Success.
- {u"foo", "chrome.0.0l6", searchbox_stats, "https://foo/",
- "{google:baseURL}?q={searchTerms}&{google:assistedQueryStats}",
- "https://foo/?q=foo&aqs=chrome.0.0l6&"},
- // Non-Google HTTPS and non-empty gs_lcrp and non-empty AQS: Success.
- {u"foo", "chrome.0.0l6", searchbox_stats, "https://bar/",
- "https://foo/?q={searchTerms}&{google:assistedQueryStats}",
- "https://foo/?q=foo&aqs=chrome.0.0l6&"},
- // No HTTPS: Failure.
- {u"foo", "chrome.0.0l6", searchbox_stats, "http://foo/",
- "{google:baseURL}?q={searchTerms}&{google:assistedQueryStats}",
- "http://foo/?q=foo&"},
- // No {google:assistedQueryStats}: Failure.
- {u"foo", "chrome.0.0l6", searchbox_stats, "https://foo/",
- "{google:baseURL}?q={searchTerms}", "https://foo/?q=foo"},
- };
- TemplateURLData data;
- data.input_encodings.push_back("UTF-8");
- for (const auto& entry : test_data) {
- data.SetURL(entry.url);
- TemplateURL url(data);
- EXPECT_TRUE(url.url_ref().IsValid(search_terms_data_));
- ASSERT_TRUE(url.url_ref().SupportsReplacement(search_terms_data_));
- TemplateURLRef::SearchTermsArgs search_terms_args(entry.search_term);
- search_terms_args.assisted_query_stats = entry.aqs;
- search_terms_args.searchbox_stats.MergeFrom(entry.searchbox_stats);
- search_terms_data_.set_google_base_url(entry.base_url);
- GURL result(url.url_ref().ReplaceSearchTerms(search_terms_args,
- search_terms_data_));
- ASSERT_TRUE(result.is_valid());
- EXPECT_EQ(entry.expected_result, result.spec());
- }
- // Expect correct histograms to have been logged.
- histogram_tester.ExpectTotalCount("Omnibox.AssistedQueryStats.Length", 2);
- histogram_tester.ExpectBucketCount("Omnibox.AssistedQueryStats.Length", 12,
- 2);
-
- histogram_tester.ExpectTotalCount("Omnibox.SearchboxStats.Length", 0);
-}
-
// Tests replacing searchbox stats (gs_lcrp) in various scenarios.
TEST_F(TemplateURLTest, ReplaceSearchboxStats) {
base::HistogramTester histogram_tester;
- base::test::ScopedFeatureList feature_list;
- feature_list.InitWithFeatures({omnibox::kReportSearchboxStats},
- {omnibox::kReportAssistedQueryStats});
omnibox::metrics::ChromeSearchboxStats searchbox_stats;
searchbox_stats.set_client_name("chrome");
@@ -730,26 +668,25 @@
struct TestData {
const std::u16string search_term;
- const std::string aqs;
const omnibox::metrics::ChromeSearchboxStats searchbox_stats;
const std::string base_url;
const std::string url;
const std::string expected_result;
} test_data[] = {
- // HTTPS and non-empty gs_lcrp and non-empty AQS: Success.
- {u"foo", "chrome.0.0l6", searchbox_stats, "https://foo/",
+ // HTTPS and non-empty gs_lcrp: Success.
+ {u"foo", searchbox_stats, "https://foo/",
"{google:baseURL}?q={searchTerms}&{google:assistedQueryStats}",
"https://foo/?q=foo&gs_lcrp=EgZjaHJvbWWwAgE&"},
- // Non-Google HTTPS and non-empty gs_lcrp and non-empty AQS: Success.
- {u"foo", "chrome.0.0l6", searchbox_stats, "https://bar/",
+ // Non-Google HTTPS and non-empty gs_lcrp: Success.
+ {u"foo", searchbox_stats, "https://bar/",
"https://foo/?q={searchTerms}&{google:assistedQueryStats}",
"https://foo/?q=foo&gs_lcrp=EgZjaHJvbWWwAgE&"},
// No HTTPS: Failure.
- {u"foo", "chrome.0.0l6", searchbox_stats, "http://foo/",
+ {u"foo", searchbox_stats, "http://foo/",
"{google:baseURL}?q={searchTerms}&{google:assistedQueryStats}",
"http://foo/?q=foo&"},
// No {google:assistedQueryStats}: Failure.
- {u"foo", "chrome.0.0l6", searchbox_stats, "https://foo/",
+ {u"foo", searchbox_stats, "https://foo/",
"{google:baseURL}?q={searchTerms}", "https://foo/?q=foo"},
};
TemplateURLData data;
@@ -760,7 +697,6 @@
EXPECT_TRUE(url.url_ref().IsValid(search_terms_data_));
ASSERT_TRUE(url.url_ref().SupportsReplacement(search_terms_data_));
TemplateURLRef::SearchTermsArgs search_terms_args(entry.search_term);
- search_terms_args.assisted_query_stats = entry.aqs;
search_terms_args.searchbox_stats.MergeFrom(entry.searchbox_stats);
search_terms_data_.set_google_base_url(entry.base_url);
GURL result(url.url_ref().ReplaceSearchTerms(search_terms_args,
@@ -769,68 +705,6 @@
EXPECT_EQ(entry.expected_result, result.spec());
}
// Expect correct histograms to have been logged.
- histogram_tester.ExpectTotalCount("Omnibox.AssistedQueryStats.Length", 0);
-
- histogram_tester.ExpectTotalCount("Omnibox.SearchboxStats.Length", 2);
- histogram_tester.ExpectBucketCount("Omnibox.SearchboxStats.Length", 15, 2);
-}
-
-// Tests replacing searchbox stats (gs_lcrp) and assisted query stats (AQS).
-TEST_F(TemplateURLTest, ReplaceSearchboxStatsAndAssistedQueryStats) {
- base::HistogramTester histogram_tester;
- base::test::ScopedFeatureList feature_list;
- feature_list.InitWithFeatures(
- {omnibox::kReportSearchboxStats, omnibox::kReportAssistedQueryStats}, {});
-
- omnibox::metrics::ChromeSearchboxStats searchbox_stats;
- searchbox_stats.set_client_name("chrome");
- searchbox_stats.set_zero_prefix_enabled(true);
-
- struct TestData {
- const std::u16string search_term;
- const std::string aqs;
- const omnibox::metrics::ChromeSearchboxStats searchbox_stats;
- const std::string base_url;
- const std::string url;
- const std::string expected_result;
- } test_data[] = {
- // HTTPS and non-empty gs_lcrp and non-empty AQS: Success.
- {u"foo", "chrome.0.0l6", searchbox_stats, "https://foo/",
- "{google:baseURL}?q={searchTerms}&{google:assistedQueryStats}",
- "https://foo/?q=foo&gs_lcrp=EgZjaHJvbWWwAgE&aqs=chrome.0.0l6&"},
- // Non-Google HTTPS and non-empty gs_lcrp and non-empty AQS: Success.
- {u"foo", "chrome.0.0l6", searchbox_stats, "https://bar/",
- "https://foo/?q={searchTerms}&{google:assistedQueryStats}",
- "https://foo/?q=foo&gs_lcrp=EgZjaHJvbWWwAgE&aqs=chrome.0.0l6&"},
- // No HTTPS: Failure.
- {u"foo", "chrome.0.0l6", searchbox_stats, "http://foo/",
- "{google:baseURL}?q={searchTerms}&{google:assistedQueryStats}",
- "http://foo/?q=foo&"},
- // No {google:assistedQueryStats}: Failure.
- {u"foo", "chrome.0.0l6", searchbox_stats, "https://foo/",
- "{google:baseURL}?q={searchTerms}", "https://foo/?q=foo"},
- };
- TemplateURLData data;
- data.input_encodings.push_back("UTF-8");
- for (const auto& entry : test_data) {
- data.SetURL(entry.url);
- TemplateURL url(data);
- EXPECT_TRUE(url.url_ref().IsValid(search_terms_data_));
- ASSERT_TRUE(url.url_ref().SupportsReplacement(search_terms_data_));
- TemplateURLRef::SearchTermsArgs search_terms_args(entry.search_term);
- search_terms_args.assisted_query_stats = entry.aqs;
- search_terms_args.searchbox_stats.MergeFrom(entry.searchbox_stats);
- search_terms_data_.set_google_base_url(entry.base_url);
- GURL result(url.url_ref().ReplaceSearchTerms(search_terms_args,
- search_terms_data_));
- ASSERT_TRUE(result.is_valid());
- EXPECT_EQ(entry.expected_result, result.spec());
- }
- // Expect correct histograms to have been logged.
- histogram_tester.ExpectTotalCount("Omnibox.AssistedQueryStats.Length", 2);
- histogram_tester.ExpectBucketCount("Omnibox.AssistedQueryStats.Length", 12,
- 2);
-
histogram_tester.ExpectTotalCount("Omnibox.SearchboxStats.Length", 2);
histogram_tester.ExpectBucketCount("Omnibox.SearchboxStats.Length", 15, 2);
}
diff --git a/ios/chrome/browser/flags/about_flags.mm b/ios/chrome/browser/flags/about_flags.mm
index e7b8b36..aa55be71 100644
--- a/ios/chrome/browser/flags/about_flags.mm
+++ b/ios/chrome/browser/flags/about_flags.mm
@@ -908,14 +908,6 @@
flag_descriptions::kOmniboxNewImplementationName,
flag_descriptions::kOmniboxNewImplementationDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kIOSNewOmniboxImplementation)},
- {"omnibox-report-assisted-query-stats",
- flag_descriptions::kOmniboxReportAssistedQueryStatsName,
- flag_descriptions::kOmniboxReportAssistedQueryStatsDescription,
- flags_ui::kOsIos, FEATURE_VALUE_TYPE(omnibox::kReportAssistedQueryStats)},
- {"omnibox-report-searchbox-stats",
- flag_descriptions::kOmniboxReportSearchboxStatsName,
- flag_descriptions::kOmniboxReportSearchboxStatsDescription,
- flags_ui::kOsIos, FEATURE_VALUE_TYPE(omnibox::kReportSearchboxStats)},
{"start-surface", flag_descriptions::kStartSurfaceName,
flag_descriptions::kStartSurfaceDescription, flags_ui::kOsIos,
FEATURE_WITH_PARAMS_VALUE_TYPE(kStartSurface,
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc
index 63c2f4c7..e887733 100644
--- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc
+++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc
@@ -734,18 +734,6 @@
"Enables storing successful query/match in the omnibox shortcut database "
"to provider better suggestions ranking.";
-const char kOmniboxReportAssistedQueryStatsName[] =
- "Omnibox Assisted Query Stats param";
-const char kOmniboxReportAssistedQueryStatsDescription[] =
- "Enables reporting the Assisted Query Stats param in search destination "
- "URLs originated from the Omnibox.";
-
-const char kOmniboxReportSearchboxStatsName[] =
- "Omnibox Searchbox Stats proto param";
-const char kOmniboxReportSearchboxStatsDescription[] =
- "Enables reporting the serialized Searchbox Stats proto param in search "
- "destination URLs originated from the Omnibox.";
-
extern const char kOmniboxSuggestionsRTLImprovementsName[] =
"Omnibox Improved RTL Suggestion Layout";
extern const char kOmniboxSuggestionsRTLImprovementsDescription[] =
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h
index 8c4544e..8e0869cc 100644
--- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h
+++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h
@@ -638,14 +638,6 @@
extern const char kOmniboxPopulateShortcutsDatabaseName[];
extern const char kOmniboxPopulateShortcutsDatabaseDescription[];
-// Title and description for assisted query stats param reporting.
-extern const char kOmniboxReportAssistedQueryStatsName[];
-extern const char kOmniboxReportAssistedQueryStatsDescription[];
-
-// Title and description for searchbox stats flag.
-extern const char kOmniboxReportSearchboxStatsName[];
-extern const char kOmniboxReportSearchboxStatsDescription[];
-
// Title and description for improved RTL layout of suggestions.
extern const char kOmniboxSuggestionsRTLImprovementsName[];
extern const char kOmniboxSuggestionsRTLImprovementsDescription[];
diff --git a/tools/metrics/histograms/metadata/omnibox/histograms.xml b/tools/metrics/histograms/metadata/omnibox/histograms.xml
index c8dbb09c..6247873 100644
--- a/tools/metrics/histograms/metadata/omnibox/histograms.xml
+++ b/tools/metrics/histograms/metadata/omnibox/histograms.xml
@@ -199,19 +199,6 @@
</summary>
</histogram>
-<histogram name="Omnibox.AssistedQueryStats.Length" units="chars"
- expires_after="2024-04-28">
- <owner>mahmadi@chromium.org</owner>
- <owner>chrome-omnibox-team@google.com</owner>
- <summary>
- Records the length of the aqs= param in the Search Result Page request URLs.
- Recorded every time a Search Result Page URL is generated in the
- omnibox/realbox. This happens either when the user selects a suggestion in
- order to load Search Result Page or when a proactive request is made to
- prefetch the Search Result Page.
- </summary>
-</histogram>
-
<histogram
name="Omnibox.AsyncAutocompletionTime2.Provider.{Provider}{Completed}"
units="ms" expires_after="2024-04-28">
@@ -1541,7 +1528,7 @@
</histogram>
<histogram name="Omnibox.SearchboxStats.Length" units="chars"
- expires_after="2024-04-28">
+ expires_after="2024-12-05">
<owner>mahmadi@chromium.org</owner>
<owner>chrome-omnibox-team@google.com</owner>
<summary>