Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Side by Side Diff: extensions/renderer/resources/media_router_bindings.js

Issue 1862913004: [Media Router] Wire through a new MRPM call to update media sinks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed indent, added wake reason. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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.startDiscovery = 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
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 'startDiscovery',
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
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 * Starts discovery.
764 */
765 MediaRouteProvider.prototype.startDiscovery = function() {
766 this.handlers_.startDiscovery();
767 };
768
756 mediaRouter = new MediaRouter(connector.bindHandleToProxy( 769 mediaRouter = new MediaRouter(connector.bindHandleToProxy(
757 serviceProvider.connectToService( 770 serviceProvider.connectToService(
758 mediaRouterMojom.MediaRouter.name), 771 mediaRouterMojom.MediaRouter.name),
759 mediaRouterMojom.MediaRouter)); 772 mediaRouterMojom.MediaRouter));
760 773
761 return mediaRouter; 774 return mediaRouter;
762 }); 775 });
763 776
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698