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

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

Issue 678553002: Badge icons in windows task bar with avatar icon. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove space Created 6 years, 2 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_info_cache.cc
diff --git a/chrome/browser/profiles/profile_info_cache.cc b/chrome/browser/profiles/profile_info_cache.cc
index c2e414899c4036c0cd094f7e5b924abc8dda16ab..3079a62d1774cb8f629f6c0eae271cc1ff30bba2 100644
--- a/chrome/browser/profiles/profile_info_cache.cc
+++ b/chrome/browser/profiles/profile_info_cache.cc
@@ -381,7 +381,7 @@ const gfx::Image* ProfileInfoCache::GetGAIAPictureOfProfileAtIndex(
return NULL;
base::FilePath image_path = path.AppendASCII(file_name);
- return LoadAvatarPictureFromPath(key, image_path);
+ return LoadAvatarPictureFromPath(path, key, image_path);
}
bool ProfileInfoCache::IsUsingGAIAPictureOfProfileAtIndex(size_t index) const {
@@ -994,10 +994,12 @@ const gfx::Image* ProfileInfoCache::GetHighResAvatarOfProfileAtIndex(
base::FilePath image_path =
profiles::GetPathOfHighResAvatarAtIndex(avatar_index);
- return LoadAvatarPictureFromPath(key, image_path);
+ return LoadAvatarPictureFromPath(GetPathOfProfileAtIndex(index),
+ key, image_path);
}
const gfx::Image* ProfileInfoCache::LoadAvatarPictureFromPath(
+ const base::FilePath& profile_path,
const std::string& key,
const base::FilePath& image_path) const {
// If the picture is already loaded then use it.
@@ -1016,11 +1018,13 @@ const gfx::Image* ProfileInfoCache::LoadAvatarPictureFromPath(
BrowserThread::PostTaskAndReply(BrowserThread::FILE, FROM_HERE,
base::Bind(&ReadBitmap, image_path, image),
base::Bind(&ProfileInfoCache::OnAvatarPictureLoaded,
- const_cast<ProfileInfoCache*>(this)->AsWeakPtr(), key, image));
+ const_cast<ProfileInfoCache*>(this)->AsWeakPtr(),
+ profile_path, key, image));
return NULL;
}
-void ProfileInfoCache::OnAvatarPictureLoaded(const std::string& key,
+void ProfileInfoCache::OnAvatarPictureLoaded(const base::FilePath& profile_path,
+ const std::string& key,
gfx::Image** image) const {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -1039,6 +1043,10 @@ void ProfileInfoCache::OnAvatarPictureLoaded(const std::string& key,
chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED,
content::NotificationService::AllSources(),
content::NotificationService::NoDetails());
+
+ FOR_EACH_OBSERVER(ProfileInfoCacheObserver,
+ observer_list_,
+ OnProfileAvatarChanged(profile_path));
}
void ProfileInfoCache::OnAvatarPictureSaved(

Powered by Google App Engine
This is Rietveld 408576698