| 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 media_router.interfaces; | 5 module media_router.interfaces; |
| 6 | 6 |
| 7 // Represents an output sink to which media can be routed. | 7 // Represents an output sink to which media can be routed. |
| 8 struct MediaSink { | 8 struct MediaSink { |
| 9 // The sink identifier, e.g. "rs71w7mFzYLFlabir_qO4NHl6SUc." | 9 // The sink identifier, e.g. "rs71w7mFzYLFlabir_qO4NHl6SUc." |
| 10 string sink_id; | 10 string sink_id; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 array<ActionType>? secondary_actions; | 77 array<ActionType>? secondary_actions; |
| 78 | 78 |
| 79 // A help page to be opened if users select learn_more. | 79 // A help page to be opened if users select learn_more. |
| 80 string? help_url; | 80 string? help_url; |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 // Modeled after the MediaRouter interface defined in | 83 // Modeled after the MediaRouter interface defined in |
| 84 // chrome/browser/media/router/media_router.h | 84 // chrome/browser/media/router/media_router.h |
| 85 interface MediaRouter { | 85 interface MediaRouter { |
| 86 // Initiates a media route from |media_source| to |sink_id|. | 86 // Initiates a media route from |media_source| to |sink_id|. |
| 87 // The presentation ID of the route created will be |presentation_id|, but it |
| 88 // may be overridden by a provider implementation. The presentation ID will |
| 89 // be used by the presentation API to refer to the created route. |
| 90 // |origin| and |tab_id| may be passed in for enforcing same-origin and/or |
| 91 // same-tab scopes. |
| 92 // Since int types cannot be made optional, use -1 as |tab_id| in cases where |
| 93 // it is not applicable. |
| 87 // If the operation was successful, |route| will be defined and | 94 // If the operation was successful, |route| will be defined and |
| 88 // |error_text| will be null. | 95 // |error_text| will be null. |
| 89 // If the operation failed, |route| will be null and |error_text| | 96 // If the operation failed, |route| will be null and |error_text| |
| 90 // will be set. | 97 // will be set. |
| 91 CreateRoute(string media_source, string sink_id) => | 98 CreateRoute(string media_source, |
| 92 (MediaRoute? route, string? error_text); | 99 string sink_id, |
| 100 string original_presentation_id, |
| 101 string origin, |
| 102 int32 tab_id) => (MediaRoute? route, string? error_text); |
| 103 |
| 104 // Joins an established route given by |presentation_id| |
| 105 // with |media_source|. |
| 106 // |origin| and |tab_id| are used for validating same-origin/tab scopes. |
| 107 // (See CreateRoute for additional documentation) |
| 108 // If the operation was successful, |route| will be defined and |
| 109 // |error_text| will be null. |
| 110 // If the operation failed, |route| will be null and |error_text| |
| 111 // will be set. |
| 112 JoinRoute(string media_source, |
| 113 string presentation_id, |
| 114 string origin, |
| 115 int32 tab_id) => (MediaRoute? route, string? error_text); |
| 93 | 116 |
| 94 // Closes the route specified by |route_id|. | 117 // Closes the route specified by |route_id|. |
| 95 CloseRoute(string route_id); | 118 CloseRoute(string route_id); |
| 96 | 119 |
| 97 // Sends |message| via the media route |media_route_id|. | 120 // Sends |message| via the media route |media_route_id|. |
| 98 // If the operation was successful, |sent| is true; otherwise it is false. | 121 // If the operation was successful, |sent| is true; otherwise it is false. |
| 99 SendRouteMessage(string media_route_id, string message) => (bool sent); | 122 SendRouteMessage(string media_route_id, string message) => (bool sent); |
| 100 | 123 |
| 101 // Starts querying for sinks capable of displaying |media_source|. | 124 // Starts querying for sinks capable of displaying |media_source|. |
| 102 StartObservingMediaSinks(string media_source); | 125 StartObservingMediaSinks(string media_source); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 132 // Called when the Media Route Manager receives a route message. | 155 // Called when the Media Route Manager receives a route message. |
| 133 OnMessage(string media_source, string message); | 156 OnMessage(string media_source, string message); |
| 134 | 157 |
| 135 // Called when issues are reported for media routes. | 158 // Called when issues are reported for media routes. |
| 136 OnIssue(Issue issue); | 159 OnIssue(Issue issue); |
| 137 | 160 |
| 138 // Called when list of routes has been updated. | 161 // Called when list of routes has been updated. |
| 139 OnRoutesUpdated(array<MediaRoute> routes); | 162 OnRoutesUpdated(array<MediaRoute> routes); |
| 140 }; | 163 }; |
| 141 | 164 |
| OLD | NEW |