Chromium Code Reviews| Index: chrome/browser/autocomplete/search_provider.cc |
| diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc |
| index 419fdfeda902f41d12504a2e461c086ac4c5adff..2813c8447f8f8f464b44fe5fd19a0a573d8c53ed 100644 |
| --- a/chrome/browser/autocomplete/search_provider.cc |
| +++ b/chrome/browser/autocomplete/search_provider.cc |
| @@ -591,9 +591,8 @@ 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(SearchTermsArgs(text))), |
| net::URLFetcher::GET, this); |
| fetcher->SetRequestContext(profile_->GetRequestContext()); |
| fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES); |
| @@ -1059,8 +1058,13 @@ 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 SearchTermsArgs(query_string)); |
| + match.search_terms_args->original_query = input_text; |
| + match.search_terms_args->accepted_suggestion = accepted_suggestion; |
| + // This is the initial replacement, which is necessary for URL dedupping |
|
Peter Kasting
2012/06/16 03:14:17
Nit: How about:
"This is the destination URL sans
Bart N
2012/06/16 23:38:10
Done.
|
| + // by AutocompleteController. |
| + match.destination_url = GURL(search_url.ReplaceSearchTerms( |
|
Peter Kasting
2012/06/16 03:14:17
Nit: Can this be wrapped after '=' instead?
Bart N
2012/06/16 23:38:10
Done.
|
| + *match.search_terms_args.get())); |
| // Search results don't look like URLs. |
| match.transition = is_keyword ? |