| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 {!Array<!MediaSink>} sinks | 267 * @param {!Array<!MediaSink>} sinks |
| 268 * @param {Array<string>=} opt_origins |
| 268 */ | 269 */ |
| 269 MediaRouter.prototype.onSinksReceived = function(sourceUrn, sinks) { | 270 MediaRouter.prototype.onSinksReceived = function(sourceUrn, sinks, |
| 270 this.service_.onSinksReceived(sourceUrn, sinks.map(sinkToMojo_)); | 271 opt_origins) { |
| 272 // TODO(imcheng): Make origins required in M52+. |
| 273 this.service_.onSinksReceived(sourceUrn, sinks.map(sinkToMojo_), |
| 274 opt_origins || []); |
| 271 }; | 275 }; |
| 272 | 276 |
| 273 /** | 277 /** |
| 274 * Called by the provider manager to keep the extension from suspending | 278 * 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 | 279 * if it enters a state where suspension is undesirable (e.g. there is an |
| 276 * active MediaRoute.) | 280 * active MediaRoute.) |
| 277 * If keepAlive is true, the extension is kept alive. | 281 * If keepAlive is true, the extension is kept alive. |
| 278 * If keepAlive is false, the extension is allowed to suspend. | 282 * If keepAlive is false, the extension is allowed to suspend. |
| 279 * @param {boolean} keepAlive | 283 * @param {boolean} keepAlive |
| 280 */ | 284 */ |
| (...skipping 453 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 |