| 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 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 remoting.Wcs.prototype.updateAccessToken = function(tokenNew) { | 74 remoting.Wcs.prototype.updateAccessToken = function(tokenNew) { |
| 75 if (tokenNew != this.token_) { | 75 if (tokenNew != this.token_) { |
| 76 this.token_ = tokenNew; | 76 this.token_ = tokenNew; |
| 77 this.wcsIqClient_.updateAccessToken(this.token_); | 77 this.wcsIqClient_.updateAccessToken(this.token_); |
| 78 } | 78 } |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 /** | 81 /** |
| 82 * Handles a message coming from the WcsIqClient. | 82 * Handles a message coming from the WcsIqClient. |
| 83 * | 83 * |
| 84 * @param {Array.<string>} msg The message. | 84 * @param {Array<string>} msg The message. |
| 85 * @return {void} Nothing. | 85 * @return {void} Nothing. |
| 86 * @private | 86 * @private |
| 87 */ | 87 */ |
| 88 remoting.Wcs.prototype.onMessage_ = function(msg) { | 88 remoting.Wcs.prototype.onMessage_ = function(msg) { |
| 89 if (msg[0] == 'is') { | 89 if (msg[0] == 'is') { |
| 90 this.onIq_(msg[1]); | 90 this.onIq_(msg[1]); |
| 91 } else if (msg[0] == 'cfj') { | 91 } else if (msg[0] == 'cfj') { |
| 92 this.clientFullJid_ = msg[1]; | 92 this.clientFullJid_ = msg[1]; |
| 93 console.log('Received JID: ' + this.clientFullJid_); | 93 console.log('Received JID: ' + this.clientFullJid_); |
| 94 if (this.onReady_) { | 94 if (this.onReady_) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 120 /** | 120 /** |
| 121 * Sets the function called when an IQ stanza is received. | 121 * Sets the function called when an IQ stanza is received. |
| 122 * | 122 * |
| 123 * @param {function(string): void} onIq The function called when an IQ stanza | 123 * @param {function(string): void} onIq The function called when an IQ stanza |
| 124 * is received. | 124 * is received. |
| 125 * @return {void} Nothing. | 125 * @return {void} Nothing. |
| 126 */ | 126 */ |
| 127 remoting.Wcs.prototype.setOnIq = function(onIq) { | 127 remoting.Wcs.prototype.setOnIq = function(onIq) { |
| 128 this.onIq_ = onIq; | 128 this.onIq_ = onIq; |
| 129 }; | 129 }; |
| OLD | NEW |