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

Unified Diff: ui/message_center/message_center.h

Issue 324583002: The 1st patch to disambiguate message center notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 6 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
« no previous file with comments | « ui/message_center/fake_message_center.cc ('k') | ui/message_center/message_center_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/message_center.h
diff --git a/ui/message_center/message_center.h b/ui/message_center/message_center.h
index 12ee38eaa30b01d02128f686f73bfc59b2673513..84824ab37765779c1c574aca2ce51f60a9805e41 100644
--- a/ui/message_center/message_center.h
+++ b/ui/message_center/message_center.h
@@ -20,6 +20,16 @@ class DictionaryValue;
// [Add|Remove|Update]Notification to create and update notifications in the
// list. It also sends those changes to its observers when a notification
// is shown, closed, or clicked on.
+//
+// MessageCenter is agnostic of profiles; it uses the string returned by
+// message_center::Notification::id() to uniquely identify a notification. It is
+// the caller's responsibility to formulate the id so that 2 different
+// notification should have different ids. For example, if the caller supports
+// multiple profiles, then caller should encode both profile characteristics and
+// notification front end's notification id into a new id and set it into the
+// notification instance before passing that in. Consequently the id passed to
+// observers will be this unique id, which can be used with MessageCenter
+// interface but probably not higher level interfaces.
namespace message_center {
@@ -51,10 +61,14 @@ class MESSAGE_CENTER_EXPORT MessageCenter {
virtual size_t NotificationCount() const = 0;
virtual size_t UnreadNotificationCount() const = 0;
virtual bool HasPopupNotifications() const = 0;
- virtual bool HasNotification(const std::string& id) = 0;
virtual bool IsQuietMode() const = 0;
virtual bool HasClickedListener(const std::string& id) = 0;
+ // Find the notification with the corresponding id. Returns NULL if not found.
+ // The returned instance is owned by the message center.
+ virtual message_center::Notification* FindVisibleNotificationById(
+ const std::string& id) = 0;
+
// Gets all notifications to be shown to the user in the message center. Note
// that queued changes due to the message center being open are not reflected
// in this list.
« no previous file with comments | « ui/message_center/fake_message_center.cc ('k') | ui/message_center/message_center_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698