[email protected] | 489db084 | 2014-01-22 18:20:03 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
[email protected] | 836e298 | 2013-05-16 08:07:42 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 489db084 | 2014-01-22 18:20:03 | [diff] [blame] | 5 | #ifndef EXTENSIONS_BROWSER_EXTENSION_PREFS_FACTORY_H_ |
6 | #define EXTENSIONS_BROWSER_EXTENSION_PREFS_FACTORY_H_ | ||||
[email protected] | 836e298 | 2013-05-16 08:07:42 | [diff] [blame] | 7 | |
8 | #include "base/memory/scoped_ptr.h" | ||||
9 | #include "base/memory/singleton.h" | ||||
[email protected] | b33f0b11 | 2014-03-13 17:05:30 | [diff] [blame^] | 10 | #include "components/keyed_service/content/browser_context_keyed_service_factory.h" |
[email protected] | 836e298 | 2013-05-16 08:07:42 | [diff] [blame] | 11 | |
12 | namespace extensions { | ||||
13 | |||||
14 | class ExtensionPrefs; | ||||
15 | |||||
[email protected] | f1484c5 | 2013-05-22 23:25:44 | [diff] [blame] | 16 | class ExtensionPrefsFactory : public BrowserContextKeyedServiceFactory { |
[email protected] | 836e298 | 2013-05-16 08:07:42 | [diff] [blame] | 17 | public: |
[email protected] | 367d9b17 | 2013-12-03 00:31:02 | [diff] [blame] | 18 | static ExtensionPrefs* GetForBrowserContext(content::BrowserContext* context); |
[email protected] | 836e298 | 2013-05-16 08:07:42 | [diff] [blame] | 19 | |
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] | b33f0b11 | 2014-03-13 17:05:30 | [diff] [blame^] | 31 | virtual KeyedService* BuildServiceInstanceFor( |
[email protected] | 367d9b17 | 2013-12-03 00:31:02 | [diff] [blame] | 32 | content::BrowserContext* context) const OVERRIDE; |
[email protected] | 836e298 | 2013-05-16 08:07:42 | [diff] [blame] | 33 | virtual content::BrowserContext* GetBrowserContextToUse( |
34 | content::BrowserContext* context) const OVERRIDE; | ||||
35 | }; | ||||
36 | |||||
37 | } // namespace extensions | ||||
38 | |||||
[email protected] | 489db084 | 2014-01-22 18:20:03 | [diff] [blame] | 39 | #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_FACTORY_H_ |