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

Unified Diff: Source/modules/notifications/PageNotificationEvent.h

Issue 1280913002: Deliver action clicks to page notifications (blink) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@click_test
Patch Set: Created 5 years, 4 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: Source/modules/notifications/PageNotificationEvent.h
diff --git a/Source/modules/notifications/PageNotificationEvent.h b/Source/modules/notifications/PageNotificationEvent.h
new file mode 100644
index 0000000000000000000000000000000000000000..613591bb284a344e75f43bebc295dc31545c4e8b
--- /dev/null
+++ b/Source/modules/notifications/PageNotificationEvent.h
@@ -0,0 +1,49 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PageNotificationEvent_h
+#define PageNotificationEvent_h
+
+#include "modules/EventModules.h"
+#include "modules/ModulesExport.h"
+#include "modules/notifications/PageNotificationEventInit.h"
+#include "platform/heap/Handle.h"
+#include "wtf/text/WTFString.h"
+
+namespace blink {
+
+class MODULES_EXPORT PageNotificationEvent final : public Event {
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ static PassRefPtrWillBeRawPtr<PageNotificationEvent> create()
+ {
+ return adoptRefWillBeNoop(new PageNotificationEvent);
+ }
+ static PassRefPtrWillBeRawPtr<PageNotificationEvent> create(const AtomicString& type, const PageNotificationEventInit& initializer)
+ {
+ return adoptRefWillBeNoop(new PageNotificationEvent(type, initializer));
+ }
+
+ String action() const { return m_action; }
+
+ const AtomicString& interfaceName() const override { return EventNames::PageNotificationEvent; }
+
+ DEFINE_INLINE_VIRTUAL_TRACE() { Event::trace(visitor); }
+
+private:
+ PageNotificationEvent() { }
+
+ PageNotificationEvent(const AtomicString& type, const PageNotificationEventInit& initializer)
+ : Event(type, initializer)
+ {
+ if (initializer.hasAction())
Peter Beverloo 2015/08/07 07:25:25 --> .cpp
+ m_action = initializer.action();
+ }
+
+ String m_action;
+};
+
+} // namespace blink
+
+#endif // PageNotificationEvent_h

Powered by Google App Engine
This is Rietveld 408576698