| 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/browser/notifications/notification_event_dispatcher_impl.h" | 5 #include "content/browser/notifications/notification_event_dispatcher_impl.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "content/browser/notifications/platform_notification_context_impl.h" | 8 #include "content/browser/notifications/platform_notification_context_impl.h" |
| 9 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 9 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 10 #include "content/browser/service_worker/service_worker_registration.h" | 10 #include "content/browser/service_worker/service_worker_registration.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 127 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 128 if (!success) { | 128 if (!success) { |
| 129 BrowserThread::PostTask( | 129 BrowserThread::PostTask( |
| 130 BrowserThread::UI, | 130 BrowserThread::UI, |
| 131 FROM_HERE, | 131 FROM_HERE, |
| 132 base::Bind(dispatch_complete_callback, | 132 base::Bind(dispatch_complete_callback, |
| 133 PERSISTENT_NOTIFICATION_STATUS_DATABASE_ERROR)); | 133 PERSISTENT_NOTIFICATION_STATUS_DATABASE_ERROR)); |
| 134 return; | 134 return; |
| 135 } | 135 } |
| 136 | 136 |
| 137 service_worker_context->context()->storage()->FindRegistrationForId( | 137 service_worker_context->FindRegistrationForId( |
| 138 notification_database_data.service_worker_registration_id, | 138 notification_database_data.service_worker_registration_id, |
| 139 origin, | 139 origin, |
| 140 base::Bind(&DispatchNotificationClickEventOnRegistration, | 140 base::Bind(&DispatchNotificationClickEventOnRegistration, |
| 141 notification_database_data, | 141 notification_database_data, |
| 142 dispatch_complete_callback)); | 142 dispatch_complete_callback)); |
| 143 } | 143 } |
| 144 | 144 |
| 145 // Reads the data associated with the |persistent_notification_id| belonging to | 145 // Reads the data associated with the |persistent_notification_id| belonging to |
| 146 // |origin| from the notification context. | 146 // |origin| from the notification context. |
| 147 void ReadNotificationDatabaseData( | 147 void ReadNotificationDatabaseData( |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 FROM_HERE, | 200 FROM_HERE, |
| 201 base::Bind(&ReadNotificationDatabaseData, | 201 base::Bind(&ReadNotificationDatabaseData, |
| 202 persistent_notification_id, | 202 persistent_notification_id, |
| 203 origin, | 203 origin, |
| 204 dispatch_complete_callback, | 204 dispatch_complete_callback, |
| 205 service_worker_context, | 205 service_worker_context, |
| 206 notification_context)); | 206 notification_context)); |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace content | 209 } // namespace content |
| OLD | NEW |