Chromium Code Reviews| Index: chrome/browser/notifications/notification_ui_manager_android.h |
| diff --git a/chrome/browser/notifications/notification_ui_manager_android.h b/chrome/browser/notifications/notification_ui_manager_android.h |
| index 3c210e83e0ad7012b38c2eaa9a939600a4c31276..cb480cbe8128bd427cd0532b025bca220c831960 100644 |
| --- a/chrome/browser/notifications/notification_ui_manager_android.h |
| +++ b/chrome/browser/notifications/notification_ui_manager_android.h |
| @@ -8,25 +8,28 @@ |
| #include <jni.h> |
| #include <stdint.h> |
| #include <map> |
| +#include <set> |
| #include <string> |
| #include "base/android/scoped_java_ref.h" |
| #include "base/macros.h" |
| -#include "chrome/browser/notifications/notification_ui_manager.h" |
| +#include "chrome/browser/notifications/notification_bridge.h" |
| -// Implementation of the Notification UI Manager for Android, which defers to |
| +// Implementation of the NotificationBridge for Android, which defers to |
| // the Android framework for displaying notifications. |
| // |
| // Android does not support getting the notifications currently shown by an |
| // app without very intrusive permissions, which means that it's not possible |
| // to provide reliable implementations for methods which have to iterate over |
| -// the existing notifications. Because of this, these have not been implemented. |
| +// the existing notifications. Because of this, they return false. |
|
Peter Beverloo
2016/04/18 14:57:10
Let's rephrase this entire paragraph, since it's n
Miguel Garcia
2016/04/19 14:24:57
Done.
|
| // |
| -// The UI manager implementation *is* reliable for adding and canceling single |
| -// notifications based on their delegate id. Finally, events for persistent Web |
| -// Notifications will be forwarded directly to the associated event handlers, |
| +// The Android implementation *is* reliable for adding and canceling |
| +// single notifications based on their delegate id. Finally, events for |
| +// persistent |
|
Peter Beverloo
2016/04/18 14:57:10
nit: odd line break
Miguel Garcia
2016/04/19 14:24:57
Done.
|
| +// Web Notifications will be forwarded directly to the associated event |
| +// handlers, |
| // as such notifications may outlive the browser process on Android. |
| -class NotificationUIManagerAndroid : public NotificationUIManager { |
| +class NotificationUIManagerAndroid : public NotificationBridge { |
| public: |
| NotificationUIManagerAndroid(); |
| ~NotificationUIManagerAndroid() override; |
| @@ -53,23 +56,19 @@ class NotificationUIManagerAndroid : public NotificationUIManager { |
| const base::android::JavaParamRef<jstring>& java_tag, |
| jboolean by_user); |
| - // NotificationUIManager implementation. |
| - void Add(const Notification& notification, Profile* profile) override; |
| - bool Update(const Notification& notification, |
| - Profile* profile) override; |
| - const Notification* FindById(const std::string& delegate_id, |
| - ProfileID profile_id) const override; |
| - bool CancelById(const std::string& delegate_id, |
| - ProfileID profile_id) override; |
| - std::set<std::string> GetAllIdsByProfileAndSourceOrigin( |
| - ProfileID profile_id, |
| - const GURL& source) override; |
| - std::set<std::string> GetAllIdsByProfile(ProfileID profile_id) override; |
| - bool CancelAllBySourceOrigin(const GURL& source_origin) override; |
| - bool CancelAllByProfile(ProfileID profile_id) override; |
| - void CancelAll() override; |
| + // NotificationBridge implementation. |
| + void Display(const std::string& notification_id, |
| + const std::string& profile_id, |
| + bool incognito, |
| + const Notification& notification) override; |
| + void Close(const std::string& profile_id, |
| + const std::string& notification_id) override; |
| + bool GetDisplayed(const std::string& profile_id, |
| + bool incognito, |
| + std::set<std::string>* notifications) const override; |
| + bool SupportsNotificationCenter() const override; |
| - static bool RegisterNotificationUIManager(JNIEnv* env); |
| + static bool RegisterNotificationBridge(JNIEnv* env); |
| private: |
| // Pair containing the information necessary in order to enable closing |