| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 CONTENT_RENDERER_PRESENTATION_PRESENTATION_CONNECTION_PROXY_H_ | 5 #ifndef CONTENT_RENDERER_PRESENTATION_PRESENTATION_CONNECTION_PROXY_H_ |
| 6 #define CONTENT_RENDERER_PRESENTATION_PRESENTATION_CONNECTION_PROXY_H_ | 6 #define CONTENT_RENDERER_PRESENTATION_PRESENTATION_CONNECTION_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "content/public/common/presentation_connection_message.h" |
| 9 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "mojo/public/cpp/bindings/binding.h" |
| 10 #include "third_party/WebKit/public/platform/modules/presentation/WebPresentatio
nConnectionProxy.h" | 11 #include "third_party/WebKit/public/platform/modules/presentation/WebPresentatio
nConnectionProxy.h" |
| 11 #include "third_party/WebKit/public/platform/modules/presentation/presentation.m
ojom.h" | 12 #include "third_party/WebKit/public/platform/modules/presentation/presentation.m
ojom.h" |
| 12 | 13 |
| 13 namespace blink { | 14 namespace blink { |
| 14 class WebPresentationConnection; | 15 class WebPresentationConnection; |
| 15 } // namespace blink | 16 } // namespace blink |
| 16 | 17 |
| 17 namespace content { | 18 namespace content { |
| 18 | 19 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // Instance of this class is created for both offscreen and non offscreen | 68 // Instance of this class is created for both offscreen and non offscreen |
| 68 // presentations. | 69 // presentations. |
| 69 class CONTENT_EXPORT PresentationConnectionProxy | 70 class CONTENT_EXPORT PresentationConnectionProxy |
| 70 : public NON_EXPORTED_BASE(blink::WebPresentationConnectionProxy), | 71 : public NON_EXPORTED_BASE(blink::WebPresentationConnectionProxy), |
| 71 public NON_EXPORTED_BASE(blink::mojom::PresentationConnection) { | 72 public NON_EXPORTED_BASE(blink::mojom::PresentationConnection) { |
| 72 public: | 73 public: |
| 73 using OnMessageCallback = base::Callback<void(bool)>; | 74 using OnMessageCallback = base::Callback<void(bool)>; |
| 74 | 75 |
| 75 ~PresentationConnectionProxy() override; | 76 ~PresentationConnectionProxy() override; |
| 76 | 77 |
| 77 virtual void SendConnectionMessage( | 78 virtual void SendConnectionMessage(PresentationConnectionMessage message, |
| 78 blink::mojom::ConnectionMessagePtr connection_message, | 79 const OnMessageCallback& callback) const; |
| 79 const OnMessageCallback& callback) const; | |
| 80 | 80 |
| 81 // blink::mojom::PresentationConnection implementation | 81 // blink::mojom::PresentationConnection implementation |
| 82 void OnMessage(blink::mojom::ConnectionMessagePtr message, | 82 void OnMessage(PresentationConnectionMessage message, |
| 83 const OnMessageCallback& callback) override; | 83 const OnMessageCallback& callback) override; |
| 84 void DidChangeState(content::PresentationConnectionState state) override; | 84 void DidChangeState(content::PresentationConnectionState state) override; |
| 85 void OnClose() override; | 85 void OnClose() override; |
| 86 | 86 |
| 87 // blink::WebPresentationConnectionProxy implementation. | 87 // blink::WebPresentationConnectionProxy implementation. |
| 88 void close() const override; | 88 void close() const override; |
| 89 | 89 |
| 90 protected: | 90 protected: |
| 91 explicit PresentationConnectionProxy( | 91 explicit PresentationConnectionProxy( |
| 92 blink::WebPresentationConnection* source_connection); | 92 blink::WebPresentationConnection* source_connection); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 // Sets |target_connection_ptr_| to |controller_connection_ptr|. Should be | 126 // Sets |target_connection_ptr_| to |controller_connection_ptr|. Should be |
| 127 // called only once. | 127 // called only once. |
| 128 void BindControllerConnection( | 128 void BindControllerConnection( |
| 129 blink::mojom::PresentationConnectionPtr controller_connection_ptr); | 129 blink::mojom::PresentationConnectionPtr controller_connection_ptr); |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 } // namespace content | 132 } // namespace content |
| 133 | 133 |
| 134 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_CONNECTION_PROXY_H_ | 134 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_CONNECTION_PROXY_H_ |
| OLD | NEW |