OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chrome/browser/notifications/stub_notification_display_service.h" | 5 #include "chrome/browser/notifications/stub_notification_display_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 std::remove_if( | 71 std::remove_if( |
72 notifications_.begin(), notifications_.end(), | 72 notifications_.begin(), notifications_.end(), |
73 [notification_type, notification_id](const NotificationData& data) { | 73 [notification_type, notification_id](const NotificationData& data) { |
74 return data.first == notification_type && | 74 return data.first == notification_type && |
75 data.second.delegate_id() == notification_id; | 75 data.second.delegate_id() == notification_id; |
76 }), | 76 }), |
77 notifications_.end()); | 77 notifications_.end()); |
78 } | 78 } |
79 | 79 |
80 void StubNotificationDisplayService::GetDisplayed( | 80 void StubNotificationDisplayService::GetDisplayed( |
81 const DisplayedNotificationsCallback& callback) const { | 81 const DisplayedNotificationsCallback& callback) { |
82 std::unique_ptr<std::set<std::string>> notifications = | 82 std::unique_ptr<std::set<std::string>> notifications = |
83 base::MakeUnique<std::set<std::string>>(); | 83 base::MakeUnique<std::set<std::string>>(); |
84 | 84 |
85 for (const auto& notification_data : notifications_) | 85 for (const auto& notification_data : notifications_) |
86 notifications->insert(notification_data.second.delegate_id()); | 86 notifications->insert(notification_data.second.delegate_id()); |
87 | 87 |
88 callback.Run(std::move(notifications), true /* supports_synchronization */); | 88 callback.Run(std::move(notifications), true /* supports_synchronization */); |
89 } | 89 } |
OLD | NEW |