Chromium Code Reviews| Index: remoting/webapp/crd/js/host_daemon_facade.js |
| diff --git a/remoting/webapp/crd/js/host_daemon_facade.js b/remoting/webapp/crd/js/host_daemon_facade.js |
| index 0596b5745cd4b62de6bef40758cc67c2eae90cc6..6569e807930b08d4bd767beb3ddd810c60fed99e 100644 |
| --- a/remoting/webapp/crd/js/host_daemon_facade.js |
| +++ b/remoting/webapp/crd/js/host_daemon_facade.js |
| @@ -294,6 +294,14 @@ remoting.HostDaemonFacade.prototype.handleIncomingMessage_ = |
| throw 'Missing userEmail or refreshToken'; |
| } |
| + case 'getTokenFromAuthCodeResponse': |
| + var refreshToken = base.getStringAttr(message, 'refreshToken'); |
| + if (refreshToken) { |
| + return refreshToken; |
| + } else { |
| + throw 'Missing refreshToken'; |
| + } |
| + |
| default: |
| throw 'Unexpected native message: ' + message; |
| } |
| @@ -495,7 +503,6 @@ remoting.HostDaemonFacade.prototype.getHostClientId = function() { |
| }; |
| /** |
| - * |
| * @param {string} authorizationCode OAuth authorization code. |
| * @return {!Promise<{remoting.XmppCredentials}>} |
| */ |
| @@ -506,3 +513,15 @@ remoting.HostDaemonFacade.prototype.getCredentialsFromAuthCode = |
| authorizationCode: authorizationCode |
| }); |
| }; |
| + |
| +/** |
| + * @param {string} authorizationCode OAuth authorization code. |
| + * @return {!Promise<string>} |
| + */ |
| +remoting.HostDaemonFacade.prototype.getTokenFromAuthCode = |
|
Sergey Ulanov
2015/04/22 21:55:41
Maybe call it GetRefreshTokenFromAuthCode() to mak
John Williams
2015/04/24 00:00:47
Done.
|
| + function(authorizationCode) { |
| + return this.postMessage_({ |
| + type: 'getTokenFromAuthCode', |
| + authorizationCode: authorizationCode |
| + }); |
| +}; |