Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(936)

Unified Diff: content/browser/notifications/notification_event_dispatcher_impl.h

Issue 1619703002: Implement notificationclose event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698