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

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

Issue 10836238: [cros] Hide user pods on Login screen while images are loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: JS cleanup and timeout. Created 8 years, 4 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/user_pod_row.css ('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 7753b3b3b55eb59c6ed68ce9c2dd385230432614..7a3d35907960e2458f606be27955acc4e665aa59 100644
--- a/chrome/browser/resources/chromeos/login/user_pod_row.js
+++ b/chrome/browser/resources/chromeos/login/user_pod_row.js
@@ -36,6 +36,14 @@ cr.define('login', function() {
var WALLPAPER_BOOT_LOAD_DELAY_MS = 500;
/**
+ * Maximum time for which the pod row remains hidden until all user images
+ * have been loaded.
+ * @type {number}
+ * @const
+ */
+ var POD_ROW_IMAGES_LOAD_TIMEOUT_MS = 3000;
+
+ /**
* Oauth token status. These must match UserManager::OAuthTokenStatus.
* @enum {number}
* @const
@@ -631,6 +639,11 @@ cr.define('login', function() {
for (var i = 0, pod; pod = this.pods[i]; ++i) {
this.podsWithPendingImages_.push(pod);
}
+ // Make sure we eventually show the pod row, even if some image is stuck.
+ setTimeout(function() {
+ $('pod-row').classList.remove('images-loading');
ygorshenin1 2012/08/14 14:39:27 $('pod-row') -> this ?
Ivan Korotkov 2012/08/14 15:00:03 It's not |this| in a timer callback and I guess sa
+ }, POD_ROW_IMAGES_LOAD_TIMEOUT_MS);
+
this.focusPod(this.preselectedPod);
},
@@ -889,7 +902,7 @@ cr.define('login', function() {
event, this.listeners_[event][0], this.listeners_[event][1]);
}
$('login-header-bar').buttonsTabIndex = UserPodTabOrder.HEADER_BAR;
- $('pod-row').updateTitles();
+ this.updateTitles();
},
/**
@@ -901,7 +914,7 @@ cr.define('login', function() {
event, this.listeners_[event][0], this.listeners_[event][1]);
}
$('login-header-bar').buttonsTabIndex = 0;
- $('pod-row').hideTitles();
+ this.hideTitles();
},
/**
@@ -915,6 +928,7 @@ cr.define('login', function() {
this.podsWithPendingImages_.splice(index, 1);
if (this.podsWithPendingImages_.length == 0) {
+ this.classList.remove('images-loading');
chrome.send('userImagesLoaded');
// Report back user pods being painted.
window.webkitRequestAnimationFrame(function() {
« no previous file with comments | « chrome/browser/resources/chromeos/login/user_pod_row.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698