OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/dom_distiller/dom_distiller_service_factory.h" | 5 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
6 | 6 |
7 #include "base/threading/sequenced_worker_pool.h" | 7 #include "base/threading/sequenced_worker_pool.h" |
8 #include "chrome/browser/profiles/incognito_helpers.h" | 8 #include "chrome/browser/profiles/incognito_helpers.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "components/dom_distiller/content/browser/distiller_page_web_contents.h
" | 10 #include "components/dom_distiller/content/browser/distiller_page_web_contents.h
" |
(...skipping 14 matching lines...) Expand all Loading... |
25 scoped_ptr<DistillerPageFactory> distiller_page_factory, | 25 scoped_ptr<DistillerPageFactory> distiller_page_factory, |
26 scoped_ptr<DistilledPagePrefs> distilled_page_prefs) | 26 scoped_ptr<DistilledPagePrefs> distilled_page_prefs) |
27 : DomDistillerService(store.Pass(), | 27 : DomDistillerService(store.Pass(), |
28 distiller_factory.Pass(), | 28 distiller_factory.Pass(), |
29 distiller_page_factory.Pass(), | 29 distiller_page_factory.Pass(), |
30 distilled_page_prefs.Pass()) { | 30 distilled_page_prefs.Pass()) { |
31 } | 31 } |
32 | 32 |
33 // static | 33 // static |
34 DomDistillerServiceFactory* DomDistillerServiceFactory::GetInstance() { | 34 DomDistillerServiceFactory* DomDistillerServiceFactory::GetInstance() { |
35 return Singleton<DomDistillerServiceFactory>::get(); | 35 return base::Singleton<DomDistillerServiceFactory>::get(); |
36 } | 36 } |
37 | 37 |
38 // static | 38 // static |
39 DomDistillerContextKeyedService* | 39 DomDistillerContextKeyedService* |
40 DomDistillerServiceFactory::GetForBrowserContext( | 40 DomDistillerServiceFactory::GetForBrowserContext( |
41 content::BrowserContext* context) { | 41 content::BrowserContext* context) { |
42 return static_cast<DomDistillerContextKeyedService*>( | 42 return static_cast<DomDistillerContextKeyedService*>( |
43 GetInstance()->GetServiceForBrowserContext(context, true)); | 43 GetInstance()->GetServiceForBrowserContext(context, true)); |
44 } | 44 } |
45 | 45 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 return service; | 90 return service; |
91 } | 91 } |
92 | 92 |
93 content::BrowserContext* DomDistillerServiceFactory::GetBrowserContextToUse( | 93 content::BrowserContext* DomDistillerServiceFactory::GetBrowserContextToUse( |
94 content::BrowserContext* context) const { | 94 content::BrowserContext* context) const { |
95 // Makes normal profile and off-the-record profile use same service instance. | 95 // Makes normal profile and off-the-record profile use same service instance. |
96 return chrome::GetBrowserContextRedirectedInIncognito(context); | 96 return chrome::GetBrowserContextRedirectedInIncognito(context); |
97 } | 97 } |
98 | 98 |
99 } // namespace dom_distiller | 99 } // namespace dom_distiller |
OLD | NEW |