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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 SetTargetConnection(PresentationConnection connection); | 62 SetTargetConnection(PresentationConnection connection); |
63 | 63 |
64 // Called when a message is sent by the target connection. | 64 // Called when a message is sent by the target connection. |
65 OnMessage(SessionMessage message); | 65 OnMessage(SessionMessage message); |
66 }; | 66 }; |
67 | 67 |
68 interface PresentationService { | 68 interface PresentationService { |
69 // Sets the PresentationServiceClient. | 69 // Sets the PresentationServiceClient. |
70 SetClient(PresentationServiceClient client); | 70 SetClient(PresentationServiceClient client); |
71 | 71 |
72 /////////////Functions here are for the controller part of the API./////////// | |
mark a. foltz
2016/11/08 23:40:52
Nit: add spaces between / and text to improve read
zhaobin
2016/11/10 04:14:01
Done.
| |
73 | |
72 // Called when the frame sets or changes the default presentation URLs. | 74 // Called when the frame sets or changes the default presentation URLs. |
73 // When the default presentation is started on this frame, | 75 // When the default presentation is started on this frame, |
74 // PresentationServiceClient::OnDefaultSessionStarted will be invoked. | 76 // PresentationServiceClient::OnDefaultSessionStarted will be invoked. |
75 SetDefaultPresentationUrls(array<url.mojom.Url> presentation_urls); | 77 SetDefaultPresentationUrls(array<url.mojom.Url> presentation_urls); |
76 | 78 |
77 // Starts listening for screen availability for presentation of | 79 // Starts listening for screen availability for presentation of |
78 // |availability_url|. Availability results will be returned to the client via | 80 // |availability_url|. Availability results will be returned to the client via |
79 // PresentationServiceClient::OnScreenAvailabilityUpdated. | 81 // PresentationServiceClient::OnScreenAvailabilityUpdated. |
80 ListenForScreenAvailability(url.mojom.Url availability_url); | 82 ListenForScreenAvailability(url.mojom.Url availability_url); |
81 | 83 |
(...skipping 14 matching lines...) Expand all Loading... | |
96 StartSession(array<url.mojom.Url> presentation_urls) | 98 StartSession(array<url.mojom.Url> presentation_urls) |
97 => (PresentationSessionInfo? sessionInfo, PresentationError? error); | 99 => (PresentationSessionInfo? sessionInfo, PresentationError? error); |
98 | 100 |
99 // Called when joinSession() is called by the frame. The result callback | 101 // Called when joinSession() is called by the frame. The result callback |
100 // works the same as for the method above. JoinSession will join a known | 102 // works the same as for the method above. JoinSession will join a known |
101 // session (i.e. when the page navigates or the user opens another tab) | 103 // session (i.e. when the page navigates or the user opens another tab) |
102 // silently and without user action. | 104 // silently and without user action. |
103 JoinSession(array<url.mojom.Url> presentation_urls, string? presentation_id) | 105 JoinSession(array<url.mojom.Url> presentation_urls, string? presentation_id) |
104 => (PresentationSessionInfo? sessionInfo, PresentationError? error); | 106 => (PresentationSessionInfo? sessionInfo, PresentationError? error); |
105 | 107 |
108 // Called in StartSession's callback function for 1-UA presentations only. It | |
mark a. foltz
2016/11/08 23:40:52
s/1-UA/offscreen/ for consistency with other docum
zhaobin
2016/11/10 04:14:01
Done.
| |
109 // sends controlling frame's PresentationConnection to PresentationService. | |
110 SetPresentationConnection(PresentationSessionInfo sessionInfo, | |
111 PresentationConnection connection); | |
112 | |
113 ////////////////////////////////////////////////////////////////////////////// | |
114 | |
106 // Called when send() is called by the frame. The true in the | 115 // Called when send() is called by the frame. The true in the |
107 // result callback notifies that the service is ready for next message. | 116 // result callback notifies that the service is ready for next message. |
108 // The false in the result callback notifies the renderer to stop sending | 117 // The false in the result callback notifies the renderer to stop sending |
109 // the send requests and invalidate all pending requests. This occurs | 118 // the send requests and invalidate all pending requests. This occurs |
110 // for eg., when frame is deleted or navigated away. | 119 // for eg., when frame is deleted or navigated away. |
111 SendSessionMessage(PresentationSessionInfo sessionInfo, | 120 SendSessionMessage(PresentationSessionInfo sessionInfo, |
112 SessionMessage message_request) => (bool success); | 121 SessionMessage message_request) => (bool success); |
113 | 122 |
114 // Called when close() is called by the frame. | 123 // Called when close() is called by the frame. |
115 CloseConnection(url.mojom.Url presentation_url, string presentation_id); | 124 CloseConnection(url.mojom.Url presentation_url, string presentation_id); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 // See PresentationService::ListenForSessionMessages. | 160 // See PresentationService::ListenForSessionMessages. |
152 OnSessionMessagesReceived(PresentationSessionInfo sessionInfo, | 161 OnSessionMessagesReceived(PresentationSessionInfo sessionInfo, |
153 array<SessionMessage> messages); | 162 array<SessionMessage> messages); |
154 | 163 |
155 // See PresentationService::SetDefaultPresentationURL. | 164 // See PresentationService::SetDefaultPresentationURL. |
156 OnDefaultSessionStarted(PresentationSessionInfo sessionInfo); | 165 OnDefaultSessionStarted(PresentationSessionInfo sessionInfo); |
157 | 166 |
158 // See PresentationService::ListeningForReceiverPageRendered. | 167 // See PresentationService::ListeningForReceiverPageRendered. |
159 OnReceiverConnectionAvailable(PresentationSessionInfo sessionInfo); | 168 OnReceiverConnectionAvailable(PresentationSessionInfo sessionInfo); |
160 }; | 169 }; |
OLD | NEW |