OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/extension_pref_value_map_factory.h" | 5 #include "chrome/browser/extensions/extension_pref_value_map_factory.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_pref_value_map.h" | 7 #include "chrome/browser/extensions/extension_pref_value_map.h" |
8 #include "chrome/browser/profiles/profile.h" | |
9 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 8 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
10 | 9 |
11 ExtensionPrefValueMapFactory::ExtensionPrefValueMapFactory() | 10 ExtensionPrefValueMapFactory::ExtensionPrefValueMapFactory() |
12 : BrowserContextKeyedServiceFactory( | 11 : BrowserContextKeyedServiceFactory( |
13 "ExtensionPrefValueMap", | 12 "ExtensionPrefValueMap", |
14 BrowserContextDependencyManager::GetInstance()) { | 13 BrowserContextDependencyManager::GetInstance()) { |
15 } | 14 } |
16 | 15 |
17 ExtensionPrefValueMapFactory::~ExtensionPrefValueMapFactory() { | 16 ExtensionPrefValueMapFactory::~ExtensionPrefValueMapFactory() { |
18 } | 17 } |
19 | 18 |
20 // static | 19 // static |
21 ExtensionPrefValueMap* ExtensionPrefValueMapFactory::GetForBrowserContext( | 20 ExtensionPrefValueMap* ExtensionPrefValueMapFactory::GetForBrowserContext( |
22 content::BrowserContext* context) { | 21 content::BrowserContext* context) { |
23 return static_cast<ExtensionPrefValueMap*>( | 22 return static_cast<ExtensionPrefValueMap*>( |
24 GetInstance()->GetServiceForBrowserContext(context, true)); | 23 GetInstance()->GetServiceForBrowserContext(context, true)); |
25 } | 24 } |
26 | 25 |
27 // static | 26 // static |
28 ExtensionPrefValueMapFactory* ExtensionPrefValueMapFactory::GetInstance() { | 27 ExtensionPrefValueMapFactory* ExtensionPrefValueMapFactory::GetInstance() { |
29 return Singleton<ExtensionPrefValueMapFactory>::get(); | 28 return Singleton<ExtensionPrefValueMapFactory>::get(); |
30 } | 29 } |
31 | 30 |
32 BrowserContextKeyedService* | 31 BrowserContextKeyedService* |
33 ExtensionPrefValueMapFactory::BuildServiceInstanceFor( | 32 ExtensionPrefValueMapFactory::BuildServiceInstanceFor( |
34 content::BrowserContext* context) const { | 33 content::BrowserContext* context) const { |
35 return new ExtensionPrefValueMap(); | 34 return new ExtensionPrefValueMap(); |
36 } | 35 } |
OLD | NEW |