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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 blink::WebNotificationDelegate* delegate) { | 202 blink::WebNotificationDelegate* delegate) { |
203 for (auto& iter : active_page_notifications_) { | 203 for (auto& iter : active_page_notifications_) { |
204 if (iter.second != delegate) | 204 if (iter.second != delegate) |
205 continue; | 205 continue; |
206 | 206 |
207 active_page_notifications_.erase(iter.first); | 207 active_page_notifications_.erase(iter.first); |
208 return; | 208 return; |
209 } | 209 } |
210 } | 210 } |
211 | 211 |
212 permissions::mojom::PermissionStatus NotificationManager::checkPermission( | 212 blink::mojom::PermissionStatus NotificationManager::checkPermission( |
213 const blink::WebSecurityOrigin& origin) { | 213 const blink::WebSecurityOrigin& origin) { |
214 permissions::mojom::PermissionStatus permission_status = | 214 blink::mojom::PermissionStatus permission_status = |
215 permissions::mojom::PermissionStatus::DENIED; | 215 blink::mojom::PermissionStatus::DENIED; |
216 | 216 |
217 // TODO(mkwst): This is potentially doing the wrong thing with unique | 217 // TODO(mkwst): This is potentially doing the wrong thing with unique |
218 // origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See | 218 // origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See |
219 // https://crbug.com/490074 for detail. | 219 // https://crbug.com/490074 for detail. |
220 thread_safe_sender_->Send(new PlatformNotificationHostMsg_CheckPermission( | 220 thread_safe_sender_->Send(new PlatformNotificationHostMsg_CheckPermission( |
221 blink::WebStringToGURL(origin.toString()), &permission_status)); | 221 blink::WebStringToGURL(origin.toString()), &permission_status)); |
222 | 222 |
223 return permission_status; | 223 return permission_status; |
224 } | 224 } |
225 | 225 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 300 |
301 notifications[i] = web_notification_info; | 301 notifications[i] = web_notification_info; |
302 } | 302 } |
303 | 303 |
304 callbacks->onSuccess(notifications); | 304 callbacks->onSuccess(notifications); |
305 | 305 |
306 pending_get_notification_requests_.Remove(request_id); | 306 pending_get_notification_requests_.Remove(request_id); |
307 } | 307 } |
308 | 308 |
309 } // namespace content | 309 } // namespace content |
OLD | NEW |