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 28 matching lines...) Expand all Loading... | |
67 StartSession(string presentation_url, string? presentation_id) | 80 StartSession(string presentation_url, string? presentation_id) |
68 => (PresentationSessionInfo? sessionInfo, PresentationError? error); | 81 => (PresentationSessionInfo? sessionInfo, PresentationError? error); |
69 | 82 |
70 // Called when joinSession() is called by the frame. The result callback | 83 // Called when joinSession() is called by the frame. The result callback |
71 // works the same as for the method above. JoinSession will join a known | 84 // works the same as for the method above. JoinSession will join a known |
72 // session (i.e. when the page navigates or the user opens another tab) | 85 // session (i.e. when the page navigates or the user opens another tab) |
73 // silently and without user action. | 86 // silently and without user action. |
74 JoinSession(string presentation_url, string? presentation_id) | 87 JoinSession(string presentation_url, string? presentation_id) |
75 => (PresentationSessionInfo? sessionInfo, PresentationError? error); | 88 => (PresentationSessionInfo? sessionInfo, PresentationError? error); |
76 | 89 |
90 // Called when send() is called by the frame. The result callback is | |
91 // to get notified that message has been received and ready for next one. | |
whywhat
2015/04/30 15:50:58
nits:
s/message/the message
s/and/and the service
USE s.singapati at gmail.com
2015/05/04 16:40:28
Done.
| |
92 SendMessage(SessionMessage message_request) => (bool success); | |
93 | |
77 // Called when closeSession() is called by the frame. | 94 // Called when closeSession() is called by the frame. |
78 CloseSession(string presentation_url, string presentation_id); | 95 CloseSession(string presentation_url, string presentation_id); |
79 | 96 |
80 // Called when the frame is ready to process the next state change. Returns | 97 // 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 | 98 // 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. | 99 // was called. Might cause the event fired with the initial state change. |
83 ListenForSessionStateChange() | 100 ListenForSessionStateChange() |
84 => (PresentationSessionInfo sessionInfo, | 101 => (PresentationSessionInfo sessionInfo, |
85 PresentationSessionState newState); | 102 PresentationSessionState newState); |
86 }; | 103 }; |
OLD | NEW |