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

Side by Side Diff: ui/message_center/notification_list.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_ 5 #ifndef UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_
6 #define UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_ 6 #define UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_
7 7
8 #include <list> 8 #include <list>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 // Returns true if the notification exists and was updated. 78 // Returns true if the notification exists and was updated.
79 bool SetNotificationImage(const std::string& notification_id, 79 bool SetNotificationImage(const std::string& notification_id,
80 const gfx::Image& image); 80 const gfx::Image& image);
81 81
82 // Returns true if the notification and button exist and were updated. 82 // Returns true if the notification and button exist and were updated.
83 bool SetNotificationButtonIcon(const std::string& notification_id, 83 bool SetNotificationButtonIcon(const std::string& notification_id,
84 int button_index, 84 int button_index,
85 const gfx::Image& image); 85 const gfx::Image& image);
86 86
87 // Returns true if |id| matches a notification in the list.
88 bool HasNotification(const std::string& id);
89
90 // Returns true if |id| matches a notification in the list and that 87 // Returns true if |id| matches a notification in the list and that
91 // notification's type matches the given type. 88 // notification's type matches the given type.
92 bool HasNotificationOfType(const std::string& id, 89 bool HasNotificationOfType(const std::string& id,
93 const NotificationType type); 90 const NotificationType type);
94 91
95 // Returns false if the first notification has been shown as a popup (which 92 // Returns false if the first notification has been shown as a popup (which
96 // means that all notifications have been shown). 93 // means that all notifications have been shown).
97 bool HasPopupNotifications(const NotificationBlockers& blockers); 94 bool HasPopupNotifications(const NotificationBlockers& blockers);
98 95
99 // Returns the recent notifications of the priority higher then LOW, 96 // Returns the recent notifications of the priority higher then LOW,
(...skipping 18 matching lines...) Expand all
118 115
119 bool quiet_mode() const { return quiet_mode_; } 116 bool quiet_mode() const { return quiet_mode_; }
120 117
121 // Sets the current quiet mode status to |quiet_mode|. 118 // Sets the current quiet mode status to |quiet_mode|.
122 void SetQuietMode(bool quiet_mode); 119 void SetQuietMode(bool quiet_mode);
123 120
124 // Sets the current quiet mode to true. The quiet mode will expire in the 121 // Sets the current quiet mode to true. The quiet mode will expire in the
125 // specified time-delta from now. 122 // specified time-delta from now.
126 void EnterQuietModeWithExpire(const base::TimeDelta& expires_in); 123 void EnterQuietModeWithExpire(const base::TimeDelta& expires_in);
127 124
125 // Returns the notification with the corresponding id. If not found, returns
126 // NULL. Notification instance is owned by this list.
127 Notification* GetNotificationById(const std::string& id);
128
128 // Returns all visible notifications, in a (priority-timestamp) order. 129 // Returns all visible notifications, in a (priority-timestamp) order.
129 // Suitable for rendering notifications in a MessageCenter. 130 // Suitable for rendering notifications in a MessageCenter.
130 Notifications GetVisibleNotifications( 131 Notifications GetVisibleNotifications(
131 const NotificationBlockers& blockers) const; 132 const NotificationBlockers& blockers) const;
132 size_t NotificationCount(const NotificationBlockers& blockers) const; 133 size_t NotificationCount(const NotificationBlockers& blockers) const;
133 size_t UnreadCount(const NotificationBlockers& blockers) const; 134 size_t UnreadCount(const NotificationBlockers& blockers) const;
134 135
135 bool is_message_center_visible() const { return message_center_visible_; } 136 bool is_message_center_visible() const { return message_center_visible_; }
136 137
137 private: 138 private:
(...skipping 11 matching lines...) Expand all
149 Notifications notifications_; 150 Notifications notifications_;
150 bool message_center_visible_; 151 bool message_center_visible_;
151 bool quiet_mode_; 152 bool quiet_mode_;
152 153
153 DISALLOW_COPY_AND_ASSIGN(NotificationList); 154 DISALLOW_COPY_AND_ASSIGN(NotificationList);
154 }; 155 };
155 156
156 } // namespace message_center 157 } // namespace message_center
157 158
158 #endif // UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_ 159 #endif // UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698