| 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 var mediaRouter; | 5 var mediaRouter; |
| 6 | 6 |
| 7 define('media_router_bindings', [ | 7 define('media_router_bindings', [ |
| 8 'mojo/public/js/bindings', | 8 'mojo/public/js/bindings', |
| 9 'mojo/public/js/core', | 9 'mojo/public/js/core', |
| 10 'content/public/renderer/service_provider', | 10 'content/public/renderer/service_provider', |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 'default_action': issueActionToMojo_(issue.defaultAction), | 271 'default_action': issueActionToMojo_(issue.defaultAction), |
| 272 'secondary_actions': secondaryActions, | 272 'secondary_actions': secondaryActions, |
| 273 'help_url': issue.helpUrl, | 273 'help_url': issue.helpUrl, |
| 274 'is_blocking': issue.isBlocking | 274 'is_blocking': issue.isBlocking |
| 275 })); | 275 })); |
| 276 }; | 276 }; |
| 277 | 277 |
| 278 /** | 278 /** |
| 279 * Called by the provider manager when the set of active routes | 279 * Called by the provider manager when the set of active routes |
| 280 * has been updated. | 280 * has been updated. |
| 281 * @param {!string} sourceUrn The sourUrn associated with this route query. |
| 281 * @param {!Array<MediaRoute>} routes The active set of media routes. | 282 * @param {!Array<MediaRoute>} routes The active set of media routes. |
| 283 * @param {!Array<string>} joinableRoutes The active set of joinable media |
| 284 * routes. |
| 282 */ | 285 */ |
| 283 MediaRouter.prototype.onRoutesUpdated = function(routes) { | 286 MediaRouter.prototype.onRoutesUpdated = |
| 284 this.service_.onRoutesUpdated(routes.map(routeToMojo_)); | 287 function(sourceUrn, routes, joinableRouteIds) { |
| 288 this.service_.onRoutesUpdated( |
| 289 sourceUrn, routes.map(routeToMojo_), joinableRouteIds); |
| 285 }; | 290 }; |
| 286 | 291 |
| 287 /** | 292 /** |
| 288 * Called by the provider manager when sink availability has been updated. | 293 * Called by the provider manager when sink availability has been updated. |
| 289 * @param {!mediaRouterMojom.MediaRouter.SinkAvailability} availability | 294 * @param {!mediaRouterMojom.MediaRouter.SinkAvailability} availability |
| 290 * The new sink availability. | 295 * The new sink availability. |
| 291 */ | 296 */ |
| 292 MediaRouter.prototype.onSinkAvailabilityUpdated = function(availability) { | 297 MediaRouter.prototype.onSinkAvailabilityUpdated = function(availability) { |
| 293 this.service_.onSinkAvailabilityUpdated(availability); | 298 this.service_.onSinkAvailabilityUpdated(availability); |
| 294 }; | 299 }; |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 * @param {!string} routeId | 575 * @param {!string} routeId |
| 571 */ | 576 */ |
| 572 MediaRouteProvider.prototype.onPresentationSessionDetached = function( | 577 MediaRouteProvider.prototype.onPresentationSessionDetached = function( |
| 573 routeId) { | 578 routeId) { |
| 574 this.handlers_.onPresentationSessionDetached(routeId); | 579 this.handlers_.onPresentationSessionDetached(routeId); |
| 575 }; | 580 }; |
| 576 | 581 |
| 577 /** | 582 /** |
| 578 * Requests that the provider manager start sending information about active | 583 * Requests that the provider manager start sending information about active |
| 579 * media routes to the Media Router. | 584 * media routes to the Media Router. |
| 585 * @param {!string} sourceUrn |
| 580 */ | 586 */ |
| 581 MediaRouteProvider.prototype.startObservingMediaRoutes = function() { | 587 MediaRouteProvider.prototype.startObservingMediaRoutes = function(sourceUrn) { |
| 582 this.handlers_.startObservingMediaRoutes(); | 588 this.handlers_.startObservingMediaRoutes(sourceUrn); |
| 583 }; | 589 }; |
| 584 | 590 |
| 585 /** | 591 /** |
| 586 * Requests that the provider manager stop sending information about active | 592 * Requests that the provider manager stop sending information about active |
| 587 * media routes to the Media Router. | 593 * media routes to the Media Router. |
| 594 * @param {!string} sourceUrn |
| 588 */ | 595 */ |
| 589 MediaRouteProvider.prototype.stopObservingMediaRoutes = function() { | 596 MediaRouteProvider.prototype.stopObservingMediaRoutes = function(sourceUrn) { |
| 590 this.handlers_.stopObservingMediaRoutes(); | 597 this.handlers_.stopObservingMediaRoutes(sourceUrn); |
| 591 }; | 598 }; |
| 592 | 599 |
| 593 mediaRouter = new MediaRouter(connector.bindHandleToProxy( | 600 mediaRouter = new MediaRouter(connector.bindHandleToProxy( |
| 594 serviceProvider.connectToService( | 601 serviceProvider.connectToService( |
| 595 mediaRouterMojom.MediaRouter.name), | 602 mediaRouterMojom.MediaRouter.name), |
| 596 mediaRouterMojom.MediaRouter)); | 603 mediaRouterMojom.MediaRouter)); |
| 597 | 604 |
| 598 return mediaRouter; | 605 return mediaRouter; |
| 599 }); | 606 }); |
| 600 | 607 |
| OLD | NEW |