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

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

Issue 1262893005: Add NotificationEvent.action property in SW events (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@actions3_fix
Patch Set: Address review comments 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 unified diff | Download patch
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 #include "config.h" 5 #include "config.h"
6 #include "modules/notifications/NotificationEvent.h" 6 #include "modules/notifications/NotificationEvent.h"
7 #include "wtf/text/WTFString.h"
7 8
8 namespace blink { 9 namespace blink {
9 10
10 NotificationEvent::NotificationEvent() 11 NotificationEvent::NotificationEvent()
12 : m_action(emptyString())
11 { 13 {
12 } 14 }
13 15
14 NotificationEvent::NotificationEvent(const AtomicString& type, const Notificatio nEventInit& initializer) 16 NotificationEvent::NotificationEvent(const AtomicString& type, const Notificatio nEventInit& initializer)
15 : ExtendableEvent(type, initializer) 17 : ExtendableEvent(type, initializer)
18 , m_action(initializer.action())
16 { 19 {
17 if (initializer.hasNotification()) 20 if (initializer.hasNotification())
18 m_notification = initializer.notification(); 21 m_notification = initializer.notification();
19 } 22 }
20 23
21 NotificationEvent::NotificationEvent(const AtomicString& type, const Notificatio nEventInit& initializer, WaitUntilObserver* observer) 24 NotificationEvent::NotificationEvent(const AtomicString& type, const Notificatio nEventInit& initializer, WaitUntilObserver* observer)
22 : ExtendableEvent(type, initializer, observer) 25 : ExtendableEvent(type, initializer, observer)
26 , m_action(initializer.action())
23 { 27 {
24 if (initializer.hasNotification()) 28 if (initializer.hasNotification())
25 m_notification = initializer.notification(); 29 m_notification = initializer.notification();
26 } 30 }
27 31
28 NotificationEvent::~NotificationEvent() 32 NotificationEvent::~NotificationEvent()
29 { 33 {
30 } 34 }
31 35
32 const AtomicString& NotificationEvent::interfaceName() const 36 const AtomicString& NotificationEvent::interfaceName() const
33 { 37 {
34 return EventNames::NotificationEvent; 38 return EventNames::NotificationEvent;
35 } 39 }
36 40
37 DEFINE_TRACE(NotificationEvent) 41 DEFINE_TRACE(NotificationEvent)
38 { 42 {
39 visitor->trace(m_notification); 43 visitor->trace(m_notification);
40 ExtendableEvent::trace(visitor); 44 ExtendableEvent::trace(visitor);
41 } 45 }
42 46
43 } // namespace blink 47 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/notifications/NotificationEvent.h ('k') | Source/modules/notifications/NotificationEvent.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698