summaryrefslogtreecommitdiff
path: root/chromium/ui/message_center/message_center_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/message_center/message_center_impl.cc')
-rw-r--r--chromium/ui/message_center/message_center_impl.cc21
1 files changed, 9 insertions, 12 deletions
diff --git a/chromium/ui/message_center/message_center_impl.cc b/chromium/ui/message_center/message_center_impl.cc
index c1a9e122cad..07cbe104ca0 100644
--- a/chromium/ui/message_center/message_center_impl.cc
+++ b/chromium/ui/message_center/message_center_impl.cc
@@ -21,7 +21,7 @@
#include "ui/message_center/notification_blocker.h"
#include "ui/message_center/notification_list.h"
#include "ui/message_center/notification_types.h"
-#include "ui/message_center/popup_timer.h"
+#include "ui/message_center/popup_timers_controller.h"
namespace message_center {
namespace internal {
@@ -643,23 +643,20 @@ void MessageCenterImpl::RemoveNotificationsForNotifierId(
}
}
-void MessageCenterImpl::RemoveAllNotifications(bool by_user) {
- // Using not |blockers_| but an empty list since it wants to remove literally
- // all notifications.
- RemoveNotifications(by_user, NotificationBlockers());
-}
+void MessageCenterImpl::RemoveAllNotifications(bool by_user, RemoveType type) {
+ bool remove_pinned = (type == RemoveType::NON_PINNED);
-void MessageCenterImpl::RemoveAllVisibleNotifications(bool by_user) {
- RemoveNotifications(by_user, blockers_);
-}
+ const NotificationBlockers& blockers =
+ (type == RemoveType::ALL ? NotificationBlockers() /* empty blockers */
+ : blockers_ /* use default blockers */);
-void MessageCenterImpl::RemoveNotifications(
- bool by_user,
- const NotificationBlockers& blockers) {
const NotificationList::Notifications notifications =
notification_list_->GetVisibleNotifications(blockers);
std::set<std::string> ids;
for (const auto& notification : notifications) {
+ if (!remove_pinned && notification->pinned())
+ continue;
+
ids.insert(notification->id());
scoped_refptr<NotificationDelegate> delegate = notification->delegate();
if (delegate.get())