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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
319 this.createRoute = null; | 319 this.createRoute = null; |
320 | 320 |
321 /** | 321 /** |
322 * @type {function(!string, !string, !string, !number)} | 322 * @type {function(!string, !string, !string, !number)} |
323 */ | 323 */ |
324 this.joinRoute = null; | 324 this.joinRoute = null; |
325 | 325 |
326 /** | 326 /** |
327 * @type {function(string)} | 327 * @type {function(string)} |
328 */ | 328 */ |
329 this.closeRoute = null; | 329 this.terminateRoute = null; |
330 | 330 |
331 /** | 331 /** |
332 * @type {function(string)} | 332 * @type {function(string)} |
333 */ | 333 */ |
334 this.startObservingMediaSinks = null; | 334 this.startObservingMediaSinks = null; |
335 | 335 |
336 /** | 336 /** |
337 * @type {function(string)} | 337 * @type {function(string)} |
338 */ | 338 */ |
339 this.stopObservingMediaSinks = null; | 339 this.stopObservingMediaSinks = null; |
(...skipping 15 matching lines...) Expand all Loading... | |
355 this.listenForRouteMessages = null; | 355 this.listenForRouteMessages = null; |
356 | 356 |
357 /** | 357 /** |
358 * @type {function(string)} | 358 * @type {function(string)} |
359 */ | 359 */ |
360 this.stopListeningForRouteMessages = null; | 360 this.stopListeningForRouteMessages = null; |
361 | 361 |
362 /** | 362 /** |
363 * @type {function(string)} | 363 * @type {function(string)} |
364 */ | 364 */ |
365 this.onPresentationSessionDetached = null; | 365 this.detachRoute = null; |
366 | 366 |
367 /** | 367 /** |
368 * @type {function()} | 368 * @type {function()} |
369 */ | 369 */ |
370 this.startObservingMediaRoutes = null; | 370 this.startObservingMediaRoutes = null; |
371 | 371 |
372 /** | 372 /** |
373 * @type {function()} | 373 * @type {function()} |
374 */ | 374 */ |
375 this.stopObservingMediaRoutes = null; | 375 this.stopObservingMediaRoutes = null; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
407 */ | 407 */ |
408 MediaRouteProvider.prototype.setHandlers = function(handlers) { | 408 MediaRouteProvider.prototype.setHandlers = function(handlers) { |
409 this.handlers_ = handlers; | 409 this.handlers_ = handlers; |
410 var requiredHandlers = [ | 410 var requiredHandlers = [ |
411 'stopObservingMediaRoutes', | 411 'stopObservingMediaRoutes', |
412 'startObservingMediaRoutes', | 412 'startObservingMediaRoutes', |
413 'sendRouteMessage', | 413 'sendRouteMessage', |
414 'sendRouteBinaryMessage', | 414 'sendRouteBinaryMessage', |
415 'listenForRouteMessages', | 415 'listenForRouteMessages', |
416 'stopListeningForRouteMessages', | 416 'stopListeningForRouteMessages', |
417 'onPresentationSessionDetached', | 417 'detachRoute', |
418 'closeRoute', | 418 'terminateRoute', |
419 'joinRoute', | 419 'joinRoute', |
420 'createRoute', | 420 'createRoute', |
421 'stopObservingMediaSinks', | 421 'stopObservingMediaSinks', |
422 'startObservingMediaRoutes' | 422 'startObservingMediaRoutes' |
423 ]; | 423 ]; |
424 requiredHandlers.forEach(function(nextHandler) { | 424 requiredHandlers.forEach(function(nextHandler) { |
425 if (handlers[nextHandler] === undefined) { | 425 if (handlers[nextHandler] === undefined) { |
426 console.error(nextHandler + ' handler not registered.'); | 426 console.error(nextHandler + ' handler not registered.'); |
427 } | 427 } |
428 }); | 428 }); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
494 }, | 494 }, |
495 function(err) { | 495 function(err) { |
496 return {error_text: 'Error joining route: ' + err.message}; | 496 return {error_text: 'Error joining route: ' + err.message}; |
497 }); | 497 }); |
498 }; | 498 }; |
499 | 499 |
500 /** | 500 /** |
501 * Closes the route specified by |routeId|. | 501 * Closes the route specified by |routeId|. |
502 * @param {!string} routeId | 502 * @param {!string} routeId |
503 */ | 503 */ |
504 MediaRouteProvider.prototype.closeRoute = function(routeId) { | 504 MediaRouteProvider.prototype.closeRoute = function(routeId) { |
imcheng
2015/12/10 19:50:46
s/closeRoute/terminateRoute
mark a. foltz
2015/12/10 23:46:49
Done
| |
505 this.handlers_.closeRoute(routeId); | 505 this.handlers_.closeRoute(routeId); |
506 }; | 506 }; |
507 | 507 |
508 /** | 508 /** |
509 * Posts a message to the route designated by |routeId|. | 509 * Posts a message to the route designated by |routeId|. |
510 * @param {!string} routeId | 510 * @param {!string} routeId |
511 * @param {!string} message | 511 * @param {!string} message |
512 * @return {!Promise.<boolean>} Resolved with true if the message was sent, | 512 * @return {!Promise.<boolean>} Resolved with true if the message was sent, |
513 * or false on failure. | 513 * or false on failure. |
514 */ | 514 */ |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
563 MediaRouteProvider.prototype.stopListeningForRouteMessages = function( | 563 MediaRouteProvider.prototype.stopListeningForRouteMessages = function( |
564 routeId) { | 564 routeId) { |
565 return this.handlers_.stopListeningForRouteMessages(routeId); | 565 return this.handlers_.stopListeningForRouteMessages(routeId); |
566 }; | 566 }; |
567 | 567 |
568 /** | 568 /** |
569 * Indicates that the presentation session that was connected to |routeId| is | 569 * Indicates that the presentation session that was connected to |routeId| is |
570 * no longer connected to it. | 570 * no longer connected to it. |
571 * @param {!string} routeId | 571 * @param {!string} routeId |
572 */ | 572 */ |
573 MediaRouteProvider.prototype.onPresentationSessionDetached = function( | 573 MediaRouteProvider.prototype.onPresentationSessionDetached = function( |
imcheng
2015/12/10 19:50:46
s/onPresentationSessionDetached/detachRoute
mark a. foltz
2015/12/10 23:46:49
Done
| |
574 routeId) { | 574 routeId) { |
575 this.handlers_.onPresentationSessionDetached(routeId); | 575 this.handlers_.onPresentationSessionDetached(routeId); |
576 }; | 576 }; |
577 | 577 |
578 /** | 578 /** |
579 * Requests that the provider manager start sending information about active | 579 * Requests that the provider manager start sending information about active |
580 * media routes to the Media Router. | 580 * media routes to the Media Router. |
581 */ | 581 */ |
582 MediaRouteProvider.prototype.startObservingMediaRoutes = function() { | 582 MediaRouteProvider.prototype.startObservingMediaRoutes = function() { |
583 this.handlers_.startObservingMediaRoutes(); | 583 this.handlers_.startObservingMediaRoutes(); |
584 }; | 584 }; |
585 | 585 |
586 /** | 586 /** |
587 * Requests that the provider manager stop sending information about active | 587 * Requests that the provider manager stop sending information about active |
588 * media routes to the Media Router. | 588 * media routes to the Media Router. |
589 */ | 589 */ |
590 MediaRouteProvider.prototype.stopObservingMediaRoutes = function() { | 590 MediaRouteProvider.prototype.stopObservingMediaRoutes = function() { |
591 this.handlers_.stopObservingMediaRoutes(); | 591 this.handlers_.stopObservingMediaRoutes(); |
592 }; | 592 }; |
593 | 593 |
594 mediaRouter = new MediaRouter(connector.bindHandleToProxy( | 594 mediaRouter = new MediaRouter(connector.bindHandleToProxy( |
595 serviceProvider.connectToService( | 595 serviceProvider.connectToService( |
596 mediaRouterMojom.MediaRouter.name), | 596 mediaRouterMojom.MediaRouter.name), |
597 mediaRouterMojom.MediaRouter)); | 597 mediaRouterMojom.MediaRouter)); |
598 | 598 |
599 return mediaRouter; | 599 return mediaRouter; |
600 }); | 600 }); |
601 | 601 |
OLD | NEW |