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#include "ui/message_center/message_center_types.h" 12 13namespace message_center { 14class NotificationBlocker; 15 16// An observer class for the change of notifications in the MessageCenter. 17class MESSAGE_CENTER_EXPORT MessageCenterObserver { 18 public: 19 virtual ~MessageCenterObserver() {} 20 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 43 // Called when the notification associated with |notification_id| is actually 44 // displayed. 45 virtual void OnNotificationDisplayed(const std::string& notification_id) {} 46 47 // Called when the notification center is shown or hidden. 48 virtual void OnCenterVisibilityChanged(Visibility visibility) {} 49 50 // Called whenever the quiet mode changes as a result of user action or when 51 // quiet mode expires. 52 virtual void OnQuietModeChanged(bool in_quiet_mode) {} 53 54 // Called when the blocking state of |blocker| is changed. 55 virtual void OnBlockingStateChanged(NotificationBlocker* blocker) {} 56}; 57 58} // namespace message_center 59 60#endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_ 61