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

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

Issue 8537015: [cros] User images are updated on the login screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 1755bdc94fb40cb2b034292f56e6037cc2fb64dd..31b826426d7de195d047f7fdd1252fa91367ae5b 100644
--- a/chrome/browser/resources/chromeos/login/user_pod_row.js
+++ b/chrome/browser/resources/chromeos/login/user_pod_row.js
@@ -175,8 +175,9 @@ cr.define('login', function() {
set user(userDict) {
this.user_ = userDict;
+ this.updateUserImage();
+
this.nameElement.textContent = userDict.name;
- this.imageElement.src = userDict.imageUrl;
this.removeUserButtonElement.hidden = !userDict.canRemove;
this.signedInIndicatorElement.hidden = !userDict.signedIn;
@@ -263,6 +264,16 @@ cr.define('login', function() {
},
/**
+ * Updates the image element of the user.
+ */
+ updateUserImage: function() {
+ this.imageElement.src = this.isGuest ?
+ 'chrome://theme/IDR_LOGIN_GUEST' :
+ 'chrome://userimage/' + this.user.emailAddress +
+ '?id=' + (new Date()).getTime();
+ },
+
+ /**
* Focuses on input element.
*/
focusInput: function() {
@@ -600,6 +611,18 @@ cr.define('login', function() {
},
/**
+ * Updates current image of a user.
+ * @param {string} email Email of the user for which to update the image.
+ * @public
+ */
+ updateUserImage: function(email) {
+ for (var i = 0; i < this.pods.length; ++i) {
+ if (this.pods[i].user.emailAddress == email)
+ this.pods[i].updateUserImage();
+ }
+ },
+
+ /**
* Handler of click event.
* @param {Event} e Click Event object.
* @private

Powered by Google App Engine
This is Rietveld 408576698