Chromium Code Reviews| 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_MESSAGE_CENTER_H_ | 5 #ifndef UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ |
| 6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ | 6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 | 69 |
| 70 // Management of the observer list. | 70 // Management of the observer list. |
| 71 virtual void AddObserver(MessageCenterObserver* observer) = 0; | 71 virtual void AddObserver(MessageCenterObserver* observer) = 0; |
| 72 virtual void RemoveObserver(MessageCenterObserver* observer) = 0; | 72 virtual void RemoveObserver(MessageCenterObserver* observer) = 0; |
| 73 | 73 |
| 74 // Queries of current notification list status. | 74 // Queries of current notification list status. |
| 75 virtual size_t NotificationCount() const = 0; | 75 virtual size_t NotificationCount() const = 0; |
| 76 virtual size_t UnreadNotificationCount() const = 0; | 76 virtual size_t UnreadNotificationCount() const = 0; |
| 77 virtual bool HasPopupNotifications() const = 0; | 77 virtual bool HasPopupNotifications() const = 0; |
| 78 virtual bool IsQuietMode() const = 0; | 78 virtual bool IsQuietMode() const = 0; |
| 79 virtual bool IsLockedState() const = 0; | |
| 79 virtual bool HasClickedListener(const std::string& id) = 0; | 80 virtual bool HasClickedListener(const std::string& id) = 0; |
| 80 | 81 |
| 81 // Find the notification with the corresponding id. Returns NULL if not found. | 82 // Find the notification with the corresponding id. Returns NULL if not found. |
| 82 // The returned instance is owned by the message center. | 83 // The returned instance is owned by the message center. |
| 83 virtual message_center::Notification* FindVisibleNotificationById( | 84 virtual message_center::Notification* FindVisibleNotificationById( |
| 84 const std::string& id) = 0; | 85 const std::string& id) = 0; |
| 85 | 86 |
| 86 // Gets all notifications to be shown to the user in the message center. Note | 87 // Gets all notifications to be shown to the user in the message center. Note |
| 87 // that queued changes due to the message center being open are not reflected | 88 // that queued changes due to the message center being open are not reflected |
| 88 // in this list. | 89 // in this list. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 // Setter/getter of notifier settings provider. This will be a weak reference. | 165 // Setter/getter of notifier settings provider. This will be a weak reference. |
| 165 // This should be set at the initialization process. The getter may return | 166 // This should be set at the initialization process. The getter may return |
| 166 // NULL for tests. | 167 // NULL for tests. |
| 167 virtual void SetNotifierSettingsProvider( | 168 virtual void SetNotifierSettingsProvider( |
| 168 NotifierSettingsProvider* provider) = 0; | 169 NotifierSettingsProvider* provider) = 0; |
| 169 virtual NotifierSettingsProvider* GetNotifierSettingsProvider() = 0; | 170 virtual NotifierSettingsProvider* GetNotifierSettingsProvider() = 0; |
| 170 | 171 |
| 171 // This can be called to change the quiet mode state (without a timeout). | 172 // This can be called to change the quiet mode state (without a timeout). |
| 172 virtual void SetQuietMode(bool in_quiet_mode) = 0; | 173 virtual void SetQuietMode(bool in_quiet_mode) = 0; |
| 173 | 174 |
| 175 // This can be called to change the quiet mode state (without a timeout). | |
|
dewittj
2016/05/19 17:34:03
nit: no need to add timeout to comment.
yoshiki
2016/05/24 17:00:14
Done.
| |
| 176 virtual void SetLockedState(bool locked) = 0; | |
| 177 | |
| 174 // Temporarily enables quiet mode for |expires_in| time. | 178 // Temporarily enables quiet mode for |expires_in| time. |
| 175 virtual void EnterQuietModeWithExpire(const base::TimeDelta& expires_in) = 0; | 179 virtual void EnterQuietModeWithExpire(const base::TimeDelta& expires_in) = 0; |
| 176 | 180 |
| 177 // Informs the notification list whether the message center is visible. | 181 // Informs the notification list whether the message center is visible. |
| 178 // This affects whether or not a message has been "read". | 182 // This affects whether or not a message has been "read". |
| 179 virtual void SetVisibility(Visibility visible) = 0; | 183 virtual void SetVisibility(Visibility visible) = 0; |
| 180 | 184 |
| 181 // Allows querying the visibility of the center. | 185 // Allows querying the visibility of the center. |
| 182 virtual bool IsMessageCenterVisible() const = 0; | 186 virtual bool IsMessageCenterVisible() const = 0; |
| 183 | 187 |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 211 // Note carefully: this may break the layout of message center. Shouldn't use | 215 // Note carefully: this may break the layout of message center. Shouldn't use |
| 212 // this method if the update changes its notification size. | 216 // this method if the update changes its notification size. |
| 213 virtual void ForceNotificationFlush(const std::string& id) {} | 217 virtual void ForceNotificationFlush(const std::string& id) {} |
| 214 | 218 |
| 215 DISALLOW_COPY_AND_ASSIGN(MessageCenter); | 219 DISALLOW_COPY_AND_ASSIGN(MessageCenter); |
| 216 }; | 220 }; |
| 217 | 221 |
| 218 } // namespace message_center | 222 } // namespace message_center |
| 219 | 223 |
| 220 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ | 224 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ |
| OLD | NEW |