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

Unified Diff: remoting/webapp/session_connector_interface.js

Issue 552403004: Interfaceify ClientPlugin in preparation for mocking it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Interfaceify more classes. Created 6 years, 3 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/session_connector_interface.js
diff --git a/remoting/webapp/session_connector_interface.js b/remoting/webapp/session_connector_interface.js
new file mode 100644
index 0000000000000000000000000000000000000000..55e303191b9554fdf37fcccff77cc6ad5c1ddd4a
--- /dev/null
+++ b/remoting/webapp/session_connector_interface.js
@@ -0,0 +1,107 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
Sergey Ulanov 2014/09/16 02:02:51 year
Jamie 2014/09/16 16:23:21 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview
+ * Interface abstracting the SessionConnector functionality.
+ */
+
+'use strict';
+
+/** @suppress {duplicate} */
+var remoting = remoting || {};
+
+/**
+ * @interface
+ */
+remoting.SessionConnectorInterface = function() {};
Sergey Ulanov 2014/09/16 02:02:51 Same comment as for ClientPluginInterface. Ideally
Jamie 2014/09/16 16:23:21 Agreed; see above.
+
+/**
+ * Reset the per-connection state so that the object can be re-used for a
+ * second connection. Note the none of the shared WCS state is reset.
+ */
+remoting.SessionConnectorInterface.prototype.reset = function() {};
+
+/**
+ * Initiate a Me2Me connection.
+ *
+ * @param {remoting.Host} host The Me2Me host to which to connect.
+ * @param {function(boolean, function(string):void):void} fetchPin Function to
+ * interactively obtain the PIN from the user.
+ * @param {function(string, string, string,
+ * function(string, string): void): void}
+ * fetchThirdPartyToken Function to obtain a token from a third party
+ * authenticaiton server.
+ * @param {string} clientPairingId The client id issued by the host when
+ * this device was paired, if it is already paired.
+ * @param {string} clientPairedSecret The shared secret issued by the host when
+ * this device was paired, if it is already paired.
+ * @return {void} Nothing.
+ */
+remoting.SessionConnectorInterface.prototype.connectMe2Me =
+ function(host, fetchPin, fetchThirdPartyToken,
+ clientPairingId, clientPairedSecret) {};
+
+/**
+ * Update the pairing info so that the reconnect function will work correctly.
+ *
+ * @param {string} clientId The paired client id.
+ * @param {string} sharedSecret The shared secret.
+ */
+remoting.SessionConnectorInterface.prototype.updatePairingInfo =
+ function(clientId, sharedSecret) {};
+
+/**
+ * Initiate an IT2Me connection.
+ *
+ * @param {string} accessCode The access code as entered by the user.
+ * @return {void} Nothing.
+ */
+remoting.SessionConnectorInterface.prototype.connectIT2Me =
+ function(accessCode) {};
+
+/**
+ * Reconnect a closed connection.
+ *
+ * @return {void} Nothing.
+ */
+remoting.SessionConnectorInterface.prototype.reconnect = function() {};
+
+/**
+ * Cancel a connection-in-progress.
+ */
+remoting.SessionConnectorInterface.prototype.cancel = function() {};
+
+/**
+ * Get the connection mode (Me2Me or IT2Me)
+ *
+ * @return {remoting.ClientSession.Mode}
+ */
+remoting.SessionConnectorInterface.prototype.getConnectionMode = function() {};
+
+/**
+ * Get host ID.
+ *
+ * @return {string}
+ */
+remoting.SessionConnectorInterface.prototype.getHostId = function() {};
+
+
+/**
+ * @interface
+ */
+remoting.SessionConnectorFactory = function() {};
+
+/**
+ * @param {HTMLElement} clientContainer Container element for the client view.
+ * @param {function(remoting.ClientSession):void} onConnected Callback on
+ * success.
+ * @param {function(remoting.Error):void} onError Callback on error.
+ * @param {function(string, string):boolean} onExtensionMessage The handler for
+ * protocol extension messages. Returns true if a message is recognized;
+ * false otherwise.
+ * @return {remoting.SessionConnectorInterface}
+ */
+remoting.SessionConnectorFactory.prototype.createConnector =
+ function(clientContainer, onConnected, onError, onExtensionMessage) {};

Powered by Google App Engine
This is Rietveld 408576698