Chromium Code Reviews| Index: chrome/browser/resources/chromeos/login/user_pod_row.js |
| diff --git a/chrome/browser/resources/chromeos/login/user_pod_row.js b/chrome/browser/resources/chromeos/login/user_pod_row.js |
| index 149b3175eb580fab6afd6c04f64a8ce12a7dd471..eb04b3a9e8f09224a76bd4e13e1a2eaf649abc3d 100644 |
| --- a/chrome/browser/resources/chromeos/login/user_pod_row.js |
| +++ b/chrome/browser/resources/chromeos/login/user_pod_row.js |
| @@ -7,14 +7,26 @@ |
| */ |
| cr.define('login', function() { |
| - // Pod width. 170px Pod + 10px padding + 10px margin on both sides. |
| - const POD_WIDTH = 170 + 2 * (10 + 10); |
| + /** |
| + * Pod width. 170px Pod + 10px padding + 10px margin on both sides. |
| + * @type {number} |
| + * @const |
| + */ |
| + var POD_WIDTH = 170 + 2 * (10 + 10); |
| + |
| + /** |
| + * Wallpaper load delay in milliseconds. |
| + * @type {number} |
| + * @const |
| + */ |
| + var WALLPAPER_LOAD_DELAY_MS = 800; |
| /** |
| * Oauth token status. These must match UserManager::OAuthTokenStatus. |
| * @enum {number} |
| + * @const |
| */ |
| - const OAuthTokenStatus = { |
| + var OAuthTokenStatus = { |
| UNKNOWN: 0, |
| INVALID: 1, |
| VALID: 2 |
| @@ -23,8 +35,9 @@ cr.define('login', function() { |
| /** |
| * Tab order for user pods. Update these when adding new controls. |
| * @enum {number} |
| + * @const |
| */ |
| - const UserPodTabOrder = { |
| + var UserPodTabOrder = { |
| POD_INPUT: 1, // Password input fields (and whole pods themselves). |
| HEADER_BAR: 2, // Buttons on the header bar (Shutdown, Add User). |
| REMOVE_USER: 3 // Remove ('X') buttons. |
| @@ -457,6 +470,10 @@ cr.define('login', function() { |
| // Activated pod, i.e. the pod of current login attempt. |
| activatedPod_: undefined, |
| + // When moving through users quickly at login screen, we need to set a |
|
James Hawkins
2012/04/27 19:29:03
nit: Don't use pronouns, e.g. 'we', in comments; p
bshe
2012/04/30 15:11:00
Done.
|
| + // timeout to prevent loading intermediate wallpapers. |
| + loadWallpaperTimeout_: null, |
| + |
| // Pods whose initial images haven't been loaded yet. |
| podsWithPendingImages_: [], |
| @@ -632,6 +649,7 @@ cr.define('login', function() { |
| if (this.focusedPod_ == podToFocus && !opt_force) |
| return; |
| + clearTimeout(this.loadWallpaperTimeout_); |
| for (var i = 0, pod; pod = this.pods[i]; ++i) { |
| pod.activeRemoveButton = false; |
| if (pod != podToFocus) { |
| @@ -647,6 +665,9 @@ cr.define('login', function() { |
| podToFocus.classList.add('focused'); |
| podToFocus.reset(true); // Reset and give focus. |
| this.scrollPodIntoView(podToFocus); |
| + this.loadWallpaperTimeout_ = window.setTimeout(function() { |
| + chrome.send('userSelectedDelayed', [podToFocus.user.username]); |
| + }, WALLPAPER_LOAD_DELAY_MS); |
| } |
| }, |