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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 | 466 |
467 /** | 467 /** |
468 * @type {function()} | 468 * @type {function()} |
469 */ | 469 */ |
470 this.stopObservingMediaRoutes = null; | 470 this.stopObservingMediaRoutes = null; |
471 | 471 |
472 /** | 472 /** |
473 * @type {function()} | 473 * @type {function()} |
474 */ | 474 */ |
475 this.connectRouteByRouteId = null; | 475 this.connectRouteByRouteId = null; |
| 476 |
| 477 /** |
| 478 * @type {function()} |
| 479 */ |
| 480 this.enableMdnsDiscovery = null; |
476 }; | 481 }; |
477 | 482 |
478 /** | 483 /** |
479 * Routes calls from Media Router to the provider manager extension. | 484 * Routes calls from Media Router to the provider manager extension. |
480 * Registered with the MediaRouter stub. | 485 * Registered with the MediaRouter stub. |
481 * @param {!MediaRouter} MediaRouter proxy to call into the | 486 * @param {!MediaRouter} MediaRouter proxy to call into the |
482 * Media Router mojo interface. | 487 * Media Router mojo interface. |
483 * @constructor | 488 * @constructor |
484 */ | 489 */ |
485 function MediaRouteProvider(mediaRouter) { | 490 function MediaRouteProvider(mediaRouter) { |
(...skipping 27 matching lines...) Expand all Loading... |
513 'sendRouteMessage', | 518 'sendRouteMessage', |
514 'sendRouteBinaryMessage', | 519 'sendRouteBinaryMessage', |
515 'listenForRouteMessages', | 520 'listenForRouteMessages', |
516 'stopListeningForRouteMessages', | 521 'stopListeningForRouteMessages', |
517 'detachRoute', | 522 'detachRoute', |
518 'terminateRoute', | 523 'terminateRoute', |
519 'joinRoute', | 524 'joinRoute', |
520 'createRoute', | 525 'createRoute', |
521 'stopObservingMediaSinks', | 526 'stopObservingMediaSinks', |
522 'startObservingMediaRoutes', | 527 'startObservingMediaRoutes', |
523 'connectRouteByRouteId' | 528 'connectRouteByRouteId', |
| 529 'enableMdnsDiscovery', |
524 ]; | 530 ]; |
525 requiredHandlers.forEach(function(nextHandler) { | 531 requiredHandlers.forEach(function(nextHandler) { |
526 if (handlers[nextHandler] === undefined) { | 532 if (handlers[nextHandler] === undefined) { |
527 console.error(nextHandler + ' handler not registered.'); | 533 console.error(nextHandler + ' handler not registered.'); |
528 } | 534 } |
529 }); | 535 }); |
530 } | 536 } |
531 | 537 |
532 /** | 538 /** |
533 * Starts querying for sinks capable of displaying the media source | 539 * Starts querying for sinks capable of displaying the media source |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 | 739 |
734 /** | 740 /** |
735 * Requests that the provider manager stop sending information about active | 741 * Requests that the provider manager stop sending information about active |
736 * media routes to the Media Router. | 742 * media routes to the Media Router. |
737 * @param {!string} sourceUrn | 743 * @param {!string} sourceUrn |
738 */ | 744 */ |
739 MediaRouteProvider.prototype.stopObservingMediaRoutes = function(sourceUrn) { | 745 MediaRouteProvider.prototype.stopObservingMediaRoutes = function(sourceUrn) { |
740 this.handlers_.stopObservingMediaRoutes(sourceUrn); | 746 this.handlers_.stopObservingMediaRoutes(sourceUrn); |
741 }; | 747 }; |
742 | 748 |
| 749 /** |
| 750 * Enables mDNS device discovery. |
| 751 */ |
| 752 MediaRouteProvider.prototype.enableMdnsDiscovery = function() { |
| 753 this.handlers_.enableMdnsDiscovery(); |
| 754 }; |
| 755 |
743 mediaRouter = new MediaRouter(connector.bindHandleToProxy( | 756 mediaRouter = new MediaRouter(connector.bindHandleToProxy( |
744 serviceProvider.connectToService( | 757 serviceProvider.connectToService( |
745 mediaRouterMojom.MediaRouter.name), | 758 mediaRouterMojom.MediaRouter.name), |
746 mediaRouterMojom.MediaRouter)); | 759 mediaRouterMojom.MediaRouter)); |
747 | 760 |
748 return mediaRouter; | 761 return mediaRouter; |
749 }); | 762 }); |
750 | 763 |
OLD | NEW |