OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * This class implements the functionality that is specific to desktop | 7 * This class implements the functionality that is specific to desktop |
8 * remoting ("Chromoting" or CRD). | 8 * remoting ("Chromoting" or CRD). |
9 */ | 9 */ |
10 | 10 |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 255 |
256 /** | 256 /** |
257 * Called when the current session's connection has failed. | 257 * Called when the current session's connection has failed. |
258 * | 258 * |
259 * @param {remoting.SessionConnector} connector | 259 * @param {remoting.SessionConnector} connector |
260 * @param {!remoting.Error} error | 260 * @param {!remoting.Error} error |
261 * @return {void} Nothing. | 261 * @return {void} Nothing. |
262 */ | 262 */ |
263 remoting.DesktopRemoting.prototype.handleConnectionFailed = function( | 263 remoting.DesktopRemoting.prototype.handleConnectionFailed = function( |
264 connector, error) { | 264 connector, error) { |
265 /** @type {remoting.DesktopRemoting} */ | |
266 var that = this; | 265 var that = this; |
267 | 266 var onHostListRefresh = function(/** boolean */ success) { |
268 /** @param {boolean} success */ | |
269 var onHostListRefresh = function(success) { | |
270 if (success) { | 267 if (success) { |
271 var host = remoting.hostList.getHostForId(connector.getHostId()); | 268 var host = remoting.hostList.getHostForId(connector.getHostId()); |
272 if (host) { | 269 if (host) { |
273 connector.retryConnectMe2Me(host); | 270 connector.retryConnectMe2Me(host); |
274 return; | 271 return; |
275 } | 272 } |
276 } | 273 } |
277 that.handleError(error); | 274 that.handleError(error); |
278 }; | 275 }; |
279 | 276 |
| 277 var mode = this.app_.getSessionConnector().getConnectionMode(); |
280 if (error.hasTag(remoting.Error.Tag.HOST_IS_OFFLINE) && | 278 if (error.hasTag(remoting.Error.Tag.HOST_IS_OFFLINE) && |
281 that.refreshHostJidIfOffline_) { | 279 mode === remoting.DesktopConnectedView.Mode.ME2ME && |
282 that.refreshHostJidIfOffline_ = false; | 280 this.refreshHostJidIfOffline_) { |
| 281 this.refreshHostJidIfOffline_ = false; |
| 282 |
283 // The plugin will be re-created when the host finished refreshing | 283 // The plugin will be re-created when the host finished refreshing |
284 remoting.hostList.refresh(onHostListRefresh); | 284 remoting.hostList.refresh(onHostListRefresh); |
285 } else { | 285 } else { |
286 this.handleError(error); | 286 this.handleError(error); |
287 } | 287 } |
288 }; | 288 }; |
289 | 289 |
290 /** | 290 /** |
291 * Called when the current session has reached the point where the host has | 291 * Called when the current session has reached the point where the host has |
292 * started streaming video frames to the client. | 292 * started streaming video frames to the client. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 } else { | 335 } else { |
336 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME); | 336 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME); |
337 } | 337 } |
338 }; | 338 }; |
339 | 339 |
340 /** | 340 /** |
341 * No cleanup required for desktop remoting. | 341 * No cleanup required for desktop remoting. |
342 */ | 342 */ |
343 remoting.DesktopRemoting.prototype.handleExit = function() { | 343 remoting.DesktopRemoting.prototype.handleExit = function() { |
344 }; | 344 }; |
OLD | NEW |