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 8 #include <string> 9 10 #include "ui/message_center/message_center_export.h" 11 12 namespace message_center { 13 14 // An observer class for the change of notifications in the MessageCenter. 15 class MESSAGE_CENTER_EXPORT MessageCenterObserver { 16 public: 17 virtual ~MessageCenterObserver() {} 18 19 // Called when the notification associated with |notification_id| is added 20 // to the notification_list. 21 virtual void OnNotificationAdded(const std::string& notification_id) {} 22 23 // Called when the notification associated with |notification_id| is removed 24 // from the notification_list. 25 virtual void OnNotificationRemoved(const std::string& notification_id, 26 bool by_user) {} 27 28 // Called when the contents of the notification associated with 29 // |notification_id| is updated. 30 virtual void OnNotificationUpdated(const std::string& notification_id) {} 31 32 // Called when a click event happens on the notification associated with 33 // |notification_id|. 34 virtual void OnNotificationClicked(const std::string& notification_id) {} 35 36 // Called when a click event happens on a button indexed by |button_index| 37 // of the notification associated with |notification_id|. 38 virtual void OnNotificationButtonClicked(const std::string& notification_id, 39 int button_index) {} 40 41 // Called when the notification associated with |notification_id| is actually 42 // displayed. 43 virtual void OnNotificationDisplayed(const std::string& notification_id) {} 44 45 // Called when the notification list is no longer being displayed as a 46 // notification center. 47 virtual void OnNotificationCenterClosed() {} 48 }; 49 50 } // namespace message_center 51 52 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_ 53