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

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

Issue 11035036: Fix wallpaper change on login screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 8 years, 2 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 | « no previous file | 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 7fee911593260fca8093d8c713ebb4bfffb93061..d84e7e0e2a9ab93c550972d728c8cfd376a0ee3a 100644
--- a/chrome/browser/resources/chromeos/login/user_pod_row.js
+++ b/chrome/browser/resources/chromeos/login/user_pod_row.js
@@ -416,6 +416,10 @@ cr.define('login', function() {
// True if inside focusPod().
insideFocusPod_: false,
+ // True if user pod has been activated with keyboard.
+ // In case of activation with keyboard we delay wallpaper change.
+ keyboardActivated_: false,
+
// Focused pod.
focusedPod_: undefined,
@@ -624,12 +628,16 @@ cr.define('login', function() {
* podToFocus is already focused.
*/
focusPod: function(podToFocus, opt_force) {
- if (this.isFocused(podToFocus) && !opt_force)
+ if (this.isFocused(podToFocus) && !opt_force) {
+ this.keyboardActivated_ = false;
return;
+ }
// Make sure there's only one focusPod operation happening at a time.
- if (this.insideFocusPod_)
+ if (this.insideFocusPod_) {
+ this.keyboardActivated_ = false;
return;
+ }
this.insideFocusPod_ = true;
clearTimeout(this.loadWallpaperTimeout_);
@@ -649,7 +657,7 @@ cr.define('login', function() {
podToFocus.classList.add('focused');
podToFocus.reset(true); // Reset and give focus.
this.scrollPodIntoView(podToFocus);
- if (hadFocus) {
+ if (hadFocus && this.keyboardActivated_) {
// Delay wallpaper loading to let user tab through pods without lag.
this.loadWallpaperTimeout_ = window.setTimeout(
this.loadWallpaper_.bind(this), WALLPAPER_LOAD_DELAY_MS);
@@ -657,12 +665,13 @@ cr.define('login', function() {
// Load wallpaper immediately if there no pod was focused
// previously, and it is not a boot into user pod list case.
this.loadWallpaper_();
- this.firstShown_ = false;
Nikita (slow) 2012/10/04 18:16:45 firstShown was never reset
}
+ this.firstShown_ = false;
} else {
chrome.send('userDeselected');
}
this.insideFocusPod_ = false;
+ this.keyboardActivated_ = false;
},
loadWallpaper_: function() {
@@ -804,6 +813,7 @@ cr.define('login', function() {
switch (e.keyIdentifier) {
case 'Left':
if (!editing) {
+ this.keyboardActivated_ = true;
if (this.focusedPod_ && this.focusedPod_.previousElementSibling)
this.focusPod(this.focusedPod_.previousElementSibling);
else
@@ -814,6 +824,7 @@ cr.define('login', function() {
break;
case 'Right':
if (!editing) {
+ this.keyboardActivated_ = true;
if (this.focusedPod_ && this.focusedPod_.nextElementSibling)
this.focusPod(this.focusedPod_.nextElementSibling);
else
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698