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_service_factory.h" | 9 #include "chrome/browser/search_engines/template_url_service_factory.h" |
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
11 #include "components/search_engines/template_url_fetcher.h" | 11 #include "components/search_engines/template_url_fetcher.h" |
12 | 12 |
13 // static | 13 // static |
14 TemplateURLFetcher* TemplateURLFetcherFactory::GetForProfile( | 14 TemplateURLFetcher* TemplateURLFetcherFactory::GetForProfile( |
15 Profile* profile) { | 15 Profile* profile) { |
16 return static_cast<TemplateURLFetcher*>( | 16 return static_cast<TemplateURLFetcher*>( |
17 GetInstance()->GetServiceForBrowserContext(profile, true)); | 17 GetInstance()->GetServiceForBrowserContext(profile, true)); |
18 } | 18 } |
19 | 19 |
20 // static | 20 // static |
21 TemplateURLFetcherFactory* TemplateURLFetcherFactory::GetInstance() { | 21 TemplateURLFetcherFactory* TemplateURLFetcherFactory::GetInstance() { |
22 return Singleton<TemplateURLFetcherFactory>::get(); | 22 return base::Singleton<TemplateURLFetcherFactory>::get(); |
23 } | 23 } |
24 | 24 |
25 // static | 25 // static |
26 void TemplateURLFetcherFactory::ShutdownForProfile(Profile* profile) { | 26 void TemplateURLFetcherFactory::ShutdownForProfile(Profile* profile) { |
27 TemplateURLFetcherFactory* factory = GetInstance(); | 27 TemplateURLFetcherFactory* factory = GetInstance(); |
28 factory->BrowserContextShutdown(profile); | 28 factory->BrowserContextShutdown(profile); |
29 factory->BrowserContextDestroyed(profile); | 29 factory->BrowserContextDestroyed(profile); |
30 } | 30 } |
31 | 31 |
32 TemplateURLFetcherFactory::TemplateURLFetcherFactory() | 32 TemplateURLFetcherFactory::TemplateURLFetcherFactory() |
(...skipping 10 matching lines...) Expand all Loading... |
43 content::BrowserContext* profile) const { | 43 content::BrowserContext* profile) const { |
44 return new TemplateURLFetcher( | 44 return new TemplateURLFetcher( |
45 TemplateURLServiceFactory::GetForProfile(static_cast<Profile*>(profile)), | 45 TemplateURLServiceFactory::GetForProfile(static_cast<Profile*>(profile)), |
46 profile->GetRequestContext()); | 46 profile->GetRequestContext()); |
47 } | 47 } |
48 | 48 |
49 content::BrowserContext* TemplateURLFetcherFactory::GetBrowserContextToUse( | 49 content::BrowserContext* TemplateURLFetcherFactory::GetBrowserContextToUse( |
50 content::BrowserContext* context) const { | 50 content::BrowserContext* context) const { |
51 return chrome::GetBrowserContextRedirectedInIncognito(context); | 51 return chrome::GetBrowserContextRedirectedInIncognito(context); |
52 } | 52 } |
OLD | NEW |