blob: 3ddc2b96399c7a27266680da8b1e681c98766e79 [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
isherman30fa851a2015-06-09 23:32:1022 void SetInstanceForTesting(content::BrowserContext* context,
23 scoped_ptr<ExtensionPrefs> prefs);
[email protected]836e2982013-05-16 08:07:4224
25 private:
olli.raula36aa8be2015-09-10 11:14:2226 friend struct base::DefaultSingletonTraits<ExtensionPrefsFactory>;
[email protected]836e2982013-05-16 08:07:4227
28 ExtensionPrefsFactory();
dcheng9168b2f2014-10-21 12:38:2429 ~ExtensionPrefsFactory() override;
[email protected]836e2982013-05-16 08:07:4230
dcheng9168b2f2014-10-21 12:38:2431 KeyedService* BuildServiceInstanceFor(
mostynb0eac4e1b2014-10-03 16:32:1932 content::BrowserContext* context) const override;
dcheng9168b2f2014-10-21 12:38:2433 content::BrowserContext* GetBrowserContextToUse(
mostynb0eac4e1b2014-10-03 16:32:1934 content::BrowserContext* context) const override;
[email protected]836e2982013-05-16 08:07:4235};
36
37} // namespace extensions
38
[email protected]489db0842014-01-22 18:20:0339#endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_FACTORY_H_