Index: remoting/webapp/crd/js/desktop_remoting_activity.js |
diff --git a/remoting/webapp/crd/js/desktop_remoting_activity.js b/remoting/webapp/crd/js/desktop_remoting_activity.js |
index 0a6da791b314c8e7aa27283dfd6183a6a99818e1..a422d55d615f652aef7592a7110a25477196245f 100644 |
--- a/remoting/webapp/crd/js/desktop_remoting_activity.js |
+++ b/remoting/webapp/crd/js/desktop_remoting_activity.js |
@@ -30,6 +30,9 @@ remoting.DesktopRemotingActivity = function(parentActivity) { |
remoting.app_capabilities()); |
/** @private {remoting.ClientSession} */ |
this.session_ = null; |
+ /** @private {remoting.ConnectingDialog} */ |
+ this.connectingDialog_ = |
+ new remoting.ConnectingDialog(parentActivity.stop.bind(parentActivity)); |
}; |
/** |
@@ -48,7 +51,10 @@ remoting.DesktopRemotingActivity.prototype.start = |
that.session_ = session; |
session.logHostOfflineErrors(!opt_suppressOfflineError); |
session.connect(host, credentialsProvider); |
- }); |
+ }).catch(remoting.Error.handler( |
+ function(/** !remoting.Error */ error) { |
+ that.parentActivity_.onConnectionFailed(error); |
+ })); |
}; |
remoting.DesktopRemotingActivity.prototype.stop = function() { |
@@ -63,6 +69,7 @@ remoting.DesktopRemotingActivity.prototype.stop = function() { |
*/ |
remoting.DesktopRemotingActivity.prototype.onConnected = |
function(connectionInfo) { |
+ this.connectingDialog_.hide(); |
remoting.setMode(remoting.AppMode.IN_SESSION); |
if (!base.isAppsV2()) { |
remoting.toolbar.center(); |
@@ -125,6 +132,7 @@ remoting.DesktopRemotingActivity.prototype.dispose = function() { |
this.connectedView_ = null; |
base.dispose(this.session_); |
this.session_ = null; |
+ this.connectingDialog_.hide(); |
}; |
/** @return {remoting.DesktopConnectedView} */ |
@@ -139,4 +147,9 @@ remoting.DesktopRemotingActivity.prototype.getSession = function() { |
return this.session_; |
}; |
+/** @return {remoting.ConnectingDialog} */ |
+remoting.DesktopRemotingActivity.prototype.getConnectingDialog = function() { |
+ return this.connectingDialog_; |
+}; |
+ |
})(); |