Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / android / offline_pages / offline_page_model_factory.h
blob25575cf0463dd571dc02bf60f31515f9e2a272da
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"
11 namespace base {
12 template <typename T>
13 struct DefaultSingletonTraits;
14 } // namespace base
16 namespace offline_pages {
18 class OfflinePageModel;
20 // A factory to create one unique OfflinePageModel.
21 class OfflinePageModelFactory : public BrowserContextKeyedServiceFactory {
22 public:
23 static OfflinePageModelFactory* GetInstance();
24 static OfflinePageModel* GetForBrowserContext(
25 content::BrowserContext* context);
27 private:
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_