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

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

Issue 1054273002: [Webapp Refactor] Implements remoting.Activity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo 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/activity.js ('k') | remoting/webapp/crd/js/desktop_remoting.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/client_session.js
diff --git a/remoting/webapp/crd/js/client_session.js b/remoting/webapp/crd/js/client_session.js
index 12260801fad8053d2e6fb0a655279b660e8628ca..c4af96b28305e6827bd4090abbe1ee57d4be8529 100644
--- a/remoting/webapp/crd/js/client_session.js
+++ b/remoting/webapp/crd/js/client_session.js
@@ -92,10 +92,48 @@ remoting.ClientSession = function(plugin, host, signalStrategy,
/** @enum {string} */
remoting.ClientSession.Events = {
- stateChanged: 'stateChanged',
+ stateChanged: 'stateChanged', // deprecated.
videoChannelStateChanged: 'videoChannelStateChanged',
};
+/**
+ * @interface
+ * [START]-------> [onConnected] ------> [onDisconnected]
+ * | |
+ * |-----> [OnConnectionFailed] |----> [onError]
+ *
+ * TODO(kelvinp): Route session state changes through this interface.
+ */
+remoting.ClientSession.EventHandler = function() {};
+
+/**
+ * Called when the connection failed before it is connected.
+ *
+ * @param {!remoting.Error} error
+ */
+remoting.ClientSession.EventHandler.prototype.onConnectionFailed =
+ function(error) {};
+
+/**
+ * Called when a new session has been connected. The |connectionInfo| will be
+ * valid until onDisconnected() or onError() is called.
+ *
+ * @param {!remoting.ConnectionInfo} connectionInfo
+ */
+remoting.ClientSession.EventHandler.prototype.onConnected =
+ function(connectionInfo) {};
+
+/**
+ * Called when the current session has been disconnected.
+ */
+remoting.ClientSession.EventHandler.prototype.onDisconnected = function() {};
+
+/**
+ * Called when an error needs to be displayed to the user.
+ * @param {!remoting.Error} error
+ */
+remoting.ClientSession.EventHandler.prototype.onError = function(error) {};
+
// Note that the positive values in both of these enums are copied directly
// from connection_to_host.h and must be kept in sync. Code in
// chromoting_instance.cc converts the C++ enums into strings that must match
@@ -544,19 +582,6 @@ remoting.ClientSession.prototype.logHostOfflineErrors = function(enable) {
};
/**
- * Request pairing with the host for PIN-less authentication.
- *
- * @param {string} clientName The human-readable name of the client.
- * @param {function(string, string):void} onDone Callback to receive the
- * client id and shared secret when they are available.
- */
-remoting.ClientSession.prototype.requestPairing = function(clientName, onDone) {
- if (this.plugin_) {
- this.plugin_.requestPairing(clientName, onDone);
- }
-};
-
-/**
* Sends a clipboard item to the host.
*
* @param {string} mimeType The MIME type of the clipboard item.
« no previous file with comments | « remoting/webapp/crd/js/activity.js ('k') | remoting/webapp/crd/js/desktop_remoting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698