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

Unified Diff: remoting/webapp/base/js/auth_init.js

Issue 981723003: Add application pre-authorization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: remoting/webapp/base/js/auth_init.js
diff --git a/remoting/webapp/base/js/auth_init.js b/remoting/webapp/base/js/auth_init.js
index 009edd149f4a5e7cb07bceb10cfccd856c85c70d..60bddf02c5d0a5f8133f4d7019516a5633bd3c04 100644
--- a/remoting/webapp/base/js/auth_init.js
+++ b/remoting/webapp/base/js/auth_init.js
@@ -8,24 +8,14 @@
var remoting = remoting || {};
/**
- * Get the user's email address and full name.
+ * Initialize the identity and authentication components.
*
- * @param {function(string,string):void} onUserInfoAvailable Callback invoked
- * when the user's email address and full name are available.
* @return {void} Nothing.
*/
-remoting.initIdentity = function(onUserInfoAvailable) {
-
- /** @param {remoting.Error} error */
- function onGetIdentityInfoError(error) {
- // No need to show the error message for NOT_AUTHENTICATED
- // because we will show "auth-dialog".
- if (error != remoting.Error.NOT_AUTHENTICATED) {
- remoting.showErrorMessage(error);
- }
- }
-
+remoting.initIdentity = function() {
if (base.isAppsV2()) {
+ // TODO(jamiewalch): Add a getAuthDialog method to Application.Delegate
+ // to allow this behaviour to be customized.
Jamie 2015/03/05 01:35:55 For example, AppStreaming should not use an in-DOM
remoting.identity =
new remoting.Identity(remoting.AuthDialog.getInstance());
} else {
@@ -41,15 +31,6 @@ remoting.initIdentity = function(onUserInfoAvailable) {
});
}
}
-
- remoting.identity.getUserInfo().then(
- /** @param {{email:string, name:string}} userInfo */
- function(userInfo) {
- onUserInfoAvailable(userInfo.email, userInfo.name);
- }).catch(function(error) {
- onGetIdentityInfoError(
- /** @type {remoting.Error} */ (error));
- });
};
/**

Powered by Google App Engine
This is Rietveld 408576698