Avi Drissman | 4a8573c | 2022-09-09 19:35:54 | [diff] [blame] | 1 | // Copyright 2020 The Chromium Authors |
Richard Knoll | e100fd2 | 2020-09-24 15:45:17 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "chrome/browser/notifications/notification_blocker.h" |
| 6 | |
David Sanders | 97aac0de | 2022-02-07 14:33:53 | [diff] [blame] | 7 | #include "base/observer_list.h" |
| 8 | |
Richard Knoll | e100fd2 | 2020-09-24 15:45:17 | [diff] [blame] | 9 | NotificationBlocker::NotificationBlocker() = default; |
| 10 | |
| 11 | NotificationBlocker::~NotificationBlocker() = default; |
| 12 | |
| 13 | void NotificationBlocker::NotifyBlockingStateChanged() { |
| 14 | for (auto& observer : observers_) |
| 15 | observer.OnBlockingStateChanged(); |
| 16 | } |
| 17 | |
| 18 | void NotificationBlocker::AddObserver(Observer* observer) { |
| 19 | observers_.AddObserver(observer); |
| 20 | } |
| 21 | |
| 22 | void NotificationBlocker::RemoveObserver(Observer* observer) { |
| 23 | observers_.RemoveObserver(observer); |
| 24 | } |