[email protected] | 2985f67a | 2013-04-12 21:07:44 | [diff] [blame] | 1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_ |
| 6 | #define UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_ |
| 7 | |
[email protected] | b754bc24 | 2013-05-13 20:12:26 | [diff] [blame] | 8 | #include <string> |
| 9 | |
[email protected] | 2985f67a | 2013-04-12 21:07:44 | [diff] [blame] | 10 | #include "ui/message_center/message_center_export.h" |
[email protected] | 826bb79 | 2013-09-11 13:48:41 | [diff] [blame] | 11 | #include "ui/message_center/message_center_types.h" |
[email protected] | 2985f67a | 2013-04-12 21:07:44 | [diff] [blame] | 12 | |
| 13 | namespace message_center { |
[email protected] | 33aa554d | 2013-12-06 00:47:53 | [diff] [blame] | 14 | class NotificationBlocker; |
[email protected] | 2985f67a | 2013-04-12 21:07:44 | [diff] [blame] | 15 | |
| 16 | // An observer class for the change of notifications in the MessageCenter. |
| 17 | class MESSAGE_CENTER_EXPORT MessageCenterObserver { |
| 18 | public: |
[email protected] | 1ca29cd | 2013-04-25 06:13:48 | [diff] [blame] | 19 | virtual ~MessageCenterObserver() {} |
| 20 | |
[email protected] | 2985f67a | 2013-04-12 21:07:44 | [diff] [blame] | 21 | // Called when the notification associated with |notification_id| is added |
| 22 | // to the notification_list. |
| 23 | virtual void OnNotificationAdded(const std::string& notification_id) {} |
| 24 | |
| 25 | // Called when the notification associated with |notification_id| is removed |
| 26 | // from the notification_list. |
| 27 | virtual void OnNotificationRemoved(const std::string& notification_id, |
| 28 | bool by_user) {} |
| 29 | |
| 30 | // Called when the contents of the notification associated with |
| 31 | // |notification_id| is updated. |
| 32 | virtual void OnNotificationUpdated(const std::string& notification_id) {} |
| 33 | |
| 34 | // Called when a click event happens on the notification associated with |
| 35 | // |notification_id|. |
| 36 | virtual void OnNotificationClicked(const std::string& notification_id) {} |
| 37 | |
| 38 | // Called when a click event happens on a button indexed by |button_index| |
| 39 | // of the notification associated with |notification_id|. |
| 40 | virtual void OnNotificationButtonClicked(const std::string& notification_id, |
| 41 | int button_index) {} |
| 42 | |
Tetsui Ohkubo | af6a159 | 2017-11-16 03:35:05 | [diff] [blame] | 43 | // Called when a click event happens on a button with an input indexed by |
| 44 | // |button_index| of the notification associated with |notification_id|. |
| 45 | virtual void OnNotificationButtonClickedWithReply( |
| 46 | const std::string& notification_id, |
| 47 | int button_index, |
| 48 | const base::string16& reply) {} |
| 49 | |
peter | 9b6e3c7 | 2017-04-10 18:35:45 | [diff] [blame] | 50 | // Called when notification settings button is clicked. The |handled| argument |
| 51 | // indicates whether the notification delegate already handled the operation. |
| 52 | virtual void OnNotificationSettingsClicked(bool handled) {} |
miguelg | b688a84 | 2015-10-21 13:19:21 | [diff] [blame] | 53 | |
[email protected] | 976f75d | 2013-04-23 01:08:24 | [diff] [blame] | 54 | // Called when the notification associated with |notification_id| is actually |
| 55 | // displayed. |
[email protected] | 47dd653 | 2014-05-08 05:08:25 | [diff] [blame] | 56 | virtual void OnNotificationDisplayed( |
| 57 | const std::string& notification_id, |
| 58 | const DisplaySource source) {} |
[email protected] | d560d4d | 2013-06-07 06:08:03 | [diff] [blame] | 59 | |
[email protected] | 826bb79 | 2013-09-11 13:48:41 | [diff] [blame] | 60 | // Called when the notification center is shown or hidden. |
| 61 | virtual void OnCenterVisibilityChanged(Visibility visibility) {} |
[email protected] | f528059f | 2013-08-28 08:23:59 | [diff] [blame] | 62 | |
| 63 | // Called whenever the quiet mode changes as a result of user action or when |
| 64 | // quiet mode expires. |
| 65 | virtual void OnQuietModeChanged(bool in_quiet_mode) {} |
[email protected] | 33aa554d | 2013-12-06 00:47:53 | [diff] [blame] | 66 | |
| 67 | // Called when the blocking state of |blocker| is changed. |
| 68 | virtual void OnBlockingStateChanged(NotificationBlocker* blocker) {} |
[email protected] | 2985f67a | 2013-04-12 21:07:44 | [diff] [blame] | 69 | }; |
| 70 | |
| 71 | } // namespace message_center |
| 72 | |
| 73 | #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_ |