OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NotificationEvent_h |
| 6 #define NotificationEvent_h |
| 7 |
| 8 #include "modules/EventModules.h" |
| 9 #include "modules/notifications/Notification.h" |
| 10 #include "modules/serviceworkers/ExtendableEvent.h" |
| 11 #include "platform/heap/Handle.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 struct NotificationEventInit : public EventInit { |
| 16 NotificationEventInit(); |
| 17 |
| 18 Member<Notification> notification; |
| 19 }; |
| 20 |
| 21 class NotificationEvent final : public ExtendableEvent { |
| 22 DEFINE_WRAPPERTYPEINFO(); |
| 23 public: |
| 24 static PassRefPtrWillBeRawPtr<NotificationEvent> create() |
| 25 { |
| 26 return adoptRefWillBeNoop(new NotificationEvent); |
| 27 } |
| 28 static PassRefPtrWillBeRawPtr<NotificationEvent> create(const AtomicString&
type, const NotificationEventInit& initializer, WaitUntilObserver* observer) |
| 29 { |
| 30 return adoptRefWillBeNoop(new NotificationEvent(type, initializer, obser
ver)); |
| 31 } |
| 32 |
| 33 ~NotificationEvent() override; |
| 34 |
| 35 Notification* notification() const { return m_notification.get(); } |
| 36 |
| 37 const AtomicString& interfaceName() const override; |
| 38 |
| 39 void trace(Visitor*) override; |
| 40 |
| 41 private: |
| 42 NotificationEvent(); |
| 43 NotificationEvent(const AtomicString& type, const NotificationEventInit&, Wa
itUntilObserver*); |
| 44 |
| 45 PersistentWillBeMember<Notification> m_notification; |
| 46 }; |
| 47 |
| 48 } // namespace blink |
| 49 |
| 50 #endif // NotificationEvent_h |
OLD | NEW |