| Index: third_party/WebKit/public/platform/modules/presentation/presentation.mojom
|
| diff --git a/third_party/WebKit/public/platform/modules/presentation/presentation.mojom b/third_party/WebKit/public/platform/modules/presentation/presentation.mojom
|
| deleted file mode 100644
|
| index 96aea0c78a8196a122c49355d7e5b61ab838d670..0000000000000000000000000000000000000000
|
| --- a/third_party/WebKit/public/platform/modules/presentation/presentation.mojom
|
| +++ /dev/null
|
| @@ -1,180 +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.
|
| -
|
| -// TODO(crbug.com/647290): Rename "Session" to "Connection"
|
| -
|
| -module blink.mojom;
|
| -
|
| -import "url/mojo/url.mojom";
|
| -
|
| -struct PresentationSessionInfo {
|
| - url.mojom.Url 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,
|
| - BINARY,
|
| -};
|
| -
|
| -struct ConnectionMessage {
|
| - PresentationMessageType type;
|
| - // Used when message type is TEXT.
|
| - string? message;
|
| - // Used when message type is BINARY.
|
| - // TODO(lethalantidote): Make this a mojo union.
|
| - // See https://crbug.com/632623.
|
| - array<uint8>? data;
|
| -};
|
| -
|
| -interface PresentationConnection {
|
| - // TODO(zhaobin): migrate SendConnectionMessage from PresentationService =>
|
| - // PresentationConnection.Send(). http://crbug.com/658474
|
| -
|
| - // Called when a message is sent by the target connection.
|
| - OnMessage(ConnectionMessage message) => (bool success);
|
| -
|
| - // Called when target connection notifies connection state change.
|
| - DidChangeState(PresentationConnectionState state);
|
| -};
|
| -
|
| -interface PresentationService {
|
| - // Sets the PresentationServiceClient.
|
| - SetClient(PresentationServiceClient client);
|
| -
|
| - ///////////// Functions here are for the controller part of the API. /////////
|
| -
|
| - // Called when the frame sets or changes the default presentation URLs.
|
| - // When the default presentation is started on this frame,
|
| - // PresentationServiceClient::OnDefaultSessionStarted will be invoked.
|
| - SetDefaultPresentationUrls(array<url.mojom.Url> presentation_urls);
|
| -
|
| - // Starts listening for screen availability for presentation of
|
| - // |availability_url|. Availability results will be returned to the client via
|
| - // PresentationServiceClient::OnScreenAvailabilityUpdated.
|
| - ListenForScreenAvailability(url.mojom.Url availability_url);
|
| -
|
| - // Stops listening for screen availability for the presentation of |url|. The
|
| - // PresentationServiceClient will stop receiving availability updates for
|
| - // |url|.
|
| - StopListeningForScreenAvailability(url.mojom.Url availability_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(array<url.mojom.Url> presentation_urls)
|
| - => (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(array<url.mojom.Url> presentation_urls, string? presentation_id)
|
| - => (PresentationSessionInfo? sessionInfo, PresentationError? error);
|
| -
|
| - // Called in StartSession's callback function for offscreen presentation only.
|
| - // It passes in controlling frame's PresentationConnection and
|
| - // PresentationConnectionRequest to PresentationService.
|
| - SetPresentationConnection(
|
| - PresentationSessionInfo sessionInfo,
|
| - PresentationConnection controller_connection_ptr,
|
| - PresentationConnection& receiver_connection_request);
|
| -
|
| - //////////////////////////////////////////////////////////////////////////////
|
| -
|
| - // 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.
|
| - SendConnectionMessage(PresentationSessionInfo sessionInfo,
|
| - ConnectionMessage message_request) => (bool success);
|
| -
|
| - // Called when close() is called by the frame.
|
| - CloseConnection(url.mojom.Url presentation_url, string presentation_id);
|
| -
|
| - // Called when terminate() is called by the frame.
|
| - Terminate(url.mojom.Url presentation_url, string presentation_id);
|
| -
|
| - // Starts listening for messages for session with |sessionInfo|.
|
| - // Messages will be received in
|
| - // PresentationServiceClient::OnConnectionMessagesReceived.
|
| - // This is called after a presentation session is created.
|
| - ListenForConnectionMessages(PresentationSessionInfo sessionInfo);
|
| -};
|
| -
|
| -interface PresentationServiceClient {
|
| -
|
| - ////////////Functions here are called only on the controlling page.///////////
|
| -
|
| - // 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(url.mojom.Url 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(url.mojom.Url url, bool available);
|
| -
|
| - // See PresentationService::SetDefaultPresentationURL.
|
| - OnDefaultSessionStarted(PresentationSessionInfo sessionInfo);
|
| -
|
| - //////////////////////////////////////////////////////////////////////////////
|
| -
|
| - // 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::ListenForConnectionMessages.
|
| - OnConnectionMessagesReceived(PresentationSessionInfo sessionInfo,
|
| - array<ConnectionMessage> messages);
|
| -
|
| - // Called on a presentation receiver when presentation connection is available
|
| - // from the controlling page.
|
| - OnReceiverConnectionAvailable(
|
| - PresentationSessionInfo sessionInfo,
|
| - PresentationConnection controller_connection_ptr,
|
| - PresentationConnection& receiver_connection_request);
|
| -};
|
|
|