| 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/frame_service_registry', | 10 'content/public/renderer/frame_service_registry', |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 | 471 |
| 472 /** | 472 /** |
| 473 * @type {function()} | 473 * @type {function()} |
| 474 */ | 474 */ |
| 475 this.connectRouteByRouteId = null; | 475 this.connectRouteByRouteId = null; |
| 476 | 476 |
| 477 /** | 477 /** |
| 478 * @type {function()} | 478 * @type {function()} |
| 479 */ | 479 */ |
| 480 this.enableMdnsDiscovery = null; | 480 this.enableMdnsDiscovery = null; |
| 481 |
| 482 /** |
| 483 * @type {function()} |
| 484 */ |
| 485 this.updateMediaSinks = null; |
| 481 }; | 486 }; |
| 482 | 487 |
| 483 /** | 488 /** |
| 484 * Routes calls from Media Router to the provider manager extension. | 489 * Routes calls from Media Router to the provider manager extension. |
| 485 * Registered with the MediaRouter stub. | 490 * Registered with the MediaRouter stub. |
| 486 * @param {!MediaRouter} MediaRouter proxy to call into the | 491 * @param {!MediaRouter} MediaRouter proxy to call into the |
| 487 * Media Router mojo interface. | 492 * Media Router mojo interface. |
| 488 * @constructor | 493 * @constructor |
| 489 */ | 494 */ |
| 490 function MediaRouteProvider(mediaRouter) { | 495 function MediaRouteProvider(mediaRouter) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 520 'listenForRouteMessages', | 525 'listenForRouteMessages', |
| 521 'stopListeningForRouteMessages', | 526 'stopListeningForRouteMessages', |
| 522 'detachRoute', | 527 'detachRoute', |
| 523 'terminateRoute', | 528 'terminateRoute', |
| 524 'joinRoute', | 529 'joinRoute', |
| 525 'createRoute', | 530 'createRoute', |
| 526 'stopObservingMediaSinks', | 531 'stopObservingMediaSinks', |
| 527 'startObservingMediaRoutes', | 532 'startObservingMediaRoutes', |
| 528 'connectRouteByRouteId', | 533 'connectRouteByRouteId', |
| 529 'enableMdnsDiscovery', | 534 'enableMdnsDiscovery', |
| 535 'updateMediaSinks', |
| 530 ]; | 536 ]; |
| 531 requiredHandlers.forEach(function(nextHandler) { | 537 requiredHandlers.forEach(function(nextHandler) { |
| 532 if (handlers[nextHandler] === undefined) { | 538 if (handlers[nextHandler] === undefined) { |
| 533 console.error(nextHandler + ' handler not registered.'); | 539 console.error(nextHandler + ' handler not registered.'); |
| 534 } | 540 } |
| 535 }); | 541 }); |
| 536 } | 542 } |
| 537 | 543 |
| 538 /** | 544 /** |
| 539 * Starts querying for sinks capable of displaying the media source | 545 * Starts querying for sinks capable of displaying the media source |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 this.handlers_.stopObservingMediaRoutes(sourceUrn); | 752 this.handlers_.stopObservingMediaRoutes(sourceUrn); |
| 747 }; | 753 }; |
| 748 | 754 |
| 749 /** | 755 /** |
| 750 * Enables mDNS device discovery. | 756 * Enables mDNS device discovery. |
| 751 */ | 757 */ |
| 752 MediaRouteProvider.prototype.enableMdnsDiscovery = function() { | 758 MediaRouteProvider.prototype.enableMdnsDiscovery = function() { |
| 753 this.handlers_.enableMdnsDiscovery(); | 759 this.handlers_.enableMdnsDiscovery(); |
| 754 }; | 760 }; |
| 755 | 761 |
| 762 /** |
| 763 * Requests that the provider manager update media sinks. |
| 764 * @param {!string} sourceUrn |
| 765 */ |
| 766 MediaRouteProvider.prototype.updateMediaSinks = function(sourceUrn) { |
| 767 this.handlers_.updateMediaSinks(sourceUrn); |
| 768 }; |
| 769 |
| 756 mediaRouter = new MediaRouter(connector.bindHandleToProxy( | 770 mediaRouter = new MediaRouter(connector.bindHandleToProxy( |
| 757 serviceProvider.connectToService( | 771 serviceProvider.connectToService( |
| 758 mediaRouterMojom.MediaRouter.name), | 772 mediaRouterMojom.MediaRouter.name), |
| 759 mediaRouterMojom.MediaRouter)); | 773 mediaRouterMojom.MediaRouter)); |
| 760 | 774 |
| 761 return mediaRouter; | 775 return mediaRouter; |
| 762 }); | 776 }); |
| 763 | 777 |
| OLD | NEW |