 Chromium Code Reviews
 Chromium Code Reviews Issue 2727123002:
  [Media Router] Custom Controls 1 - Add MediaStatus, MediaRouteController, and mojo interfaces  (Closed)
    
  
    Issue 2727123002:
  [Media Router] Custom Controls 1 - Add MediaStatus, MediaRouteController, and mojo interfaces  (Closed) 
  | Index: chrome/browser/media/router/mojo/media_router.mojom | 
| diff --git a/chrome/browser/media/router/mojo/media_router.mojom b/chrome/browser/media/router/mojo/media_router.mojom | 
| index 37fc064748de40d2a68f17ebec05798d2c3a4871..3aa60c0088a23fa44650591a7ced49586510ac73 100644 | 
| --- a/chrome/browser/media/router/mojo/media_router.mojom | 
| +++ b/chrome/browser/media/router/mojo/media_router.mojom | 
| @@ -4,6 +4,8 @@ | 
| module media_router.mojom; | 
| +import "chrome/browser/media/router/mojo/media_controller.mojom"; | 
| +import "chrome/browser/media/router/mojo/media_status.mojom"; | 
| import "mojo/common/time.mojom"; | 
| import "url/mojo/origin.mojom"; | 
| @@ -38,8 +40,7 @@ struct MediaRoute { | 
| string? media_source; | 
| // The ID of sink that is rendering the media content. | 
| string media_sink_id; | 
| - // Human readable description of this route, e.g. | 
| - // "Tab casting". | 
| + // Human readable description of this route, e.g. "Tab casting". | 
| string description; | 
| // Specifies that the route is requested locally. | 
| bool is_local; | 
| @@ -322,6 +323,25 @@ interface MediaRouteProvider { | 
| string media_source, | 
| SinkSearchCriteria search_criteria) => | 
| (string sink_id); | 
| + | 
| + // Creates a controller for the media route with given |route_id| and binds it | 
| + // to |media_controller| for receiving media commands. This method returns | 
| + // false if such a media route doesn't exist, a controller already exists | 
| + // for it, or there was an error while creating a controller. | 
| + // |media_controller| becomes invalid when the media route is terminated. The | 
| + // created controller is destroyed when |media_controller| becomes invalid. | 
| + // TODO(takumif): Consider returning an enum instead of a bool to distinguish | 
| + // between error conditions for metrics/debugging. | 
| + CreateMediaRouteController(string route_id, | 
| + MediaController& media_controller) => | 
| + (bool success); | 
| + | 
| + // Sets the observer to be notified whenever there is a change in the status | 
| + // of a media route. A media route can have at most one observer at a time, | 
| + // and it will be overwritten each time this method is called with the same | 
| + // |route_id|. | 
| + // TODO(takumif): Consider allowing multiple observers per media route. | 
| + SetMediaRouteStatusObserver(string route_id, MediaStatusObserver observer); | 
| 
dcheng
2017/03/08 01:08:20
Is there a time when we'd want to create a media r
 
takumif
2017/03/08 04:24:03
We originally had it that way and there was some d
 
mark a. foltz
2017/03/13 18:22:31
The context might have been support for multiple o
 | 
| }; | 
| // Interface for a service which observes state changes across media |