| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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_OBSERVER_H_ | 5 #ifndef UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_ |
| 6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_ | 6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ui/message_center/message_center_export.h" | 10 #include "ui/message_center/message_center_export.h" |
| 11 #include "ui/message_center/message_center_types.h" |
| 11 | 12 |
| 12 namespace message_center { | 13 namespace message_center { |
| 13 | 14 |
| 14 // An observer class for the change of notifications in the MessageCenter. | 15 // An observer class for the change of notifications in the MessageCenter. |
| 15 class MESSAGE_CENTER_EXPORT MessageCenterObserver { | 16 class MESSAGE_CENTER_EXPORT MessageCenterObserver { |
| 16 public: | 17 public: |
| 17 virtual ~MessageCenterObserver() {} | 18 virtual ~MessageCenterObserver() {} |
| 18 | 19 |
| 19 // Called when the notification associated with |notification_id| is added | 20 // Called when the notification associated with |notification_id| is added |
| 20 // to the notification_list. | 21 // to the notification_list. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 35 | 36 |
| 36 // Called when a click event happens on a button indexed by |button_index| | 37 // Called when a click event happens on a button indexed by |button_index| |
| 37 // of the notification associated with |notification_id|. | 38 // of the notification associated with |notification_id|. |
| 38 virtual void OnNotificationButtonClicked(const std::string& notification_id, | 39 virtual void OnNotificationButtonClicked(const std::string& notification_id, |
| 39 int button_index) {} | 40 int button_index) {} |
| 40 | 41 |
| 41 // Called when the notification associated with |notification_id| is actually | 42 // Called when the notification associated with |notification_id| is actually |
| 42 // displayed. | 43 // displayed. |
| 43 virtual void OnNotificationDisplayed(const std::string& notification_id) {} | 44 virtual void OnNotificationDisplayed(const std::string& notification_id) {} |
| 44 | 45 |
| 45 // Called when the notification list is no longer being displayed as a | 46 // Called when the notification center is shown or hidden. |
| 46 // notification center. | 47 virtual void OnCenterVisibilityChanged(Visibility visibility) {} |
| 47 virtual void OnNotificationCenterClosed() {} | |
| 48 | 48 |
| 49 // Called whenever the quiet mode changes as a result of user action or when | 49 // Called whenever the quiet mode changes as a result of user action or when |
| 50 // quiet mode expires. | 50 // quiet mode expires. |
| 51 virtual void OnQuietModeChanged(bool in_quiet_mode) {} | 51 virtual void OnQuietModeChanged(bool in_quiet_mode) {} |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace message_center | 54 } // namespace message_center |
| 55 | 55 |
| 56 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_ | 56 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_ |
| OLD | NEW |