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

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

Issue 896003002: Use the local user's email when connecting to It2MeHelpeeChannel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@HRD_V2Auth
Patch Set: Created 5 years, 11 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/crd/js/identity.js
diff --git a/remoting/webapp/crd/js/identity.js b/remoting/webapp/crd/js/identity.js
index 0421410448a5ce7660487b695d1a6b541ecc0e50..84db4c74d76b0713c255586f6ee1f168983d96cf 100644
--- a/remoting/webapp/crd/js/identity.js
+++ b/remoting/webapp/crd/js/identity.js
@@ -21,7 +21,7 @@ var remoting = remoting || {};
remoting.identity = null;
/**
- * @param {remoting.Identity.ConsentDialog} consentDialog
+ * @param {remoting.Identity.ConsentDialog=} consentDialog
dcaiafa 2015/02/04 00:12:35 nit: According to the Google style guide, optional
kelvinp 2015/02/04 00:38:13 Done.
* @constructor
*/
remoting.Identity = function(consentDialog) {
@@ -36,7 +36,7 @@ remoting.Identity = function(consentDialog) {
};
/**
- * chrome.identity.getAuthToken must be initiated from user interactions if
+ * chrome.identity.getAuthToken should be initiated from user interactions if
* called with interactive equals true. This interface prompts a dialog for
* the user's consent.
*
@@ -223,7 +223,9 @@ remoting.Identity.prototype.onAuthComplete_ = function(interactive, token) {
// If there's no token, but we haven't yet prompted for permission, do so
// now.
var that = this;
- this.consentDialog_.show().then(function() {
+ var showConsentDialog =
+ (this.consentDialog_) ? this.consentDialog_.show() : Promise.resolve();
+ showConsentDialog.then(function() {
chrome.identity.getAuthToken({'interactive': true},
that.onAuthComplete_.bind(that, true));
});

Powered by Google App Engine
This is Rietveld 408576698