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

Unified Diff: remoting/webapp/crd/js/apps_v2_migration.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/base/js/base.js ('k') | remoting/webapp/crd/js/client_session.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/apps_v2_migration.js
diff --git a/remoting/webapp/crd/js/apps_v2_migration.js b/remoting/webapp/crd/js/apps_v2_migration.js
index 61c174ed8f11e0a86e6710715c8273f31731a6b9..3f49883f2b26f624b1874ab0ba5733187265e66c 100644
--- a/remoting/webapp/crd/js/apps_v2_migration.js
+++ b/remoting/webapp/crd/js/apps_v2_migration.js
@@ -47,8 +47,7 @@ remoting.AppsV2Migration.hasHostsInV1App = function() {
var getV1UserInfo = base.Promise.as(chrome.storage.local.get,
[MIGRATION_KEY_],
chrome.storage.local);
- var getEmail = base.Promise.as(remoting.identity.getUserInfo, [],
- remoting.identity, true);
+ var getEmail = remoting.identity.getEmail();
return Promise.all([getV1UserInfo, getEmail]).then(
/** @param {Object} results */
@@ -93,14 +92,13 @@ remoting.AppsV2Migration.saveUserInfo = function() {
* @param {string} email
* @param {string} fullName
*/
- remoting.identity.getUserInfo(function(email, fullName) {
+ remoting.identity.getUserInfo().then(function(userInfo) {
var preference = {};
preference[MIGRATION_KEY_] =
- new remoting.MigrationSettings(email, fullName);
+ new remoting.MigrationSettings(userInfo.email, userInfo.name);
chrome.storage.local.set(preference);
- }, base.doNothing);
+ }).catch(base.doNothing);
}
};
}());
-
« no previous file with comments | « remoting/webapp/base/js/base.js ('k') | remoting/webapp/crd/js/client_session.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698