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

Unified Diff: chrome/browser/autocomplete/history_quick_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_quick_provider.cc
diff --git a/chrome/browser/autocomplete/history_quick_provider.cc b/chrome/browser/autocomplete/history_quick_provider.cc
index 96c763b0044465347582e03ae702d2ce3a21ee7b..705b3f5ebdaa63d13f8f6b49c6316c374e3d5971 100644
--- a/chrome/browser/autocomplete/history_quick_provider.cc
+++ b/chrome/browser/autocomplete/history_quick_provider.cc
@@ -19,7 +19,6 @@
#include "chrome/browser/autocomplete/history_url_provider.h"
#include "chrome/browser/autocomplete/in_memory_url_index.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.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/common/chrome_switches.h"
@@ -47,9 +46,11 @@
bool HistoryQuickProvider::disabled_ = false;
HistoryQuickProvider::HistoryQuickProvider(
+ AutocompleteProviderClient* client,
Profile* profile,
InMemoryURLIndex* in_memory_url_index)
- : HistoryProvider(profile, AutocompleteProvider::TYPE_HISTORY_QUICK),
+ : HistoryProvider(AutocompleteProvider::TYPE_HISTORY_QUICK, client),
+ profile_(profile),
languages_(profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)),
in_memory_url_index_(in_memory_url_index) {
}
@@ -105,9 +106,7 @@ void HistoryQuickProvider::DoAutocomplete() {
autocomplete_input_.parts().password.is_nonempty() ||
autocomplete_input_.parts().path.is_nonempty());
if (can_have_url_what_you_typed_match_first) {
- history::HistoryService* const history_service =
- HistoryServiceFactory::GetForProfile(
- profile_, ServiceAccessType::EXPLICIT_ACCESS);
+ history::HistoryService* const history_service = client()->HistoryService();
// We expect HistoryService to be available. In case it's not,
// (e.g., due to Profile corruption) we let HistoryQuick provider
// completions (which may be available because it's a different
« no previous file with comments | « chrome/browser/autocomplete/history_quick_provider.h ('k') | chrome/browser/autocomplete/history_quick_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698