Index: chrome/browser/autocomplete/search_provider.cc |
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc |
index 9d1281b3cc74ca5850ce6cc2c06643119c647690..69c52ed5a511f4da53b1aa15653f27a13d5762d2 100644 |
--- a/chrome/browser/autocomplete/search_provider.cc |
+++ b/chrome/browser/autocomplete/search_provider.cc |
@@ -591,9 +591,9 @@ net::URLFetcher* SearchProvider::CreateSuggestFetcher( |
const TemplateURLRef& suggestions_url, |
const string16& text) { |
DCHECK(suggestions_url.SupportsReplacement()); |
- net::URLFetcher* fetcher = content::URLFetcher::Create(id, |
- GURL(suggestions_url.ReplaceSearchTerms(text, |
- TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16())), |
+ net::URLFetcher* fetcher = content::URLFetcher::Create( |
+ id, GURL(suggestions_url.ReplaceSearchTerms( |
+ TemplateURLRef::SearchTermsArgs(text))), |
net::URLFetcher::GET, this); |
fetcher->SetRequestContext(profile_->GetRequestContext()); |
fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES); |
@@ -1078,8 +1078,15 @@ void SearchProvider::AddMatchToMap(const string16& query_string, |
const TemplateURLRef& search_url = provider_url->url_ref(); |
DCHECK(search_url.SupportsReplacement()); |
- match.destination_url = GURL(search_url.ReplaceSearchTerms(query_string, |
- accepted_suggestion, input_text)); |
+ match.search_terms_args.reset( |
+ new TemplateURLRef::SearchTermsArgs(query_string)); |
+ match.search_terms_args->original_query = input_text; |
+ match.search_terms_args->accepted_suggestion = accepted_suggestion; |
+ // This is the destination URL sans assisted query stats. This must be set |
+ // so the AutocompleteController can properly de-dupe; the controller will |
+ // eventually overwrite it before it reaches the user. |
+ match.destination_url = |
+ GURL(search_url.ReplaceSearchTerms(*match.search_terms_args.get())); |
// Search results don't look like URLs. |
match.transition = is_keyword ? |