Chromium Code Reviews| 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"; | 7 import "presentation_session.mojom"; |
| 8 | 8 |
| 9 struct PresentationSessionInfo { | 9 struct PresentationSessionInfo { |
| 10 PresentationSession session; | |
|
whywhat
2015/03/10 17:05:05
Why removing this?
imcheng
2015/03/10 18:31:16
I don't think we should include an service interfa
whywhat
2015/03/10 23:20:23
Which PresentationSession do you mean? The JS inte
imcheng
2015/03/12 20:03:41
I mean the (currently empty) mojo interface define
whywhat
2015/03/13 17:44:34
Hm, the PresentationDispatcher would keep the Pres
imcheng
2015/03/13 23:36:45
I want to understand this a little better. Who is
| |
| 11 string url; | 10 string url; |
| 12 string id; | 11 string id; |
| 13 }; | 12 }; |
| 14 | 13 |
| 15 enum PresentationErrorType { | 14 enum PresentationErrorType { |
| 16 NO_AVAILABLE_SCREENS, | 15 NO_AVAILABLE_SCREENS, |
| 17 SESSION_REQUEST_CANCELLED, | 16 SESSION_REQUEST_CANCELLED, |
| 18 NO_PRESENTATION_FOUND, | 17 NO_PRESENTATION_FOUND, |
| 19 UNKNOWN, | 18 UNKNOWN, |
| 20 }; | 19 }; |
| 21 | 20 |
| 22 struct PresentationError { | 21 struct PresentationError { |
| 23 PresentationErrorType errorType; | 22 PresentationErrorType error_type; |
| 24 string message; | 23 string message; |
| 25 }; | 24 }; |
| 26 | 25 |
| 27 interface PresentationService { | 26 interface PresentationService { |
| 28 // Returns the last screen availability state if it’s changed since the last | 27 // Returns the last screen availability state if it’s changed since the last |
| 29 // time the method was called. The client has to call this method again when | 28 // time the method was called. The client has to call this method again when |
| 30 // handling the result (provided via Mojo callback) to get the next update | 29 // handling the result (provided via Mojo callback) to get the next update |
| 31 // about the availability status. | 30 // about the availability status. |
| 32 // May start discovery of the presentation screens. The implementation might | 31 // May start discovery of the presentation screens. The implementation might |
| 33 // stop discovery once there are no active calls to GetScreenAvailability. | 32 // stop discovery once there are no active calls to GetScreenAvailability. |
| 34 // |presentation_url| can be specified to help the implementation to filter | 33 // |presentation_url| can be specified to help the implementation to filter |
| 35 // out incompatible screens. | 34 // out incompatible screens. |
| 36 GetScreenAvailability(string? presentation_url) => (bool available); | 35 GetScreenAvailability(string? presentation_url) => (bool available); |
| 37 | 36 |
| 38 // Called when the frame no longer listens to the | 37 // Called when the frame no longer listens to the |
| 39 // |availablechange| event. | 38 // |availablechange| event. |
| 40 OnScreenAvailabilityListenerRemoved(); | 39 OnScreenAvailabilityListenerRemoved(); |
| 41 | 40 |
| 41 // Sets the default presentation URL for the frame. | |
| 42 // If parameter is an empty string, clears the default presentation URL. | |
| 43 SetDefaultPresentationUrl(string default_presentation_url); | |
| 44 | |
| 42 // Called when startSession() is called by the frame. The result callback | 45 // Called when startSession() is called by the frame. The result callback |
| 43 // will return a non-null and valid PresentationSessionInfo if starting the | 46 // will return a non-null and valid PresentationSessionInfo if starting the |
| 44 // session succeeded, or null with a PresentationError if starting the | 47 // session succeeded, or null with a PresentationError if starting the |
| 45 // session failed. | 48 // session failed. |
| 46 // The presentation id is always returned along with the initialized | 49 // The presentation id is always returned along with the initialized |
| 47 // session on success. | 50 // session on success. |
| 48 // If the UA identifies a matching session (same presentation url and id), | 51 // If the UA identifies a matching session (same presentation url and id), |
| 49 // the user may choose this existing session and the page will join it | 52 // the user may choose this existing session and the page will join it |
| 50 // rather than get a new one. An empty presentation id means that the | 53 // rather than get a new one. An empty presentation id means that the |
| 51 // UA will generate the presentation id. | 54 // UA will generate the presentation id. |
| 52 StartSession(string presentation_url, string? presentation_id) | 55 StartSession(string presentation_url, string? presentation_id) |
| 53 => (PresentationSessionInfo? sessionInfo, PresentationError? error); | 56 => (PresentationSessionInfo? sessionInfo, PresentationError? error); |
| 54 | 57 |
| 55 // Called when joinSession() is called by the frame. The result callback | 58 // Called when joinSession() is called by the frame. The result callback |
| 56 // works the same as for the method above. JoinSession will join a known | 59 // works the same as for the method above. JoinSession will join a known |
| 57 // session (i.e. when the page navigates or the user opens another tab) | 60 // session (i.e. when the page navigates or the user opens another tab) |
| 58 // silently and without user action. | 61 // silently and without user action. |
| 59 JoinSession(string presentation_url, string? presentation_id) | 62 JoinSession(string presentation_url, string? presentation_id) |
| 60 => (PresentationSessionInfo? sessionInfo, PresentationError? error); | 63 => (PresentationSessionInfo? sessionInfo, PresentationError? error); |
| 61 }; | 64 }; |
| OLD | NEW |