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

Unified Diff: chrome/browser/search_engines/template_url_service_factory.cc

Issue 367863005: No chrome dependencies in TemplateURLService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename to TemplateURLServiceClient Created 6 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/search_engines/template_url_service_factory.cc
diff --git a/chrome/browser/search_engines/template_url_service_factory.cc b/chrome/browser/search_engines/template_url_service_factory.cc
index cc2498979675e6eac6902d42b579529b01f21fa2..80b55b5223d96f6b9c8f0426cf152300c211f38b 100644
--- a/chrome/browser/search_engines/template_url_service_factory.cc
+++ b/chrome/browser/search_engines/template_url_service_factory.cc
@@ -13,7 +13,9 @@
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/rlz/rlz.h"
+#include "chrome/browser/search_engines/chrome_template_url_service_client.h"
#include "chrome/browser/search_engines/template_url_service.h"
+#include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
#include "chrome/browser/webdata/web_data_service_factory.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/pref_registry/pref_registry_syncable.h"
@@ -33,7 +35,7 @@ TemplateURLServiceFactory* TemplateURLServiceFactory::GetInstance() {
// static
KeyedService* TemplateURLServiceFactory::BuildInstanceFor(
- content::BrowserContext* profile) {
+ content::BrowserContext* context) {
base::Closure dsp_change_callback;
#if defined(ENABLE_RLZ)
dsp_change_callback =
@@ -42,9 +44,17 @@ KeyedService* TemplateURLServiceFactory::BuildInstanceFor(
RLZTracker::ChromeOmnibox(),
rlz_lib::SET_TO_GOOGLE);
#endif
- return new TemplateURLService(static_cast<Profile*>(profile),
- g_browser_process->rappor_service(),
- dsp_change_callback);
+ Profile* profile = static_cast<Profile*>(context);
+ return new TemplateURLService(
+ profile->GetPrefs(),
+ scoped_ptr<SearchTermsData>(new UIThreadSearchTermsData(profile)),
+ WebDataServiceFactory::GetKeywordWebDataForProfile(
+ profile, Profile::EXPLICIT_ACCESS),
+ scoped_ptr<TemplateURLServiceClient>(
+ new ChromeTemplateURLServiceClient(profile)),
+ GoogleURLTrackerFactory::GetForProfile(profile),
+ g_browser_process->rappor_service(),
+ dsp_change_callback);
}
TemplateURLServiceFactory::TemplateURLServiceFactory()

Powered by Google App Engine
This is Rietveld 408576698