Chromium Code Reviews| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 257 * @return {boolean} | 257 * @return {boolean} |
| 258 */ | 258 */ |
| 259 MediaRouter.prototype.getKeepAlive = function() { | 259 MediaRouter.prototype.getKeepAlive = function() { |
| 260 return this.keepAlive_ != null; | 260 return this.keepAlive_ != null; |
| 261 }; | 261 }; |
| 262 | 262 |
| 263 /** | 263 /** |
| 264 * Called by the provider manager when a sink list for a given source is | 264 * Called by the provider manager when a sink list for a given source is |
| 265 * updated. | 265 * updated. |
| 266 * @param {!string} sourceUrn | 266 * @param {!string} sourceUrn |
| 267 * @param {!string} origin | |
| 267 * @param {!Array<!MediaSink>} sinks | 268 * @param {!Array<!MediaSink>} sinks |
| 268 */ | 269 */ |
| 269 MediaRouter.prototype.onSinksReceived = function(sourceUrn, sinks) { | 270 MediaRouter.prototype.onSinksReceived = function( |
| 270 this.service_.onSinksReceived(sourceUrn, sinks.map(sinkToMojo_)); | 271 sourceUrn, origin, sinks) { |
| 272 this.service_.onSinksReceived(sourceUrn, origin, sinks.map(sinkToMojo_)); | |
|
mark a. foltz
2016/03/03 22:58:37
How will this handle an extension that does not us
matt.boetger
2016/03/04 00:22:11
Done.
| |
| 271 }; | 273 }; |
| 272 | 274 |
| 273 /** | 275 /** |
| 274 * Called by the provider manager to keep the extension from suspending | 276 * Called by the provider manager to keep the extension from suspending |
| 275 * if it enters a state where suspension is undesirable (e.g. there is an | 277 * if it enters a state where suspension is undesirable (e.g. there is an |
| 276 * active MediaRoute.) | 278 * active MediaRoute.) |
| 277 * If keepAlive is true, the extension is kept alive. | 279 * If keepAlive is true, the extension is kept alive. |
| 278 * If keepAlive is false, the extension is allowed to suspend. | 280 * If keepAlive is false, the extension is allowed to suspend. |
| 279 * @param {boolean} keepAlive | 281 * @param {boolean} keepAlive |
| 280 */ | 282 */ |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 523 console.error(nextHandler + ' handler not registered.'); | 525 console.error(nextHandler + ' handler not registered.'); |
| 524 } | 526 } |
| 525 }); | 527 }); |
| 526 } | 528 } |
| 527 | 529 |
| 528 /** | 530 /** |
| 529 * Starts querying for sinks capable of displaying the media source | 531 * Starts querying for sinks capable of displaying the media source |
| 530 * designated by |sourceUrn|. Results are returned by calling | 532 * designated by |sourceUrn|. Results are returned by calling |
| 531 * OnSinksReceived. | 533 * OnSinksReceived. |
| 532 * @param {!string} sourceUrn | 534 * @param {!string} sourceUrn |
| 535 * @param {!string} origin | |
| 533 */ | 536 */ |
| 534 MediaRouteProvider.prototype.startObservingMediaSinks = | 537 MediaRouteProvider.prototype.startObservingMediaSinks = |
| 535 function(sourceUrn) { | 538 function(sourceUrn, origin) { |
| 536 this.handlers_.startObservingMediaSinks(sourceUrn); | 539 this.handlers_.startObservingMediaSinks(sourceUrn, origin); |
| 537 }; | 540 }; |
| 538 | 541 |
| 539 /** | 542 /** |
| 540 * Stops querying for sinks capable of displaying |sourceUrn|. | 543 * Stops querying for sinks capable of displaying |sourceUrn|. |
| 541 * @param {!string} sourceUrn | 544 * @param {!string} sourceUrn |
| 545 * @param {!string} origin | |
| 542 */ | 546 */ |
| 543 MediaRouteProvider.prototype.stopObservingMediaSinks = | 547 MediaRouteProvider.prototype.stopObservingMediaSinks = |
| 544 function(sourceUrn) { | 548 function(sourceUrn, origin) { |
| 545 this.handlers_.stopObservingMediaSinks(sourceUrn); | 549 this.handlers_.stopObservingMediaSinks(sourceUrn, origin); |
| 546 }; | 550 }; |
| 547 | 551 |
| 548 /** | 552 /** |
| 549 * Requests that |sinkId| render the media referenced by |sourceUrn|. If the | 553 * Requests that |sinkId| render the media referenced by |sourceUrn|. If the |
| 550 * request is from the Presentation API, then origin and tabId will | 554 * request is from the Presentation API, then origin and tabId will |
| 551 * be populated. | 555 * be populated. |
| 552 * @param {!string} sourceUrn Media source to render. | 556 * @param {!string} sourceUrn Media source to render. |
| 553 * @param {!string} sinkId Media sink ID. | 557 * @param {!string} sinkId Media sink ID. |
| 554 * @param {!string} presentationId Presentation ID from the site | 558 * @param {!string} presentationId Presentation ID from the site |
| 555 * requesting presentation. TODO(mfoltz): Remove. | 559 * requesting presentation. TODO(mfoltz): Remove. |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 734 }; | 738 }; |
| 735 | 739 |
| 736 mediaRouter = new MediaRouter(connector.bindHandleToProxy( | 740 mediaRouter = new MediaRouter(connector.bindHandleToProxy( |
| 737 serviceProvider.connectToService( | 741 serviceProvider.connectToService( |
| 738 mediaRouterMojom.MediaRouter.name), | 742 mediaRouterMojom.MediaRouter.name), |
| 739 mediaRouterMojom.MediaRouter)); | 743 mediaRouterMojom.MediaRouter)); |
| 740 | 744 |
| 741 return mediaRouter; | 745 return mediaRouter; |
| 742 }); | 746 }); |
| 743 | 747 |
| OLD | NEW |