| 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 }; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // session. If the default session is started by the embedder before this | 66 // session. If the default session is started by the embedder before this |
| 67 // call, the embedder may queue it and run the callback when the call is | 67 // call, the embedder may queue it and run the callback when the call is |
| 68 // performed. | 68 // performed. |
| 69 ListenForDefaultSessionStart() | 69 ListenForDefaultSessionStart() |
| 70 => (PresentationSessionInfo? defaultSessionInfo); | 70 => (PresentationSessionInfo? defaultSessionInfo); |
| 71 | 71 |
| 72 // Called when startSession() is called by the frame. The result callback | 72 // Called when startSession() is called by the frame. The result callback |
| 73 // will return a non-null and valid PresentationSessionInfo if starting the | 73 // will return a non-null and valid PresentationSessionInfo if starting the |
| 74 // session succeeded, or null with a PresentationError if starting the | 74 // session succeeded, or null with a PresentationError if starting the |
| 75 // session failed. | 75 // session failed. |
| 76 // The presentation id is always returned along with the initialized | 76 // The presentation id returned in |sessionInfo| on success is generated by |
| 77 // session on success. | 77 // the UA. |
| 78 // If the UA identifies a matching session (same presentation url and id), | 78 // If the UA identifies a matching session (same presentation url), the user |
| 79 // the user may choose this existing session and the page will join it | 79 // may choose this existing session and the page will join it rather than get |
| 80 // rather than get a new one. An empty presentation id means that the | 80 // a new one. |
| 81 // UA will generate the presentation id. | 81 StartSession(string presentation_url) |
| 82 StartSession(string presentation_url, string? presentation_id) | |
| 83 => (PresentationSessionInfo? sessionInfo, PresentationError? error); | 82 => (PresentationSessionInfo? sessionInfo, PresentationError? error); |
| 84 | 83 |
| 85 // Called when joinSession() is called by the frame. The result callback | 84 // Called when joinSession() is called by the frame. The result callback |
| 86 // works the same as for the method above. JoinSession will join a known | 85 // works the same as for the method above. JoinSession will join a known |
| 87 // session (i.e. when the page navigates or the user opens another tab) | 86 // session (i.e. when the page navigates or the user opens another tab) |
| 88 // silently and without user action. | 87 // silently and without user action. |
| 89 JoinSession(string presentation_url, string? presentation_id) | 88 JoinSession(string presentation_url, string? presentation_id) |
| 90 => (PresentationSessionInfo? sessionInfo, PresentationError? error); | 89 => (PresentationSessionInfo? sessionInfo, PresentationError? error); |
| 91 | 90 |
| 92 // Called when send() is called by the frame. The true in the | 91 // Called when send() is called by the frame. The true in the |
| (...skipping 28 matching lines...) Expand all Loading... |
| 121 // Called when the client is listening for screen availability and the state | 120 // Called when the client is listening for screen availability and the state |
| 122 // changes. When the client starts to listen for screen availability, this | 121 // changes. When the client starts to listen for screen availability, this |
| 123 // method will always be called to give the current known state. It will then | 122 // method will always be called to give the current known state. It will then |
| 124 // be called to notify of state updates. | 123 // be called to notify of state updates. |
| 125 OnScreenAvailabilityUpdated(bool available); | 124 OnScreenAvailabilityUpdated(bool available); |
| 126 | 125 |
| 127 // See PresentationService::ListenForSessionStateChange. | 126 // See PresentationService::ListenForSessionStateChange. |
| 128 OnSessionStateChanged(PresentationSessionInfo sessionInfo, | 127 OnSessionStateChanged(PresentationSessionInfo sessionInfo, |
| 129 PresentationSessionState newState); | 128 PresentationSessionState newState); |
| 130 }; | 129 }; |
| OLD | NEW |