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

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

Issue 1101613003: [Webapp Refactor] Reliably cancels a connection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ImproveUnittest
Patch Set: Rebase 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
« no previous file with comments | « remoting/webapp/crd/js/desktop_remoting_activity.js ('k') | remoting/webapp/crd/js/me2me_activity.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6810ae8f545f7a03603257233be9a1260c3dcda3..8140c9f5bca8ff7e5b2286916a02a70d15ec9e30 100644
--- a/remoting/webapp/crd/js/it2me_activity.js
+++ b/remoting/webapp/crd/js/it2me_activity.js
@@ -44,8 +44,11 @@ remoting.It2MeActivity.prototype.dispose = function() {
remoting.It2MeActivity.prototype.start = function() {
var that = this;
+ this.desktopActivity_ = new remoting.DesktopRemotingActivity(this);
+ remoting.app.setConnectionMode(remoting.Application.Mode.IT2ME);
+
this.accessCodeDialog_.show().then(function(/** string */ accessCode) {
- remoting.setMode(remoting.AppMode.CLIENT_CONNECTING);
+ that.desktopActivity_.getConnectingDialog().show();
return that.verifyAccessCode_(accessCode);
}).then(function() {
return remoting.identity.getToken();
@@ -55,7 +58,7 @@ remoting.It2MeActivity.prototype.start = function() {
return that.onHostInfo_(response);
}).then(function(/** remoting.Host */ host) {
that.connect_(host);
- }).catch(function(/** remoting.Error */ error) {
+ }).catch(remoting.Error.handler(function(/** remoting.Error */ error) {
if (error.hasTag(remoting.Error.Tag.CANCELLED)) {
remoting.setMode(remoting.AppMode.HOME);
} else {
@@ -63,7 +66,7 @@ remoting.It2MeActivity.prototype.start = function() {
l10n.localizeElementFromTag(errorDiv, error.getTag());
remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME);
}
- });
+ }));
};
remoting.It2MeActivity.prototype.stop = function() {
@@ -193,9 +196,6 @@ remoting.It2MeActivity.prototype.onHostInfo_ = function(xhrResponse) {
* @private
*/
remoting.It2MeActivity.prototype.connect_ = function(host) {
- base.dispose(this.desktopActivity_);
- this.desktopActivity_ = new remoting.DesktopRemotingActivity(this);
- remoting.app.setConnectionMode(remoting.Application.Mode.IT2ME);
this.desktopActivity_.start(
host, new remoting.CredentialsProvider({ accessCode: this.passCode_ }));
};
« no previous file with comments | « remoting/webapp/crd/js/desktop_remoting_activity.js ('k') | remoting/webapp/crd/js/me2me_activity.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698