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

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

Issue 1093373005: [Webapp Refactor] Cleans up the ClientSession.EventHandler interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/it2me_activity.js
diff --git a/remoting/webapp/crd/js/it2me_activity.js b/remoting/webapp/crd/js/it2me_activity.js
index e5dc2db7054fd81abae923b92e42c8235e69db7c..6810ae8f545f7a03603257233be9a1260c3dcda3 100644
--- a/remoting/webapp/crd/js/it2me_activity.js
+++ b/remoting/webapp/crd/js/it2me_activity.js
@@ -74,7 +74,9 @@ remoting.It2MeActivity.prototype.stop = function() {
* @param {!remoting.Error} error
*/
remoting.It2MeActivity.prototype.onConnectionFailed = function(error) {
- this.onError(error);
+ this.showErrorMessage_(error);
+ base.dispose(this.desktopActivity_);
+ this.desktopActivity_ = null;
};
/**
@@ -84,14 +86,22 @@ remoting.It2MeActivity.prototype.onConnected = function(connectionInfo) {
this.accessCodeDialog_.inputField().value = '';
};
-remoting.It2MeActivity.prototype.onDisconnected = function() {
- this.showFinishDialog_(remoting.AppMode.CLIENT_SESSION_FINISHED_IT2ME);
+remoting.It2MeActivity.prototype.onDisconnected = function(error) {
+ if (error.isNone()) {
+ this.showFinishDialog_(remoting.AppMode.CLIENT_SESSION_FINISHED_IT2ME);
+ } else {
+ this.showErrorMessage_(error);
+ }
+
+ base.dispose(this.desktopActivity_);
+ this.desktopActivity_ = null;
};
/**
* @param {!remoting.Error} error
+ * @private
*/
-remoting.It2MeActivity.prototype.onError = function(error) {
+remoting.It2MeActivity.prototype.showErrorMessage_ = function(error) {
var errorDiv = document.getElementById('connect-error-message');
l10n.localizeElementFromTag(errorDiv, error.getTag());
this.showFinishDialog_(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME);

Powered by Google App Engine
This is Rietveld 408576698