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

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

Issue 1104383002: Added ability to list and delete hosts with GCD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/gcd_client.js
diff --git a/remoting/webapp/crd/js/gcd_client.js b/remoting/webapp/crd/js/gcd_client.js
index 5417737253bc796e31a1dafa3897186b5e40ab82..ab45bb124b8a0f65830a4d9f75e84f25b122c27a 100644
--- a/remoting/webapp/crd/js/gcd_client.js
+++ b/remoting/webapp/crd/js/gcd_client.js
@@ -32,7 +32,8 @@ remoting.gcd.RegistrationTicket;
/**
* TODO: Flesh out with typical fields.
* @typedef {{
- * id:string
+ * id:string,
+ * name:string
* }}
*/
remoting.gcd.Device;
@@ -206,12 +207,16 @@ remoting.gcd.Client.prototype.finalizeRegistrationTicket = function(ticketId) {
/**
* Lists devices user has access to.
* TODO: Add link to GCD docs.
+ * @param {string=} opt_nameSubstring
Jamie 2015/04/27 22:44:06 Please document this parameter.
John Williams 2015/04/27 23:05:42 Done.
* @return {!Promise<!Array<remoting.gcd.Device>>}
*/
-remoting.gcd.Client.prototype.listDevices = function() {
+remoting.gcd.Client.prototype.listDevices = function(opt_nameSubstring) {
return new remoting.Xhr({
method: 'GET',
url: this.apiBaseUrl_ + '/devices',
+ urlParams: {
+ nameSubstring: opt_nameSubstring || null
+ },
useIdentity: true,
acceptJson: true
}).start().then(function(response) {
@@ -241,7 +246,7 @@ remoting.gcd.Client.prototype.deleteDevice = function(deviceId) {
return false;
}
if (response.isError()) {
- console.warn('error deleting device');
+ console.error('error deleting device');
throw remoting.Error.unexpected();
}
return true;
« no previous file with comments | « no previous file | remoting/webapp/crd/js/host_list_api_gcd_impl.js » ('j') | remoting/webapp/crd/js/host_list_api_gcd_impl.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698