OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/subresource_filter/subresource_filter_content_settings_
manager_factory.h" | 5 #include "chrome/browser/subresource_filter/subresource_filter_content_settings_
manager_factory.h" |
6 | 6 |
7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/subresource_filter/subresource_filter_content_settings_
manager.h" | 9 #include "chrome/browser/subresource_filter/subresource_filter_content_settings_
manager.h" |
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
11 #include "components/keyed_service/core/keyed_service.h" | 11 #include "components/keyed_service/core/keyed_service.h" |
12 | 12 |
13 // static | 13 // static |
14 void SubresourceFilterContentSettingsManagerFactory::EnsureForProfile( | 14 SubresourceFilterContentSettingsManager* |
| 15 SubresourceFilterContentSettingsManagerFactory::EnsureForProfile( |
15 Profile* profile) { | 16 Profile* profile) { |
16 GetInstance()->GetServiceForBrowserContext(profile, true /* create */); | 17 return static_cast<SubresourceFilterContentSettingsManager*>( |
| 18 GetInstance()->GetServiceForBrowserContext(profile, true /* create */)); |
17 } | 19 } |
18 | 20 |
19 // static | 21 // static |
20 SubresourceFilterContentSettingsManagerFactory* | 22 SubresourceFilterContentSettingsManagerFactory* |
21 SubresourceFilterContentSettingsManagerFactory::GetInstance() { | 23 SubresourceFilterContentSettingsManagerFactory::GetInstance() { |
22 return base::Singleton<SubresourceFilterContentSettingsManagerFactory>::get(); | 24 return base::Singleton<SubresourceFilterContentSettingsManagerFactory>::get(); |
23 } | 25 } |
24 | 26 |
25 SubresourceFilterContentSettingsManagerFactory:: | 27 SubresourceFilterContentSettingsManagerFactory:: |
26 SubresourceFilterContentSettingsManagerFactory() | 28 SubresourceFilterContentSettingsManagerFactory() |
27 : BrowserContextKeyedServiceFactory( | 29 : BrowserContextKeyedServiceFactory( |
28 "SubresourceFilterContentSettingsManager", | 30 "SubresourceFilterContentSettingsManager", |
29 BrowserContextDependencyManager::GetInstance()) {} | 31 BrowserContextDependencyManager::GetInstance()) {} |
30 | 32 |
31 KeyedService* | 33 KeyedService* |
32 SubresourceFilterContentSettingsManagerFactory::BuildServiceInstanceFor( | 34 SubresourceFilterContentSettingsManagerFactory::BuildServiceInstanceFor( |
33 content::BrowserContext* profile) const { | 35 content::BrowserContext* profile) const { |
34 return new SubresourceFilterContentSettingsManager( | 36 return new SubresourceFilterContentSettingsManager( |
35 static_cast<Profile*>(profile)); | 37 static_cast<Profile*>(profile)); |
36 } | 38 } |
OLD | NEW |