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

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

Issue 10830111: [cros] Encode user images when set from WebUI (regression fix). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes Created 8 years, 5 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
Index: chrome/browser/chromeos/login/user_manager_impl.cc
diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc
index 6257ebbcd1fd317850d4ca0f8b28fb9eea55d85f..1fcc4dd735bfbf3fa8b5c7fbec6b823528fd21a6 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.cc
+++ b/chrome/browser/chromeos/login/user_manager_impl.cc
@@ -420,7 +420,7 @@ void UserManagerImpl::UserSelected(const std::string& email) {
ash::WallpaperLayout layout = static_cast<ash::WallpaperLayout>(index);
// Load user image asynchronously.
image_loader_->Start(
- wallpaper_path, 0, false,
+ wallpaper_path, 0,
base::Bind(&UserManagerImpl::OnCustomWallpaperLoaded,
base::Unretained(this), email, layout));
return;
@@ -631,7 +631,7 @@ void UserManagerImpl::SaveUserImageFromFile(const std::string& username,
const FilePath& path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
image_loader_->Start(
- path.value(), login::kMaxUserImageSize, true,
+ path.value(), login::kMaxUserImageSize,
base::Bind(&UserManagerImpl::SaveUserImage,
base::Unretained(this), username));
}
@@ -644,7 +644,7 @@ void UserManagerImpl::SaveUserWallpaperFromFile(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// For wallpapers, save the image without resizing.
image_loader_->Start(
- path.value(), 0 /* Original size */, false,
+ path.value(), 0 /* Original size */,
base::Bind(&UserManagerImpl::SaveUserWallpaperInternal,
base::Unretained(this), username, layout, User::CUSTOMIZED,
delegate));
@@ -656,9 +656,10 @@ void UserManagerImpl::SaveUserImageFromProfileImage(
if (!downloaded_profile_image_.empty()) {
// Profile image has already been downloaded, so save it to file right now.
DCHECK(profile_image_url_.is_valid());
- SaveUserImageInternal(username,
- User::kProfileImageIndex, profile_image_url_,
- UserImage(downloaded_profile_image_));
+ SaveUserImageInternal(
+ username,
+ User::kProfileImageIndex, profile_image_url_,
+ UserImage::CreateAndEncode(downloaded_profile_image_));
} else {
// No profile image - use the stub image (gray avatar).
SetUserImage(username, User::kProfileImageIndex,
@@ -849,7 +850,7 @@ void UserManagerImpl::EnsureUsersLoaded() {
DCHECK(!image_path.empty());
// Load user image asynchronously.
image_loader_->Start(
- image_path, user_image_size, true,
+ image_path, user_image_size,
base::Bind(&UserManagerImpl::SetUserImage,
base::Unretained(this),
email, image_index, GURL()));
@@ -879,7 +880,7 @@ void UserManagerImpl::EnsureUsersLoaded() {
if (!image_path.empty()) {
// Load user image asynchronously.
image_loader_->Start(
- image_path, user_image_size, true,
+ image_path, user_image_size,
base::Bind(&UserManagerImpl::SetUserImage,
base::Unretained(this),
email, image_index, image_gurl));
@@ -1270,7 +1271,7 @@ void UserManagerImpl::OnCustomWallpaperLoaded(const std::string& email,
std::string wallpaper_thumbnail_path =
GetWallpaperPathForUser(email, true).value();
image_loader_->Start(
- wallpaper_thumbnail_path, 0, false,
+ wallpaper_thumbnail_path, 0,
base::Bind(&UserManagerImpl::OnCustomWallpaperThumbnailLoaded,
base::Unretained(this), email));
}

Powered by Google App Engine
This is Rietveld 408576698