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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 => (PresentationSessionInfo? sessionInfo, PresentationError? error); | 80 => (PresentationSessionInfo? sessionInfo, PresentationError? error); |
81 | 81 |
82 // Called when send() is called by the frame. The true in the | 82 // Called when send() is called by the frame. The true in the |
83 // result callback notifies that the service is ready for next message. | 83 // result callback notifies that the service is ready for next message. |
84 // The false in the result callback notifies the renderer to stop sending | 84 // The false in the result callback notifies the renderer to stop sending |
85 // the send requests and invalidate all pending requests. This occurs | 85 // the send requests and invalidate all pending requests. This occurs |
86 // for eg., when frame is deleted or navigated away. | 86 // for eg., when frame is deleted or navigated away. |
87 SendSessionMessage(PresentationSessionInfo sessionInfo, | 87 SendSessionMessage(PresentationSessionInfo sessionInfo, |
88 SessionMessage message_request) => (bool success); | 88 SessionMessage message_request) => (bool success); |
89 | 89 |
90 // Called when closeSession() is called by the frame. | 90 // Called when close() is called by the frame. |
91 CloseSession(string presentation_url, string presentation_id); | 91 CloseSession(string presentation_url, string presentation_id); |
92 | 92 |
| 93 // Called when terminate() is called by the frame. |
| 94 TerminateSession(string presentation_url, string presentation_id); |
| 95 |
93 // Starts listening for messages for session with |sessionInfo|. | 96 // Starts listening for messages for session with |sessionInfo|. |
94 // Messages will be received in | 97 // Messages will be received in |
95 // PresentationServiceClient::OnSessionMessagesReceived. | 98 // PresentationServiceClient::OnSessionMessagesReceived. |
96 // This is called after a presentation session is created. | 99 // This is called after a presentation session is created. |
97 ListenForSessionMessages(PresentationSessionInfo sessionInfo); | 100 ListenForSessionMessages(PresentationSessionInfo sessionInfo); |
98 }; | 101 }; |
99 | 102 |
100 interface PresentationServiceClient { | 103 interface PresentationServiceClient { |
101 // Called when the client tries to listen for screen availability changes for | 104 // Called when the client tries to listen for screen availability changes for |
102 // presentation of |url| but it is not supported by the device or underlying | 105 // presentation of |url| but it is not supported by the device or underlying |
(...skipping 12 matching lines...) Expand all Loading... |
115 OnConnectionStateChanged(PresentationSessionInfo connection, | 118 OnConnectionStateChanged(PresentationSessionInfo connection, |
116 PresentationConnectionState newState); | 119 PresentationConnectionState newState); |
117 | 120 |
118 // See PresentationService::ListenForSessionMessages. | 121 // See PresentationService::ListenForSessionMessages. |
119 OnSessionMessagesReceived(PresentationSessionInfo sessionInfo, | 122 OnSessionMessagesReceived(PresentationSessionInfo sessionInfo, |
120 array<SessionMessage> messages); | 123 array<SessionMessage> messages); |
121 | 124 |
122 // See PresentationService::SetDefaultPresentationURL. | 125 // See PresentationService::SetDefaultPresentationURL. |
123 OnDefaultSessionStarted(PresentationSessionInfo sessionInfo); | 126 OnDefaultSessionStarted(PresentationSessionInfo sessionInfo); |
124 }; | 127 }; |
OLD | NEW |