| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * REST API for host-list management. | 7 * REST API for host-list management. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 /** @suppress {duplicate} */ | 10 /** @suppress {duplicate} */ |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // Don't return anything. | 119 // Don't return anything. |
| 120 }); | 120 }); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 /** @override */ | 123 /** @override */ |
| 124 remoting.GcdHostListApi.prototype.getSupportHost = function(supportId) { | 124 remoting.GcdHostListApi.prototype.getSupportHost = function(supportId) { |
| 125 console.error('getSupportHost not supported by HostListApiGclImpl'); | 125 console.error('getSupportHost not supported by HostListApiGclImpl'); |
| 126 return Promise.reject(remoting.Error.unexpected()); | 126 return Promise.reject(remoting.Error.unexpected()); |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 /** @override */ |
| 130 remoting.GcdHostListApi.prototype.getHostIdFromConfig = function(config) { |
| 131 return base.getStringAttr(config, 'gcd_device_id'); |
| 132 }; |
| 133 |
| 129 /** | 134 /** |
| 130 * Tag for distinguishing Chromoting hosts from other devices stored | 135 * Tag for distinguishing Chromoting hosts from other devices stored |
| 131 * in GCD. | 136 * in GCD. |
| 132 * | 137 * |
| 133 * @const | 138 * @const |
| 134 */ | 139 */ |
| 135 var CHROMOTING_DEVICE_TAG = '1ce4542c-dd87-4320-ba19-ac173f98c04e'; | 140 var CHROMOTING_DEVICE_TAG = '1ce4542c-dd87-4320-ba19-ac173f98c04e'; |
| 136 | 141 |
| 137 /** | 142 /** |
| 138 * Check whether a GCD device entry is a Chromoting host. | 143 * Check whether a GCD device entry is a Chromoting host. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 host.createdTime = new Date(creationTimeMs).toISOString(); | 176 host.createdTime = new Date(creationTimeMs).toISOString(); |
| 172 } | 177 } |
| 173 var lastUpdateTimeMs = base.getNumberAttr(device, 'lastUpdateTimeMs', 0); | 178 var lastUpdateTimeMs = base.getNumberAttr(device, 'lastUpdateTimeMs', 0); |
| 174 if (lastUpdateTimeMs) { | 179 if (lastUpdateTimeMs) { |
| 175 host.updatedTime = new Date(lastUpdateTimeMs).toISOString(); | 180 host.updatedTime = new Date(lastUpdateTimeMs).toISOString(); |
| 176 } | 181 } |
| 177 return host; | 182 return host; |
| 178 }; | 183 }; |
| 179 | 184 |
| 180 })(); | 185 })(); |
| OLD | NEW |