Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: remoting/webapp/crd/js/desktop_remoting.js

Issue 1007543003: Implements It2MeBrowserTest CancelShare and VerifyAccessCodeNotReusable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};
/**
« no previous file with comments | « remoting/webapp/browser_test/it2me_browser_test.js ('k') | testing/chromoting/browser_test_commands_linux.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698