OLD | NEW |
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 PresentationSession_h | 5 #ifndef PresentationSession_h |
6 #define PresentationSession_h | 6 #define PresentationSession_h |
7 | 7 |
8 #include "core/events/EventTarget.h" | 8 #include "core/events/EventTarget.h" |
9 #include "core/frame/DOMWindowProperty.h" | 9 #include "core/frame/DOMWindowProperty.h" |
10 #include "public/platform/modules/presentation/WebPresentationSessionClient.h" | 10 #include "public/platform/modules/presentation/WebPresentationSessionClient.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 49 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
50 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); | 50 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); |
51 | 51 |
52 // Returns true if and only if the WebPresentationSessionClient represents t
his session. | 52 // Returns true if and only if the WebPresentationSessionClient represents t
his session. |
53 bool matches(WebPresentationSessionClient*) const; | 53 bool matches(WebPresentationSessionClient*) const; |
54 | 54 |
55 // Notifies the session about its state change. | 55 // Notifies the session about its state change. |
56 void didChangeState(WebPresentationSessionState); | 56 void didChangeState(WebPresentationSessionState); |
57 | 57 |
| 58 // Notifies the session about new text message. |
| 59 void didReceiveTextMessage(const String& message); |
| 60 |
58 private: | 61 private: |
59 PresentationSession(LocalFrame*, const String& id, const String& url); | 62 PresentationSession(LocalFrame*, const String& id, const String& url); |
60 | 63 |
61 // Returns the |PresentationController| object associated with the frame | 64 // Returns the |PresentationController| object associated with the frame |
62 // |Presentation| corresponds to. Can return |nullptr| if the frame is | 65 // |Presentation| corresponds to. Can return |nullptr| if the frame is |
63 // detached from the document. | 66 // detached from the document. |
64 PresentationController* presentationController(); | 67 PresentationController* presentationController(); |
65 | 68 |
66 // Common send method for both ArrayBufferView and ArrayBuffer. | 69 // Common send method for both ArrayBufferView and ArrayBuffer. |
67 void sendInternal(const uint8_t* data, size_t, ExceptionState&); | 70 void sendInternal(const uint8_t* data, size_t, ExceptionState&); |
68 | 71 |
69 String m_id; | 72 String m_id; |
70 String m_url; | 73 String m_url; |
71 WebPresentationSessionState m_state; | 74 WebPresentationSessionState m_state; |
72 }; | 75 }; |
73 | 76 |
74 } // namespace blink | 77 } // namespace blink |
75 | 78 |
76 #endif // PresentationSession_h | 79 #endif // PresentationSession_h |
OLD | NEW |