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'; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 remoting.It2MeActivity.prototype.stop = function() { | 99 remoting.It2MeActivity.prototype.stop = function() { |
100 if (this.desktopActivity_) { | 100 if (this.desktopActivity_) { |
101 this.desktopActivity_.stop(); | 101 this.desktopActivity_.stop(); |
102 } | 102 } |
103 }; | 103 }; |
104 | 104 |
105 /** | 105 /** |
106 * @param {!remoting.Error} error | 106 * @param {!remoting.Error} error |
107 */ | 107 */ |
108 remoting.It2MeActivity.prototype.onConnectionFailed = function(error) { | 108 remoting.It2MeActivity.prototype.onConnectionFailed = function(error) { |
109 this.showErrorMessage_(error); | 109 // onConnectionFailed is also called if the connection is canceled, in which |
| 110 // case no error message should be shown. |
| 111 if (!error.isNone()) { |
| 112 this.showErrorMessage_(error); |
| 113 } |
110 base.dispose(this.desktopActivity_); | 114 base.dispose(this.desktopActivity_); |
111 this.desktopActivity_ = null; | 115 this.desktopActivity_ = null; |
112 }; | 116 }; |
113 | 117 |
114 /** | 118 /** |
115 * @param {!remoting.ConnectionInfo} connectionInfo | 119 * @param {!remoting.ConnectionInfo} connectionInfo |
116 */ | 120 */ |
117 remoting.It2MeActivity.prototype.onConnected = function(connectionInfo) { | 121 remoting.It2MeActivity.prototype.onConnected = function(connectionInfo) { |
118 this.accessCodeDialog_.inputField().value = ''; | 122 this.accessCodeDialog_.inputField().value = ''; |
119 }; | 123 }; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 /** | 182 /** |
179 * @param {remoting.Host} host | 183 * @param {remoting.Host} host |
180 * @private | 184 * @private |
181 */ | 185 */ |
182 remoting.It2MeActivity.prototype.connect_ = function(host) { | 186 remoting.It2MeActivity.prototype.connect_ = function(host) { |
183 this.desktopActivity_.start( | 187 this.desktopActivity_.start( |
184 host, new remoting.CredentialsProvider({accessCode: this.passCode_})); | 188 host, new remoting.CredentialsProvider({accessCode: this.passCode_})); |
185 }; | 189 }; |
186 | 190 |
187 })(); | 191 })(); |
OLD | NEW |