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 }; |
11 | 11 |
12 enum PresentationSessionState { | 12 enum PresentationSessionState { |
13 CONNECTED, | 13 CONNECTED, |
14 DISCONNECTED | 14 DISCONNECTED |
15 }; | 15 }; |
16 | 16 |
17 enum PresentationErrorType { | 17 enum PresentationErrorType { |
18 NO_AVAILABLE_SCREENS, | 18 NO_AVAILABLE_SCREENS, |
19 SESSION_REQUEST_CANCELLED, | 19 SESSION_REQUEST_CANCELLED, |
20 NO_PRESENTATION_FOUND, | 20 NO_PRESENTATION_FOUND, |
21 UNKNOWN, | 21 UNKNOWN, |
22 }; | 22 }; |
23 | 23 |
24 struct PresentationError { | 24 struct PresentationError { |
25 PresentationErrorType error_type; | 25 PresentationErrorType error_type; |
26 string message; | 26 string message; |
27 }; | 27 }; |
28 | 28 |
| 29 enum PresentationMessageType { |
| 30 TEXT, |
| 31 ARRAY_BUFFER, |
| 32 }; |
| 33 |
| 34 struct SessionMessage { |
| 35 string presentation_url; |
| 36 string presentation_id; |
| 37 PresentationMessageType type; |
| 38 string? message; |
| 39 array<uint8>? data; |
| 40 }; |
| 41 |
29 interface PresentationService { | 42 interface PresentationService { |
30 // Called when the frame sets or changes the default presentation URL or | 43 // Called when the frame sets or changes the default presentation URL or |
31 // presentation ID. | 44 // presentation ID. |
32 SetDefaultPresentationURL( | 45 SetDefaultPresentationURL( |
33 string default_presentation_url, | 46 string default_presentation_url, |
34 string? default_presentation_id); | 47 string? default_presentation_id); |
35 | 48 |
36 // Returns the last screen availability state if it’s changed since the last | 49 // Returns the last screen availability state if it’s changed since the last |
37 // time the method was called. The client has to call this method again when | 50 // time the method was called. The client has to call this method again when |
38 // handling the result (provided via Mojo callback) to get the next update | 51 // handling the result (provided via Mojo callback) to get the next update |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 89 |
77 // Called when closeSession() is called by the frame. | 90 // Called when closeSession() is called by the frame. |
78 CloseSession(string presentation_url, string presentation_id); | 91 CloseSession(string presentation_url, string presentation_id); |
79 | 92 |
80 // Called when the frame is ready to process the next state change. Returns | 93 // Called when the frame is ready to process the next state change. Returns |
81 // the last session state if it’s changed since the last time the callback | 94 // the last session state if it’s changed since the last time the callback |
82 // was called. Might cause the event fired with the initial state change. | 95 // was called. Might cause the event fired with the initial state change. |
83 ListenForSessionStateChange() | 96 ListenForSessionStateChange() |
84 => (PresentationSessionInfo sessionInfo, | 97 => (PresentationSessionInfo sessionInfo, |
85 PresentationSessionState newState); | 98 PresentationSessionState newState); |
| 99 |
| 100 // Called when the frame is ready to process the next batch of messages. |
| 101 ListenForSessionMessages() |
| 102 => (array<SessionMessage> messages); |
86 }; | 103 }; |
OLD | NEW |