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 "base/feature_list.h" | 9 #include "base/feature_list.h" |
| 10 #include "chrome/browser/notifications/notification_channels_provider_android.h" |
10 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 11 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
11 #include "chrome/browser/profiles/off_the_record_profile_impl.h" | 12 #include "chrome/browser/profiles/off_the_record_profile_impl.h" |
12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/common/chrome_features.h" | 14 #include "chrome/common/chrome_features.h" |
14 #include "components/content_settings/core/browser/host_content_settings_map.h" | 15 #include "components/content_settings/core/browser/host_content_settings_map.h" |
15 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 16 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
16 #include "components/sync_preferences/pref_service_syncable.h" | 17 #include "components/sync_preferences/pref_service_syncable.h" |
17 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
18 #include "extensions/features/features.h" | 19 #include "extensions/features/features.h" |
19 | 20 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 SupervisedUserSettingsServiceFactory::GetForProfile(profile); | 103 SupervisedUserSettingsServiceFactory::GetForProfile(profile); |
103 // This may be null in testing. | 104 // This may be null in testing. |
104 if (supervised_service) { | 105 if (supervised_service) { |
105 std::unique_ptr<content_settings::SupervisedProvider> supervised_provider( | 106 std::unique_ptr<content_settings::SupervisedProvider> supervised_provider( |
106 new content_settings::SupervisedProvider(supervised_service)); | 107 new content_settings::SupervisedProvider(supervised_service)); |
107 settings_map->RegisterProvider(HostContentSettingsMap::SUPERVISED_PROVIDER, | 108 settings_map->RegisterProvider(HostContentSettingsMap::SUPERVISED_PROVIDER, |
108 std::move(supervised_provider)); | 109 std::move(supervised_provider)); |
109 } | 110 } |
110 #endif // BUILDFLAG(ENABLE_SUPERVISED_USERS) | 111 #endif // BUILDFLAG(ENABLE_SUPERVISED_USERS) |
111 | 112 |
| 113 #if defined(OS_ANDROID) |
| 114 if (base::FeatureList::IsEnabled(features::kSiteNotificationChannels)) { |
| 115 auto channels_provider = |
| 116 base::MakeUnique<NotificationChannelsProviderAndroid>(); |
| 117 settings_map->RegisterProvider( |
| 118 HostContentSettingsMap::NOTIFICATION_ANDROID_PROVIDER, |
| 119 std::move(channels_provider)); |
| 120 } |
| 121 #endif // defined (OS_ANDROID) |
112 return settings_map; | 122 return settings_map; |
113 } | 123 } |
114 | 124 |
115 content::BrowserContext* HostContentSettingsMapFactory::GetBrowserContextToUse( | 125 content::BrowserContext* HostContentSettingsMapFactory::GetBrowserContextToUse( |
116 content::BrowserContext* context) const { | 126 content::BrowserContext* context) const { |
117 return context; | 127 return context; |
118 } | 128 } |
OLD | NEW |