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

Side by Side Diff: Source/modules/notifications/NotificationEvent.h

Issue 780963004: Use event init dictionaries in modules/{notifications,push_messaging,serviceworkers} (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/notifications/NotificationEvent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef NotificationEvent_h 5 #ifndef NotificationEvent_h
6 #define NotificationEvent_h 6 #define NotificationEvent_h
7 7
8 #include "modules/EventModules.h" 8 #include "modules/EventModules.h"
9 #include "modules/notifications/Notification.h" 9 #include "modules/notifications/Notification.h"
10 #include "modules/notifications/NotificationEventInit.h"
10 #include "modules/serviceworkers/ExtendableEvent.h" 11 #include "modules/serviceworkers/ExtendableEvent.h"
11 #include "platform/heap/Handle.h" 12 #include "platform/heap/Handle.h"
12 13
13 namespace blink { 14 namespace blink {
14 15
15 struct NotificationEventInit : public ExtendableEventInit {
16 NotificationEventInit();
17
18 Member<Notification> notification;
19 };
20
21 class NotificationEvent final : public ExtendableEvent { 16 class NotificationEvent final : public ExtendableEvent {
22 DEFINE_WRAPPERTYPEINFO(); 17 DEFINE_WRAPPERTYPEINFO();
23 public: 18 public:
24 static PassRefPtrWillBeRawPtr<NotificationEvent> create() 19 static PassRefPtrWillBeRawPtr<NotificationEvent> create()
25 { 20 {
26 return adoptRefWillBeNoop(new NotificationEvent); 21 return adoptRefWillBeNoop(new NotificationEvent);
27 } 22 }
28 static PassRefPtrWillBeRawPtr<NotificationEvent> create(const AtomicString& type, const NotificationEventInit& initializer) 23 static PassRefPtrWillBeRawPtr<NotificationEvent> create(const AtomicString& type, const NotificationEventInit& initializer)
29 { 24 {
30 return adoptRefWillBeNoop(new NotificationEvent(type, initializer)); 25 return adoptRefWillBeNoop(new NotificationEvent(type, initializer));
(...skipping 15 matching lines...) Expand all
46 NotificationEvent(); 41 NotificationEvent();
47 NotificationEvent(const AtomicString& type, const NotificationEventInit&); 42 NotificationEvent(const AtomicString& type, const NotificationEventInit&);
48 NotificationEvent(const AtomicString& type, const NotificationEventInit&, Wa itUntilObserver*); 43 NotificationEvent(const AtomicString& type, const NotificationEventInit&, Wa itUntilObserver*);
49 44
50 PersistentWillBeMember<Notification> m_notification; 45 PersistentWillBeMember<Notification> m_notification;
51 }; 46 };
52 47
53 } // namespace blink 48 } // namespace blink
54 49
55 #endif // NotificationEvent_h 50 #endif // NotificationEvent_h
OLDNEW
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/notifications/NotificationEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698