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

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

Issue 918783002: CRD Viewport Management refactor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + plumbing remoting.Host into clientSession Created 5 years, 10 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/host_list_api_impl.js
diff --git a/remoting/webapp/crd/js/host_list_api_impl.js b/remoting/webapp/crd/js/host_list_api_impl.js
index 5cf4a2debac9e778f5d0a85a39c7dd1d4448b03f..57bf389ee41899621cb8e102f9273620e182e31c 100644
--- a/remoting/webapp/crd/js/host_list_api_impl.js
+++ b/remoting/webapp/crd/js/host_list_api_impl.js
@@ -109,7 +109,22 @@ remoting.HostListApiImpl.prototype.parseHostListResponse_ =
console.error('Invalid "hosts" response from server.');
onError(remoting.Error.UNEXPECTED);
} else {
- var hosts = response.data.items || [];
+ var items = response.data.items || [];
+ var hosts = items.map(
+ /** @param {Object} item */
+ function(item) {
+ var host = new remoting.Host();
+ host.hostName = item['hostName'];
+ host.hostId = item['hostId'];
+ host.status = item['status'];
+ host.jabberId = item['jabberId'];
+ host.publicKey = item['publicKey'];
+ host.hostVersion = item['hostVersion'];
+ host.tokenUrlPatterns = item['tokenUrlPatterns'];
+ host.updatedTime = item['updatedTime'];
+ host.hostOfflineReason = item['hostOfflineReason'];
+ return host;
+ });
onDone(hosts);
}
} else {

Powered by Google App Engine
This is Rietveld 408576698