OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * Connect set-up state machine for Me2Me and IT2Me | 7 * Connect set-up state machine for Me2Me and IT2Me |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
11 | 11 |
12 /** @suppress {duplicate} */ | 12 /** @suppress {duplicate} */ |
13 var remoting = remoting || {}; | 13 var remoting = remoting || {}; |
14 | 14 |
15 /** | 15 /** |
16 * @param {HTMLElement} clientContainer Container element for the client view. | 16 * @param {HTMLElement} clientContainer Container element for the client view. |
17 * @param {function(remoting.ClientSession):void} onConnected Callback on | 17 * @param {function(remoting.ClientSession):void} onConnected Callback on |
18 * success. | 18 * success. |
19 * @param {function(remoting.Error):void} onError Callback on error. | 19 * @param {function(remoting.Error):void} onError Callback on error. |
20 * @param {function(string, string):boolean} onExtensionMessage The handler for | 20 * @param {function(string, string):boolean} onExtensionMessage The handler for |
21 * protocol extension messages. Returns true if a message is recognized; | 21 * protocol extension messages. Returns true if a message is recognized; |
22 * false otherwise. | 22 * false otherwise. |
23 * @param {function(remoting.Error):void} onConnectionFailed Callback for when | 23 * @param {function(remoting.Error):void} onConnectionFailed Callback for when |
24 * the connection fails. | 24 * the connection fails. |
25 * @param {Array.<string>} requiredCapabilities Connector capabilities | 25 * @param {Array<string>} requiredCapabilities Connector capabilities |
26 * required by this application. | 26 * required by this application. |
27 * @param {string} defaultRemapKeys The default set of key mappings for the | 27 * @param {string} defaultRemapKeys The default set of key mappings for the |
28 * client session to use. | 28 * client session to use. |
29 * @constructor | 29 * @constructor |
30 * @implements {remoting.SessionConnector} | 30 * @implements {remoting.SessionConnector} |
31 */ | 31 */ |
32 remoting.SessionConnectorImpl = function(clientContainer, onConnected, onError, | 32 remoting.SessionConnectorImpl = function(clientContainer, onConnected, onError, |
33 onExtensionMessage, | 33 onExtensionMessage, |
34 onConnectionFailed, | 34 onConnectionFailed, |
35 requiredCapabilities, | 35 requiredCapabilities, |
(...skipping 22 matching lines...) Expand all Loading... |
58 */ | 58 */ |
59 this.onExtensionMessage_ = onExtensionMessage; | 59 this.onExtensionMessage_ = onExtensionMessage; |
60 | 60 |
61 /** | 61 /** |
62 * @type {function(remoting.Error):void} | 62 * @type {function(remoting.Error):void} |
63 * @private | 63 * @private |
64 */ | 64 */ |
65 this.onConnectionFailed_ = onConnectionFailed; | 65 this.onConnectionFailed_ = onConnectionFailed; |
66 | 66 |
67 /** | 67 /** |
68 * @type {Array.<string>} | 68 * @type {Array<string>} |
69 * @private | 69 * @private |
70 */ | 70 */ |
71 this.requiredCapabilities_ = requiredCapabilities; | 71 this.requiredCapabilities_ = requiredCapabilities; |
72 | 72 |
73 /** | 73 /** |
74 * @type {string} | 74 * @type {string} |
75 * @private | 75 * @private |
76 */ | 76 */ |
77 this.defaultRemapKeys_ = defaultRemapKeys; | 77 this.defaultRemapKeys_ = defaultRemapKeys; |
78 | 78 |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 /** | 640 /** |
641 * @param {HTMLElement} clientContainer Container element for the client view. | 641 * @param {HTMLElement} clientContainer Container element for the client view. |
642 * @param {function(remoting.ClientSession):void} onConnected Callback on | 642 * @param {function(remoting.ClientSession):void} onConnected Callback on |
643 * success. | 643 * success. |
644 * @param {function(remoting.Error):void} onError Callback on error. | 644 * @param {function(remoting.Error):void} onError Callback on error. |
645 * @param {function(string, string):boolean} onExtensionMessage The handler for | 645 * @param {function(string, string):boolean} onExtensionMessage The handler for |
646 * protocol extension messages. Returns true if a message is recognized; | 646 * protocol extension messages. Returns true if a message is recognized; |
647 * false otherwise. | 647 * false otherwise. |
648 * @param {function(remoting.Error):void} onConnectionFailed Callback for when | 648 * @param {function(remoting.Error):void} onConnectionFailed Callback for when |
649 * the connection fails. | 649 * the connection fails. |
650 * @param {Array.<string>} requiredCapabilities Connector capabilities | 650 * @param {Array<string>} requiredCapabilities Connector capabilities |
651 * required by this application. | 651 * required by this application. |
652 * @param {string} defaultRemapKeys The default set of key mappings to use | 652 * @param {string} defaultRemapKeys The default set of key mappings to use |
653 * in the client session. | 653 * in the client session. |
654 * @return {remoting.SessionConnector} | 654 * @return {remoting.SessionConnector} |
655 */ | 655 */ |
656 remoting.DefaultSessionConnectorFactory.prototype.createConnector = | 656 remoting.DefaultSessionConnectorFactory.prototype.createConnector = |
657 function(clientContainer, onConnected, onError, onExtensionMessage, | 657 function(clientContainer, onConnected, onError, onExtensionMessage, |
658 onConnectionFailed, requiredCapabilities, defaultRemapKeys) { | 658 onConnectionFailed, requiredCapabilities, defaultRemapKeys) { |
659 return new remoting.SessionConnectorImpl(clientContainer, onConnected, | 659 return new remoting.SessionConnectorImpl(clientContainer, onConnected, |
660 onError, onExtensionMessage, | 660 onError, onExtensionMessage, |
661 onConnectionFailed, | 661 onConnectionFailed, |
662 requiredCapabilities, | 662 requiredCapabilities, |
663 defaultRemapKeys); | 663 defaultRemapKeys); |
664 }; | 664 }; |
OLD | NEW |