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

Unified Diff: remoting/webapp/crd/js/me2me_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/me2me_activity.js
diff --git a/remoting/webapp/crd/js/me2me_activity.js b/remoting/webapp/crd/js/me2me_activity.js
index 0618464e9e44fbbfde4424d1a7ad034331d8943f..fe9ac40f2586d282737a0b5003e95ee7313da5a7 100644
--- a/remoting/webapp/crd/js/me2me_activity.js
+++ b/remoting/webapp/crd/js/me2me_activity.js
@@ -140,15 +140,18 @@ remoting.Me2MeActivity.prototype.onConnectionFailed = function(error) {
that.connect_(false);
return;
}
- that.onError(error);
+ that.showErrorMessage_(error);
};
this.retryOnHostOffline_ = false;
// The plugin will be re-created when the host finished refreshing
remoting.hostList.refresh(onHostListRefresh);
- } else {
- this.onError(error);
+ } else if (!error.isNone()) {
+ this.showErrorMessage_(error);
}
+
+ base.dispose(this.desktopActivity_);
+ this.desktopActivity_ = null;
};
/**
@@ -172,14 +175,23 @@ remoting.Me2MeActivity.prototype.onConnected = function(connectionInfo) {
connectionInfo.session());
};
-remoting.Me2MeActivity.prototype.onDisconnected = function() {
- this.showFinishDialog_(remoting.AppMode.CLIENT_SESSION_FINISHED_ME2ME);
+remoting.Me2MeActivity.prototype.onDisconnected = function(error) {
+ if (error.isNone()) {
+ this.showFinishDialog_(remoting.AppMode.CLIENT_SESSION_FINISHED_ME2ME);
+ } else {
+ this.reconnector_.onConnectionDropped(error);
+ this.showErrorMessage_(error);
+ }
+
+ base.dispose(this.desktopActivity_);
+ this.desktopActivity_ = null;
};
/**
* @param {!remoting.Error} error
+ * @private
*/
-remoting.Me2MeActivity.prototype.onError = function(error) {
+remoting.Me2MeActivity.prototype.showErrorMessage_ = function(error) {
var errorDiv = document.getElementById('connect-error-message');
l10n.localizeElementFromTag(errorDiv, error.getTag());
this.showFinishDialog_(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME);

Powered by Google App Engine
This is Rietveld 408576698