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 presentation; | 5 module presentation; |
6 | 6 |
7 struct PresentationSessionInfo { | 7 struct PresentationSessionInfo { |
8 string url; | 8 string url; |
9 string id; | 9 string id; |
10 }; | 10 }; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 // When state change occurs, PresentationServiceClient::OnSessionStateChanged | 97 // When state change occurs, PresentationServiceClient::OnSessionStateChanged |
98 // will be invoked with the session and its new state. | 98 // will be invoked with the session and its new state. |
99 // This is called after a presentation session is created. | 99 // This is called after a presentation session is created. |
100 ListenForSessionStateChange(PresentationSessionInfo sessionInfo); | 100 ListenForSessionStateChange(PresentationSessionInfo sessionInfo); |
101 | 101 |
102 // Starts listening for messages for session with |sessionInfo|. | 102 // Starts listening for messages for session with |sessionInfo|. |
103 // Messages will be received in | 103 // Messages will be received in |
104 // PresentationServiceClient::OnSessionMessagesReceived. | 104 // PresentationServiceClient::OnSessionMessagesReceived. |
105 // This is called after a presentation session is created. | 105 // This is called after a presentation session is created. |
106 ListenForSessionMessages(PresentationSessionInfo sessionInfo); | 106 ListenForSessionMessages(PresentationSessionInfo sessionInfo); |
107 | |
108 // Gets a single receiver PresentationSessionInfo object for the | |
109 // offscreen presentation hosted on the offscreen tab containing this frame. | |
110 // If the calling frame is not the main frame of an offscreen tab, | |
111 // null will be returned. | |
mark a. foltz
2015/10/12 21:56:10
This might be simpler as,
// Returns a Presentati
imcheng
2015/10/17 01:00:24
Done.
| |
112 // Otherwise, a PresentationSessionInfo object will be returned, | |
113 // with url set to empty, and id set to the ID of the offscreen presentation. | |
mark a. foltz
2015/10/12 21:56:10
Can we look up the URL from the PresentationReques
imcheng
2015/10/17 01:00:24
We can certainly. But I believe spec says URL is u
| |
114 // If a receiver presentation session never becomes available, null will be | |
115 // returned right before this request becomes invalid (e.g., due to frame | |
116 // deletion, frame navigation). | |
117 GetPresentationReceiverSession() => (PresentationSessionInfo? session_info); | |
107 }; | 118 }; |
108 | 119 |
109 interface PresentationServiceClient { | 120 interface PresentationServiceClient { |
110 // Called when the client tries to listen for screen availability changes for | 121 // Called when the client tries to listen for screen availability changes for |
111 // presentation of |url| but it is not supported by the device or underlying | 122 // presentation of |url| but it is not supported by the device or underlying |
112 // platform. This can also be called if the device is currently in a mode | 123 // platform. This can also be called if the device is currently in a mode |
113 // where it can't do screen discoveries (eg. low battery). | 124 // where it can't do screen discoveries (eg. low battery). |
114 OnScreenAvailabilityNotSupported(string url); | 125 OnScreenAvailabilityNotSupported(string url); |
115 | 126 |
116 // Called when the client is listening for screen availability for | 127 // Called when the client is listening for screen availability for |
117 // presentation of |url| and the state changes. When the client starts to | 128 // presentation of |url| and the state changes. When the client starts to |
118 // listen for screen availability, this method will always be called to give | 129 // listen for screen availability, this method will always be called to give |
119 // the current known state. It will then be called to notify of state updates. | 130 // the current known state. It will then be called to notify of state updates. |
120 OnScreenAvailabilityUpdated(string url, bool available); | 131 OnScreenAvailabilityUpdated(string url, bool available); |
121 | 132 |
122 // See PresentationService::ListenForSessionStateChange. | 133 // See PresentationService::ListenForSessionStateChange. |
123 OnSessionStateChanged(PresentationSessionInfo sessionInfo, | 134 OnSessionStateChanged(PresentationSessionInfo sessionInfo, |
124 PresentationSessionState newState); | 135 PresentationSessionState newState); |
125 | 136 |
126 // See PresentationService::ListenForSessionMessages. | 137 // See PresentationService::ListenForSessionMessages. |
127 OnSessionMessagesReceived(PresentationSessionInfo sessionInfo, array<SessionMe ssage> messages); | 138 OnSessionMessagesReceived(PresentationSessionInfo sessionInfo, array<SessionMe ssage> messages); |
128 }; | 139 }; |
OLD | NEW |