| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/notification_list.h" | 5 #include "ui/message_center/notification_list.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 return false; | 54 return false; |
| 55 return false; | 55 return false; |
| 56 } | 56 } |
| 57 | 57 |
| 58 NotificationList::NotificationList(MessageCenter* message_center) | 58 NotificationList::NotificationList(MessageCenter* message_center) |
| 59 : message_center_(message_center), | 59 : message_center_(message_center), |
| 60 quiet_mode_(false) { | 60 quiet_mode_(false) { |
| 61 } | 61 } |
| 62 | 62 |
| 63 NotificationList::~NotificationList() { | 63 NotificationList::~NotificationList() { |
| 64 STLDeleteContainerPointers(notifications_.begin(), notifications_.end()); | 64 base::STLDeleteContainerPointers(notifications_.begin(), |
| 65 notifications_.end()); |
| 65 } | 66 } |
| 66 | 67 |
| 67 void NotificationList::SetNotificationsShown( | 68 void NotificationList::SetNotificationsShown( |
| 68 const NotificationBlockers& blockers, | 69 const NotificationBlockers& blockers, |
| 69 std::set<std::string>* updated_ids) { | 70 std::set<std::string>* updated_ids) { |
| 70 Notifications notifications = GetVisibleNotifications(blockers); | 71 Notifications notifications = GetVisibleNotifications(blockers); |
| 71 | 72 |
| 72 for (auto iter = notifications.begin(); iter != notifications.end(); ++iter) { | 73 for (auto iter = notifications.begin(); iter != notifications.end(); ++iter) { |
| 73 Notification* notification = *iter; | 74 Notification* notification = *iter; |
| 74 bool was_popup = notification->shown_as_popup(); | 75 bool was_popup = notification->shown_as_popup(); |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 notification->set_shown_as_popup(message_center_->IsMessageCenterVisible() | 344 notification->set_shown_as_popup(message_center_->IsMessageCenterVisible() |
| 344 || quiet_mode_ | 345 || quiet_mode_ |
| 345 || notification->shown_as_popup()); | 346 || notification->shown_as_popup()); |
| 346 } | 347 } |
| 347 // Take ownership. The notification can only be removed from the list | 348 // Take ownership. The notification can only be removed from the list |
| 348 // in EraseNotification(), which will delete it. | 349 // in EraseNotification(), which will delete it. |
| 349 notifications_.insert(notification.release()); | 350 notifications_.insert(notification.release()); |
| 350 } | 351 } |
| 351 | 352 |
| 352 } // namespace message_center | 353 } // namespace message_center |
| OLD | NEW |