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

Unified Diff: remoting/webapp/crd/js/crd_event_handlers.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/client_session.js ('k') | remoting/webapp/crd/js/error.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/crd_event_handlers.js
diff --git a/remoting/webapp/crd/js/crd_event_handlers.js b/remoting/webapp/crd/js/crd_event_handlers.js
index 4d21a5a8ee739a4e38bc620cbb4f27df8ca403a6..b730db429c0b4abc67e192712e090bd2a89a91c8 100644
--- a/remoting/webapp/crd/js/crd_event_handlers.js
+++ b/remoting/webapp/crd/js/crd_event_handlers.js
@@ -15,12 +15,11 @@ remoting.initElementEventHandlers = function() {
// We don't need a token until we authenticate, but asking for one here
// handles the token-expired case earlier, avoiding asking the user for
// the access code both before and after re-authentication.
- remoting.identity.callWithToken(
- /** @param {string} token */
- function(token) {
+ remoting.identity.getToken().
+ then(function(token) {
remoting.setMode(remoting.AppMode.CLIENT_UNCONNECTED);
- },
- remoting.showErrorMessage);
+ }).
+ catch(remoting.Error.handler(remoting.showErrorMessage));
};
var goFinishedIT2Me = function() {
if (remoting.currentMode == remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME) {
« no previous file with comments | « remoting/webapp/crd/js/client_session.js ('k') | remoting/webapp/crd/js/error.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698