| 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_fetcher_factory.h" | 5 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/incognito_helpers.h" | 7 #include "chrome/browser/profiles/incognito_helpers.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/search_engines/template_url_fetcher.h" | 9 #include "chrome/browser/search_engines/template_url_fetcher.h" |
| 10 #include "chrome/browser/search_engines/template_url_service_factory.h" | 10 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 "TemplateURLFetcher", | 34 "TemplateURLFetcher", |
| 35 BrowserContextDependencyManager::GetInstance()) { | 35 BrowserContextDependencyManager::GetInstance()) { |
| 36 DependsOn(TemplateURLServiceFactory::GetInstance()); | 36 DependsOn(TemplateURLServiceFactory::GetInstance()); |
| 37 } | 37 } |
| 38 | 38 |
| 39 TemplateURLFetcherFactory::~TemplateURLFetcherFactory() { | 39 TemplateURLFetcherFactory::~TemplateURLFetcherFactory() { |
| 40 } | 40 } |
| 41 | 41 |
| 42 KeyedService* TemplateURLFetcherFactory::BuildServiceInstanceFor( | 42 KeyedService* TemplateURLFetcherFactory::BuildServiceInstanceFor( |
| 43 content::BrowserContext* profile) const { | 43 content::BrowserContext* profile) const { |
| 44 return new TemplateURLFetcher(static_cast<Profile*>(profile)); | 44 return new TemplateURLFetcher( |
| 45 TemplateURLServiceFactory::GetForProfile(static_cast<Profile*>(profile)), |
| 46 profile->GetRequestContext()); |
| 45 } | 47 } |
| 46 | 48 |
| 47 content::BrowserContext* TemplateURLFetcherFactory::GetBrowserContextToUse( | 49 content::BrowserContext* TemplateURLFetcherFactory::GetBrowserContextToUse( |
| 48 content::BrowserContext* context) const { | 50 content::BrowserContext* context) const { |
| 49 return chrome::GetBrowserContextRedirectedInIncognito(context); | 51 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 50 } | 52 } |
| OLD | NEW |