Chromium Code Reviews| 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 "content/public/common/presentation_connection_message.h" |
| 10 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "mojo/public/cpp/bindings/binding.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 ~ControllerConnectionProxy() override; | 109 ~ControllerConnectionProxy() override; |
| 110 | 110 |
| 111 blink::mojom::PresentationConnectionPtr Bind(); | 111 blink::mojom::PresentationConnectionPtr Bind(); |
| 112 blink::mojom::PresentationConnectionRequest MakeRemoteRequest(); | 112 blink::mojom::PresentationConnectionRequest MakeRemoteRequest(); |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 // Represents PresentationConnectionProxy object on receiver frame. | 115 // Represents PresentationConnectionProxy object on receiver frame. |
| 116 class CONTENT_EXPORT ReceiverConnectionProxy | 116 class CONTENT_EXPORT ReceiverConnectionProxy |
| 117 : public PresentationConnectionProxy { | 117 : public PresentationConnectionProxy { |
| 118 public: | 118 public: |
| 119 // Invoked when |source_connection_| transition to 'closed' state. Remove | |
| 120 // |source_connection_| from blink PresentationReceiver's connection list. | |
|
mark a. foltz
2017/05/12 22:22:19
nit: s/blink//
zhaobin
2017/05/15 17:46:03
Done.
| |
| 121 using OnConnectionClosedCallback = base::Callback<void()>; | |
| 122 | |
| 119 explicit ReceiverConnectionProxy( | 123 explicit ReceiverConnectionProxy( |
| 120 blink::WebPresentationConnection* receiver_connection); | 124 blink::WebPresentationConnection* receiver_connection, |
| 125 const OnConnectionClosedCallback& connection_closed_callback); | |
| 121 ~ReceiverConnectionProxy() override; | 126 ~ReceiverConnectionProxy() override; |
| 122 | 127 |
| 123 void Bind( | 128 void Bind( |
| 124 blink::mojom::PresentationConnectionRequest receiver_connection_request); | 129 blink::mojom::PresentationConnectionRequest receiver_connection_request); |
| 125 | 130 |
| 126 // Sets |target_connection_ptr_| to |controller_connection_ptr|. Should be | 131 // Sets |target_connection_ptr_| to |controller_connection_ptr|. Should be |
| 127 // called only once. | 132 // called only once. |
| 128 void BindControllerConnection( | 133 void BindControllerConnection( |
| 129 blink::mojom::PresentationConnectionPtr controller_connection_ptr); | 134 blink::mojom::PresentationConnectionPtr controller_connection_ptr); |
| 135 | |
| 136 // PresentationConnectionProxy override | |
| 137 void DidChangeState(content::PresentationConnectionState state) override; | |
| 138 | |
| 139 private: | |
| 140 // See comments for |OnConnectionClosedCallback|. | |
| 141 OnConnectionClosedCallback connection_closed_callback_; | |
| 130 }; | 142 }; |
| 131 | 143 |
| 132 } // namespace content | 144 } // namespace content |
| 133 | 145 |
| 134 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_CONNECTION_PROXY_H_ | 146 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_CONNECTION_PROXY_H_ |
| OLD | NEW |