| 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 160b31268ef8d9dca12e875bfc7d958bd866026f..47e54922239196851987d0a55bba930b97f1005b 100644
|
| --- a/chrome/browser/resources/gaia_auth/background.js
|
| +++ b/chrome/browser/resources/gaia_auth/background.js
|
| @@ -33,7 +33,7 @@ function BackgroundBridgeManager() {
|
|
|
| BackgroundBridgeManager.prototype = {
|
| CONTINUE_URL_BASE: 'chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik' +
|
| - '/success.html',
|
| + '/success.html',
|
| // Maps a tab id to its associated BackgroundBridge.
|
| bridges_: null,
|
|
|
| @@ -45,8 +45,7 @@ BackgroundBridgeManager.prototype = {
|
| if (this.bridges_[details.tabId])
|
| return this.bridges_[details.tabId].onInsecureRequest(details.url);
|
| }.bind(this),
|
| - {urls: ['http://*/*', 'file://*/*', 'ftp://*/*']},
|
| - ['blocking']);
|
| + {urls: ['http://*/*', 'file://*/*', 'ftp://*/*']}, ['blocking']);
|
|
|
| chrome.webRequest.onBeforeSendHeaders.addListener(
|
| function(details) {
|
| @@ -176,14 +175,11 @@ BackgroundBridge.prototype = {
|
| this.channelMain_.registerMessage(
|
| 'startAuth', this.onAuthStarted_.bind(this));
|
| this.channelMain_.registerMessage(
|
| - 'getScrapedPasswords',
|
| - this.onGetScrapedPasswords_.bind(this));
|
| + 'getScrapedPasswords', this.onGetScrapedPasswords_.bind(this));
|
| this.channelMain_.registerMessage(
|
| 'apiResponse', this.onAPIResponse_.bind(this));
|
|
|
| - this.channelMain_.send({
|
| - 'name': 'channelConnected'
|
| - });
|
| + this.channelMain_.send({'name': 'channelConnected'});
|
| },
|
|
|
| /**
|
| @@ -223,8 +219,7 @@ BackgroundBridge.prototype = {
|
| onCompleted: function(details) {
|
| // Only monitors requests in the gaia frame. The gaia frame is the one
|
| // where the initial frame URL completes.
|
| - if (details.url.lastIndexOf(
|
| - this.initialFrameUrlWithoutParams, 0) == 0) {
|
| + if (details.url.lastIndexOf(this.initialFrameUrlWithoutParams, 0) == 0) {
|
| this.frameId = details.frameId;
|
| }
|
| if (this.frameId == -1) {
|
| @@ -263,10 +258,7 @@ BackgroundBridge.prototype = {
|
| return;
|
| }
|
| }
|
| - var msg = {
|
| - 'name': 'switchToFullTab',
|
| - 'url': details.url
|
| - };
|
| + var msg = {'name': 'switchToFullTab', 'url': details.url};
|
| this.channelMain_.send(msg);
|
| }
|
| },
|
| @@ -324,8 +316,8 @@ BackgroundBridge.prototype = {
|
| // requests will be coming from the IdP. Append a cookie to the
|
| // current |headers| that marks the point at which the redirect
|
| // occurred.
|
| - headers.push({name: 'Set-Cookie',
|
| - value: 'google-accounts-saml-start=now'});
|
| + headers.push(
|
| + {name: 'Set-Cookie', value: 'google-accounts-saml-start=now'});
|
| return {responseHeaders: headers};
|
| } else if (action == 'end') {
|
| this.isSAML_ = false;
|
| @@ -349,8 +341,8 @@ BackgroundBridge.prototype = {
|
| // ignored by Chrome in cookie headers, causing the modified headers
|
| // to actually set the original cookies.
|
| var otherHeaders = [];
|
| - var cookies = [{name: 'Set-Cookie',
|
| - value: 'google-accounts-saml-end=now'}];
|
| + var cookies =
|
| + [{name: 'Set-Cookie', value: 'google-accounts-saml-end=now'}];
|
| for (var j = 0; j < headers.length; ++j) {
|
| if (headers[j].name.toLowerCase().startsWith('set-cookie')) {
|
| var header = headers[j];
|
| @@ -376,10 +368,8 @@ BackgroundBridge.prototype = {
|
| onBeforeSendHeaders: function(details) {
|
| if (!this.isDesktopFlow_ && this.gaiaUrl_ &&
|
| details.url.startsWith(this.gaiaUrl_)) {
|
| - details.requestHeaders.push({
|
| - name: 'X-Cros-Auth-Ext-Support',
|
| - value: 'SAML'
|
| - });
|
| + details.requestHeaders.push(
|
| + {name: 'X-Cros-Auth-Ext-Support', value: 'SAML'});
|
| }
|
| return {requestHeaders: details.requestHeaders};
|
| },
|
| @@ -449,9 +439,8 @@ BackgroundBridge.prototype = {
|
|
|
| onPageLoaded_: function(msg) {
|
| if (this.channelMain_)
|
| - this.channelMain_.send({name: 'onAuthPageLoaded',
|
| - url: msg.url,
|
| - isSAMLPage: this.isSAML_});
|
| + this.channelMain_.send(
|
| + {name: 'onAuthPageLoaded', url: msg.url, isSAMLPage: this.isSAML_});
|
| },
|
|
|
| onGetSAMLFlag_: function(msg) {
|
|
|