| 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 #include "public/platform/modules/presentation/WebPresentationClient.h" |
| 9 | 10 |
| 10 namespace blink { | 11 namespace blink { |
| 11 | 12 |
| 12 class WebPresentationConnectionClient; | |
| 13 class WebString; | 13 class WebString; |
| 14 enum class WebPresentationConnectionCloseReason; | 14 enum class WebPresentationConnectionCloseReason; |
| 15 enum class WebPresentationConnectionState; | 15 enum class WebPresentationConnectionState; |
| 16 | 16 |
| 17 // The delegate Blink provides to WebPresentationClient in order to get updates. | 17 // The delegate Blink provides to WebPresentationClient in order to get updates. |
| 18 class BLINK_PLATFORM_EXPORT WebPresentationController { | 18 class BLINK_PLATFORM_EXPORT WebPresentationController : public WebPresentationMe
ssageObserver { |
| 19 public: | 19 public: |
| 20 virtual ~WebPresentationController() { } | 20 virtual ~WebPresentationController() { } |
| 21 | 21 |
| 22 // Called when the presentation session is started by the embedder using | 22 // Called when the presentation session is started by the embedder using |
| 23 // the default presentation URL and id. | 23 // the default presentation URL and id. |
| 24 virtual void didStartDefaultSession(WebPresentationConnectionClient*) = 0; | 24 virtual void didStartDefaultSession(WebPresentationConnectionClient*) = 0; |
| 25 | 25 |
| 26 // Called when the state of a session changes. | 26 // Called when the state of a session changes. |
| 27 virtual void didChangeSessionState(WebPresentationConnectionClient*, WebPres
entationConnectionState) = 0; | 27 virtual void didChangeSessionState(WebPresentationConnectionClient*, WebPres
entationConnectionState) = 0; |
| 28 | 28 |
| 29 // Called when a connection closes. | 29 // Called when a connection closes. |
| 30 virtual void didCloseConnection(WebPresentationConnectionClient*, WebPresent
ationConnectionCloseReason, const WebString& message) = 0; | 30 virtual void didCloseConnection(WebPresentationConnectionClient*, WebPresent
ationConnectionCloseReason, const WebString& message) = 0; |
| 31 | 31 |
| 32 // Called when a text message of a session is received. | 32 // Called when a text message of a session is received. |
| 33 virtual void didReceiveSessionTextMessage(WebPresentationConnectionClient*,
const WebString& message) = 0; | 33 virtual void didReceiveSessionTextMessage(WebPresentationConnectionClient*,
const WebString& message) = 0; |
| 34 | 34 |
| 35 // Called when a binary message of a session is received. | 35 // Called when a binary message of a session is received. |
| 36 virtual void didReceiveSessionBinaryMessage(WebPresentationConnectionClient*
, const uint8_t* data, size_t length) = 0; | 36 virtual void didReceiveSessionBinaryMessage(WebPresentationConnectionClient*
, const uint8_t* data, size_t length) = 0; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 } // namespace blink | 39 } // namespace blink |
| 40 | 40 |
| 41 #endif // WebPresentationController_h | 41 #endif // WebPresentationController_h |
| OLD | NEW |