X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fchrome%2Fbrowser%2Fprofiles%2Fprofile_info_cache.cc;h=3079a62d1774cb8f629f6c0eae271cc1ff30bba2;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=c2e414899c4036c0cd094f7e5b924abc8dda16ab;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/chrome/browser/profiles/profile_info_cache.cc b/src/chrome/browser/profiles/profile_info_cache.cc index c2e4148..3079a62 100644 --- a/src/chrome/browser/profiles/profile_info_cache.cc +++ b/src/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(this)->AsWeakPtr(), key, image)); + const_cast(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(