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 | |
miu
2015/10/07 21:51:47
See my comment in presentation_service_delegate.h,
imcheng
2015/10/10 04:39:43
since all mojo callbacks have to be invoked before
| |
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. | |
112 // Otherwise, a PresentationSessionInfo object will be returned, | |
113 // with url set to empty, and id set to the ID of the offscreen presentation. | |
114 GetPresentationReceiverSession() => (PresentationSessionInfo? session_info); | |
107 }; | 115 }; |
108 | 116 |
109 interface PresentationServiceClient { | 117 interface PresentationServiceClient { |
110 // Called when the client tries to listen for screen availability changes for | 118 // 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 | 119 // 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 | 120 // 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). | 121 // where it can't do screen discoveries (eg. low battery). |
114 OnScreenAvailabilityNotSupported(string url); | 122 OnScreenAvailabilityNotSupported(string url); |
115 | 123 |
116 // Called when the client is listening for screen availability for | 124 // Called when the client is listening for screen availability for |
117 // presentation of |url| and the state changes. When the client starts to | 125 // 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 | 126 // 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. | 127 // the current known state. It will then be called to notify of state updates. |
120 OnScreenAvailabilityUpdated(string url, bool available); | 128 OnScreenAvailabilityUpdated(string url, bool available); |
121 | 129 |
122 // See PresentationService::ListenForSessionStateChange. | 130 // See PresentationService::ListenForSessionStateChange. |
123 OnSessionStateChanged(PresentationSessionInfo sessionInfo, | 131 OnSessionStateChanged(PresentationSessionInfo sessionInfo, |
124 PresentationSessionState newState); | 132 PresentationSessionState newState); |
125 | 133 |
126 // See PresentationService::ListenForSessionMessages. | 134 // See PresentationService::ListenForSessionMessages. |
127 OnSessionMessagesReceived(PresentationSessionInfo sessionInfo, array<SessionMe ssage> messages); | 135 OnSessionMessagesReceived(PresentationSessionInfo sessionInfo, array<SessionMe ssage> messages); |
128 }; | 136 }; |
OLD | NEW |