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(
46      const std::string& notification_id,
47      const DisplaySource source) {}
48
49  // Called when the notification center is shown or hidden.
50  virtual void OnCenterVisibilityChanged(Visibility visibility) {}
51
52  // Called whenever the quiet mode changes as a result of user action or when
53  // quiet mode expires.
54  virtual void OnQuietModeChanged(bool in_quiet_mode) {}
55
56  // Called when the blocking state of |blocker| is changed.
57  virtual void OnBlockingStateChanged(NotificationBlocker* blocker) {}
58};
59
60}  // namespace message_center
61
62#endif  // UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_
63