Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2329)

Unified Diff: content/common/presentation/presentation_service.mojom

Issue 935083002: [PresentationAPI] Implementing start/joinSession from WebPresentationClient to PresentationService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the last round of comments Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/BUILD.gn ('k') | content/common/presentation/presentation_session.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d1e4b07909b59f888cd7f09433da54fcdb0742c0 100644
--- a/content/common/presentation/presentation_service.mojom
+++ b/content/common/presentation/presentation_service.mojom
@@ -4,6 +4,26 @@
module presentation;
+import "presentation_session.mojom";
+
+struct PresentationSessionInfo {
+ PresentationSession session;
+ string url;
+ string id;
+};
+
+enum PresentationErrorType {
+ NO_AVAILABLE_SCREENS,
+ SESSION_REQUEST_CANCELLED,
+ NO_PRESENTATION_FOUND,
+ UNKNOWN,
+};
+
+struct PresentationError {
+ PresentationErrorType errorType;
+ 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 +38,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 and valid PresentationSessionInfo if starting the
+ // session succeeded, or null with a PresentationError 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);
+
+ // Called when joinSession() is called by the frame. The result callback
+ // works the same as for the method above. JoinSession will join a known
+ // session (i.e. when the page navigates or the user opens another tab)
+ // silently and without user action.
+ JoinSession(string presentation_url, string? presentation_id)
+ => (PresentationSessionInfo? sessionInfo, PresentationError? error);
};
« no previous file with comments | « content/common/BUILD.gn ('k') | content/common/presentation/presentation_session.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698