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

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

Issue 10541007: [cros] Pre-select the first user pod on login screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 8 years, 6 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
« no previous file with comments | « chrome/browser/resources/chromeos/login/screen_account_picker.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7d1eb8b4ff7c72098d641cb618f184157231c901..c8f3655e4a4964e3277c13fb492d1a7ed98950bd 100644
--- a/chrome/browser/resources/chromeos/login/user_pod_row.js
+++ b/chrome/browser/resources/chromeos/login/user_pod_row.js
@@ -659,18 +659,31 @@ cr.define('login', function() {
}
}
+ var hadFocus = !!this.focusedPod_;
this.focusedPod_ = podToFocus;
if (podToFocus) {
podToFocus.classList.remove('faded');
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);
+ // Load wallpaper immediately if there no pod was focused previously,
+ // otherwise delay loading to let user tab through pods without lag.
+ if (hadFocus) {
+ this.loadWallpaperTimeout_ = window.setTimeout(
+ this.loadWallpaper_.bind(this), WALLPAPER_LOAD_DELAY_MS);
+ } else {
+ this.loadWallpaper_();
+ }
+ } else {
+ // TODO(ivankr): reset wallpaper.
}
},
+ loadWallpaper_: function() {
+ if (this.focusedPod_)
+ chrome.send('userSelectedDelayed', [this.focusedPod_.user.username]);
+ },
+
/**
* Returns the currently activated pod.
* @type {UserPod}
« no previous file with comments | « chrome/browser/resources/chromeos/login/screen_account_picker.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698