Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2544)

Unified Diff: chrome/browser/notifications/notification_ui_manager_android.h

Issue 1026853002: Integrate the notification database with the normal code path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-db-ConfirmShow
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 e7681bbdbb618412375146322c0d1bf947387769..cc7ac328ef2d44f8b835255e74942fd3b1eb2afd 100644
--- a/chrome/browser/notifications/notification_ui_manager_android.h
+++ b/chrome/browser/notifications/notification_ui_manager_android.h
@@ -17,21 +17,27 @@ 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.
class NotificationUIManagerAndroid : public NotificationUIManager {
public:
NotificationUIManagerAndroid();
~NotificationUIManagerAndroid() override;
- // Called by the Java implementation when a notification has been clicked on.
+ // Called by the Java implementation when the notification has been clicked.
bool OnNotificationClicked(JNIEnv* env,
jobject java_object,
- jstring notification_id,
- jbyteArray serialized_notification_data);
+ jlong persistent_notification_id,
+ jstring java_origin,
+ jstring java_tag);
- // Called by the Java implementation when a notification has been closed.
+ // Called by the Java implementation when the notification has been closed.
bool OnNotificationClosed(JNIEnv* env,
jobject java_object,
- jstring notification_id);
+ jlong persistent_notification_id,
+ jstring java_origin,
+ jstring java_tag);
// NotificationUIManager implementation;
void Add(const Notification& notification, Profile* profile) override;
@@ -75,11 +81,14 @@ class NotificationUIManagerAndroid : public NotificationUIManager {
// Map from a notification id to the associated ProfileNotification*.
std::map<std::string, ProfileNotification*> profile_notifications_;
- // Holds the tag of a notification, and its origin.
+ // 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 notification id to RegeneratedNotificationInfo.
- std::map<std::string, RegeneratedNotificationInfo>
+ // Map from persistent notification id to RegeneratedNotificationInfo.
+ std::map<int64_t, RegeneratedNotificationInfo>
regenerated_notification_infos_;
base::android::ScopedJavaGlobalRef<jobject> java_object_;

Powered by Google App Engine
This is Rietveld 408576698