Chromium Code Reviews| Index: remoting/webapp/crd/js/desktop_remoting.js |
| diff --git a/remoting/webapp/crd/js/desktop_remoting.js b/remoting/webapp/crd/js/desktop_remoting.js |
| index c345d6444320779d5b2f807a34b0d22e1e06c9e6..b18bb1281edc9e1804f51521071ff25b81a3f1f3 100644 |
| --- a/remoting/webapp/crd/js/desktop_remoting.js |
| +++ b/remoting/webapp/crd/js/desktop_remoting.js |
| @@ -251,29 +251,35 @@ remoting.DesktopRemoting.prototype.handleDisconnected = function() { |
| */ |
| remoting.DesktopRemoting.prototype.handleConnectionFailed = function( |
| connector, error) { |
| - /** @type {remoting.DesktopRemoting} */ |
| - var that = this; |
| - |
| - /** @param {boolean} success */ |
| - var onHostListRefresh = function(success) { |
| - if (success) { |
| - var host = remoting.hostList.getHostForId(connector.getHostId()); |
| - if (host) { |
| - connector.retryConnectMe2Me(host); |
| - return; |
| - } |
| + if (error.tag === remoting.Error.Tag.HOST_IS_OFFLINE) { |
| + var mode = this.app_.getSessionConnector().getConnectionMode(); |
| + if (mode === remoting.DesktopConnectedView.Mode.IT2ME) { |
| + // HOST_IS_OFFLINE during an It2Me connection indicates the host portion |
| + // of the access code is invalid, just return INVALID_ACCESS_CODE. |
| + // TODO(kelvinp): Move this code to It2MeConnectFlow once it is owned |
| + // by remoting.DesktopRemoting. |
| + error = remoting.Error.INVALID_ACCESS_CODE; |
|
Jamie
2015/03/13 18:38:47
There are two cases to consider here: where the di
kelvinp
2015/03/13 18:55:25
For case 1)
If the directory returns 404, It2MeCon
rmsousa
2015/03/13 22:14:27
HOST_IS_OFFLINE does not indicate that the host po
|
| + } else if (this.refreshHostJidIfOffline_) { |
| + this.refreshHostJidIfOffline_ = false; |
| + var that = this; |
| + |
| + var onHostListRefresh = function(/** boolean */ success) { |
| + if (success) { |
| + var host = remoting.hostList.getHostForId(connector.getHostId()); |
| + if (host) { |
| + connector.retryConnectMe2Me(host); |
| + return; |
| + } |
| + } |
| + that.handleError(error); |
| + }; |
| + |
| + // The plugin will be re-created when the host finished refreshing |
| + remoting.hostList.refresh(onHostListRefresh); |
| + return; |
| } |
| - that.handleError(error); |
| - }; |
| - |
| - if (error.tag == remoting.Error.Tag.HOST_IS_OFFLINE && |
| - that.refreshHostJidIfOffline_) { |
| - that.refreshHostJidIfOffline_ = false; |
| - // The plugin will be re-created when the host finished refreshing |
| - remoting.hostList.refresh(onHostListRefresh); |
| - } else { |
| - this.handleError(error); |
| } |
| + this.handleError(error); |
| }; |
| /** |