Index: chrome/browser/notifications/android_settings_provider.h |
diff --git a/chrome/browser/notifications/android_settings_provider.h b/chrome/browser/notifications/android_settings_provider.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..04d9307dc4bcf8c91288f60717c5c239cfca1457 |
--- /dev/null |
+++ b/chrome/browser/notifications/android_settings_provider.h |
@@ -0,0 +1,50 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_NOTIFICATIONS_ANDROID_SETTINGS_PROVIDER_H_ |
+#define CHROME_BROWSER_NOTIFICATIONS_ANDROID_SETTINGS_PROVIDER_H_ |
+ |
+#include <string> |
+ |
+#include "base/macros.h" |
+#include "components/content_settings/core/browser/content_settings_observable_provider.h" |
+#include "components/content_settings/core/browser/content_settings_observer.h" |
+#include "components/content_settings/core/common/content_settings.h" |
+#include "components/content_settings/core/common/content_settings_types.h" |
+#include "components/keyed_service/core/keyed_service.h" |
+ |
+namespace content_settings { |
Peter Beverloo
2017/05/15 15:10:09
nit: only code that's part of the content_settings
awdf
2017/05/16 15:17:36
Done (I note every other content settings observab
|
+ |
+// This class provides notification content settings from system notification |
+// channels on Android O+. |
Peter Beverloo
2017/05/15 15:10:09
It would be good to document the priority order of
awdf
2017/05/16 15:17:35
Done.
|
+class AndroidSettingsProvider : public ObservableProvider { |
Peter Beverloo
2017/05/15 15:10:09
I'd suggest calling this NotificationContentSettin
awdf
2017/05/16 15:17:36
Done. ..Although, what about 'NotificationChannels
Peter Beverloo
2017/05/16 16:15:33
Up to you.
|
+ public: |
+ AndroidSettingsProvider(); |
+ ~AndroidSettingsProvider() override; |
+ |
+ // ProviderInterface methods: |
+ std::unique_ptr<RuleIterator> GetRuleIterator( |
+ ContentSettingsType content_type, |
+ const ResourceIdentifier& resource_identifier, |
+ bool incognito) const override; |
+ |
+ bool SetWebsiteSetting(const ContentSettingsPattern& primary_pattern, |
+ const ContentSettingsPattern& secondary_pattern, |
+ ContentSettingsType content_type, |
+ const ResourceIdentifier& resource_identifier, |
+ base::Value* value) override; |
+ |
+ void ClearAllContentSettingsRules(ContentSettingsType content_type) override; |
+ |
+ void ShutdownOnUIThread() override; |
Peter Beverloo
2017/05/15 15:10:09
micro nit: I wouldn't put the empty lines between
awdf
2017/05/16 15:17:36
interesting, even if they're multiline? That would
Peter Beverloo
2017/05/16 16:15:33
Yeah, think of it as a "block" of implementations
|
+ |
+ private: |
+ bool should_use_channels_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(AndroidSettingsProvider); |
+}; |
+ |
+} // namespace content_settings |
+ |
+#endif // CHROME_BROWSER_NOTIFICATIONS_ANDROID_SETTINGS_PROVIDER_H_ |