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