Index: content/browser/notifications/notification_event_dispatcher_impl.h |
diff --git a/content/browser/notifications/notification_event_dispatcher_impl.h b/content/browser/notifications/notification_event_dispatcher_impl.h |
index fbc5d429f272edd3800662c4f4c40c3e43c7dab6..748d6ded1d001dd40e2a0ba59694caa28ffec8ae 100644 |
--- a/content/browser/notifications/notification_event_dispatcher_impl.h |
+++ b/content/browser/notifications/notification_event_dispatcher_impl.h |
@@ -9,29 +9,57 @@ |
#include "base/macros.h" |
#include "base/memory/singleton.h" |
+#include "content/public/browser/notification_database_data.h" |
#include "content/public/browser/notification_event_dispatcher.h" |
namespace content { |
+class PlatformNotificationContext; |
+class ServiceWorkerRegistration; |
+ |
class NotificationEventDispatcherImpl : public NotificationEventDispatcher { |
public: |
// Returns the instance of the NotificationEventDispatcherImpl. Must be called |
// on the UI thread. |
static NotificationEventDispatcherImpl* GetInstance(); |
+ using NotificationActionCallback = |
+ base::Callback<void(const ServiceWorkerRegistration*, |
+ const NotificationDatabaseData&)>; |
+ |
+ using CurriedNotificationActionCallback = |
+ base::Callback<void(scoped_refptr<PlatformNotificationContext>, |
+ const ServiceWorkerRegistration*, |
+ const NotificationDatabaseData&)>; |
+ |
// NotificationEventDispatcher implementation. |
void DispatchNotificationClickEvent( |
BrowserContext* browser_context, |
int64_t persistent_notification_id, |
const GURL& origin, |
int action_index, |
- const NotificationClickDispatchCompleteCallback& |
- dispatch_complete_callback) override; |
+ const NotificationDispatchCompleteCallback& dispatch_complete_callback) |
+ override; |
+ void DispatchNotificationCloseEvent( |
+ BrowserContext* browser_context, |
+ int64_t persistent_notification_id, |
+ const GURL& origin, |
+ const NotificationDispatchCompleteCallback& dispatch_complete_callback) |
+ override; |
private: |
NotificationEventDispatcherImpl(); |
~NotificationEventDispatcherImpl() override; |
+ // Dispatches any notification event. The actual, specific event dispatch |
+ // should be done by the |notification_action_callback|. |
+ void DispatchNotificationEvent( |
Peter Beverloo
2016/01/26 16:13:45
Is there a reason that we'd like to expose this in
Nina
2016/01/27 18:48:58
No reason - fixed.
|
+ BrowserContext* browser_context, |
+ int64_t persistent_notification_id, |
+ const GURL& origin, |
+ const CurriedNotificationActionCallback& notification_action_callback, |
+ const NotificationDispatchCompleteCallback& notification_error_callback); |
+ |
friend struct base::DefaultSingletonTraits<NotificationEventDispatcherImpl>; |
DISALLOW_COPY_AND_ASSIGN(NotificationEventDispatcherImpl); |