1 // Copyright 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 #include "ui/message_center/notification_blocker.h"
7 #include "ui/message_center/message_center.h"
9 namespace message_center
{
11 NotificationBlocker::NotificationBlocker(MessageCenter
* message_center
)
12 : message_center_(message_center
) {
14 message_center_
->AddNotificationBlocker(this);
17 NotificationBlocker::~NotificationBlocker() {
19 message_center_
->RemoveNotificationBlocker(this);
22 void NotificationBlocker::AddObserver(NotificationBlocker::Observer
* observer
) {
23 observers_
.AddObserver(observer
);
26 void NotificationBlocker::RemoveObserver(
27 NotificationBlocker::Observer
* observer
) {
28 observers_
.RemoveObserver(observer
);
31 bool NotificationBlocker::ShouldShowNotification(
32 const NotifierId
& notifier_id
) const {
36 void NotificationBlocker::NotifyBlockingStateChanged() {
38 NotificationBlocker::Observer
, observers_
, OnBlockingStateChanged(this));
41 } // namespace message_center