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 // TODO(crbug.com/647290): Rename "Session" to "Connection" | 5 // TODO(crbug.com/647290): Rename "Session" to "Connection" |
6 | 6 |
7 module blink.mojom; | 7 module blink.mojom; |
8 | 8 |
9 import "url/mojo/url.mojom"; | 9 import "url/mojo/url.mojom"; |
10 | 10 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 Terminate(url.mojom.Url presentation_url, string presentation_id); | 128 Terminate(url.mojom.Url presentation_url, string presentation_id); |
129 | 129 |
130 // Starts listening for messages for session with |sessionInfo|. | 130 // Starts listening for messages for session with |sessionInfo|. |
131 // Messages will be received in | 131 // Messages will be received in |
132 // PresentationServiceClient::OnSessionMessagesReceived. | 132 // PresentationServiceClient::OnSessionMessagesReceived. |
133 // This is called after a presentation session is created. | 133 // This is called after a presentation session is created. |
134 ListenForSessionMessages(PresentationSessionInfo sessionInfo); | 134 ListenForSessionMessages(PresentationSessionInfo sessionInfo); |
135 }; | 135 }; |
136 | 136 |
137 interface PresentationServiceClient { | 137 interface PresentationServiceClient { |
| 138 |
| 139 ////////////Functions here are called only on the controlling page./////////// |
| 140 |
138 // Called when the client tries to listen for screen availability changes for | 141 // Called when the client tries to listen for screen availability changes for |
139 // presentation of |url| but it is not supported by the device or underlying | 142 // presentation of |url| but it is not supported by the device or underlying |
140 // platform. This can also be called if the device is currently in a mode | 143 // platform. This can also be called if the device is currently in a mode |
141 // where it can't do screen discoveries (eg. low battery). | 144 // where it can't do screen discoveries (eg. low battery). |
142 OnScreenAvailabilityNotSupported(url.mojom.Url url); | 145 OnScreenAvailabilityNotSupported(url.mojom.Url url); |
143 | 146 |
144 // Called when the client is listening for screen availability for | 147 // Called when the client is listening for screen availability for |
145 // presentation of |url| and the state changes. When the client starts to | 148 // presentation of |url| and the state changes. When the client starts to |
146 // listen for screen availability, this method will always be called to give | 149 // listen for screen availability, this method will always be called to give |
147 // the current known state. It will then be called to notify of state updates. | 150 // the current known state. It will then be called to notify of state updates. |
148 OnScreenAvailabilityUpdated(url.mojom.Url url, bool available); | 151 OnScreenAvailabilityUpdated(url.mojom.Url url, bool available); |
149 | 152 |
| 153 // See PresentationService::SetDefaultPresentationURL. |
| 154 OnDefaultSessionStarted(PresentationSessionInfo sessionInfo); |
| 155 |
| 156 ////////////////////////////////////////////////////////////////////////////// |
| 157 |
150 // Called when the state of PresentationConnection |connection| started on | 158 // Called when the state of PresentationConnection |connection| started on |
151 // this frame has changed to |newState|. | 159 // this frame has changed to |newState|. |
152 OnConnectionStateChanged(PresentationSessionInfo connection, | 160 OnConnectionStateChanged(PresentationSessionInfo connection, |
153 PresentationConnectionState newState); | 161 PresentationConnectionState newState); |
154 | 162 |
155 // Caled when the state of |connection| started on this frame has changed to | 163 // Caled when the state of |connection| started on this frame has changed to |
156 // CLOSED. | 164 // CLOSED. |
157 OnConnectionClosed(PresentationSessionInfo connection, | 165 OnConnectionClosed(PresentationSessionInfo connection, |
158 PresentationConnectionCloseReason reason, | 166 PresentationConnectionCloseReason reason, |
159 string message); | 167 string message); |
160 | 168 |
161 // See PresentationService::ListenForSessionMessages. | 169 // See PresentationService::ListenForSessionMessages. |
162 OnSessionMessagesReceived(PresentationSessionInfo sessionInfo, | 170 OnSessionMessagesReceived(PresentationSessionInfo sessionInfo, |
163 array<SessionMessage> messages); | 171 array<SessionMessage> messages); |
164 | 172 |
165 // See PresentationService::SetDefaultPresentationURL. | 173 // Called on a presentation receiver when the first presentation connection is |
166 OnDefaultSessionStarted(PresentationSessionInfo sessionInfo); | 174 // available from the controlling page. |
167 | 175 OnReceiverConnectionAvailable(PresentationSessionInfo sessionInfo, |
168 // See PresentationService::ListeningForReceiverPageRendered. | 176 PresentationConnection connection); |
169 OnReceiverConnectionAvailable(PresentationSessionInfo sessionInfo); | |
170 }; | 177 }; |
OLD | NEW |