Chromium Code Reviews| Index: content/renderer/presentation/presentation_dispatcher.h |
| diff --git a/content/renderer/presentation/presentation_dispatcher.h b/content/renderer/presentation/presentation_dispatcher.h |
| index 057a91d584802d96f8127e59eee5121f9cc372db..96fddb4c429153857f4dba0cdd252a0631437bcb 100644 |
| --- a/content/renderer/presentation/presentation_dispatcher.h |
| +++ b/content/renderer/presentation/presentation_dispatcher.h |
| @@ -33,6 +33,7 @@ class WebVector; |
| namespace content { |
| +class PresentationConnectionProxy; |
|
imcheng
2016/11/01 17:20:30
nit: add blank line below
zhaobin
2016/11/02 03:55:48
Done.
|
| // PresentationDispatcher is a delegate for Presentation API messages used by |
| // Blink. It forwards the calls to the Mojo PresentationService. |
| class CONTENT_EXPORT PresentationDispatcher |
| @@ -43,6 +44,13 @@ class CONTENT_EXPORT PresentationDispatcher |
| explicit PresentationDispatcher(RenderFrame* render_frame); |
| ~PresentationDispatcher() override; |
| + static blink::mojom::SessionMessagePtr ToMojoTextMessage( |
|
imcheng
2016/11/01 17:20:30
do these need to be public static methods or can t
zhaobin
2016/11/02 03:55:48
Done.
|
| + const blink::WebString& message); |
| + static blink::mojom::SessionMessagePtr ToMojoBinaryMessage( |
| + blink::mojom::PresentationMessageType type, |
| + const uint8_t* data, |
| + size_t length); |
| + |
| private: |
| struct SendMessageRequest { |
| SendMessageRequest(blink::mojom::PresentationSessionInfoPtr session_info, |
| @@ -125,7 +133,8 @@ class CONTENT_EXPORT PresentationDispatcher |
| blink::mojom::PresentationSessionInfoPtr session_info, |
| blink::mojom::PresentationErrorPtr error); |
| void OnReceiverConnectionAvailable( |
| - blink::mojom::PresentationSessionInfoPtr) override; |
| + blink::mojom::PresentationSessionInfoPtr, |
| + blink::mojom::PresentationConnectionPtr) override; |
| // Call to PresentationService to send the message in |request|. |
| // |session_info| and |message| of |reuqest| will be consumed. |
| @@ -136,6 +145,9 @@ class CONTENT_EXPORT PresentationDispatcher |
| void ConnectToPresentationServiceIfNeeded(); |
| void UpdateListeningState(); |
| + std::unique_ptr<PresentationConnectionProxy> |
| + CreateAndSetControllerConnectionProxy( |
| + blink::mojom::PresentationSessionInfoPtr session_info); |
| // Used as a weak reference. Can be null since lifetime is bound to the frame. |
| blink::WebPresentationController* controller_; |