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

Unified Diff: remoting/webapp/crd/js/smart_reconnector.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/me2me_activity.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/smart_reconnector.js
diff --git a/remoting/webapp/crd/js/smart_reconnector.js b/remoting/webapp/crd/js/smart_reconnector.js
index a1aa22496d79362405c290715100ddc0f976daab..afb6975a916176decb762439b83179442eb2fe0d 100644
--- a/remoting/webapp/crd/js/smart_reconnector.js
+++ b/remoting/webapp/crd/js/smart_reconnector.js
@@ -21,6 +21,7 @@ var remoting = remoting || {};
/**
* @constructor
+ * @param {remoting.ConnectingDialog} connectingDialog
* @param {function()} reconnectCallback
* @param {function()} disconnectCallback
* @param {remoting.ClientSession} clientSession This represents the current
@@ -28,8 +29,8 @@ var remoting = remoting || {};
* connection state.
* @implements {base.Disposable}
*/
-remoting.SmartReconnector =
- function(reconnectCallback, disconnectCallback, clientSession) {
+remoting.SmartReconnector = function(connectingDialog, reconnectCallback,
+ disconnectCallback, clientSession) {
/** @private */
this.reconnectCallback_ = reconnectCallback;
@@ -47,6 +48,9 @@ remoting.SmartReconnector =
*/
this.pending_ = null;
+ /** @private */
+ this.connectingDialog_ = connectingDialog;
+
var Events = remoting.ClientSession.Events;
/** @private */
this.eventHook_ =
@@ -66,13 +70,12 @@ var CONNECTION_TIMEOUT_MS = 10000;
remoting.SmartReconnector.prototype.reconnect_ = function() {
this.cancelPending_();
this.disconnectCallback_();
- remoting.setMode(remoting.AppMode.CLIENT_CONNECTING);
this.reconnectCallback_();
};
remoting.SmartReconnector.prototype.reconnectAsync_ = function() {
this.cancelPending_();
- remoting.setMode(remoting.AppMode.CLIENT_CONNECTING);
+ this.connectingDialog_.show();
this.pending_ =
new base.OneShotTimer(this.reconnect_.bind(this), RECONNECT_DELAY_MS);
};
« no previous file with comments | « remoting/webapp/crd/js/me2me_activity.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698