1 // Copyright 2015 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_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_FACTORY_H_
6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_FACTORY_H_
8 #include "base/macros.h"
9 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
13 struct DefaultSingletonTraits
;
16 namespace offline_pages
{
18 class OfflinePageModel
;
20 // A factory to create one unique OfflinePageModel.
21 class OfflinePageModelFactory
: public BrowserContextKeyedServiceFactory
{
23 static OfflinePageModelFactory
* GetInstance();
24 static OfflinePageModel
* GetForBrowserContext(
25 content::BrowserContext
* context
);
28 friend struct base::DefaultSingletonTraits
<OfflinePageModelFactory
>;
30 OfflinePageModelFactory();
31 ~OfflinePageModelFactory() override
{}
33 KeyedService
* BuildServiceInstanceFor(
34 content::BrowserContext
* context
) const override
;
36 content::BrowserContext
* GetBrowserContextToUse(
37 content::BrowserContext
* context
) const override
;
39 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelFactory
);
42 } // namespace offline_pages
44 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_FACTORY_H_