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" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "ui/gfx/image/image.h" | 13 #include "ui/gfx/image/image.h" |
14 #include "ui/message_center/message_center.h" | 14 #include "ui/message_center/message_center.h" |
15 #include "ui/message_center/message_center_style.h" | 15 #include "ui/message_center/message_center_style.h" |
16 #include "ui/message_center/notification.h" | 16 #include "ui/message_center/notification.h" |
17 #include "ui/message_center/notification_blocker.h" | 17 #include "ui/message_center/notification_blocker.h" |
18 #include "ui/message_center/notification_types.h" | 18 #include "ui/message_center/notification_types.h" |
19 | 19 |
20 namespace message_center { | 20 namespace message_center { |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 bool ShouldShowNotificationAsPopup( | 24 bool ShouldShowNotificationAsPopup( |
25 const Notification& notification, | 25 const Notification& notification, |
26 const NotificationBlockers& blockers) { | 26 const NotificationBlockers& blockers) { |
27 for (const auto& blocker : blockers) { | 27 for (auto* blocker : blockers) { |
28 if (!blocker->ShouldShowNotificationAsPopup(notification)) | 28 if (!blocker->ShouldShowNotificationAsPopup(notification)) |
29 return false; | 29 return false; |
30 } | 30 } |
31 return true; | 31 return true; |
32 } | 32 } |
33 | 33 |
34 } // namespace | 34 } // namespace |
35 | 35 |
36 bool ComparePriorityTimestampSerial::operator()(Notification* n1, | 36 bool ComparePriorityTimestampSerial::operator()(Notification* n1, |
37 Notification* n2) { | 37 Notification* n2) { |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 notification->set_shown_as_popup(message_center_->IsMessageCenterVisible() | 333 notification->set_shown_as_popup(message_center_->IsMessageCenterVisible() |
334 || quiet_mode_ | 334 || quiet_mode_ |
335 || notification->shown_as_popup()); | 335 || notification->shown_as_popup()); |
336 } | 336 } |
337 // Take ownership. The notification can only be removed from the list | 337 // Take ownership. The notification can only be removed from the list |
338 // in EraseNotification(), which will delete it. | 338 // in EraseNotification(), which will delete it. |
339 notifications_.insert(std::move(notification)); | 339 notifications_.insert(std::move(notification)); |
340 } | 340 } |
341 | 341 |
342 } // namespace message_center | 342 } // namespace message_center |
OLD | NEW |