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

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..650ec884b21bb44244efd3167c6d8d5dc5842b4f 100644
--- a/remoting/webapp/crd/js/host_list_api_impl.js
+++ b/remoting/webapp/crd/js/host_list_api_impl.js
@@ -42,11 +42,11 @@ remoting.HostListApiImpl.prototype.register = function(
}).start().then(function(response) {
if (response.status == 200) {
var result = response.getJson();
+ var authCode = '';
if (result['data']) {
- return base.getStringAttr(result['data'], 'authorizationCode', '');
- } else {
- return '';
+ authCode = base.getStringAttr(result['data'], 'authorizationCode', '');
}
+ return { authCode: authCode, email: '' };
Jamie 2015/04/27 23:24:24 Rather than adding code at call sites to deal with
John Williams 2015/04/28 20:27:40 The call site already has to fetch the user's emai
} else {
console.log(
'Failed to register the host. Status: ' + response.status +

Powered by Google App Engine
This is Rietveld 408576698