| Index: chrome/browser/resources/chromeos/login/screen_gaia_signin.js
|
| diff --git a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
|
| index 7fdf7438242310263c8f041db3164947a873b795..534c0bc234d6ca7ac12bf00660faa489b42537cb 100644
|
| --- a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
|
| +++ b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
|
| @@ -8,10 +8,10 @@
|
|
|
| cr.define('login', function() {
|
| // Gaia loading time after which portal check should be fired.
|
| - const GAIA_LOADING_PORTAL_SUSSPECT_TIME_SEC = 5;
|
| + /** @const */ var GAIA_LOADING_PORTAL_SUSSPECT_TIME_SEC = 5;
|
|
|
| // Maximum Gaia loading time in seconds.
|
| - const MAX_GAIA_LOADING_TIME_SEC = 60;
|
| + /** @const */ var MAX_GAIA_LOADING_TIME_SEC = 60;
|
|
|
| /**
|
| * Creates a new sign in screen div.
|
| @@ -59,7 +59,7 @@ cr.define('login', function() {
|
|
|
| // Email of the user, which is logging in using offline mode.
|
| // @type {string}
|
| - email: "",
|
| + email: '',
|
|
|
| // Timer id of pending load.
|
| loadingTimer_: undefined,
|
| @@ -103,8 +103,8 @@ cr.define('login', function() {
|
| chrome.send('fixCaptivePortal');
|
| this.loadingTimer_ = window.setTimeout(
|
| this.onLoadingTimeOut_.bind(this),
|
| - (MAX_GAIA_LOADING_TIME_SEC - GAIA_LOADING_PORTAL_SUSSPECT_TIME_SEC)
|
| - * 1000);
|
| + (MAX_GAIA_LOADING_TIME_SEC - GAIA_LOADING_PORTAL_SUSSPECT_TIME_SEC) *
|
| + 1000);
|
| },
|
|
|
| /**
|
| @@ -155,8 +155,8 @@ cr.define('login', function() {
|
|
|
| /**
|
| * Event handler that is invoked just before the frame is shown.
|
| - * @param data {string} Screen init payload. Url of auth extension start
|
| - * page.
|
| + * @param {string} data Screen init payload. Url of auth extension start
|
| + * page.
|
| */
|
| onBeforeShow: function(data) {
|
| // Announce the name of the screen, if accessibility is on.
|
| @@ -176,7 +176,7 @@ cr.define('login', function() {
|
| loadAuthExtension_: function(data) {
|
| this.silentLoad_ = data.silentLoad;
|
| this.isLocal = data.isLocal;
|
| - this.email = "";
|
| + this.email = '';
|
|
|
| // Offline sign-in is only allowed for the case when users aren't shown
|
| // because there is no other way for an user to enter when device is
|
| @@ -252,7 +252,7 @@ cr.define('login', function() {
|
|
|
| /**
|
| * Checks if message comes from the loaded authentication extension.
|
| - * @param e {object} Payload of the received HTML5 message.
|
| + * @param {object} e Payload of the received HTML5 message.
|
| * @type {boolean}
|
| */
|
| isAuthExtMessage_: function(e) {
|
| @@ -263,7 +263,7 @@ cr.define('login', function() {
|
|
|
| /**
|
| * Event handler that is invoked when HTML5 message is received.
|
| - * @param e {object} Payload of the received HTML5 message.
|
| + * @param {object} e Payload of the received HTML5 message.
|
| */
|
| onMessage_: function(e) {
|
| if (!this.isAuthExtMessage_(e)) {
|
| @@ -276,7 +276,7 @@ cr.define('login', function() {
|
| console.log('GaiaSigninScreen.onMessage_: method=' + msg.method);
|
|
|
| if (msg.method == 'completeLogin') {
|
| - chrome.send('completeLogin', [msg.email, msg.password] );
|
| + chrome.send('completeLogin', [msg.email, msg.password]);
|
| this.loading = true;
|
| // Now that we're in logged in state header should be hidden.
|
| Oobe.getInstance().headerHidden = true;
|
| @@ -291,7 +291,11 @@ cr.define('login', function() {
|
| }
|
| this.clearRetry_();
|
| chrome.send('loginWebuiReady');
|
| - } else if (msg.method =='offlineLogin') {
|
| + // Report back sign in UI being painted.
|
| + window.webkitRequestAnimationFrame(function() {
|
| + chrome.send('loginVisible');
|
| + });
|
| + } else if (msg.method == 'offlineLogin') {
|
| this.email = msg.email;
|
| chrome.send('authenticateUser', [msg.email, msg.password]);
|
| this.loading = true;
|
| @@ -353,8 +357,8 @@ cr.define('login', function() {
|
| if (this.retryCount_ >= 3 || this.retryTimer_)
|
| return;
|
|
|
| - const MAX_DELAY = 7200; // 7200 seconds (i.e. 2 hours)
|
| - const MIN_DELAY = 1; // 1 second
|
| + /** @const */ var MAX_DELAY = 7200; // 7200 seconds (i.e. 2 hours)
|
| + /** @const */ var MIN_DELAY = 1; // 1 second
|
|
|
| var delay = Math.pow(2, this.retryCount_) * 5;
|
| delay = Math.max(MIN_DELAY, Math.min(MAX_DELAY, delay)) * 1000;
|
|
|