Chromium Code Reviews| Index: chrome/browser/autocomplete/history_url_provider.cc |
| diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc |
| index 24aa7f0842d904faeb4a3e1cd17f8a493aca8b7b..11e39c845531d4edf4efeac55a8cd53556b8ce1b 100644 |
| --- a/chrome/browser/autocomplete/history_url_provider.cc |
| +++ b/chrome/browser/autocomplete/history_url_provider.cc |
| @@ -17,7 +17,6 @@ |
| #include "base/time/time.h" |
| #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" |
| #include "chrome/browser/autocomplete/scored_history_match.h" |
| -#include "chrome/browser/history/history_service_factory.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/search_engines/template_url_service_factory.h" |
| #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" |
| @@ -471,9 +470,11 @@ HistoryURLProviderParams::HistoryURLProviderParams( |
| HistoryURLProviderParams::~HistoryURLProviderParams() { |
| } |
| -HistoryURLProvider::HistoryURLProvider(AutocompleteProviderListener* listener, |
| +HistoryURLProvider::HistoryURLProvider(AutocompleteProviderClient* client, |
| + AutocompleteProviderListener* listener, |
| Profile* profile) |
| - : HistoryProvider(profile, AutocompleteProvider::TYPE_HISTORY_URL), |
| + : HistoryProvider(AutocompleteProvider::TYPE_HISTORY_URL, client), |
| + profile_(profile), |
| listener_(listener), |
| params_(NULL) { |
| // Initialize HUP scoring params based on the current experiment. |
| @@ -526,11 +527,9 @@ void HistoryURLProvider::Start(const AutocompleteInput& input, |
| matches_.push_back(what_you_typed_match); |
| // We'll need the history service to run both passes, so try to obtain it. |
| - if (!profile_) |
| + if (!client()) |
|
Peter Kasting
2015/06/16 00:03:42
Can this ever be null?
blundell
2015/06/16 07:21:25
No. Removed.
|
| return; |
| - history::HistoryService* const history_service = |
| - HistoryServiceFactory::GetForProfile(profile_, |
| - ServiceAccessType::EXPLICIT_ACCESS); |
| + history::HistoryService* const history_service = client()->HistoryService(); |
| if (!history_service) |
| return; |