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

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

Issue 10832336: chromeos: Use gfx::ImageSkia instead of SkBitmap for downloaded profile image. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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/chromeos/login/user_manager_impl.h ('k') | 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_impl.cc
diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc
index 6f2251fa7bcf316ceeb5d02b8bf58c01166f57c8..6e98b27f5a7bd1e21cb595296457799e4e4609ef 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.cc
+++ b/chrome/browser/chromeos/login/user_manager_impl.cc
@@ -684,7 +684,7 @@ void UserManagerImpl::RemoveObserver(Observer* obs) {
observer_list_.RemoveObserver(obs);
}
-const SkBitmap& UserManagerImpl::DownloadedProfileImage() const {
+const gfx::ImageSkia& UserManagerImpl::DownloadedProfileImage() const {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
return downloaded_profile_image_;
}
@@ -1110,7 +1110,7 @@ void UserManagerImpl::InitDownloadedProfileImage() {
VLOG(1) << "Profile image initialized";
downloaded_profile_image_ = logged_in_user_->image();
downloaded_profile_image_data_url_ =
- web_ui_util::GetImageDataUrl(gfx::ImageSkia(downloaded_profile_image_));
+ web_ui_util::GetImageDataUrl(downloaded_profile_image_);
profile_image_url_ = logged_in_user_->image_url();
}
}
@@ -1255,7 +1255,7 @@ void UserManagerImpl::OnProfileDownloadSuccess(ProfileDownloader* downloader) {
return;
downloaded_profile_image_data_url_ = new_image_data_url;
- downloaded_profile_image_ = downloader->GetProfilePicture();
+ downloaded_profile_image_ = gfx::ImageSkia(downloader->GetProfilePicture());
profile_image_url_ = GURL(downloader->GetProfilePictureURL());
if (GetLoggedInUser().image_index() == User::kProfileImageIndex) {
@@ -1267,13 +1267,10 @@ void UserManagerImpl::OnProfileDownloadSuccess(ProfileDownloader* downloader) {
SaveUserImageFromProfileImage(GetLoggedInUser().email());
}
- // TODO(ivankr): temporary measure until UserManager is fully migrated
- // to use ImageSkia instead of SkBitmap.
- gfx::ImageSkia profile_image(downloaded_profile_image_);
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_PROFILE_IMAGE_UPDATED,
content::Source<UserManagerImpl>(this),
- content::Details<const gfx::ImageSkia>(&profile_image));
+ content::Details<const gfx::ImageSkia>(&downloaded_profile_image_));
}
void UserManagerImpl::OnProfileDownloadFailure(ProfileDownloader* downloader) {
« no previous file with comments | « chrome/browser/chromeos/login/user_manager_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698