| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 // StopObservingMediaRoutes() is called. | 149 // StopObservingMediaRoutes() is called. |
| 152 StartObservingMediaRoutes(); | 150 StartObservingMediaRoutes(); |
| 153 | 151 |
| 154 // Stops querying the state of all media routes. | 152 // Stops querying the state of all media routes. |
| 155 StopObservingMediaRoutes(); | 153 StopObservingMediaRoutes(); |
| 156 | 154 |
| 157 // "Clears" an issue after it is addressed. | 155 // "Clears" an issue after it is addressed. |
| 158 ClearIssue(string issue_id); | 156 ClearIssue(string issue_id); |
| 159 | 157 |
| 160 // Called when the MediaRouter is ready to get the next batch of messages | 158 // Called when the MediaRouter is ready to get the next batch of messages |
| 161 // associated with one of the |route_ids|. | 159 // associated with |route_id|. |
| 162 ListenForRouteMessages(array<string> route_ids) | 160 ListenForRouteMessages(string route_id) => (array<RouteMessage> messages); |
| 163 => (array<RouteMessage> messages); | |
| 164 }; | 161 }; |
| 165 | 162 |
| 166 // Interface for a service which observes state changes across media | 163 // Interface for a service which observes state changes across media |
| 167 // sources, sinks, and issues. | 164 // sources, sinks, and issues. |
| 168 interface MediaRouter { | 165 interface MediaRouter { |
| 169 // Registers a MediaRouteProvider with the MediaRouter. | 166 // Registers a MediaRouteProvider with the MediaRouter. |
| 170 // Returns a string that uniquely identifies the Media Router browser | 167 // Returns a string that uniquely identifies the Media Router browser |
| 171 // process. | 168 // process. |
| 172 RegisterMediaRouteProvider(MediaRouteProvider media_router_provider) => | 169 RegisterMediaRouteProvider(MediaRouteProvider media_router_provider) => |
| 173 (string instance_id); | 170 (string instance_id); |
| 174 | 171 |
| 175 // Called when the Media Route Manager receives a new list of sinks. | 172 // Called when the Media Route Manager receives a new list of sinks. |
| 176 OnSinksReceived(string media_source, array<MediaSink> sinks); | 173 OnSinksReceived(string media_source, array<MediaSink> sinks); |
| 177 | 174 |
| 178 // Called when issues are reported for media routes. | 175 // Called when issues are reported for media routes. |
| 179 OnIssue(Issue issue); | 176 OnIssue(Issue issue); |
| 180 | 177 |
| 181 // Called when list of routes has been updated. | 178 // Called when list of routes has been updated. |
| 182 OnRoutesUpdated(array<MediaRoute> routes); | 179 OnRoutesUpdated(array<MediaRoute> routes); |
| 183 }; | 180 }; |
| 184 | 181 |
| OLD | NEW |