OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/notifications/notification_manager.h" | 5 #include "content/child/notifications/notification_manager.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
10 #include "base/threading/thread_local.h" | 10 #include "base/threading/thread_local.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 } | 134 } |
135 | 135 |
136 void NotificationManager::closePersistent( | 136 void NotificationManager::closePersistent( |
137 const blink::WebSerializedOrigin& origin, | 137 const blink::WebSerializedOrigin& origin, |
138 const blink::WebString& persistent_notification_id) { | 138 const blink::WebString& persistent_notification_id) { |
139 thread_safe_sender_->Send(new PlatformNotificationHostMsg_ClosePersistent( | 139 thread_safe_sender_->Send(new PlatformNotificationHostMsg_ClosePersistent( |
140 GURL(origin.string()), | 140 GURL(origin.string()), |
141 base::UTF16ToUTF8(persistent_notification_id))); | 141 base::UTF16ToUTF8(persistent_notification_id))); |
142 } | 142 } |
143 | 143 |
144 void NotificationManager::closePersistent( | |
145 const blink::WebString& persistent_notification_id) { | |
146 closePersistent(blink::WebSerializedOrigin(), persistent_notification_id); | |
147 } | |
148 | |
149 void NotificationManager::notifyDelegateDestroyed( | 144 void NotificationManager::notifyDelegateDestroyed( |
150 blink::WebNotificationDelegate* delegate) { | 145 blink::WebNotificationDelegate* delegate) { |
151 if (pending_notifications_.CancelPageNotificationFetches(delegate)) | 146 if (pending_notifications_.CancelPageNotificationFetches(delegate)) |
152 return; | 147 return; |
153 | 148 |
154 for (auto& iter : active_page_notifications_) { | 149 for (auto& iter : active_page_notifications_) { |
155 if (iter.second != delegate) | 150 if (iter.second != delegate) |
156 continue; | 151 continue; |
157 | 152 |
158 active_page_notifications_.erase(iter.first); | 153 active_page_notifications_.erase(iter.first); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 GURL(origin.string()), | 231 GURL(origin.string()), |
237 icon, | 232 icon, |
238 ToPlatformNotificationData(notification_data))); | 233 ToPlatformNotificationData(notification_data))); |
239 | 234 |
240 // There currently isn't a case in which the promise would be rejected per | 235 // There currently isn't a case in which the promise would be rejected per |
241 // our implementation, so always resolve it here. | 236 // our implementation, so always resolve it here. |
242 callbacks->onSuccess(); | 237 callbacks->onSuccess(); |
243 } | 238 } |
244 | 239 |
245 } // namespace content | 240 } // namespace content |
OLD | NEW |