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

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

Issue 1111603002: Added ability to register new hosts using GCD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@host-list-delete
Patch Set: for review 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/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 542e3f0e9d68e3f9ef8cd10101963cd644d444d2..b573530c27309f0abdf799047424f87e64c39599 100644
--- a/remoting/webapp/crd/js/host_list_api_impl.js
+++ b/remoting/webapp/crd/js/host_list_api_impl.js
@@ -42,11 +42,9 @@ remoting.HostListApiImpl.prototype.register = function(
}).start().then(function(response) {
if (response.status == 200) {
var result = response.getJson();
- if (result['data']) {
- return base.getStringAttr(result['data'], 'authorizationCode', '');
- } else {
- return '';
- }
+ var data = base.getObjectAttr(result, 'data');
+ var authCode = base.getStringAttr(data, 'authorizationCode');
John Williams 2015/04/28 20:27:41 Simplified based on the assumption that the auth c
+ return { authCode: authCode, email: '' };
} else {
console.log(
'Failed to register the host. Status: ' + response.status +
« no previous file with comments | « remoting/webapp/crd/js/host_list_api_gcd_impl.js ('k') | remoting/webapp/crd/js/host_list_api_impl_unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698