| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 // A help page to be opened if users select learn_more. | 83 // A help page to be opened if users select learn_more. |
| 84 string? help_url; | 84 string? help_url; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 struct RouteMessage { | 87 struct RouteMessage { |
| 88 enum Type { | 88 enum Type { |
| 89 TEXT, | 89 TEXT, |
| 90 BINARY | 90 BINARY |
| 91 }; | 91 }; |
| 92 // The route ID of this message. | |
| 93 string route_id; | |
| 94 // The type of this message. | 92 // The type of this message. |
| 95 Type type; | 93 Type type; |
| 96 // Used when the |type| is TEXT. | 94 // Used when the |type| is TEXT. |
| 97 string? message; | 95 string? message; |
| 98 // Used when the |type| is BINARY. | 96 // Used when the |type| is BINARY. |
| 99 array<uint8>? data; | 97 array<uint8>? data; |
| 100 }; | 98 }; |
| 101 | 99 |
| 102 // Modeled after the MediaRouter interface defined in | 100 // Modeled after the MediaRouter interface defined in |
| 103 // chrome/browser/media/router/media_router.h | 101 // chrome/browser/media/router/media_router.h |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // StopObservingMediaRoutes() is called. | 154 // StopObservingMediaRoutes() is called. |
| 157 StartObservingMediaRoutes(); | 155 StartObservingMediaRoutes(); |
| 158 | 156 |
| 159 // Stops querying the state of all media routes. | 157 // Stops querying the state of all media routes. |
| 160 StopObservingMediaRoutes(); | 158 StopObservingMediaRoutes(); |
| 161 | 159 |
| 162 // "Clears" an issue after it is addressed. | 160 // "Clears" an issue after it is addressed. |
| 163 ClearIssue(string issue_id); | 161 ClearIssue(string issue_id); |
| 164 | 162 |
| 165 // Called when the MediaRouter is ready to get the next batch of messages | 163 // Called when the MediaRouter is ready to get the next batch of messages |
| 166 // associated with one of the |route_ids|. | 164 // associated with |route_id|. |
| 167 ListenForRouteMessages(array<string> route_ids) | 165 ListenForRouteMessages(string route_id) => (array<RouteMessage> messages); |
| 168 => (array<RouteMessage> messages); | |
| 169 }; | 166 }; |
| 170 | 167 |
| 171 // Interface for a service which observes state changes across media | 168 // Interface for a service which observes state changes across media |
| 172 // sources, sinks, and issues. | 169 // sources, sinks, and issues. |
| 173 interface MediaRouter { | 170 interface MediaRouter { |
| 174 // Registers a MediaRouteProvider with the MediaRouter. | 171 // Registers a MediaRouteProvider with the MediaRouter. |
| 175 // Returns a string that uniquely identifies the Media Router browser | 172 // Returns a string that uniquely identifies the Media Router browser |
| 176 // process. | 173 // process. |
| 177 RegisterMediaRouteProvider(MediaRouteProvider media_router_provider) => | 174 RegisterMediaRouteProvider(MediaRouteProvider media_router_provider) => |
| 178 (string instance_id); | 175 (string instance_id); |
| 179 | 176 |
| 180 // Called when the Media Route Manager receives a new list of sinks. | 177 // Called when the Media Route Manager receives a new list of sinks. |
| 181 OnSinksReceived(string media_source, array<MediaSink> sinks); | 178 OnSinksReceived(string media_source, array<MediaSink> sinks); |
| 182 | 179 |
| 183 // Called when issues are reported for media routes. | 180 // Called when issues are reported for media routes. |
| 184 OnIssue(Issue issue); | 181 OnIssue(Issue issue); |
| 185 | 182 |
| 186 // Called when list of routes has been updated. | 183 // Called when list of routes has been updated. |
| 187 OnRoutesUpdated(array<MediaRoute> routes); | 184 OnRoutesUpdated(array<MediaRoute> routes); |
| 188 }; | 185 }; |
| 189 | 186 |
| OLD | NEW |