| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/search_engines/template_url_service_factory.h" | 5 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 rlz_lib::CHROME, | 43 rlz_lib::CHROME, |
| 44 RLZTracker::ChromeOmnibox(), | 44 RLZTracker::ChromeOmnibox(), |
| 45 rlz_lib::SET_TO_GOOGLE); | 45 rlz_lib::SET_TO_GOOGLE); |
| 46 #endif | 46 #endif |
| 47 Profile* profile = static_cast<Profile*>(context); | 47 Profile* profile = static_cast<Profile*>(context); |
| 48 return new TemplateURLService( | 48 return new TemplateURLService( |
| 49 profile->GetPrefs(), | 49 profile->GetPrefs(), |
| 50 scoped_ptr<SearchTermsData>(new UIThreadSearchTermsData(profile)), | 50 scoped_ptr<SearchTermsData>(new UIThreadSearchTermsData(profile)), |
| 51 WebDataServiceFactory::GetKeywordWebDataForProfile( | 51 WebDataServiceFactory::GetKeywordWebDataForProfile( |
| 52 profile, Profile::EXPLICIT_ACCESS), | 52 profile, Profile::EXPLICIT_ACCESS), |
| 53 scoped_ptr<TemplateURLServiceClient>( | 53 scoped_ptr<TemplateURLServiceClient>(new ChromeTemplateURLServiceClient( |
| 54 new ChromeTemplateURLServiceClient(profile)), | 54 HistoryServiceFactory::GetForProfile(profile, |
| 55 Profile::EXPLICIT_ACCESS))), |
| 55 GoogleURLTrackerFactory::GetForProfile(profile), | 56 GoogleURLTrackerFactory::GetForProfile(profile), |
| 56 g_browser_process->rappor_service(), | 57 g_browser_process->rappor_service(), |
| 57 dsp_change_callback); | 58 dsp_change_callback); |
| 58 } | 59 } |
| 59 | 60 |
| 60 TemplateURLServiceFactory::TemplateURLServiceFactory() | 61 TemplateURLServiceFactory::TemplateURLServiceFactory() |
| 61 : BrowserContextKeyedServiceFactory( | 62 : BrowserContextKeyedServiceFactory( |
| 62 "TemplateURLServiceFactory", | 63 "TemplateURLServiceFactory", |
| 63 BrowserContextDependencyManager::GetInstance()) { | 64 BrowserContextDependencyManager::GetInstance()) { |
| 64 DependsOn(GoogleURLTrackerFactory::GetInstance()); | 65 DependsOn(GoogleURLTrackerFactory::GetInstance()); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 153 } |
| 153 | 154 |
| 154 content::BrowserContext* TemplateURLServiceFactory::GetBrowserContextToUse( | 155 content::BrowserContext* TemplateURLServiceFactory::GetBrowserContextToUse( |
| 155 content::BrowserContext* context) const { | 156 content::BrowserContext* context) const { |
| 156 return chrome::GetBrowserContextRedirectedInIncognito(context); | 157 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 157 } | 158 } |
| 158 | 159 |
| 159 bool TemplateURLServiceFactory::ServiceIsNULLWhileTesting() const { | 160 bool TemplateURLServiceFactory::ServiceIsNULLWhileTesting() const { |
| 160 return true; | 161 return true; |
| 161 } | 162 } |
| OLD | NEW |