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

Unified Diff: chrome/browser/autocomplete/autocomplete_controller.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/autocomplete_controller.cc
diff --git a/chrome/browser/autocomplete/autocomplete_controller.cc b/chrome/browser/autocomplete/autocomplete_controller.cc
index 35b0ccb1ddb656e5d8aaff06af8bd9eb9fe1d01f..d414fb641429d3d8f613ac48af72ad33349bdb46 100644
--- a/chrome/browser/autocomplete/autocomplete_controller.cc
+++ b/chrome/browser/autocomplete/autocomplete_controller.cc
@@ -16,7 +16,6 @@
#include "chrome/browser/autocomplete/autocomplete_controller_delegate.h"
#include "chrome/browser/autocomplete/bookmark_provider.h"
#include "chrome/browser/autocomplete/builtin_provider.h"
-#include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h"
#include "chrome/browser/autocomplete/history_quick_provider.h"
#include "chrome/browser/autocomplete/history_url_provider.h"
#include "chrome/browser/autocomplete/in_memory_url_index_factory.h"
@@ -178,6 +177,7 @@ AutocompleteController::AutocompleteController(
keyword_provider_(NULL),
search_provider_(NULL),
zero_suggest_provider_(NULL),
+ provider_client_(new ChromeAutocompleteProviderClient(profile)),
stop_timer_duration_(OmniboxFieldTrial::StopTimerFieldTrialDuration()),
done_(true),
in_start_(false),
@@ -189,10 +189,12 @@ AutocompleteController::AutocompleteController(
providers_.push_back(new BuiltinProvider());
if (provider_types & AutocompleteProvider::TYPE_HISTORY_QUICK) {
providers_.push_back(new HistoryQuickProvider(
- profile, InMemoryURLIndexFactory::GetForProfile(profile)));
+ provider_client_.get(), profile,
+ InMemoryURLIndexFactory::GetForProfile(profile)));
}
if (provider_types & AutocompleteProvider::TYPE_HISTORY_URL) {
- history_url_provider_ = new HistoryURLProvider(this, profile);
+ history_url_provider_ =
+ new HistoryURLProvider(provider_client_.get(), this, profile);
providers_.push_back(history_url_provider_);
}
// "Tab to search" can be used on all platforms other than Android.
@@ -208,16 +210,15 @@ AutocompleteController::AutocompleteController(
}
#endif
if (provider_types & AutocompleteProvider::TYPE_SEARCH) {
- search_provider_ = new SearchProvider(
- this, template_url_service, scoped_ptr<AutocompleteProviderClient>(
- new ChromeAutocompleteProviderClient(profile)));
+ search_provider_ =
+ new SearchProvider(this, template_url_service, provider_client_.get());
Peter Kasting 2015/06/16 00:03:42 Nit: If you're going to do it in the history provi
blundell 2015/06/16 07:21:25 Done.
providers_.push_back(search_provider_);
}
if (provider_types & AutocompleteProvider::TYPE_SHORTCUTS)
providers_.push_back(new ShortcutsProvider(profile));
if (provider_types & AutocompleteProvider::TYPE_ZERO_SUGGEST) {
zero_suggest_provider_ = ZeroSuggestProvider::Create(
- this, template_url_service, profile);
+ this, template_url_service, profile, provider_client_.get());
if (zero_suggest_provider_)
providers_.push_back(zero_suggest_provider_);
}

Powered by Google App Engine
This is Rietveld 408576698