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

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

Issue 1314413005: [Presentation API] 1-UA presentation support + presenter APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/service_provider', 10 'content/public/renderer/service_provider',
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 * @param {!number} tabId ID of tab requesting presentation. 418 * @param {!number} tabId ID of tab requesting presentation.
419 * @return {!Promise.<!Object>} A Promise resolving to an object describing 419 * @return {!Promise.<!Object>} A Promise resolving to an object describing
420 * the newly created media route, or rejecting with an error message on 420 * the newly created media route, or rejecting with an error message on
421 * failure. 421 * failure.
422 */ 422 */
423 MediaRouteProvider.prototype.createRoute = 423 MediaRouteProvider.prototype.createRoute =
424 function(sourceUrn, sinkId, presentationId, origin, tabId) { 424 function(sourceUrn, sinkId, presentationId, origin, tabId) {
425 return this.handlers_.createRoute( 425 return this.handlers_.createRoute(
426 sourceUrn, sinkId, presentationId, origin, tabId) 426 sourceUrn, sinkId, presentationId, origin, tabId)
427 .then(function(route) { 427 .then(function(route) {
428 return {route: routeToMojo_(route)}; 428 return {route: routeToMojo_(route),
429 // TODO(imcheng): Plumb is_one_ua_presentation.
430 is_one_ua_presentation: false};
429 }.bind(this)) 431 }.bind(this))
430 .catch(function(err) { 432 .catch(function(err) {
431 return {error_text: 'Error creating route: ' + err.message}; 433 return {error_text: 'Error creating route: ' + err.message,
434 is_one_ua_presentation: false};
432 }); 435 });
433 }; 436 };
434 437
435 /** 438 /**
436 * Handles a request via the Presentation API to join an existing route given 439 * Handles a request via the Presentation API to join an existing route given
437 * by |sourceUrn| and |presentationId|. |origin| and |tabId| are used for 440 * by |sourceUrn| and |presentationId|. |origin| and |tabId| are used for
438 * validating same-origin/tab scope. 441 * validating same-origin/tab scope.
439 * @param {!string} sourceUrn Media source to render. 442 * @param {!string} sourceUrn Media source to render.
440 * @param {!string} presentationId Presentation ID to join. 443 * @param {!string} presentationId Presentation ID to join.
441 * @param {!string} origin Origin of site requesting join. 444 * @param {!string} origin Origin of site requesting join.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 }; 553 };
551 554
552 mediaRouter = new MediaRouter(connector.bindHandleToProxy( 555 mediaRouter = new MediaRouter(connector.bindHandleToProxy(
553 serviceProvider.connectToService( 556 serviceProvider.connectToService(
554 mediaRouterMojom.MediaRouter.name), 557 mediaRouterMojom.MediaRouter.name),
555 mediaRouterMojom.MediaRouter)); 558 mediaRouterMojom.MediaRouter));
556 559
557 return mediaRouter; 560 return mediaRouter;
558 }); 561 });
559 562
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698