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

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: Fix unit test failure and rebase 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/background.js ('k') | remoting/webapp/crd/js/it2me_helpee_channel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..161e083e318069d929c937062d2f39fdf102e469 100644
--- a/remoting/webapp/crd/js/identity.js
+++ b/remoting/webapp/crd/js/identity.js
@@ -21,12 +21,12 @@ var remoting = remoting || {};
remoting.identity = null;
/**
- * @param {remoting.Identity.ConsentDialog} consentDialog
+ * @param {remoting.Identity.ConsentDialog=} opt_consentDialog
* @constructor
*/
-remoting.Identity = function(consentDialog) {
+remoting.Identity = function(opt_consentDialog) {
/** @private */
- this.consentDialog_ = consentDialog;
+ this.consentDialog_ = opt_consentDialog;
/** @type {string} @private */
this.email_ = '';
/** @type {string} @private */
@@ -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));
});
« no previous file with comments | « remoting/webapp/crd/js/background.js ('k') | remoting/webapp/crd/js/it2me_helpee_channel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698