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

Unified Diff: chrome/browser/profiles/profile_avatar_downloader.cc

Issue 1242793005: Refactor most c/b/profiles calls to ProfileInfoCache. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Windows unit test and ChromeOS build Created 5 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/profiles/profile_avatar_downloader.cc
diff --git a/chrome/browser/profiles/profile_avatar_downloader.cc b/chrome/browser/profiles/profile_avatar_downloader.cc
index 69f4a4c94130debd1adb8a4ae19a419b63130465..1acd64ae5caff8a441d44367b40aca0cfd4d7644 100644
--- a/chrome/browser/profiles/profile_avatar_downloader.cc
+++ b/chrome/browser/profiles/profile_avatar_downloader.cc
@@ -19,10 +19,10 @@ const char kHighResAvatarDownloadUrlPrefix[] =
ProfileAvatarDownloader::ProfileAvatarDownloader(
size_t icon_index,
const base::FilePath& profile_path,
- ProfileInfoCache* cache)
+ ProfileAttributesStorage* storage)
: icon_index_(icon_index),
profile_path_(profile_path),
- cache_(cache) {
+ storage_(storage) {
GURL url(std::string(kHighResAvatarDownloadUrlPrefix) +
profiles::GetDefaultAvatarIconFileNameAtIndex(icon_index));
fetcher_.reset(new chrome::BitmapFetcher(url, this));
@@ -48,12 +48,13 @@ void ProfileAvatarDownloader::Start() {
// BitmapFetcherDelegate overrides.
void ProfileAvatarDownloader::OnFetchComplete(const GURL& url,
const SkBitmap* bitmap) {
- if (!bitmap || !cache_)
+ if (!bitmap || !storage_)
return;
- // Decode the downloaded bitmap. Ownership of the image is taken by |cache_|.
+ // Decode the downloaded bitmap.
+ // Ownership of the image is taken by |storage_|.
gfx::Image image = gfx::Image::CreateFrom1xBitmap(*bitmap);
- cache_->SaveAvatarImageAtPath(&image,
+ storage_->SaveAvatarImageAtPath(&image,
profiles::GetDefaultAvatarIconFileNameAtIndex(icon_index_),
profiles::GetPathOfHighResAvatarAtIndex(icon_index_),
profile_path_);

Powered by Google App Engine
This is Rietveld 408576698