| 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 module blink.mojom; | 5 module blink.mojom; |
| 6 | 6 |
| 7 import "url/mojo/url.mojom"; | 7 import "url/mojo/url.mojom"; |
| 8 | 8 |
| 9 struct PresentationInfo { | 9 struct PresentationInfo { |
| 10 url.mojom.Url url; | 10 url.mojom.Url url; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // presentation failed. | 91 // presentation failed. |
| 92 StartPresentation(array<url.mojom.Url> presentation_urls) | 92 StartPresentation(array<url.mojom.Url> presentation_urls) |
| 93 => (PresentationInfo? presentation_info, PresentationError? error); | 93 => (PresentationInfo? presentation_info, PresentationError? error); |
| 94 | 94 |
| 95 // Called when reconnect() is called by the frame. The result callback | 95 // Called when reconnect() is called by the frame. The result callback |
| 96 // works the same as for the method above. reconnect() will create a new | 96 // works the same as for the method above. reconnect() will create a new |
| 97 // connection to a presentation with the matching URL and id. | 97 // connection to a presentation with the matching URL and id. |
| 98 ReconnectPresentation(array<url.mojom.Url> presentation_urls, string? presenta
tion_id) | 98 ReconnectPresentation(array<url.mojom.Url> presentation_urls, string? presenta
tion_id) |
| 99 => (PresentationInfo? presentation_info, PresentationError? error); | 99 => (PresentationInfo? presentation_info, PresentationError? error); |
| 100 | 100 |
| 101 // Called in StartPresentation's callback function for offscreen presentation
only. | 101 // Notifies the service that a PresentationConnection has been started. |
| 102 // It passes in controlling frame's PresentationConnection and | 102 // |controller_connection_ptr| is a handle to a PresentationConnection in |
| 103 // PresentationConnectionRequest to PresentationService. | 103 // the page that started the presentation (aka the "controller"). This can be |
| 104 // used by PresentationService to send messages to the controller |
| 105 // PresentationConnection, for example. |
| 106 // The PresentationService should bind |receiver_connection_request| to a |
| 107 // PresentationConnection implementation in order to receive messages and |
| 108 // commands issued by the controller PresentationConnection. |
| 104 SetPresentationConnection( | 109 SetPresentationConnection( |
| 105 PresentationInfo presentation_info, | 110 PresentationInfo presentation_info, |
| 106 PresentationConnection controller_connection_ptr, | 111 PresentationConnection controller_connection_ptr, |
| 107 PresentationConnection& receiver_connection_request); | 112 PresentationConnection& receiver_connection_request); |
| 108 | 113 |
| 109 ////////////////////////////////////////////////////////////////////////////// | 114 ////////////////////////////////////////////////////////////////////////////// |
| 110 // Called when close() is called by the frame. | 115 // Called when close() is called by the frame. |
| 111 CloseConnection(url.mojom.Url presentation_url, string presentation_id); | 116 CloseConnection(url.mojom.Url presentation_url, string presentation_id); |
| 112 | 117 |
| 113 // Called when terminate() is called by the frame. | 118 // Called when terminate() is called by the frame. |
| 114 Terminate(url.mojom.Url presentation_url, string presentation_id); | 119 Terminate(url.mojom.Url presentation_url, string presentation_id); |
| 115 | |
| 116 // Starts listening for messages on the presentation identified by |presentati
on_info|. | |
| 117 // Messages will be received in | |
| 118 // PresentationServiceClient::OnConnectionMessagesReceived. | |
| 119 // This is called after a connection has been established to the presentation | |
| 120 // from the frame. | |
| 121 ListenForConnectionMessages(PresentationInfo presentation_info); | |
| 122 }; | 120 }; |
| 123 | 121 |
| 124 interface PresentationServiceClient { | 122 interface PresentationServiceClient { |
| 125 ////////// This API is implemented by a controlling frame. ///////////////// | 123 ////////// This API is implemented by a controlling frame. ///////////////// |
| 126 | 124 |
| 127 // Called when the client tries to listen for screen availability changes for | 125 // Called when the client tries to listen for screen availability changes for |
| 128 // presentation of |url| but it is not supported by the device or underlying | 126 // presentation of |url| but it is not supported by the device or underlying |
| 129 // platform. This can also be called if the device is currently in a mode | 127 // platform. This can also be called if the device is currently in a mode |
| 130 // where it can't do screen discoveries (eg. low battery). | 128 // where it can't do screen discoveries (eg. low battery). |
| 131 OnScreenAvailabilityNotSupported(url.mojom.Url url); | 129 OnScreenAvailabilityNotSupported(url.mojom.Url url); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 154 // Called when the state of PresentationConnection |connection| started on | 152 // Called when the state of PresentationConnection |connection| started on |
| 155 // this frame has changed to |newState|. | 153 // this frame has changed to |newState|. |
| 156 OnConnectionStateChanged(PresentationInfo presentation_info, | 154 OnConnectionStateChanged(PresentationInfo presentation_info, |
| 157 PresentationConnectionState newState); | 155 PresentationConnectionState newState); |
| 158 | 156 |
| 159 // Caled when the state of |presentation_info| started on this frame has chang
ed to | 157 // Caled when the state of |presentation_info| started on this frame has chang
ed to |
| 160 // CLOSED. | 158 // CLOSED. |
| 161 OnConnectionClosed(PresentationInfo presentation_info, | 159 OnConnectionClosed(PresentationInfo presentation_info, |
| 162 PresentationConnectionCloseReason reason, | 160 PresentationConnectionCloseReason reason, |
| 163 string message); | 161 string message); |
| 164 | |
| 165 // See PresentationService::ListenForConnectionMessages. | |
| 166 OnConnectionMessagesReceived(PresentationInfo presentation_info, | |
| 167 array<PresentationConnectionMessage> messages); | |
| 168 }; | 162 }; |
| OLD | NEW |