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 #ifndef CHROME_BROWSER_DOM_DISTILLER_DOM_DISTILLER_SERVICE_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_DOM_DISTILLER_DOM_DISTILLER_SERVICE_FACTORY_H_ |
6 #define CHROME_BROWSER_DOM_DISTILLER_DOM_DISTILLER_SERVICE_FACTORY_H_ | 6 #define CHROME_BROWSER_DOM_DISTILLER_DOM_DISTILLER_SERVICE_FACTORY_H_ |
7 | 7 |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "components/dom_distiller/core/distilled_page_prefs.h" | 9 #include "components/dom_distiller/core/distilled_page_prefs.h" |
10 #include "components/dom_distiller/core/dom_distiller_service.h" | 10 #include "components/dom_distiller/core/dom_distiller_service.h" |
11 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 11 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
12 #include "components/keyed_service/core/keyed_service.h" | 12 #include "components/keyed_service/core/keyed_service.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 class BrowserContext; | 15 class BrowserContext; |
16 } // namespace content | 16 } // namespace content |
17 | 17 |
18 namespace dom_distiller { | 18 namespace dom_distiller { |
19 | 19 |
20 // A simple wrapper for DomDistillerService to expose it as a | 20 // A simple wrapper for DomDistillerService to expose it as a |
21 // KeyedService. | 21 // KeyedService. |
22 class DomDistillerContextKeyedService : public KeyedService, | 22 class DomDistillerContextKeyedService : public KeyedService, |
23 public DomDistillerService { | 23 public DomDistillerService { |
24 public: | 24 public: |
25 DomDistillerContextKeyedService( | 25 DomDistillerContextKeyedService( |
26 scoped_ptr<DomDistillerStoreInterface> store, | 26 scoped_ptr<DomDistillerStoreInterface> store, |
27 scoped_ptr<DistillerFactory> distiller_factory, | 27 scoped_ptr<DistillerFactory> distiller_factory, |
28 scoped_ptr<DistillerPageFactory> distiller_page_factory, | 28 scoped_ptr<DistillerPageFactory> distiller_page_factory, |
29 scoped_ptr<DistilledPagePrefs> distilled_page_prefs); | 29 scoped_ptr<DistilledPagePrefs> distilled_page_prefs); |
30 virtual ~DomDistillerContextKeyedService() {} | 30 ~DomDistillerContextKeyedService() override {} |
31 | 31 |
32 private: | 32 private: |
33 DISALLOW_COPY_AND_ASSIGN(DomDistillerContextKeyedService); | 33 DISALLOW_COPY_AND_ASSIGN(DomDistillerContextKeyedService); |
34 }; | 34 }; |
35 | 35 |
36 class DomDistillerServiceFactory : public BrowserContextKeyedServiceFactory { | 36 class DomDistillerServiceFactory : public BrowserContextKeyedServiceFactory { |
37 public: | 37 public: |
38 static DomDistillerServiceFactory* GetInstance(); | 38 static DomDistillerServiceFactory* GetInstance(); |
39 static DomDistillerContextKeyedService* GetForBrowserContext( | 39 static DomDistillerContextKeyedService* GetForBrowserContext( |
40 content::BrowserContext* context); | 40 content::BrowserContext* context); |
41 | 41 |
42 private: | 42 private: |
43 friend struct DefaultSingletonTraits<DomDistillerServiceFactory>; | 43 friend struct DefaultSingletonTraits<DomDistillerServiceFactory>; |
44 | 44 |
45 DomDistillerServiceFactory(); | 45 DomDistillerServiceFactory(); |
46 virtual ~DomDistillerServiceFactory(); | 46 ~DomDistillerServiceFactory() override; |
47 | 47 |
48 virtual KeyedService* BuildServiceInstanceFor( | 48 KeyedService* BuildServiceInstanceFor( |
49 content::BrowserContext* context) const override; | 49 content::BrowserContext* context) const override; |
50 | 50 |
51 virtual content::BrowserContext* GetBrowserContextToUse( | 51 content::BrowserContext* GetBrowserContextToUse( |
52 content::BrowserContext* context) const override; | 52 content::BrowserContext* context) const override; |
53 }; | 53 }; |
54 | 54 |
55 } // namespace dom_distiller | 55 } // namespace dom_distiller |
56 | 56 |
57 #endif // CHROME_BROWSER_DOM_DISTILLER_DOM_DISTILLER_SERVICE_FACTORY_H_ | 57 #endif // CHROME_BROWSER_DOM_DISTILLER_DOM_DISTILLER_SERVICE_FACTORY_H_ |
OLD | NEW |