Chromium Code Reviews| Index: chrome/browser/autocomplete/autocomplete_result.cc |
| diff --git a/chrome/browser/autocomplete/autocomplete_result.cc b/chrome/browser/autocomplete/autocomplete_result.cc |
| index 12256e27da5cb385f1e61510e6cd7885beece8e0..2342a806170d5b7320e0f5f8c3167760636a2852 100644 |
| --- a/chrome/browser/autocomplete/autocomplete_result.cc |
| +++ b/chrome/browser/autocomplete/autocomplete_result.cc |
| @@ -10,6 +10,7 @@ |
| #include "base/logging.h" |
| #include "chrome/browser/autocomplete/autocomplete_input.h" |
| #include "chrome/browser/autocomplete/autocomplete_match.h" |
| +#include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
|
Peter Kasting
2012/10/26 22:13:49
Nit: Not necessary?
Bart N.
2012/10/26 23:36:55
Good catch, yes.
|
| // static |
| const size_t AutocompleteResult::kMaxMatches = 6; |
| @@ -47,7 +48,8 @@ void AutocompleteResult::CopyFrom(const AutocompleteResult& rhs) { |
| } |
| void AutocompleteResult::CopyOldMatches(const AutocompleteInput& input, |
| - const AutocompleteResult& old_matches) { |
| + const AutocompleteResult& old_matches, |
| + Profile* profile) { |
| if (old_matches.empty()) |
| return; |
| @@ -82,7 +84,7 @@ void AutocompleteResult::CopyOldMatches(const AutocompleteInput& input, |
| MergeMatchesByProvider(i->second, matches_per_provider[i->first]); |
| } |
| - SortAndCull(input); |
| + SortAndCull(input, profile); |
| } |
| void AutocompleteResult::AppendMatches(const ACMatches& matches) { |
| @@ -112,9 +114,10 @@ void AutocompleteResult::AddMatch(const AutocompleteMatch& match) { |
| default_match_ = begin() + default_offset; |
| } |
| -void AutocompleteResult::SortAndCull(const AutocompleteInput& input) { |
| +void AutocompleteResult::SortAndCull(const AutocompleteInput& input, |
| + Profile* profile) { |
| for (ACMatches::iterator i(matches_.begin()); i != matches_.end(); ++i) |
| - i->ComputeStrippedDestinationURL(); |
| + i->ComputeStrippedDestinationURL(profile); |
| // Remove duplicates. |
| std::sort(matches_.begin(), matches_.end(), |