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 768eccc8ad690616f5398a646de0cd215f0cbb7c..d31113058a06f25b3908ca031b46e69174918f63 100644 |
--- a/remoting/webapp/crd/js/desktop_remoting_activity.js |
+++ b/remoting/webapp/crd/js/desktop_remoting_activity.js |
@@ -24,6 +24,15 @@ remoting.DesktopRemotingActivity = function(parentActivity) { |
this.parentActivity_ = parentActivity; |
/** @private {remoting.DesktopConnectedView} */ |
this.connectedView_ = null; |
+ /** @private {remoting.ClientSession} */ |
+ this.session_ = null; |
+}; |
+ |
+remoting.DesktopRemotingActivity.prototype.stop = function() { |
+ if (this.session_) { |
+ this.session_.disconnect(remoting.Error.none()); |
+ console.log('Disconnected.'); |
+ } |
}; |
/** |
@@ -37,6 +46,8 @@ remoting.DesktopRemotingActivity.prototype.onConnected = |
remoting.toolbar.preview(); |
} |
+ this.session_ = connectionInfo.session(); |
+ |
this.connectedView_ = new remoting.DesktopConnectedView( |
document.getElementById('client-container'), connectionInfo); |
@@ -58,8 +69,7 @@ remoting.DesktopRemotingActivity.prototype.onConnected = |
remoting.DesktopRemotingActivity.prototype.onDisconnected = function() { |
this.parentActivity_.onDisconnected(); |
- base.dispose(this.connectedView_); |
- this.connectedView_ = null; |
+ this.dispose(); |
}; |
/** |
@@ -84,13 +94,13 @@ remoting.DesktopRemotingActivity.prototype.onError = function(error) { |
this.parentActivity_.onError(error); |
- base.dispose(this.connectedView_); |
- this.connectedView_ = null; |
+ this.dispose(); |
}; |
remoting.DesktopRemotingActivity.prototype.dispose = function() { |
base.dispose(this.connectedView_); |
this.connectedView_ = null; |
+ this.session_ = null; |
}; |
/** @return {remoting.DesktopConnectedView} */ |