OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_CONTENT_SETTINGS_PROVIDER_ANDR
OID_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_CONTENT_SETTINGS_PROVIDER_ANDR
OID_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "components/content_settings/core/browser/content_settings_observable_p
rovider.h" |
| 12 #include "components/content_settings/core/browser/content_settings_observer.h" |
| 13 #include "components/content_settings/core/browser/content_settings_rule.h" |
| 14 #include "components/content_settings/core/common/content_settings.h" |
| 15 #include "components/content_settings/core/common/content_settings_types.h" |
| 16 #include "components/keyed_service/core/keyed_service.h" |
| 17 |
| 18 // This class provides notification content settings from system notification |
| 19 // channels on Android O+. This provider takes precedence over pref-provided |
| 20 // content settings, but defers to supervised user and policy settings - see |
| 21 // ordering of the ProviderType enum values in HostContentSettingsMap. |
| 22 class NotificationContentSettingsProviderAndroid |
| 23 : public content_settings::ObservableProvider { |
| 24 public: |
| 25 NotificationContentSettingsProviderAndroid(); |
| 26 ~NotificationContentSettingsProviderAndroid() override; |
| 27 |
| 28 // ProviderInterface methods: |
| 29 std::unique_ptr<content_settings::RuleIterator> GetRuleIterator( |
| 30 ContentSettingsType content_type, |
| 31 const content_settings::ResourceIdentifier& resource_identifier, |
| 32 bool incognito) const override; |
| 33 |
| 34 bool SetWebsiteSetting( |
| 35 const ContentSettingsPattern& primary_pattern, |
| 36 const ContentSettingsPattern& secondary_pattern, |
| 37 ContentSettingsType content_type, |
| 38 const content_settings::ResourceIdentifier& resource_identifier, |
| 39 base::Value* value) override; |
| 40 |
| 41 void ClearAllContentSettingsRules(ContentSettingsType content_type) override; |
| 42 |
| 43 void ShutdownOnUIThread() override; |
| 44 |
| 45 private: |
| 46 bool should_use_channels_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(NotificationContentSettingsProviderAndroid); |
| 49 }; |
| 50 |
| 51 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_CONTENT_SETTINGS_PROVIDER_A
NDROID_H_ |
OLD | NEW |