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 blink.mojom; | 5 module blink.mojom; |
6 | 6 |
7 struct PresentationSessionInfo { | 7 struct PresentationSessionInfo { |
8 string url; | 8 string url; |
9 string id; | 9 string id; |
10 }; | 10 }; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 // Used when message type is TEXT. | 45 // Used when message type is TEXT. |
46 string? message; | 46 string? message; |
47 // Used when message type is ARRAY_BUFFER or BLOB. | 47 // Used when message type is ARRAY_BUFFER or BLOB. |
48 array<uint8>? data; | 48 array<uint8>? data; |
49 }; | 49 }; |
50 | 50 |
51 interface PresentationService { | 51 interface PresentationService { |
52 // Sets the PresentationServiceClient. | 52 // Sets the PresentationServiceClient. |
53 SetClient(PresentationServiceClient client); | 53 SetClient(PresentationServiceClient client); |
54 | 54 |
55 // Called when the frame sets or changes the default presentation URL. | 55 // Called when the frame sets or changes the default presentation URLs. |
56 // When the default presentation is started on this frame, | 56 // When the default presentation is started on this frame, |
57 // PresentationServiceClient::OnDefaultSessionStarted will be invoked. | 57 // PresentationServiceClient::OnDefaultSessionStarted will be invoked. |
58 SetDefaultPresentationURL(string url); | 58 SetDefaultPresentationUrls(array<string> presentation_urls); |
dcheng
2016/07/30 10:21:03
Please pass URLs as URL types. For Mojo, that is u
mark a. foltz
2016/08/29 23:54:54
Done.
| |
59 | 59 |
60 // Starts listening for screen availability for presentation of | 60 // Starts listening for screen availability for presentation of |
61 // |url|. Availability results will be returned to the client via | 61 // |availability_url|. Availability results will be returned to the client via |
62 // PresentationServiceClient::OnScreenAvailabilityUpdated. | 62 // PresentationServiceClient::OnScreenAvailabilityUpdated. |
63 ListenForScreenAvailability(string url); | 63 ListenForScreenAvailability(string availability_url); |
64 | 64 |
65 // Stops listening for screen availability for the presentation of |url|. The | 65 // Stops listening for screen availability for the presentation of |url|. The |
66 // PresentationServiceClient will stop receiving availability updates for | 66 // PresentationServiceClient will stop receiving availability updates for |
67 // |url|. | 67 // |url|. |
68 StopListeningForScreenAvailability(string url); | 68 StopListeningForScreenAvailability(string availability_url); |
69 | 69 |
70 // Called when startSession() is called by the frame. The result callback | 70 // Called when startSession() is called by the frame. The result callback |
71 // will return a non-null and valid PresentationSessionInfo if starting the | 71 // will return a non-null and valid PresentationSessionInfo if starting the |
72 // session succeeded, or null with a PresentationError if starting the | 72 // session succeeded, or null with a PresentationError if starting the |
73 // session failed. | 73 // session failed. |
74 // The presentation id returned in |sessionInfo| on success is generated by | 74 // The presentation id returned in |sessionInfo| on success is generated by |
75 // the UA. | 75 // the UA. |
76 // If the UA identifies a matching session (same presentation url), the user | 76 // If the UA identifies a matching session (same presentation url), the user |
77 // may choose this existing session and the page will join it rather than get | 77 // may choose this existing session and the page will join it rather than get |
78 // a new one. | 78 // a new one. |
79 StartSession(string presentation_url) | 79 StartSession(array<string> presentation_urls) |
80 => (PresentationSessionInfo? sessionInfo, PresentationError? error); | 80 => (PresentationSessionInfo? sessionInfo, PresentationError? error); |
81 | 81 |
82 // Called when joinSession() is called by the frame. The result callback | 82 // Called when joinSession() is called by the frame. The result callback |
83 // works the same as for the method above. JoinSession will join a known | 83 // works the same as for the method above. JoinSession will join a known |
84 // session (i.e. when the page navigates or the user opens another tab) | 84 // session (i.e. when the page navigates or the user opens another tab) |
85 // silently and without user action. | 85 // silently and without user action. |
86 JoinSession(string presentation_url, string? presentation_id) | 86 JoinSession(array<string> presentation_urls, string? presentation_id) |
87 => (PresentationSessionInfo? sessionInfo, PresentationError? error); | 87 => (PresentationSessionInfo? sessionInfo, PresentationError? error); |
88 | 88 |
89 // Called when send() is called by the frame. The true in the | 89 // Called when send() is called by the frame. The true in the |
90 // result callback notifies that the service is ready for next message. | 90 // result callback notifies that the service is ready for next message. |
91 // The false in the result callback notifies the renderer to stop sending | 91 // The false in the result callback notifies the renderer to stop sending |
92 // the send requests and invalidate all pending requests. This occurs | 92 // the send requests and invalidate all pending requests. This occurs |
93 // for eg., when frame is deleted or navigated away. | 93 // for eg., when frame is deleted or navigated away. |
94 SendSessionMessage(PresentationSessionInfo sessionInfo, | 94 SendSessionMessage(PresentationSessionInfo sessionInfo, |
95 SessionMessage message_request) => (bool success); | 95 SessionMessage message_request) => (bool success); |
96 | 96 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 PresentationConnectionCloseReason reason, | 131 PresentationConnectionCloseReason reason, |
132 string message); | 132 string message); |
133 | 133 |
134 // See PresentationService::ListenForSessionMessages. | 134 // See PresentationService::ListenForSessionMessages. |
135 OnSessionMessagesReceived(PresentationSessionInfo sessionInfo, | 135 OnSessionMessagesReceived(PresentationSessionInfo sessionInfo, |
136 array<SessionMessage> messages); | 136 array<SessionMessage> messages); |
137 | 137 |
138 // See PresentationService::SetDefaultPresentationURL. | 138 // See PresentationService::SetDefaultPresentationURL. |
139 OnDefaultSessionStarted(PresentationSessionInfo sessionInfo); | 139 OnDefaultSessionStarted(PresentationSessionInfo sessionInfo); |
140 }; | 140 }; |
OLD | NEW |