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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 9 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
10 #include "chrome/browser/profiles/off_the_record_profile_impl.h" | 10 #include "chrome/browser/profiles/off_the_record_profile_impl.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "components/content_settings/core/browser/host_content_settings_map.h" | 12 #include "components/content_settings/core/browser/host_content_settings_map.h" |
13 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 13 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
14 #include "components/syncable_prefs/pref_service_syncable.h" | 14 #include "components/sync_preferences/pref_service_syncable.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 | 16 |
17 #if defined(ENABLE_EXTENSIONS) | 17 #if defined(ENABLE_EXTENSIONS) |
18 #include "chrome/browser/extensions/extension_service.h" | 18 #include "chrome/browser/extensions/extension_service.h" |
19 #include "extensions/browser/extension_system.h" | 19 #include "extensions/browser/extension_system.h" |
20 #include "extensions/browser/extension_system_provider.h" | 20 #include "extensions/browser/extension_system_provider.h" |
21 #include "extensions/browser/extensions_browser_client.h" | 21 #include "extensions/browser/extensions_browser_client.h" |
22 #endif | 22 #endif |
23 | 23 |
24 #if defined(ENABLE_SUPERVISED_USERS) | 24 #if defined(ENABLE_SUPERVISED_USERS) |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 if (profile->GetProfileType() == Profile::INCOGNITO_PROFILE && | 71 if (profile->GetProfileType() == Profile::INCOGNITO_PROFILE && |
72 profile != profile->GetOriginalProfile()) { | 72 profile != profile->GetOriginalProfile()) { |
73 GetForProfile(profile->GetOriginalProfile()); | 73 GetForProfile(profile->GetOriginalProfile()); |
74 } | 74 } |
75 | 75 |
76 scoped_refptr<HostContentSettingsMap> settings_map(new HostContentSettingsMap( | 76 scoped_refptr<HostContentSettingsMap> settings_map(new HostContentSettingsMap( |
77 profile->GetPrefs(), | 77 profile->GetPrefs(), |
78 profile->GetProfileType() == Profile::INCOGNITO_PROFILE, | 78 profile->GetProfileType() == Profile::INCOGNITO_PROFILE, |
79 profile->GetProfileType() == Profile::GUEST_PROFILE)); | 79 profile->GetProfileType() == Profile::GUEST_PROFILE)); |
80 | 80 |
81 syncable_prefs::PrefServiceSyncable* pref_service = | 81 sync_preferences::PrefServiceSyncable* pref_service = |
82 PrefServiceSyncableFromProfile(profile); | 82 PrefServiceSyncableFromProfile(profile); |
83 if (pref_service) { | 83 if (pref_service) { |
84 pref_service->RegisterMergeDataFinishedCallback( | 84 pref_service->RegisterMergeDataFinishedCallback( |
85 base::Bind(&HostContentSettingsMap::MigrateDomainScopedSettings, | 85 base::Bind(&HostContentSettingsMap::MigrateDomainScopedSettings, |
86 settings_map->GetWeakPtr(), true /* after_sync */)); | 86 settings_map->GetWeakPtr(), true /* after_sync */)); |
87 } | 87 } |
88 | 88 |
89 #if defined(ENABLE_EXTENSIONS) | 89 #if defined(ENABLE_EXTENSIONS) |
90 ExtensionService *ext_service = | 90 ExtensionService *ext_service = |
91 extensions::ExtensionSystem::Get(profile)->extension_service(); | 91 extensions::ExtensionSystem::Get(profile)->extension_service(); |
(...skipping 14 matching lines...) Expand all Loading... |
106 } | 106 } |
107 #endif // defined(ENABLE_SUPERVISED_USERS) | 107 #endif // defined(ENABLE_SUPERVISED_USERS) |
108 | 108 |
109 return settings_map; | 109 return settings_map; |
110 } | 110 } |
111 | 111 |
112 content::BrowserContext* HostContentSettingsMapFactory::GetBrowserContextToUse( | 112 content::BrowserContext* HostContentSettingsMapFactory::GetBrowserContextToUse( |
113 content::BrowserContext* context) const { | 113 content::BrowserContext* context) const { |
114 return context; | 114 return context; |
115 } | 115 } |
OLD | NEW |