blob: 0d4a05a4f7fae7612067bfe0a40ac085c97a04a0 [file] [log] [blame]
[email protected]489db0842014-01-22 18:20:031// Copyright 2014 The Chromium Authors. All rights reserved.
[email protected]836e2982013-05-16 08:07:422// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]489db0842014-01-22 18:20:035#ifndef EXTENSIONS_BROWSER_EXTENSION_PREFS_FACTORY_H_
6#define EXTENSIONS_BROWSER_EXTENSION_PREFS_FACTORY_H_
[email protected]836e2982013-05-16 08:07:427
8#include "base/memory/scoped_ptr.h"
9#include "base/memory/singleton.h"
[email protected]b33f0b112014-03-13 17:05:3010#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
[email protected]836e2982013-05-16 08:07:4211
12namespace extensions {
13
14class ExtensionPrefs;
15
[email protected]f1484c52013-05-22 23:25:4416class ExtensionPrefsFactory : public BrowserContextKeyedServiceFactory {
[email protected]836e2982013-05-16 08:07:4217 public:
[email protected]367d9b172013-12-03 00:31:0218 static ExtensionPrefs* GetForBrowserContext(content::BrowserContext* context);
[email protected]836e2982013-05-16 08:07:4219
20 static ExtensionPrefsFactory* GetInstance();
21
22 void SetInstanceForTesting(
23 content::BrowserContext* context, ExtensionPrefs* prefs);
24
25 private:
26 friend struct DefaultSingletonTraits<ExtensionPrefsFactory>;
27
28 ExtensionPrefsFactory();
29 virtual ~ExtensionPrefsFactory();
30
[email protected]b33f0b112014-03-13 17:05:3031 virtual KeyedService* BuildServiceInstanceFor(
[email protected]367d9b172013-12-03 00:31:0232 content::BrowserContext* context) const OVERRIDE;
[email protected]836e2982013-05-16 08:07:4233 virtual content::BrowserContext* GetBrowserContextToUse(
34 content::BrowserContext* context) const OVERRIDE;
35};
36
37} // namespace extensions
38
[email protected]489db0842014-01-22 18:20:0339#endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_FACTORY_H_