| 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 "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "content/browser/notifications/platform_notification_context_impl.h" | 9 #include "content/browser/notifications/platform_notification_context_impl.h" |
| 10 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 10 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 133 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 134 if (!success) { | 134 if (!success) { |
| 135 BrowserThread::PostTask( | 135 BrowserThread::PostTask( |
| 136 BrowserThread::UI, | 136 BrowserThread::UI, |
| 137 FROM_HERE, | 137 FROM_HERE, |
| 138 base::Bind(dispatch_complete_callback, | 138 base::Bind(dispatch_complete_callback, |
| 139 PERSISTENT_NOTIFICATION_STATUS_DATABASE_ERROR)); | 139 PERSISTENT_NOTIFICATION_STATUS_DATABASE_ERROR)); |
| 140 return; | 140 return; |
| 141 } | 141 } |
| 142 | 142 |
| 143 service_worker_context->context()->storage()->FindRegistrationForId( | 143 service_worker_context->FindRegistrationForId( |
| 144 notification_database_data.service_worker_registration_id, | 144 notification_database_data.service_worker_registration_id, |
| 145 origin, | 145 origin, |
| 146 base::Bind(&DispatchNotificationClickEventOnRegistration, | 146 base::Bind(&DispatchNotificationClickEventOnRegistration, |
| 147 notification_database_data, | 147 notification_database_data, |
| 148 dispatch_complete_callback)); | 148 dispatch_complete_callback)); |
| 149 } | 149 } |
| 150 | 150 |
| 151 // Reads the data associated with the |persistent_notification_id| belonging to | 151 // Reads the data associated with the |persistent_notification_id| belonging to |
| 152 // |origin| from the notification context. | 152 // |origin| from the notification context. |
| 153 void ReadNotificationDatabaseData( | 153 void ReadNotificationDatabaseData( |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 FROM_HERE, | 206 FROM_HERE, |
| 207 base::Bind(&ReadNotificationDatabaseData, | 207 base::Bind(&ReadNotificationDatabaseData, |
| 208 persistent_notification_id, | 208 persistent_notification_id, |
| 209 origin, | 209 origin, |
| 210 dispatch_complete_callback, | 210 dispatch_complete_callback, |
| 211 service_worker_context, | 211 service_worker_context, |
| 212 notification_context)); | 212 notification_context)); |
| 213 } | 213 } |
| 214 | 214 |
| 215 } // namespace content | 215 } // namespace content |
| OLD | NEW |