Commit ee5e8d8f authored by ivankr@chromium.org's avatar ivankr@chromium.org

[cros] Users without no profile image get a gray avatar when Local State is loaded.

BUG=chromium-os:23210
TEST=Manual: on the Login screen, users who selected profile image but don't have one should be displayed with a gray avatar.

Review URL: http://codereview.chromium.org/8634007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111160 0039d316-1c4b-4281-b951-d872f2087c98
parent 86ebf054
...@@ -79,8 +79,7 @@ const char kStubUser[] = "stub-user@example.com"; ...@@ -79,8 +79,7 @@ const char kStubUser[] = "stub-user@example.com";
const char kImagePathNodeName[] = "path"; const char kImagePathNodeName[] = "path";
const char kImageIndexNodeName[] = "index"; const char kImageIndexNodeName[] = "index";
// Index of the default image used as stub while the real user image is loading // Index of the default image used for the |kStubUser| user.
// from file and for the |kStubUser| user.
const int kStubDefaultImageIndex = 0; const int kStubDefaultImageIndex = 0;
// Delay betweeen user login and attempt to update user's profile image. // Delay betweeen user login and attempt to update user's profile image.
...@@ -591,7 +590,8 @@ void UserManager::EnsureUsersLoaded() { ...@@ -591,7 +590,8 @@ void UserManager::EnsureUsersLoaded() {
} else { } else {
int image_index = User::kExternalImageIndex; int image_index = User::kExternalImageIndex;
// Until image has been loaded, use a stub. // Until image has been loaded, use a stub.
user->SetImage(GetDefaultImage(kStubDefaultImageIndex), user->SetImage(*ResourceBundle::GetSharedInstance().
GetBitmapNamed(IDR_PROFILE_PICTURE_LOADING),
image_index); image_index);
DCHECK(!image_path.empty()); DCHECK(!image_path.empty());
// Load user image asynchronously. // Load user image asynchronously.
...@@ -615,8 +615,9 @@ void UserManager::EnsureUsersLoaded() { ...@@ -615,8 +615,9 @@ void UserManager::EnsureUsersLoaded() {
// after user logs in). // after user logs in).
DCHECK(!image_path.empty() || DCHECK(!image_path.empty() ||
image_index == User::kProfileImageIndex); image_index == User::kProfileImageIndex);
// Until image has been loaded, use a stub. // Until image has been loaded, use a gray avatar.
user->SetImage(GetDefaultImage(kStubDefaultImageIndex), user->SetImage(*ResourceBundle::GetSharedInstance().
GetBitmapNamed(IDR_PROFILE_PICTURE_LOADING),
image_index); image_index);
if (!image_path.empty()) { if (!image_path.empty()) {
// Load user image asynchronously. // Load user image asynchronously.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment