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 "build/build_config.h" | 8 #include "build/build_config.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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 // Dispatches the given notification action event on | 88 // Dispatches the given notification action event on |
89 // |service_worker_registration| if the registration was available. Must be | 89 // |service_worker_registration| if the registration was available. Must be |
90 // called on the IO thread. | 90 // called on the IO thread. |
91 void DispatchNotificationEventOnRegistration( | 91 void DispatchNotificationEventOnRegistration( |
92 const NotificationDatabaseData& notification_database_data, | 92 const NotificationDatabaseData& notification_database_data, |
93 const scoped_refptr<PlatformNotificationContext>& notification_context, | 93 const scoped_refptr<PlatformNotificationContext>& notification_context, |
94 const NotificationOperationCallback& dispatch_event_action, | 94 const NotificationOperationCallback& dispatch_event_action, |
95 const NotificationDispatchCompleteCallback& dispatch_error_callback, | 95 const NotificationDispatchCompleteCallback& dispatch_error_callback, |
96 ServiceWorkerStatusCode service_worker_status, | 96 ServiceWorkerStatusCode service_worker_status, |
97 const scoped_refptr<ServiceWorkerRegistration>& | 97 scoped_refptr<ServiceWorkerRegistration> service_worker_registration) { |
98 service_worker_registration) { | |
99 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 98 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
100 #if defined(OS_ANDROID) | 99 #if defined(OS_ANDROID) |
101 // This LOG(INFO) deliberately exists to help track down the cause of | 100 // This LOG(INFO) deliberately exists to help track down the cause of |
102 // https://crbug.com/534537, where notifications sometimes do not react to | 101 // https://crbug.com/534537, where notifications sometimes do not react to |
103 // the user clicking on them. It should be removed once that's fixed. | 102 // the user clicking on them. It should be removed once that's fixed. |
104 LOG(INFO) << "Trying to dispatch notification for SW with status: " | 103 LOG(INFO) << "Trying to dispatch notification for SW with status: " |
105 << service_worker_status; | 104 << service_worker_status; |
106 #endif | 105 #endif |
107 if (service_worker_status == SERVICE_WORKER_OK) { | 106 if (service_worker_status == SERVICE_WORKER_OK) { |
108 DCHECK(service_worker_registration->active_version()); | 107 DCHECK(service_worker_registration->active_version()); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 const GURL& origin, | 374 const GURL& origin, |
376 bool by_user, | 375 bool by_user, |
377 const NotificationDispatchCompleteCallback& dispatch_complete_callback) { | 376 const NotificationDispatchCompleteCallback& dispatch_complete_callback) { |
378 DispatchNotificationEvent(browser_context, persistent_notification_id, origin, | 377 DispatchNotificationEvent(browser_context, persistent_notification_id, origin, |
379 base::Bind(&DoDispatchNotificationCloseEvent, | 378 base::Bind(&DoDispatchNotificationCloseEvent, |
380 by_user, dispatch_complete_callback), | 379 by_user, dispatch_complete_callback), |
381 dispatch_complete_callback); | 380 dispatch_complete_callback); |
382 } | 381 } |
383 | 382 |
384 } // namespace content | 383 } // namespace content |
OLD | NEW |