Index: content/common/presentation/presentation_service.mojom |
diff --git a/content/common/presentation/presentation_service.mojom b/content/common/presentation/presentation_service.mojom |
index 2ff381a41cb5d2f7affb681cf2cc65dfddadd909..a82ba591b95bdd2f34ddd4dd68dc6a8a72653088 100644 |
--- a/content/common/presentation/presentation_service.mojom |
+++ b/content/common/presentation/presentation_service.mojom |
@@ -4,6 +4,19 @@ |
module presentation; |
+import "presentation_session.mojom"; |
+ |
+struct PresentationSessionInfo { |
+ PresentationSession session; |
+ string url; |
+ string id; |
+}; |
+ |
+struct PresentationError { |
+ 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.
|
+ string message; |
+}; |
+ |
interface PresentationService { |
// Returns the last screen availability state if it’s changed since the last |
// time the method was called. The client has to call this method again when |
@@ -18,4 +31,24 @@ interface PresentationService { |
// Called when the frame no longer listens to the |
// |availablechange| event. |
OnScreenAvailabilityListenerRemoved(); |
+ |
+ // Called when startSession() is called by the frame. The result callback |
+ // will return a non-null PresentationSessionInfo if starting the session |
+ // succeeded (so the session object is valid) or an error message if |
+ // starting the session failed. |
+ // The presentation id is always returned along with the initialized |
+ // session on success. |
+ // If the UA identifies a matching session (same presentation url and id), |
+ // the user may choose this existing session and the page will join it |
+ // rather than get a new one. An empty presentation id means that the |
+ // UA will generate the presentation id. |
+ StartSession(string presentation_url, string? presentation_id) => ( |
+ 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.
|
+ |
+ // Called when joinSession() is called by the frame. The result callback |
+ // works the same as for the method above. JoinSession is used to silently |
+ // (no user action needed) join a known session (i.e. when the page |
+ // navigates or the user opens another tab). |
+ JoinSession(string presentation_url, string? presentation_id) => ( |
+ PresentationSessionInfo? sessionInfo, PresentationError? error); |
mlamouri (slow - plz ping)
2015/02/23 14:07:39
ditto
whywhat
2015/02/25 14:12:41
Done.
|
}; |