OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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/storage/durable_storage_permission_context_factory.h" | 5 #include "chrome/browser/storage/durable_storage_permission_context_factory.h" |
6 | 6 |
7 #include "chrome/browser/profiles/incognito_helpers.h" | 7 #include "chrome/browser/profiles/incognito_helpers.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/storage/durable_storage_permission_context.h" | 9 #include "chrome/browser/storage/durable_storage_permission_context.h" |
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
11 | 11 |
12 // static | 12 // static |
13 DurableStoragePermissionContext* | 13 DurableStoragePermissionContext* |
14 DurableStoragePermissionContextFactory::GetForProfile(Profile* profile) { | 14 DurableStoragePermissionContextFactory::GetForProfile(Profile* profile) { |
15 return static_cast<DurableStoragePermissionContext*>( | 15 return static_cast<DurableStoragePermissionContext*>( |
16 GetInstance()->GetServiceForBrowserContext(profile, true)); | 16 GetInstance()->GetServiceForBrowserContext(profile, true)); |
17 } | 17 } |
18 | 18 |
19 // static | 19 // static |
20 DurableStoragePermissionContextFactory* | 20 DurableStoragePermissionContextFactory* |
21 DurableStoragePermissionContextFactory::GetInstance() { | 21 DurableStoragePermissionContextFactory::GetInstance() { |
22 return Singleton<DurableStoragePermissionContextFactory>::get(); | 22 return base::Singleton<DurableStoragePermissionContextFactory>::get(); |
23 } | 23 } |
24 | 24 |
25 DurableStoragePermissionContextFactory::DurableStoragePermissionContextFactory() | 25 DurableStoragePermissionContextFactory::DurableStoragePermissionContextFactory() |
26 : BrowserContextKeyedServiceFactory( | 26 : BrowserContextKeyedServiceFactory( |
27 "DurableStoragePermissionContext", | 27 "DurableStoragePermissionContext", |
28 BrowserContextDependencyManager::GetInstance()) { | 28 BrowserContextDependencyManager::GetInstance()) { |
29 } | 29 } |
30 | 30 |
31 KeyedService* DurableStoragePermissionContextFactory::BuildServiceInstanceFor( | 31 KeyedService* DurableStoragePermissionContextFactory::BuildServiceInstanceFor( |
32 content::BrowserContext* profile) const { | 32 content::BrowserContext* profile) const { |
33 return new DurableStoragePermissionContext(static_cast<Profile*>(profile)); | 33 return new DurableStoragePermissionContext(static_cast<Profile*>(profile)); |
34 } | 34 } |
35 | 35 |
36 content::BrowserContext* | 36 content::BrowserContext* |
37 DurableStoragePermissionContextFactory::GetBrowserContextToUse( | 37 DurableStoragePermissionContextFactory::GetBrowserContextToUse( |
38 content::BrowserContext* context) const { | 38 content::BrowserContext* context) const { |
39 return chrome::GetBrowserContextOwnInstanceInIncognito(context); | 39 return chrome::GetBrowserContextOwnInstanceInIncognito(context); |
40 } | 40 } |
OLD | NEW |