| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 WebPresentationController_h | 5 #ifndef WebPresentationController_h |
| 6 #define WebPresentationController_h | 6 #define WebPresentationController_h |
| 7 | 7 |
| 8 #include "public/platform/WebCommon.h" | 8 #include "public/platform/WebCommon.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 struct WebPresentationSessionInfo; | |
| 13 class WebPresentationConnection; | 12 class WebPresentationConnection; |
| 13 struct WebPresentationInfo; |
| 14 class WebString; | 14 class WebString; |
| 15 | 15 |
| 16 enum class WebPresentationConnectionCloseReason { Error = 0, Closed, WentAway }; | 16 enum class WebPresentationConnectionCloseReason { Error = 0, Closed, WentAway }; |
| 17 | 17 |
| 18 enum class WebPresentationConnectionState { | 18 enum class WebPresentationConnectionState { |
| 19 Connecting = 0, | 19 Connecting = 0, |
| 20 Connected, | 20 Connected, |
| 21 Closed, | 21 Closed, |
| 22 Terminated, | 22 Terminated, |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 // The delegate Blink provides to WebPresentationClient in order to get updates. | 25 // The delegate Blink provides to WebPresentationClient in order to get updates. |
| 26 class BLINK_PLATFORM_EXPORT WebPresentationController { | 26 class BLINK_PLATFORM_EXPORT WebPresentationController { |
| 27 public: | 27 public: |
| 28 virtual ~WebPresentationController() {} | 28 virtual ~WebPresentationController() {} |
| 29 | 29 |
| 30 // Called when the presentation session is started by the embedder using | 30 // Called when the presentation is started using the default presentation URL |
| 31 // the default presentation URL and id. | 31 // and id. |
| 32 virtual WebPresentationConnection* didStartDefaultSession( | 32 virtual WebPresentationConnection* didStartDefaultPresentation( |
| 33 const WebPresentationSessionInfo&) = 0; | 33 const WebPresentationInfo&) = 0; |
| 34 | 34 |
| 35 // Called when the state of a session changes. | 35 // Called when the state of a presentation connection changes. |
| 36 virtual void didChangeSessionState(const WebPresentationSessionInfo&, | 36 virtual void didChangeConnectionState(const WebPresentationInfo&, |
| 37 WebPresentationConnectionState) = 0; | 37 WebPresentationConnectionState) = 0; |
| 38 | 38 |
| 39 // Called when a connection closes. | 39 // Called when a connection closes. |
| 40 virtual void didCloseConnection(const WebPresentationSessionInfo&, | 40 virtual void didCloseConnection(const WebPresentationInfo&, |
| 41 WebPresentationConnectionCloseReason, | 41 WebPresentationConnectionCloseReason, |
| 42 const WebString& message) = 0; | 42 const WebString& message) = 0; |
| 43 | 43 |
| 44 // Called when a text message of a session is received. | 44 // Called when a text message is received from the presentation. |
| 45 virtual void didReceiveSessionTextMessage(const WebPresentationSessionInfo&, | 45 virtual void didReceiveConnectionTextMessage(const WebPresentationInfo&, |
| 46 const WebString& message) = 0; | 46 const WebString& message) = 0; |
| 47 | 47 |
| 48 // Called when a binary message of a session is received. | 48 // Called when a binary message is received from the presentation. |
| 49 virtual void didReceiveSessionBinaryMessage(const WebPresentationSessionInfo&, | 49 virtual void didReceiveConnectionBinaryMessage(const WebPresentationInfo&, |
| 50 const uint8_t* data, | 50 const uint8_t* data, |
| 51 size_t length) = 0; | 51 size_t length) = 0; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace blink | 54 } // namespace blink |
| 55 | 55 |
| 56 #endif // WebPresentationController_h | 56 #endif // WebPresentationController_h |
| OLD | NEW |