| 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> |
| 8 |
| 7 #include "chrome/browser/profiles/off_the_record_profile_impl.h" | 9 #include "chrome/browser/profiles/off_the_record_profile_impl.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 9 #include "components/content_settings/core/browser/host_content_settings_map.h" | 11 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 12 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 11 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 12 | 14 |
| 13 #if defined(ENABLE_EXTENSIONS) | 15 #if defined(ENABLE_EXTENSIONS) |
| 14 #include "chrome/browser/extensions/extension_service.h" | 16 #include "chrome/browser/extensions/extension_service.h" |
| 15 #include "extensions/browser/extension_system.h" | 17 #include "extensions/browser/extension_system.h" |
| 16 #include "extensions/browser/extension_system_provider.h" | 18 #include "extensions/browser/extension_system_provider.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 ext_service->RegisterContentSettings(settings_map.get()); | 80 ext_service->RegisterContentSettings(settings_map.get()); |
| 79 #endif // defined(ENABLE_EXTENSIONS) | 81 #endif // defined(ENABLE_EXTENSIONS) |
| 80 #if defined(ENABLE_SUPERVISED_USERS) | 82 #if defined(ENABLE_SUPERVISED_USERS) |
| 81 SupervisedUserSettingsService* supervised_service = | 83 SupervisedUserSettingsService* supervised_service = |
| 82 SupervisedUserSettingsServiceFactory::GetForProfile(profile); | 84 SupervisedUserSettingsServiceFactory::GetForProfile(profile); |
| 83 // This may be null in testing. | 85 // This may be null in testing. |
| 84 if (supervised_service) { | 86 if (supervised_service) { |
| 85 scoped_ptr<content_settings::SupervisedProvider> supervised_provider( | 87 scoped_ptr<content_settings::SupervisedProvider> supervised_provider( |
| 86 new content_settings::SupervisedProvider(supervised_service)); | 88 new content_settings::SupervisedProvider(supervised_service)); |
| 87 settings_map->RegisterProvider(HostContentSettingsMap::SUPERVISED_PROVIDER, | 89 settings_map->RegisterProvider(HostContentSettingsMap::SUPERVISED_PROVIDER, |
| 88 supervised_provider.Pass()); | 90 std::move(supervised_provider)); |
| 89 } | 91 } |
| 90 #endif // defined(ENABLE_SUPERVISED_USERS) | 92 #endif // defined(ENABLE_SUPERVISED_USERS) |
| 91 | 93 |
| 92 return settings_map; | 94 return settings_map; |
| 93 } | 95 } |
| 94 | 96 |
| 95 content::BrowserContext* HostContentSettingsMapFactory::GetBrowserContextToUse( | 97 content::BrowserContext* HostContentSettingsMapFactory::GetBrowserContextToUse( |
| 96 content::BrowserContext* context) const { | 98 content::BrowserContext* context) const { |
| 97 return context; | 99 return context; |
| 98 } | 100 } |
| OLD | NEW |