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

Unified Diff: remoting/webapp/client_session.js

Issue 10692179: Propagate connection state from networking layer to UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/client_session.js
diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js
index fbd38d30fe7914454e9b8eb1ad926f558a789771..f9bd25333fd2034eef0ad0e3a71ed0f04fef9dbe 100644
--- a/remoting/webapp/client_session.js
+++ b/remoting/webapp/client_session.js
@@ -303,7 +303,9 @@ remoting.ClientSession.prototype.onPluginInitialized_ =
};
this.plugin.onConnectionStatusUpdateHandler =
- this.connectionStatusUpdateCallback.bind(this);
+ this.onConnectionStatusUpdate_.bind(this);
+ this.plugin.onConnectionInactiveHandler =
+ this.onConnectionInactive_.bind(this);
this.plugin.onDesktopSizeUpdateHandler =
this.onDesktopSizeChanged_.bind(this);
@@ -482,7 +484,7 @@ remoting.ClientSession.prototype.connectPluginToWcs_ =
* @param {number} status The plugin's status.
* @param {number} error The plugin's error state, if any.
Jamie 2012/07/12 01:46:42 Add @private if this is a private method, or remov
Sergey Ulanov 2012/07/13 20:42:50 Done.
*/
-remoting.ClientSession.prototype.connectionStatusUpdateCallback =
+remoting.ClientSession.prototype.onConnectionStatusUpdate_ =
function(status, error) {
if (status == remoting.ClientSession.State.CONNECTED) {
this.onDesktopSizeChanged_();
@@ -493,6 +495,21 @@ remoting.ClientSession.prototype.connectionStatusUpdateCallback =
};
/**
+ * Callback that the plugin invokes to indicate when the connection is
+ * inactive.
+ *
+ * @param {boolean} inactive True if the connection is inactive.
Jamie 2012/07/12 01:46:42 Add @private or remove the underscore.
Sergey Ulanov 2012/07/13 20:42:50 Done.
+ */
+remoting.ClientSession.prototype.onConnectionInactive_ =
+ function(inactive) {
+ if (inactive) {
+ this.plugin.element().classList.add("session-client-inactive");
+ } else {
+ this.plugin.element().classList.remove("session-client-inactive");
+ }
+}
+
+/**
* @private
* @param {remoting.ClientSession.State} newState The new state for the session.
* @return {void} Nothing.

Powered by Google App Engine
This is Rietveld 408576698