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