OLD | NEW |
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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // 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 |
122 // specified time-delta from now. | 122 // specified time-delta from now. |
123 void EnterQuietModeWithExpire(const base::TimeDelta& expires_in); | 123 void EnterQuietModeWithExpire(const base::TimeDelta& expires_in); |
124 | 124 |
125 // Returns all notifications, in a (priority-timestamp) order. Suitable for | 125 // Returns all notifications, in a (priority-timestamp) order. Suitable for |
126 // rendering notifications in a NotificationCenter. | 126 // rendering notifications in a NotificationCenter. |
127 const Notifications& GetNotifications(); | 127 const Notifications& GetNotifications(); |
128 size_t NotificationCount() const; | 128 size_t NotificationCount() const; |
129 size_t unread_count() const { return unread_count_; } | 129 size_t unread_count() const { return unread_count_; } |
130 | 130 |
131 static const size_t kMaxVisiblePopupNotifications; | |
132 static const size_t kMaxVisibleMessageCenterNotifications; | |
133 | |
134 private: | 131 private: |
135 friend class test::NotificationListTest; | 132 friend class test::NotificationListTest; |
136 | 133 |
137 // Iterates through the list and returns the first notification matching |id|. | 134 // Iterates through the list and returns the first notification matching |id|. |
138 Notifications::iterator GetNotification(const std::string& id); | 135 Notifications::iterator GetNotification(const std::string& id); |
139 | 136 |
140 void EraseNotification(Notifications::iterator iter); | 137 void EraseNotification(Notifications::iterator iter); |
141 | 138 |
142 void PushNotification(scoped_ptr<Notification> notification); | 139 void PushNotification(scoped_ptr<Notification> notification); |
143 | 140 |
144 // Sets the current quiet mode status to |quiet_mode|. | 141 // Sets the current quiet mode status to |quiet_mode|. |
145 void SetQuietModeInternal(bool quiet_mode); | 142 void SetQuietModeInternal(bool quiet_mode); |
146 | 143 |
147 Notifications notifications_; | 144 Notifications notifications_; |
148 bool message_center_visible_; | 145 bool message_center_visible_; |
149 size_t unread_count_; | 146 size_t unread_count_; |
150 bool quiet_mode_; | 147 bool quiet_mode_; |
151 scoped_ptr<base::OneShotTimer<NotificationList> > quiet_mode_timer_; | 148 scoped_ptr<base::OneShotTimer<NotificationList> > quiet_mode_timer_; |
152 | 149 |
153 DISALLOW_COPY_AND_ASSIGN(NotificationList); | 150 DISALLOW_COPY_AND_ASSIGN(NotificationList); |
154 }; | 151 }; |
155 | 152 |
156 } // namespace message_center | 153 } // namespace message_center |
157 | 154 |
158 #endif // UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_ | 155 #endif // UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_ |
OLD | NEW |