summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/gaia_auth_host/authenticator.js
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-10-13 13:24:50 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-10-14 10:57:25 +0000
commitaf3d4809763ef308f08ced947a73b624729ac7ea (patch)
tree4402b911e30383f6c6dace1e8cf3b8e85355db3a /chromium/chrome/browser/resources/gaia_auth_host/authenticator.js
parent0e8ff63a407fe323e215bb1a2c423c09a4747c8a (diff)
BASELINE: Update Chromium to 47.0.2526.14
Also adding in sources needed for spellchecking. Change-Id: Idd44170fa1616f26315188970a8d5ba7d472b18a Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
Diffstat (limited to 'chromium/chrome/browser/resources/gaia_auth_host/authenticator.js')
-rw-r--r--chromium/chrome/browser/resources/gaia_auth_host/authenticator.js39
1 files changed, 16 insertions, 23 deletions
diff --git a/chromium/chrome/browser/resources/gaia_auth_host/authenticator.js b/chromium/chrome/browser/resources/gaia_auth_host/authenticator.js
index ed83ce3619f..64627402bb7 100644
--- a/chromium/chrome/browser/resources/gaia_auth_host/authenticator.js
+++ b/chromium/chrome/browser/resources/gaia_auth_host/authenticator.js
@@ -110,7 +110,6 @@ cr.define('cr.login', function() {
this.skipForNow_ = false;
this.authFlow = AuthFlow.DEFAULT;
this.authDomain = '';
- this.loaded_ = false;
this.idpOrigin_ = null;
this.continueUrl_ = null;
this.continueUrlWithoutParams_ = null;
@@ -196,7 +195,6 @@ cr.define('cr.login', function() {
Authenticator.prototype.load = function(authMode, data) {
this.authMode = authMode;
this.clearCredentials_();
- this.loaded_ = false;
// gaiaUrl parameter is used for testing. Once defined, it is never changed.
this.idpOrigin_ = data.gaiaUrl || IDP_ORIGIN;
this.continueUrl_ = data.continueUrl || CONTINUE_URL;
@@ -210,6 +208,7 @@ cr.define('cr.login', function() {
this.gapsCookie_ = data.gapsCookie;
this.gapsCookieSent_ = false;
this.newGapsCookie_ = null;
+ this.dontResizeNonEmbeddedPages = data.dontResizeNonEmbeddedPages;
this.initialFrameUrl_ = this.constructInitialFrameUrl_(data);
this.reloadUrl_ = data.frameUrl || this.initialFrameUrl_;
@@ -243,7 +242,6 @@ cr.define('cr.login', function() {
*/
Authenticator.prototype.reload = function() {
this.clearCredentials_();
- this.loaded_ = false;
this.webview_.src = this.reloadUrl_;
};
@@ -318,7 +316,12 @@ cr.define('cr.login', function() {
}
}
}
- if (!isEmbeddedPage) {
+
+ // In some cases, non-embedded pages should not be resized. For
+ // example, on desktop when reauthenticating for purposes of unlocking
+ // a profile, resizing would cause a browser window to open in the
+ // system profile, which is not allowed.
+ if (!isEmbeddedPage && !this.dontResizeNonEmbeddedPages) {
this.dispatchEvent(new CustomEvent('resize', {detail: currentUrl}));
return;
}
@@ -515,13 +518,13 @@ cr.define('cr.login', function() {
var msg = e.data;
if (msg.method == 'attemptLogin') {
this.email_ = msg.email;
- this.password_ = msg.password;
+ if (this.authMode == AuthMode.DESKTOP)
+ this.password_ = msg.password;
+
this.chooseWhatToSync_ = msg.chooseWhatToSync;
// We need to dispatch only first event, before user enters password.
- if (!msg.password) {
- this.dispatchEvent(
- new CustomEvent('attemptLogin', {detail: msg.email}));
- }
+ this.dispatchEvent(
+ new CustomEvent('attemptLogin', {detail: msg.email}));
} else if (msg.method == 'dialogShown') {
this.dispatchEvent(new Event('dialogShown'));
} else if (msg.method == 'dialogHidden') {
@@ -585,13 +588,6 @@ cr.define('cr.login', function() {
return;
}
- // TODO(achuith): Eliminate this branch when credential passing api is
- // stable on prod. crbug.com/467778.
- if (this.authFlow != AuthFlow.SAML) {
- this.onAuthCompleted_();
- return;
- }
-
if (this.samlHandler_.scrapedPasswordCount == 0) {
if (this.noPasswordCallback) {
this.noPasswordCallback(this.email_);
@@ -703,6 +699,10 @@ cr.define('cr.login', function() {
};
this.webview_.contentWindow.postMessage(msg, currentUrl);
+
+ this.dispatchEvent(new Event('ready'));
+ // Focus webview after dispatching event when webview is already visible.
+ this.webview_.focus();
}
};
@@ -721,13 +721,6 @@ cr.define('cr.login', function() {
* @private
*/
Authenticator.prototype.onLoadStop_ = function(e) {
- if (!this.loaded_) {
- this.loaded_ = true;
- this.dispatchEvent(new Event('ready'));
- // Focus webview after dispatching event when webview is already visible.
- this.webview_.focus();
- }
-
// Sends client id to EAFE on every loadstop after a small timeout. This is
// needed because EAFE sits behind SSO and initialize asynchrounouly
// and we don't know for sure when it is loaded and ready to listen