Chromium Code Reviews| 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'); |
| +}; |
| + |
| })(); |