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

Unified Diff: chrome/browser/chromeos/login/user_manager.cc

Issue 8634007: [cros] Users without no profile image get a gray avatar when Local State is loaded. (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
« 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/chromeos/login/user_manager.cc
diff --git a/chrome/browser/chromeos/login/user_manager.cc b/chrome/browser/chromeos/login/user_manager.cc
index 6e6a3622c90eab80b99c5c18c6b2c514b41ca89b..823a708644919606fdfc87a2fc40519d8a41015b 100644
--- a/chrome/browser/chromeos/login/user_manager.cc
+++ b/chrome/browser/chromeos/login/user_manager.cc
@@ -603,17 +603,25 @@ void UserManager::EnsureUsersLoaded() {
image_properties->GetInteger(kImageIndexNodeName, &image_index);
if (image_index >= 0 && image_index < kDefaultImagesCount) {
user->SetImage(GetDefaultImage(image_index), image_index);
- } else if (image_index == User::kExternalImageIndex ||
- image_index == User::kProfileImageIndex) {
+ } else if (image_index == User::kExternalImageIndex) {
+ DCHECK(!image_path.empty());
+ // Until image has been loaded, use a stub.
+ user->SetImage(GetDefaultImage(kStubDefaultImageIndex),
+ User::kExternalImageIndex);
+ // Load user image asynchronously.
+ image_loader_->Start(
+ image_path, 0,
+ base::Bind(&UserManager::SetUserImage,
+ base::Unretained(this), email, image_index));
+ } else if (image_index == User::kProfileImageIndex) {
+ // Until image has been loaded, use the default gray avatar.
whywhat 2011/11/22 13:55:39 Let's use gray avatar in both cases.
Ivan Korotkov 2011/11/22 15:11:07 Makes sense.
+ user->SetImage(*ResourceBundle::GetSharedInstance().
+ GetBitmapNamed(IDR_PROFILE_PICTURE_LOADING),
+ User::kProfileImageIndex);
// Path may be empty for profile images (meaning that the image
// hasn't been downloaded for the first time yet, in which case a
// download will be scheduled for |kProfileImageDownloadDelayMs|
// after user logs in).
- DCHECK(!image_path.empty() ||
- image_index == User::kProfileImageIndex);
- // Until image has been loaded, use a stub.
- user->SetImage(GetDefaultImage(kStubDefaultImageIndex),
- image_index);
if (!image_path.empty()) {
// Load user image asynchronously.
image_loader_->Start(
« 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