Chromium Code Reviews| Index: chrome/browser/resources/gaia_auth/background.js |
| diff --git a/chrome/browser/resources/gaia_auth/background.js b/chrome/browser/resources/gaia_auth/background.js |
| index ffe0b0785871f96bee7a2357e42d142266732860..f8be49c3d751b9776b95b4504d245510577ae748 100644 |
| --- a/chrome/browser/resources/gaia_auth/background.js |
| +++ b/chrome/browser/resources/gaia_auth/background.js |
| @@ -119,6 +119,10 @@ BackgroundBridge.prototype = { |
| // 'google-accounts-signin'. |
| email_: null, |
| + // Gaia Id of the newly authenticated user based on the gaia response |
| + // header 'google-accounts-signin'. |
| + gaiaId_: null, |
| + |
| // Session index of the newly authenticated user based on the gaia response |
| // header 'google-accounts-signin'. |
| sessionIndex_: null, |
| @@ -204,7 +208,7 @@ BackgroundBridge.prototype = { |
| onCompleted: function(details) { |
| // Only monitors requests in the gaia frame whose parent frame ID must be |
| // positive. |
| - if (!this.isDesktopFlow_ || details.parentFrameId <= 0) |
| + if (details.parentFrameId <= 0) |
| return; |
| if (details.url.lastIndexOf(backgroundBridgeManager.CONTINUE_URL_BASE, 0) == |
| @@ -218,6 +222,7 @@ BackgroundBridge.prototype = { |
| var msg = { |
| 'name': 'completeLogin', |
| 'email': this.email_, |
| + 'gaiaId': this.gaiaId_, |
| 'password': passwords[0], |
| 'sessionIndex': this.sessionIndex_, |
| 'skipForNow': skipForNow |
| @@ -262,11 +267,8 @@ BackgroundBridge.prototype = { |
| onHeadersReceived: function(details) { |
| var headers = details.responseHeaders; |
| - if (this.isDesktopFlow_ && |
| - this.gaiaUrl_ && |
| - details.url.lastIndexOf(this.gaiaUrl_) == 0) { |
| - // TODO(xiyuan, guohui): CrOS should reuse the logic below for reading the |
| - // email for SAML users and cut off the /ListAccount call. |
| + if (!this.isDesktopFlow_ || |
| + (this.gaiaUrl_ && details.url.lastIndexOf(this.gaiaUrl_) == 0)) { |
|
bartfab (slow)
2014/10/14 17:12:37
On desktop, we look for GAIA headers only when the
guohui
2014/10/14 18:50:02
+1, seems we could just remove the check for isDes
Roger Tawa OOO till Jul 10th
2014/10/16 02:39:31
Good catch. I got the condition wrong. Should al
Roger Tawa OOO till Jul 10th
2014/10/16 02:39:31
Done.
|
| for (var i = 0; headers && i < headers.length; ++i) { |
| if (headers[i].name.toLowerCase() == 'google-accounts-signin') { |
| var headerValues = headers[i].value.toLowerCase().split(','); |
| @@ -277,6 +279,7 @@ BackgroundBridge.prototype = { |
| }); |
| // Remove "" around. |
| this.email_ = signinDetails['email'].slice(1, -1); |
| + this.gaiaId_ = signinDetails['obfuscatedid'].slice(1, -1); |
| this.sessionIndex_ = signinDetails['sessionindex']; |
| break; |
| } |