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

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

Issue 1217643002: Added HostListApl implementation to connect to legacy directory and GCD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcd-e2e
Patch Set: Created 5 years, 6 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/crd/js/legacy_host_list_api.js
diff --git a/remoting/webapp/crd/js/legacy_host_list_api.js b/remoting/webapp/crd/js/legacy_host_list_api.js
index c99c97758b1575ebfa76d5802694c7b493e4a4ad..c9941a6c6c65e75ef78b95a5d715db2b7f10da1f 100644
--- a/remoting/webapp/crd/js/legacy_host_list_api.js
+++ b/remoting/webapp/crd/js/legacy_host_list_api.js
@@ -25,6 +25,22 @@ remoting.LegacyHostListApi = function() {
remoting.LegacyHostListApi.prototype.register = function(
hostName, publicKey, hostClientId) {
var newHostId = base.generateUuid();
+ return remoting.LegacyHostListApi.registerWithHostId(
+ newHostId, hostName, publicKey, hostClientId);
John Williams 2015/06/29 19:45:05 I split the implementation of this method into a s
+};
+
+/**
+ * Registers a host with the Chromoting directory using a specified
+ * host ID, which should not be equal to the ID of any existing host.
+ *
+ * @param {string} newHostId The host ID of the new host.
+ * @param {string} hostName The user-visible name of the new host.
+ * @param {string} publicKey The public half of the host's key pair.
+ * @param {?string} hostClientId The OAuth2 client ID of the host.
+ * @return {!Promise<remoting.HostListApi.RegisterResult>}
+ */
+remoting.LegacyHostListApi.registerWithHostId = function(
+ newHostId, hostName, publicKey, hostClientId) {
var newHostDetails = { data: {
hostId: newHostId,
hostName: hostName,
@@ -195,4 +211,9 @@ remoting.LegacyHostListApi.prototype.getSupportHost = function(supportId) {
});
};
+/** @override */
+remoting.LegacyHostListApi.prototype.getHostIdFromConfig = function(config) {
+ return base.getStringAttr(config, 'host_id');
+};
+
})();

Powered by Google App Engine
This is Rietveld 408576698