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/content_settings/host_content_settings_map_factory.h" | 5 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
6 | 6 |
7 #include "chrome/browser/profiles/off_the_record_profile_impl.h" | 7 #include "chrome/browser/profiles/off_the_record_profile_impl.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "components/content_settings/core/browser/host_content_settings_map.h" | 9 #include "components/content_settings/core/browser/host_content_settings_map.h" |
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 HostContentSettingsMap* HostContentSettingsMapFactory::GetForProfile( | 43 HostContentSettingsMap* HostContentSettingsMapFactory::GetForProfile( |
44 Profile* profile) { | 44 Profile* profile) { |
45 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 45 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
46 | 46 |
47 return static_cast<HostContentSettingsMap*>( | 47 return static_cast<HostContentSettingsMap*>( |
48 GetInstance()->GetServiceForBrowserContext(profile, true).get()); | 48 GetInstance()->GetServiceForBrowserContext(profile, true).get()); |
49 } | 49 } |
50 | 50 |
51 // static | 51 // static |
52 HostContentSettingsMapFactory* HostContentSettingsMapFactory::GetInstance() { | 52 HostContentSettingsMapFactory* HostContentSettingsMapFactory::GetInstance() { |
53 return Singleton<HostContentSettingsMapFactory>::get(); | 53 return base::Singleton<HostContentSettingsMapFactory>::get(); |
54 } | 54 } |
55 | 55 |
56 scoped_refptr<RefcountedKeyedService> | 56 scoped_refptr<RefcountedKeyedService> |
57 HostContentSettingsMapFactory::BuildServiceInstanceFor( | 57 HostContentSettingsMapFactory::BuildServiceInstanceFor( |
58 content::BrowserContext* context) const { | 58 content::BrowserContext* context) const { |
59 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 59 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
60 | 60 |
61 Profile* profile = static_cast<Profile*>(context); | 61 Profile* profile = static_cast<Profile*>(context); |
62 bool off_the_record = profile->GetProfileType() == Profile::INCOGNITO_PROFILE; | 62 bool off_the_record = profile->GetProfileType() == Profile::INCOGNITO_PROFILE; |
63 | 63 |
(...skipping 25 matching lines...) Expand all Loading... |
89 } | 89 } |
90 #endif // defined(ENABLE_SUPERVISED_USERS) | 90 #endif // defined(ENABLE_SUPERVISED_USERS) |
91 | 91 |
92 return settings_map; | 92 return settings_map; |
93 } | 93 } |
94 | 94 |
95 content::BrowserContext* HostContentSettingsMapFactory::GetBrowserContextToUse( | 95 content::BrowserContext* HostContentSettingsMapFactory::GetBrowserContextToUse( |
96 content::BrowserContext* context) const { | 96 content::BrowserContext* context) const { |
97 return context; | 97 return context; |
98 } | 98 } |
OLD | NEW |