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 { | |
13 CONNECTED, | |
14 DISCONNECTED | |
15 }; | |
16 | |
12 enum PresentationErrorType { | 17 enum PresentationErrorType { |
13 NO_AVAILABLE_SCREENS, | 18 NO_AVAILABLE_SCREENS, |
14 SESSION_REQUEST_CANCELLED, | 19 SESSION_REQUEST_CANCELLED, |
15 NO_PRESENTATION_FOUND, | 20 NO_PRESENTATION_FOUND, |
16 UNKNOWN, | 21 UNKNOWN, |
17 }; | 22 }; |
18 | 23 |
19 struct PresentationError { | 24 struct PresentationError { |
20 PresentationErrorType error_type; | 25 PresentationErrorType error_type; |
21 string message; | 26 string message; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 | 70 |
66 // Called when joinSession() is called by the frame. The result callback | 71 // Called when joinSession() is called by the frame. The result callback |
67 // works the same as for the method above. JoinSession will join a known | 72 // works the same as for the method above. JoinSession will join a known |
68 // session (i.e. when the page navigates or the user opens another tab) | 73 // session (i.e. when the page navigates or the user opens another tab) |
69 // silently and without user action. | 74 // silently and without user action. |
70 JoinSession(string presentation_url, string? presentation_id) | 75 JoinSession(string presentation_url, string? presentation_id) |
71 => (PresentationSessionInfo? sessionInfo, PresentationError? error); | 76 => (PresentationSessionInfo? sessionInfo, PresentationError? error); |
72 | 77 |
73 // Called when closeSession() is called by the frame. | 78 // Called when closeSession() is called by the frame. |
74 CloseSession(string presentation_url, string presentation_id); | 79 CloseSession(string presentation_url, string presentation_id); |
80 | |
81 // Called when the frame is ready to process the next state | |
82 // change. Returns the last session state if it’s | |
83 // changed since the last time the callback was called. Might | |
Peter Beverloo
2015/03/20 19:13:39
nit: advocating for 70-character line length limit
whywhat
2015/03/24 19:20:57
Copy paste from the doc about the Mojo interface.
| |
84 // cause the event fired with the initial state change. | |
85 ListenForSessionStateChange() | |
mark a. foltz
2015/03/20 21:22:43
GetSessionState() for consistency with GetScreenAv
whywhat
2015/03/24 19:20:57
But this is consistent with ListenForDefaultSessio
mark a. foltz
2015/03/24 22:53:34
SGTM
| |
86 => (PresentationSessionInfo sessionInfo, | |
87 PresentationSessionState newState); | |
75 }; | 88 }; |
OLD | NEW |