| 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 /** @suppress {duplicate} */ | 5 /** @suppress {duplicate} */ |
| 6 var remoting = remoting || {}; | 6 var remoting = remoting || {}; |
| 7 | 7 |
| 8 (function() { | 8 (function() { |
| 9 | 9 |
| 10 'use strict'; | 10 'use strict'; |
| 11 | 11 |
| 12 /** | 12 /** |
| 13 * @param {Element} container parent element for the plugin to be created. | 13 * @param {Element} container parent element for the plugin to be created. |
| 14 * @param {Array<string>} capabilities capabilities required by this | 14 * @param {Array<string>} capabilities capabilities required by this |
| 15 * application. | 15 * application. |
| 16 * @constructor | 16 * @constructor |
| 17 */ | 17 */ |
| 18 remoting.ClientSessionFactory = function(container, capabilities) { | 18 remoting.ClientSessionFactory = function(container, capabilities) { |
| 19 /** @private */ | 19 /** @private */ |
| 20 this.container_ = /** @type {HTMLElement} */ (container); | 20 this.container_ = /** @type {HTMLElement} */ (container); |
| 21 | 21 |
| 22 /** @private {Array<string>} */ | 22 /** @private {Array<string>} */ |
| 23 this.requiredCapabilities_ = [ | 23 this.requiredCapabilities_ = [ |
| 24 remoting.ClientSession.Capability.SEND_INITIAL_RESOLUTION, | 24 remoting.ClientSession.Capability.SEND_INITIAL_RESOLUTION, |
| 25 remoting.ClientSession.Capability.RATE_LIMIT_RESIZE_REQUESTS, | 25 remoting.ClientSession.Capability.RATE_LIMIT_RESIZE_REQUESTS, |
| 26 remoting.ClientSession.Capability.VIDEO_RECORDER | 26 remoting.ClientSession.Capability.VIDEO_RECORDER, |
| 27 remoting.ClientSession.Capability.TOUCH_EVENTS |
| 27 ]; | 28 ]; |
| 28 | 29 |
| 29 // Append the app-specific capabilities. | 30 // Append the app-specific capabilities. |
| 30 this.requiredCapabilities_.push.apply(this.requiredCapabilities_, | 31 this.requiredCapabilities_.push.apply(this.requiredCapabilities_, |
| 31 capabilities); | 32 capabilities); |
| 32 }; | 33 }; |
| 33 | 34 |
| 34 /** | 35 /** |
| 35 * Creates a session. | 36 * Creates a session. |
| 36 * | 37 * |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 new remoting.Error(remoting.Error.Tag.BAD_PLUGIN_VERSION)); | 126 new remoting.Error(remoting.Error.Tag.BAD_PLUGIN_VERSION)); |
| 126 return; | 127 return; |
| 127 } | 128 } |
| 128 deferred.resolve(plugin); | 129 deferred.resolve(plugin); |
| 129 } | 130 } |
| 130 plugin.initialize(onInitialized); | 131 plugin.initialize(onInitialized); |
| 131 return deferred.promise(); | 132 return deferred.promise(); |
| 132 } | 133 } |
| 133 | 134 |
| 134 })(); | 135 })(); |
| OLD | NEW |