Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: ui/message_center/message_center_impl.cc

Issue 2313923002: Don't close pinned notification by the close all button (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/message_center/message_center_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/message_center/message_center_impl.h" 5 #include "ui/message_center/message_center_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 notification_list_->GetNotificationsByNotifierId(notifier_id); 643 notification_list_->GetNotificationsByNotifierId(notifier_id);
644 for (auto* notification : notifications) 644 for (auto* notification : notifications)
645 RemoveNotification(notification->id(), false); 645 RemoveNotification(notification->id(), false);
646 if (!notifications.empty()) { 646 if (!notifications.empty()) {
647 notification_cache_.Rebuild( 647 notification_cache_.Rebuild(
648 notification_list_->GetVisibleNotifications(blockers_)); 648 notification_list_->GetVisibleNotifications(blockers_));
649 } 649 }
650 } 650 }
651 651
652 void MessageCenterImpl::RemoveAllNotifications(bool by_user, RemoveType type) { 652 void MessageCenterImpl::RemoveAllNotifications(bool by_user, RemoveType type) {
653 bool remove_pinned = (type == RemoveType::NON_PINNED); 653 bool remove_pinned = (type == RemoveType::ALL);
654 654
655 const NotificationBlockers& blockers = 655 const NotificationBlockers& blockers =
656 (type == RemoveType::ALL ? NotificationBlockers() /* empty blockers */ 656 (type == RemoveType::ALL ? NotificationBlockers() /* empty blockers */
657 : blockers_ /* use default blockers */); 657 : blockers_ /* use default blockers */);
658 658
659 const NotificationList::Notifications notifications = 659 const NotificationList::Notifications notifications =
660 notification_list_->GetVisibleNotifications(blockers); 660 notification_list_->GetVisibleNotifications(blockers);
661 std::set<std::string> ids; 661 std::set<std::string> ids;
662 for (auto* notification : notifications) { 662 for (auto* notification : notifications) {
663 if (!remove_pinned && notification->pinned()) 663 if (!remove_pinned && notification->pinned())
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 } 901 }
902 902
903 void MessageCenterImpl::EnableChangeQueueForTest(bool enable) { 903 void MessageCenterImpl::EnableChangeQueueForTest(bool enable) {
904 if (enable) 904 if (enable)
905 notification_queue_.reset(new internal::ChangeQueue()); 905 notification_queue_.reset(new internal::ChangeQueue());
906 else 906 else
907 notification_queue_.reset(); 907 notification_queue_.reset();
908 } 908 }
909 909
910 } // namespace message_center 910 } // namespace message_center
OLDNEW
« no previous file with comments | « no previous file | ui/message_center/message_center_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698