blob: 54255aba82277177fba512890aeceead4d39e2da [file] [log] [blame]
[email protected]2985f67a2013-04-12 21:07:441// 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 // Called when the notification associated with |notification_id| is added
16 // to the notification_list.
17 virtual void OnNotificationAdded(const std::string& notification_id) {}
18
19 // Called when the notification associated with |notification_id| is removed
20 // from the notification_list.
21 virtual void OnNotificationRemoved(const std::string& notification_id,
22 bool by_user) {}
23
24 // Called when the contents of the notification associated with
25 // |notification_id| is updated.
26 virtual void OnNotificationUpdated(const std::string& notification_id) {}
27
28 // Called when a click event happens on the notification associated with
29 // |notification_id|.
30 virtual void OnNotificationClicked(const std::string& notification_id) {}
31
32 // Called when a click event happens on a button indexed by |button_index|
33 // of the notification associated with |notification_id|.
34 virtual void OnNotificationButtonClicked(const std::string& notification_id,
35 int button_index) {}
36
37 protected:
38 virtual ~MessageCenterObserver() {}
39};
40
41} // namespace message_center
42
43#endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_