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

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

Issue 937593002: Changed identity API to use promises instead of callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed bad merge 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
« no previous file with comments | « remoting/webapp/crd/js/remoting.js ('k') | remoting/webapp/crd/js/wcs_sandbox_container.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/session_connector_impl.js
diff --git a/remoting/webapp/crd/js/session_connector_impl.js b/remoting/webapp/crd/js/session_connector_impl.js
index feab2b7a1b7c29812cccfd2ee6e4ca7258a16e24..9465d70ef7b14b0287ae31f71fef0e6fc79332be 100644
--- a/remoting/webapp/crd/js/session_connector_impl.js
+++ b/remoting/webapp/crd/js/session_connector_impl.js
@@ -309,8 +309,9 @@ remoting.SessionConnectorImpl.prototype.connectIT2Me = function(accessCode) {
var hostId = normalizedAccessCode.substring(0, kSupportIdLen);
this.passPhrase_ = normalizedAccessCode;
this.connectionMode_ = remoting.DesktopConnectedView.Mode.IT2ME;
- remoting.identity.callWithToken(
- this.connectIT2MeWithToken_.bind(this, hostId), this.onError_);
+ remoting.identity.getToken().then(
+ this.connectIT2MeWithToken_.bind(this, hostId),
+ remoting.Error.handler(this.onError_));
};
/**
@@ -374,8 +375,9 @@ remoting.SessionConnectorImpl.prototype.connectSignaling_ = function() {
/** @param {string} token */
function connectSignalingWithToken(token) {
- remoting.identity.getUserInfo(
- connectSignalingWithTokenAndUserInfo.bind(null, token), that.onError_);
+ remoting.identity.getUserInfo().then(
+ connectSignalingWithTokenAndUserInfo.bind(null, token),
+ remoting.Error.handler(that.onError_));
}
/**
@@ -385,19 +387,20 @@ remoting.SessionConnectorImpl.prototype.connectSignaling_ = function() {
* and been granted the userinfo.profile permission.
*
* @param {string} token
- * @param {string} email
- * @param {string} fullName
+ * @param {{email: string, name: string}} userInfo
*/
- function connectSignalingWithTokenAndUserInfo(token, email, fullName) {
+ function connectSignalingWithTokenAndUserInfo(token, userInfo) {
that.signalStrategy_.connect(
- remoting.settings.XMPP_SERVER_FOR_CLIENT, email, token);
+ remoting.settings.XMPP_SERVER_FOR_CLIENT, userInfo.email, token);
}
this.signalStrategy_ = remoting.SignalStrategy.create();
this.signalStrategy_.setStateChangedCallback(
this.onSignalingState_.bind(this));
- remoting.identity.callWithToken(connectSignalingWithToken, this.onError_);
+ remoting.identity.getToken().then(
+ connectSignalingWithToken,
+ remoting.Error.handler(this.onError_));
};
/**
« no previous file with comments | « remoting/webapp/crd/js/remoting.js ('k') | remoting/webapp/crd/js/wcs_sandbox_container.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698