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

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
« no previous file with comments | « remoting/webapp/client_plugin_async.js ('k') | remoting/webapp/main.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/client_session.js
diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js
index 24a5d235349268e25108368ceed9dc40264d07aa..da8051e452e7e987b4efee4a77d271c2de0c6f40 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.onConnectionReadyHandler =
+ this.onConnectionReady_.bind(this);
this.plugin.onDesktopSizeUpdateHandler =
this.onDesktopSizeChanged_.bind(this);
@@ -479,10 +481,11 @@ remoting.ClientSession.prototype.connectPluginToWcs_ =
* Callback that the plugin invokes to indicate that the connection
* status has changed.
*
+ * @private
* @param {number} status The plugin's status.
* @param {number} error The plugin's error state, if any.
*/
-remoting.ClientSession.prototype.connectionStatusUpdateCallback =
+remoting.ClientSession.prototype.onConnectionStatusUpdate_ =
function(status, error) {
if (status == remoting.ClientSession.State.CONNECTED) {
this.onDesktopSizeChanged_();
@@ -493,6 +496,21 @@ remoting.ClientSession.prototype.connectionStatusUpdateCallback =
};
/**
+ * Callback that the plugin invokes to indicate when the connection is
+ * ready.
+ *
+ * @private
+ * @param {boolean} ready True if the connection is ready.
+ */
+remoting.ClientSession.prototype.onConnectionReady_ = function(ready) {
+ if (!ready) {
+ 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.
@@ -707,6 +725,7 @@ remoting.ClientSession.prototype.scroll_ = function(dx, dy) {
/**
* Enable or disable bump-scrolling.
+ * @private
* @param {boolean} enable True to enable bump-scrolling, false to disable it.
*/
remoting.ClientSession.prototype.enableBumpScroll_ = function(enable) {
« no previous file with comments | « remoting/webapp/client_plugin_async.js ('k') | remoting/webapp/main.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698