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 import "presentation_session.mojom"; | |
8 | |
9 struct PresentationSessionInfo { | |
10 PresentationSession session; | |
11 string url; | |
12 string id; | |
13 }; | |
14 | |
15 struct PresentationError { | |
16 int32 errorCode; | |
mlamouri (slow - plz ping)
2015/02/23 14:07:39
Could you have an enum called PresentationErroryTy
whywhat
2015/02/25 14:12:41
Done.
| |
17 string message; | |
18 }; | |
19 | |
7 interface PresentationService { | 20 interface PresentationService { |
8 // Returns the last screen availability state if it’s changed since the last | 21 // Returns the last screen availability state if it’s changed since the last |
9 // time the method was called. The client has to call this method again when | 22 // time the method was called. The client has to call this method again when |
10 // handling the result (provided via Mojo callback) to get the next update | 23 // handling the result (provided via Mojo callback) to get the next update |
11 // about the availability status. | 24 // about the availability status. |
12 // May start discovery of the presentation screens. The implementation might | 25 // May start discovery of the presentation screens. The implementation might |
13 // stop discovery once there are no active calls to GetScreenAvailability. | 26 // stop discovery once there are no active calls to GetScreenAvailability. |
14 // |presentation_url| can be specified to help the implementation to filter | 27 // |presentation_url| can be specified to help the implementation to filter |
15 // out incompatible screens. | 28 // out incompatible screens. |
16 GetScreenAvailability(string? presentation_url) => (bool available); | 29 GetScreenAvailability(string? presentation_url) => (bool available); |
17 | 30 |
18 // Called when the frame no longer listens to the | 31 // Called when the frame no longer listens to the |
19 // |availablechange| event. | 32 // |availablechange| event. |
20 OnScreenAvailabilityListenerRemoved(); | 33 OnScreenAvailabilityListenerRemoved(); |
34 | |
35 // Called when startSession() is called by the frame. The result callback | |
36 // will return a non-null PresentationSessionInfo if starting the session | |
37 // succeeded (so the session object is valid) or an error message if | |
38 // starting the session failed. | |
39 // The presentation id is always returned along with the initialized | |
40 // session on success. | |
41 // If the UA identifies a matching session (same presentation url and id), | |
42 // the user may choose this existing session and the page will join it | |
43 // rather than get a new one. An empty presentation id means that the | |
44 // UA will generate the presentation id. | |
45 StartSession(string presentation_url, string? presentation_id) => ( | |
46 PresentationSessionInfo? sessionInfo, PresentationError? error); | |
mlamouri (slow - plz ping)
2015/02/23 14:07:39
nit: this looks more readable:
StartSession(string
whywhat
2015/02/25 14:12:41
Done.
| |
47 | |
48 // Called when joinSession() is called by the frame. The result callback | |
49 // works the same as for the method above. JoinSession is used to silently | |
50 // (no user action needed) join a known session (i.e. when the page | |
51 // navigates or the user opens another tab). | |
52 JoinSession(string presentation_url, string? presentation_id) => ( | |
53 PresentationSessionInfo? sessionInfo, PresentationError? error); | |
mlamouri (slow - plz ping)
2015/02/23 14:07:39
ditto
whywhat
2015/02/25 14:12:41
Done.
| |
21 }; | 54 }; |
OLD | NEW |