Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1358)

Unified Diff: chrome/browser/resources/chromeos/login/user_pod_row.js

Issue 10207030: Asynchronously load wallpapers when user pod is selected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..f3314cd0309498fb57dea003d36d32c5cc2bbd7b 100644
--- a/chrome/browser/resources/chromeos/login/user_pod_row.js
+++ b/chrome/browser/resources/chromeos/login/user_pod_row.js
@@ -8,13 +8,16 @@
cr.define('login', function() {
// Pod width. 170px Pod + 10px padding + 10px margin on both sides.
- const POD_WIDTH = 170 + 2 * (10 + 10);
+ var POD_WIDTH = 170 + 2 * (10 + 10);
+
+ // Wallpaper load delay in milliseconds.
+ var WALLPAPER_LOAD_DELAY = 800;
Nikita (slow) 2012/04/26 17:22:03 nit: WALLPAPER_LOAD_DELAY_MS
/**
* Oauth token status. These must match UserManager::OAuthTokenStatus.
* @enum {number}
*/
- const OAuthTokenStatus = {
+ var OAuthTokenStatus = {
UNKNOWN: 0,
INVALID: 1,
VALID: 2
@@ -24,7 +27,7 @@ cr.define('login', function() {
* Tab order for user pods. Update these when adding new controls.
* @enum {number}
*/
- 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 +460,10 @@ cr.define('login', function() {
// Activated pod, i.e. the pod of current login attempt.
activatedPod_: undefined,
+ // When quickly move through users at login screen, we need to set a
+ // timeout to prevent loading intermediate wallpapers.
+ loadWallpaperTimeout_: null,
+
// Pods whose initial images haven't been loaded yet.
podsWithPendingImages_: [],
@@ -632,6 +639,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 +655,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);
}
},
« no previous file with comments | « chrome/browser/chromeos/login/webui_login_display.cc ('k') | chrome/browser/ui/views/ash/chrome_shell_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698