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.
5 #ifndef UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_
6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_
10 #include "ui/message_center/message_center_export.h"
11 #include "ui/message_center/message_center_types.h"
13 namespace message_center
{
14 class NotificationBlocker
;
16 // An observer class for the change of notifications in the MessageCenter.
17 class MESSAGE_CENTER_EXPORT MessageCenterObserver
{
19 virtual ~MessageCenterObserver() {}
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
) {}
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
,
30 // Called when the contents of the notification associated with
31 // |notification_id| is updated.
32 virtual void OnNotificationUpdated(const std::string
& notification_id
) {}
34 // Called when a click event happens on the notification associated with
36 virtual void OnNotificationClicked(const std::string
& notification_id
) {}
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
,
43 // Called when the notification associated with |notification_id| is actually
45 virtual void OnNotificationDisplayed(
46 const std::string
& notification_id
,
47 const DisplaySource source
) {}
49 // Called when the notification center is shown or hidden.
50 virtual void OnCenterVisibilityChanged(Visibility visibility
) {}
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
) {}
56 // Called when the blocking state of |blocker| is changed.
57 virtual void OnBlockingStateChanged(NotificationBlocker
* blocker
) {}
60 } // namespace message_center
62 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_OBSERVER_H_