blob: feb358bd0a98f25f0fa3f112bef2282eaa6cf2cd [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
[email protected]b754bc242013-05-13 20:12:268#include <string>
9
[email protected]2985f67a2013-04-12 21:07:4410#include "ui/message_center/message_center_export.h"
[email protected]826bb792013-09-11 13:48:4111#include "ui/message_center/message_center_types.h"
[email protected]2985f67a2013-04-12 21:07:4412
13namespace message_center {
[email protected]33aa554d2013-12-06 00:47:5314class NotificationBlocker;
[email protected]2985f67a2013-04-12 21:07:4415
16// An observer class for the change of notifications in the MessageCenter.
17class MESSAGE_CENTER_EXPORT MessageCenterObserver {
18 public:
[email protected]1ca29cd2013-04-25 06:13:4819 virtual ~MessageCenterObserver() {}
20
[email protected]2985f67a2013-04-12 21:07:4421 // 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
Tetsui Ohkuboaf6a1592017-11-16 03:35:0543 // Called when a click event happens on a button with an input indexed by
44 // |button_index| of the notification associated with |notification_id|.
45 virtual void OnNotificationButtonClickedWithReply(
46 const std::string& notification_id,
47 int button_index,
48 const base::string16& reply) {}
49
peter9b6e3c72017-04-10 18:35:4550 // Called when notification settings button is clicked. The |handled| argument
51 // indicates whether the notification delegate already handled the operation.
52 virtual void OnNotificationSettingsClicked(bool handled) {}
miguelgb688a842015-10-21 13:19:2153
[email protected]976f75d2013-04-23 01:08:2454 // Called when the notification associated with |notification_id| is actually
55 // displayed.
[email protected]47dd6532014-05-08 05:08:2556 virtual void OnNotificationDisplayed(
57 const std::string& notification_id,
58 const DisplaySource source) {}
[email protected]d560d4d2013-06-07 06:08:0359
[email protected]826bb792013-09-11 13:48:4160 // Called when the notification center is shown or hidden.
61 virtual void OnCenterVisibilityChanged(Visibility visibility) {}
[email protected]f528059f2013-08-28 08:23:5962
63 // Called whenever the quiet mode changes as a result of user action or when
64 // quiet mode expires.
65 virtual void OnQuietModeChanged(bool in_quiet_mode) {}
[email protected]33aa554d2013-12-06 00:47:5366
67 // Called when the blocking state of |blocker| is changed.
68 virtual void OnBlockingStateChanged(NotificationBlocker* blocker) {}
[email protected]2985f67a2013-04-12 21:07:4469};
70
71} // namespace message_center
72
73#endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_