OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 PresentationConnectionCloseEvent_h | 5 #ifndef PresentationConnectionCloseEvent_h |
6 #define PresentationConnectionCloseEvent_h | 6 #define PresentationConnectionCloseEvent_h |
7 | 7 |
8 #include "modules/EventModules.h" | 8 #include "modules/EventModules.h" |
9 #include "modules/presentation/PresentationConnection.h" | 9 #include "modules/presentation/PresentationConnection.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class PresentationConnectionCloseEventInit; | 14 class PresentationConnectionCloseEventInit; |
15 | 15 |
16 // Presentation API event to be fired when the state of a PresentationConnection | 16 // Presentation API event to be fired when the state of a PresentationConnection |
17 // has changed to 'closed'. | 17 // has changed to 'closed'. |
18 class PresentationConnectionCloseEvent final : public Event { | 18 class PresentationConnectionCloseEvent final : public Event { |
19 DEFINE_WRAPPERTYPEINFO(); | 19 DEFINE_WRAPPERTYPEINFO(); |
20 public: | 20 public: |
21 ~PresentationConnectionCloseEvent() override = default; | 21 ~PresentationConnectionCloseEvent() override = default; |
22 | 22 |
23 static PresentationConnectionCloseEvent* create() | |
24 { | |
25 return new PresentationConnectionCloseEvent; | |
26 } | |
27 | |
28 static PresentationConnectionCloseEvent* create(const AtomicString& eventTyp
e, const String& reason, const String& message) | 23 static PresentationConnectionCloseEvent* create(const AtomicString& eventTyp
e, const String& reason, const String& message) |
29 { | 24 { |
30 return new PresentationConnectionCloseEvent(eventType, reason, message); | 25 return new PresentationConnectionCloseEvent(eventType, reason, message); |
31 } | 26 } |
32 | 27 |
33 static PresentationConnectionCloseEvent* create(const AtomicString& eventTyp
e, const PresentationConnectionCloseEventInit& initializer) | 28 static PresentationConnectionCloseEvent* create(const AtomicString& eventTyp
e, const PresentationConnectionCloseEventInit& initializer) |
34 { | 29 { |
35 return new PresentationConnectionCloseEvent(eventType, initializer); | 30 return new PresentationConnectionCloseEvent(eventType, initializer); |
36 } | 31 } |
37 | 32 |
38 const String& reason() const { return m_reason; } | 33 const String& reason() const { return m_reason; } |
39 const String& message() const { return m_message; } | 34 const String& message() const { return m_message; } |
40 | 35 |
41 const AtomicString& interfaceName() const override; | 36 const AtomicString& interfaceName() const override; |
42 | 37 |
43 DECLARE_VIRTUAL_TRACE(); | 38 DECLARE_VIRTUAL_TRACE(); |
44 | 39 |
45 private: | 40 private: |
46 PresentationConnectionCloseEvent() = default; | |
47 PresentationConnectionCloseEvent(const AtomicString& eventType, const String
& reason, const String& message); | 41 PresentationConnectionCloseEvent(const AtomicString& eventType, const String
& reason, const String& message); |
48 PresentationConnectionCloseEvent(const AtomicString& eventType, const Presen
tationConnectionCloseEventInit& initializer); | 42 PresentationConnectionCloseEvent(const AtomicString& eventType, const Presen
tationConnectionCloseEventInit& initializer); |
49 | 43 |
50 String m_reason; | 44 String m_reason; |
51 String m_message; | 45 String m_message; |
52 }; | 46 }; |
53 | 47 |
54 } // namespace blink | 48 } // namespace blink |
55 | 49 |
56 #endif // PresentationConnectionAvailableEvent_h | 50 #endif // PresentationConnectionAvailableEvent_h |
OLD | NEW |