Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3638)

Unified Diff: chrome/browser/autocomplete/history_url_provider.cc

Issue 1185723002: Prepare HistoryProvider for componentization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..c99fb0865bb6dea3fed915c1ba927182c5fb45f5 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,7 @@ 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_)
- return;
- history::HistoryService* const history_service =
- HistoryServiceFactory::GetForProfile(profile_,
- ServiceAccessType::EXPLICIT_ACCESS);
+ history::HistoryService* const history_service = client()->HistoryService();
if (!history_service)
return;
« no previous file with comments | « chrome/browser/autocomplete/history_url_provider.h ('k') | chrome/browser/autocomplete/history_url_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698