Commit ed72893b authored by Justin Donnelly's avatar Justin Donnelly Committed by Commit Bot

[omnibox] Don't include additional_query_params when deduping in AcMatch

This is basically just a revert of https://crrev.com/c/1273620 but I
wanted to keep the comment improvements I made there.

Bug: 886988
Change-Id: Ie08bb820f9e2b6eac4b1eeb672332e2f9306fe0d
Reviewed-on: https://chromium-review.googlesource.com/c/1340787Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Commit-Queue: Justin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609306}
parent b9ed3c50
......@@ -474,8 +474,7 @@ GURL AutocompleteMatch::GURLToStrippedGURL(
const GURL& url,
const AutocompleteInput& input,
const TemplateURLService* template_url_service,
const base::string16& keyword,
const std::string& additional_query_params) {
const base::string16& keyword) {
if (!url.is_valid())
return url;
......@@ -496,12 +495,10 @@ GURL AutocompleteMatch::GURLToStrippedGURL(
stripped_destination_url,
template_url_service->search_terms_data(),
&search_terms)) {
TemplateURLRef::SearchTermsArgs search_terms_args(search_terms);
if (!additional_query_params.empty())
search_terms_args.additional_query_params = additional_query_params;
stripped_destination_url =
GURL(template_url->url_ref().ReplaceSearchTerms(
search_terms_args, template_url_service->search_terms_data()));
TemplateURLRef::SearchTermsArgs(search_terms),
template_url_service->search_terms_data()));
}
}
......@@ -624,9 +621,8 @@ url_formatter::FormatUrlTypes AutocompleteMatch::GetFormatTypes(
void AutocompleteMatch::ComputeStrippedDestinationURL(
const AutocompleteInput& input,
TemplateURLService* template_url_service) {
stripped_destination_url = GURLToStrippedGURL(
destination_url, input, template_url_service, keyword,
search_terms_args ? search_terms_args->additional_query_params : "");
stripped_destination_url =
GURLToStrippedGURL(destination_url, input, template_url_service, keyword);
}
void AutocompleteMatch::GetKeywordUIState(
......
......@@ -233,16 +233,10 @@ struct AutocompleteMatch {
// - If the match's keyword is known, it can be provided in |keyword|.
// Otherwise, it can be left empty and the template URL (if any) is
// determined from the destination's hostname.
// - If |additional_query_params| is provided, these will be added to the
// resulting URL in the cases where a template URL is used. This is used to
// distinguish cases such as entity suggestions where the response contains
// additional meaningful parameters beyond the search terms themselves.
static GURL GURLToStrippedGURL(
const GURL& url,
const AutocompleteInput& input,
const TemplateURLService* template_url_service,
const base::string16& keyword,
const std::string& additional_query_params = "");
static GURL GURLToStrippedGURL(const GURL& url,
const AutocompleteInput& input,
const TemplateURLService* template_url_service,
const base::string16& keyword);
// Sets the |match_in_scheme|, |match_in_subdomain|, and |match_after_host|
// flags based on the provided |url| and list of substring |match_positions|.
......
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