| OLD | NEW |
| 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 /** | 6 /** |
| 7 * @fileoverview | 7 * @fileoverview |
| 8 * A class that provides an interface to a WCS connection. | 8 * A class that provides an interface to a WCS connection. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 'use strict'; | 11 'use strict'; |
| 12 | 12 |
| 13 /** @suppress {duplicate} */ | 13 /** @suppress {duplicate} */ |
| 14 var remoting = remoting || {}; | 14 var remoting = remoting || {}; |
| 15 | 15 |
| 16 /** @type {remoting.Wcs} */ | 16 /** @type {remoting.Wcs} */ |
| 17 remoting.wcs = null; | 17 remoting.wcs = null; |
| 18 | 18 |
| 19 /** | 19 /** |
| 20 * @constructor | 20 * @constructor |
| 21 * @param {remoting.WcsIqClient} wcsIqClient The WCS client. | 21 * @param {remoting.WcsIqClient} wcsIqClient The WCS client. |
| 22 * @param {string} token An OAuth2 access token. | 22 * @param {string} token An OAuth2 access token. |
| 23 * @param {function(string): void} onReady Called with the WCS client's JID. | 23 * @param {function(string): void} onReady Called with the WCS client's JID. |
| 24 */ | 24 */ |
| 25 remoting.Wcs = function(wcsIqClient, token, onReady) { | 25 remoting.Wcs = function(wcsIqClient, token, onReady) { |
| 26 /** | 26 /** |
| 27 * The WCS client. | 27 * The WCS client. |
| 28 * @type {remoting.WcsIqClient} | 28 * @private {remoting.WcsIqClient} |
| 29 * @private | |
| 30 */ | 29 */ |
| 31 this.wcsIqClient_ = wcsIqClient; | 30 this.wcsIqClient_ = wcsIqClient; |
| 32 | 31 |
| 33 /** | 32 /** |
| 34 * The OAuth2 access token. | 33 * The OAuth2 access token. |
| 35 * @type {string} | 34 * @private {string} |
| 36 * @private | |
| 37 */ | 35 */ |
| 38 this.token_ = token; | 36 this.token_ = token; |
| 39 | 37 |
| 40 /** | 38 /** |
| 41 * The function called when the WCS client has received a full JID. | 39 * The function called when the WCS client has received a full JID. |
| 42 * @type {?function(string): void} | 40 * @private {?function(string): void} |
| 43 * @private | |
| 44 */ | 41 */ |
| 45 this.onReady_ = onReady; | 42 this.onReady_ = onReady; |
| 46 | 43 |
| 47 /** | 44 /** |
| 48 * The full JID of the WCS client. | 45 * The full JID of the WCS client. |
| 49 * @type {string} | 46 * @private {string} |
| 50 * @private | |
| 51 */ | 47 */ |
| 52 this.clientFullJid_ = ''; | 48 this.clientFullJid_ = ''; |
| 53 | 49 |
| 54 /** | 50 /** |
| 55 * A function called when an IQ stanza is received. | 51 * A function called when an IQ stanza is received. |
| 56 * @param {string} stanza The IQ stanza. | 52 * @param {string} stanza The IQ stanza. |
| 57 * @private | 53 * @private |
| 58 */ | 54 */ |
| 59 this.onIq_ = function(stanza) {}; | 55 this.onIq_ = function(stanza) {}; |
| 60 | 56 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 /** | 116 /** |
| 121 * Sets the function called when an IQ stanza is received. | 117 * Sets the function called when an IQ stanza is received. |
| 122 * | 118 * |
| 123 * @param {function(string): void} onIq The function called when an IQ stanza | 119 * @param {function(string): void} onIq The function called when an IQ stanza |
| 124 * is received. | 120 * is received. |
| 125 * @return {void} Nothing. | 121 * @return {void} Nothing. |
| 126 */ | 122 */ |
| 127 remoting.Wcs.prototype.setOnIq = function(onIq) { | 123 remoting.Wcs.prototype.setOnIq = function(onIq) { |
| 128 this.onIq_ = onIq; | 124 this.onIq_ = onIq; |
| 129 }; | 125 }; |
| OLD | NEW |