| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 'default_action': issueActionToMojo_(issue.defaultAction), | 250 'default_action': issueActionToMojo_(issue.defaultAction), |
| 251 'secondary_actions': secondaryActions, | 251 'secondary_actions': secondaryActions, |
| 252 'help_url': issue.helpUrl, | 252 'help_url': issue.helpUrl, |
| 253 'is_blocking': issue.isBlocking | 253 'is_blocking': issue.isBlocking |
| 254 })); | 254 })); |
| 255 }; | 255 }; |
| 256 | 256 |
| 257 /** | 257 /** |
| 258 * Called by the provider manager when the set of active routes | 258 * Called by the provider manager when the set of active routes |
| 259 * has been updated. | 259 * has been updated. |
| 260 * @param {!string} sourceUrn The sourUrn associated with this route query. |
| 260 * @param {!Array<MediaRoute>} routes The active set of media routes. | 261 * @param {!Array<MediaRoute>} routes The active set of media routes. |
| 262 * @param {!Array<string>} joinableRoutes The active set of joinable media |
| 263 * routes. |
| 261 */ | 264 */ |
| 262 MediaRouter.prototype.onRoutesUpdated = function(routes) { | 265 MediaRouter.prototype.onRoutesUpdated = |
| 263 this.service_.onRoutesUpdated(routes.map(routeToMojo_)); | 266 function(sourceUrn, routes, joinableRouteIds) { |
| 267 this.service_.onRoutesUpdated( |
| 268 sourceUrn, routes.map(routeToMojo_), joinableRouteIds); |
| 264 }; | 269 }; |
| 265 | 270 |
| 266 /** | 271 /** |
| 267 * Called by the provider manager when sink availability has been updated. | 272 * Called by the provider manager when sink availability has been updated. |
| 268 * @param {!MediaRouter.SinkAvailability} The new sink availability. | 273 * @param {!MediaRouter.SinkAvailability} The new sink availability. |
| 269 */ | 274 */ |
| 270 MediaRouter.prototype.onSinkAvailabilityUpdated = function(availability) { | 275 MediaRouter.prototype.onSinkAvailabilityUpdated = function(availability) { |
| 271 this.service_.onSinkAvailabilityUpdated(availability); | 276 this.service_.onSinkAvailabilityUpdated(availability); |
| 272 }; | 277 }; |
| 273 | 278 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 * @param {!string} routeId | 541 * @param {!string} routeId |
| 537 */ | 542 */ |
| 538 MediaRouteProvider.prototype.onPresentationSessionDetached = function( | 543 MediaRouteProvider.prototype.onPresentationSessionDetached = function( |
| 539 routeId) { | 544 routeId) { |
| 540 this.handlers_.onPresentationSessionDetached(routeId); | 545 this.handlers_.onPresentationSessionDetached(routeId); |
| 541 }; | 546 }; |
| 542 | 547 |
| 543 /** | 548 /** |
| 544 * Requests that the provider manager start sending information about active | 549 * Requests that the provider manager start sending information about active |
| 545 * media routes to the Media Router. | 550 * media routes to the Media Router. |
| 551 * @param {!string} sourceUrn |
| 546 */ | 552 */ |
| 547 MediaRouteProvider.prototype.startObservingMediaRoutes = function() { | 553 MediaRouteProvider.prototype.startObservingMediaRoutes = function(sourceUrn) { |
| 548 this.handlers_.startObservingMediaRoutes(); | 554 this.handlers_.startObservingMediaRoutes(sourceUrn); |
| 549 }; | 555 }; |
| 550 | 556 |
| 551 /** | 557 /** |
| 552 * Requests that the provider manager stop sending information about active | 558 * Requests that the provider manager stop sending information about active |
| 553 * media routes to the Media Router. | 559 * media routes to the Media Router. |
| 560 * @param {!string} sourceUrn |
| 554 */ | 561 */ |
| 555 MediaRouteProvider.prototype.stopObservingMediaRoutes = function() { | 562 MediaRouteProvider.prototype.stopObservingMediaRoutes = function(sourceUrn) { |
| 556 this.handlers_.stopObservingMediaRoutes(); | 563 this.handlers_.stopObservingMediaRoutes(sourceUrn); |
| 557 }; | 564 }; |
| 558 | 565 |
| 559 mediaRouter = new MediaRouter(connector.bindHandleToProxy( | 566 mediaRouter = new MediaRouter(connector.bindHandleToProxy( |
| 560 serviceProvider.connectToService( | 567 serviceProvider.connectToService( |
| 561 mediaRouterMojom.MediaRouter.name), | 568 mediaRouterMojom.MediaRouter.name), |
| 562 mediaRouterMojom.MediaRouter)); | 569 mediaRouterMojom.MediaRouter)); |
| 563 | 570 |
| 564 return mediaRouter; | 571 return mediaRouter; |
| 565 }); | 572 }); |
| 566 | 573 |
| OLD | NEW |