summaryrefslogtreecommitdiff
path: root/chromium/ui/message_center/notification_blocker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/message_center/notification_blocker.cc')
-rw-r--r--chromium/ui/message_center/notification_blocker.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/chromium/ui/message_center/notification_blocker.cc b/chromium/ui/message_center/notification_blocker.cc
new file mode 100644
index 00000000000..6d6c5d3ce16
--- /dev/null
+++ b/chromium/ui/message_center/notification_blocker.cc
@@ -0,0 +1,31 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/message_center/notification_blocker.h"
+
+#include "ui/message_center/message_center.h"
+
+namespace message_center {
+
+NotificationBlocker::NotificationBlocker(MessageCenter* message_center)
+ : message_center_(message_center) {
+ if (message_center_)
+ message_center_->AddNotificationBlocker(this);
+}
+
+NotificationBlocker::~NotificationBlocker() {
+ if (message_center_)
+ message_center_->RemoveNotificationBlocker(this);
+}
+
+void NotificationBlocker::AddObserver(NotificationBlocker::Observer* observer) {
+ observers_.AddObserver(observer);
+}
+
+void NotificationBlocker::RemoveObserver(
+ NotificationBlocker::Observer* observer) {
+ observers_.RemoveObserver(observer);
+}
+
+} // namespace message_center