| 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 cc7ac328ef2d44f8b835255e74942fd3b1eb2afd..59b5adc640d150c7f03570e44c6065474a55b6c9 100644
|
| --- a/chrome/browser/notifications/notification_ui_manager_android.h
|
| +++ b/chrome/browser/notifications/notification_ui_manager_android.h
|
| @@ -7,19 +7,23 @@
|
|
|
| #include <jni.h>
|
| #include <map>
|
| -#include <set>
|
| #include <string>
|
|
|
| #include "base/android/scoped_java_ref.h"
|
| #include "chrome/browser/notifications/notification_ui_manager.h"
|
|
|
| -class ProfileNotification;
|
| -
|
| // Implementation of the Notification UI Manager for Android, which defers to
|
| // the Android framework for displaying notifications.
|
| //
|
| -// The Android notification manager only operates reliably on notifications
|
| -// that were opened or interacted with since the last restart of Chrome.
|
| +// 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 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,
|
| +// as such notifications may outlive the browser process on Android.
|
| class NotificationUIManagerAndroid : public NotificationUIManager {
|
| public:
|
| NotificationUIManagerAndroid();
|
| @@ -39,7 +43,7 @@ class NotificationUIManagerAndroid : public NotificationUIManager {
|
| jstring java_origin,
|
| jstring java_tag);
|
|
|
| - // NotificationUIManager implementation;
|
| + // NotificationUIManager implementation.
|
| void Add(const Notification& notification, Profile* profile) override;
|
| bool Update(const Notification& notification,
|
| Profile* profile) override;
|
| @@ -57,37 +61,15 @@ class NotificationUIManagerAndroid : public NotificationUIManager {
|
| static bool RegisterNotificationUIManager(JNIEnv* env);
|
|
|
| private:
|
| - // Closes the Notification as displayed on the Android system.
|
| - void PlatformCloseNotification(const std::string& notification_id);
|
| -
|
| - // Adds |profile_notification| to a private local map. The map takes ownership
|
| - // of the notification object.
|
| - void AddProfileNotification(ProfileNotification* profile_notification);
|
| -
|
| - // Erases |profile_notification| from the private local map and deletes it.
|
| - // If |close| is true, also closes the notification.
|
| - void RemoveProfileNotification(ProfileNotification* profile_notification,
|
| - bool close);
|
| -
|
| - // Returns the ProfileNotification for the |id|, or NULL if no such
|
| - // notification is found.
|
| - ProfileNotification* FindProfileNotification(const std::string& id) const;
|
| -
|
| - // Returns the ProfileNotification for |profile| that has the same origin and
|
| - // tag as |notification|. Returns NULL if no valid match is found.
|
| - ProfileNotification* FindNotificationToReplace(
|
| - const Notification& notification, Profile* profile) const;
|
| -
|
| - // Map from a notification id to the associated ProfileNotification*.
|
| - std::map<std::string, ProfileNotification*> profile_notifications_;
|
| -
|
| // Pair containing the information necessary in order to enable closing
|
| // notifications that were not created by this instance of the manager: the
|
| // notification's origin and tag. This list may not contain the notifications
|
| // that have not been interacted with since the last restart of Chrome.
|
| using RegeneratedNotificationInfo = std::pair<std::string, std::string>;
|
|
|
| - // Map from persistent notification id to RegeneratedNotificationInfo.
|
| + // Mapping of a persistent notification id to renegerated notification info.
|
| + // TODO(peter): Remove this map once notification delegate ids for Web
|
| + // notifications are created by the content/ layer.
|
| std::map<int64_t, RegeneratedNotificationInfo>
|
| regenerated_notification_infos_;
|
|
|
|
|