| Index: content/common/presentation/presentation_service.mojom
|
| diff --git a/content/common/presentation/presentation_service.mojom b/content/common/presentation/presentation_service.mojom
|
| deleted file mode 100644
|
| index 2c470a52ed309fb6a999981ad1e9c295e3ee38c7..0000000000000000000000000000000000000000
|
| --- a/content/common/presentation/presentation_service.mojom
|
| +++ /dev/null
|
| @@ -1,140 +0,0 @@
|
| -// Copyright 2015 The Chromium Authors. All rights reserved.
|
| -// Use of this source code is governed by a BSD-style license that can be
|
| -// found in the LICENSE file.
|
| -
|
| -module content.mojom;
|
| -
|
| -struct PresentationSessionInfo {
|
| - string url;
|
| - string id;
|
| -};
|
| -
|
| -enum PresentationConnectionState {
|
| - CONNECTING,
|
| - CONNECTED,
|
| - CLOSED,
|
| - TERMINATED
|
| -};
|
| -
|
| -enum PresentationConnectionCloseReason {
|
| - CONNECTION_ERROR,
|
| - CLOSED,
|
| - WENT_AWAY
|
| -};
|
| -
|
| -enum PresentationErrorType {
|
| - NO_AVAILABLE_SCREENS,
|
| - SESSION_REQUEST_CANCELLED,
|
| - NO_PRESENTATION_FOUND,
|
| - UNKNOWN,
|
| -};
|
| -
|
| -struct PresentationError {
|
| - PresentationErrorType error_type;
|
| - string message;
|
| -};
|
| -
|
| -enum PresentationMessageType {
|
| - TEXT,
|
| - ARRAY_BUFFER,
|
| - BLOB,
|
| -};
|
| -
|
| -struct SessionMessage {
|
| - PresentationMessageType type;
|
| - // Used when message type is TEXT.
|
| - string? message;
|
| - // Used when message type is ARRAY_BUFFER or BLOB.
|
| - array<uint8>? data;
|
| -};
|
| -
|
| -interface PresentationService {
|
| - // Sets the PresentationServiceClient.
|
| - SetClient(PresentationServiceClient client);
|
| -
|
| - // Called when the frame sets or changes the default presentation URL.
|
| - // When the default presentation is started on this frame,
|
| - // PresentationServiceClient::OnDefaultSessionStarted will be invoked.
|
| - SetDefaultPresentationURL(string url);
|
| -
|
| - // Starts listening for screen availability for presentation of
|
| - // |url|. Availability results will be returned to the client via
|
| - // PresentationServiceClient::OnScreenAvailabilityUpdated.
|
| - ListenForScreenAvailability(string url);
|
| -
|
| - // Stops listening for screen availability for the presentation of |url|. The
|
| - // PresentationServiceClient will stop receiving availability updates for
|
| - // |url|.
|
| - StopListeningForScreenAvailability(string url);
|
| -
|
| - // 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 returned in |sessionInfo| on success is generated by
|
| - // the UA.
|
| - // If the UA identifies a matching session (same presentation url), the user
|
| - // may choose this existing session and the page will join it rather than get
|
| - // a new one.
|
| - StartSession(string presentation_url)
|
| - => (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);
|
| -
|
| - // Called when send() is called by the frame. The true in the
|
| - // result callback notifies that the service is ready for next message.
|
| - // The false in the result callback notifies the renderer to stop sending
|
| - // the send requests and invalidate all pending requests. This occurs
|
| - // for eg., when frame is deleted or navigated away.
|
| - SendSessionMessage(PresentationSessionInfo sessionInfo,
|
| - SessionMessage message_request) => (bool success);
|
| -
|
| - // Called when close() is called by the frame.
|
| - CloseConnection(string presentation_url, string presentation_id);
|
| -
|
| - // Called when terminate() is called by the frame.
|
| - Terminate(string presentation_url, string presentation_id);
|
| -
|
| - // Starts listening for messages for session with |sessionInfo|.
|
| - // Messages will be received in
|
| - // PresentationServiceClient::OnSessionMessagesReceived.
|
| - // This is called after a presentation session is created.
|
| - ListenForSessionMessages(PresentationSessionInfo sessionInfo);
|
| -};
|
| -
|
| -interface PresentationServiceClient {
|
| - // Called when the client tries to listen for screen availability changes for
|
| - // presentation of |url| but it is not supported by the device or underlying
|
| - // platform. This can also be called if the device is currently in a mode
|
| - // where it can't do screen discoveries (eg. low battery).
|
| - OnScreenAvailabilityNotSupported(string url);
|
| -
|
| - // Called when the client is listening for screen availability for
|
| - // presentation of |url| and the state changes. When the client starts to
|
| - // listen for screen availability, this method will always be called to give
|
| - // the current known state. It will then be called to notify of state updates.
|
| - OnScreenAvailabilityUpdated(string url, bool available);
|
| -
|
| - // Called when the state of PresentationConnection |connection| started on
|
| - // this frame has changed to |newState|.
|
| - OnConnectionStateChanged(PresentationSessionInfo connection,
|
| - PresentationConnectionState newState);
|
| -
|
| - // Caled when the state of |connection| started on this frame has changed to
|
| - // CLOSED.
|
| - OnConnectionClosed(PresentationSessionInfo connection,
|
| - PresentationConnectionCloseReason reason,
|
| - string message);
|
| -
|
| - // See PresentationService::ListenForSessionMessages.
|
| - OnSessionMessagesReceived(PresentationSessionInfo sessionInfo,
|
| - array<SessionMessage> messages);
|
| -
|
| - // See PresentationService::SetDefaultPresentationURL.
|
| - OnDefaultSessionStarted(PresentationSessionInfo sessionInfo);
|
| -};
|
|
|