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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_DOM_DISTILLER_DOM_DISTILLER_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_DOM_DISTILLER_DOM_DISTILLER_SERVICE_FACTORY_H_
8 #include "base/memory/singleton.h"
9 #include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h"
10 #include "components/dom_distiller/core/dom_distiller_service.h"
14 } // namespace content
16 namespace dom_distiller
{
18 // A simple wrapper for DomDistillerService to expose it as a
19 // BrowserContextKeyedService.
20 class DomDistillerContextKeyedService
: public BrowserContextKeyedService
,
21 public DomDistillerService
{
23 DomDistillerContextKeyedService(
24 scoped_ptr
<DomDistillerStoreInterface
> store
,
25 scoped_ptr
<DistillerFactory
> distiller_factory
);
26 virtual ~DomDistillerContextKeyedService() {}
29 DISALLOW_COPY_AND_ASSIGN(DomDistillerContextKeyedService
);
32 class DomDistillerServiceFactory
: public BrowserContextKeyedServiceFactory
{
34 static DomDistillerServiceFactory
* GetInstance();
35 static DomDistillerContextKeyedService
* GetForBrowserContext(
36 content::BrowserContext
* context
);
39 friend struct DefaultSingletonTraits
<DomDistillerServiceFactory
>;
41 DomDistillerServiceFactory();
42 virtual ~DomDistillerServiceFactory();
44 virtual BrowserContextKeyedService
* BuildServiceInstanceFor(
45 content::BrowserContext
* context
) const OVERRIDE
;
47 virtual content::BrowserContext
* GetBrowserContextToUse(
48 content::BrowserContext
* context
) const OVERRIDE
;
51 } // namespace dom_distiller
53 #endif // CHROME_BROWSER_DOM_DISTILLER_DOM_DISTILLER_SERVICE_FACTORY_H_