| Index: chrome/browser/profiles/gaia_info_update_service.cc
|
| diff --git a/chrome/browser/profiles/gaia_info_update_service.cc b/chrome/browser/profiles/gaia_info_update_service.cc
|
| index 0f58dc0d4b557cc0018d9f40d7aefb49d96ea4e3..b1672e084c87f443394957900ab2a4022e512871 100644
|
| --- a/chrome/browser/profiles/gaia_info_update_service.cc
|
| +++ b/chrome/browser/profiles/gaia_info_update_service.cc
|
| @@ -78,6 +78,8 @@ bool GAIAInfoUpdateService::ShouldUseGAIAProfileInfo(Profile* profile) {
|
| void GAIAInfoUpdateService::RegisterUserPrefs(PrefService* prefs) {
|
| prefs->RegisterInt64Pref(
|
| prefs::kProfileGAIAInfoUpdateTime, 0, PrefService::UNSYNCABLE_PREF);
|
| + prefs->RegisterStringPref(
|
| + prefs::kProfileGAIAInfoPictureURL, "", PrefService::UNSYNCABLE_PREF);
|
| }
|
|
|
| int GAIAInfoUpdateService::GetDesiredImageSideLength() {
|
| @@ -88,6 +90,10 @@ Profile* GAIAInfoUpdateService::GetBrowserProfile() {
|
| return profile_;
|
| }
|
|
|
| +std::string GAIAInfoUpdateService::GetCachedPictureURL() {
|
| + return profile_->GetPrefs()->GetString(prefs::kProfileGAIAInfoPictureURL);
|
| +}
|
| +
|
| void GAIAInfoUpdateService::OnDownloadComplete(ProfileDownloader* downloader,
|
| bool success) {
|
| // Save the last updated time.
|
| @@ -103,6 +109,9 @@ void GAIAInfoUpdateService::OnDownloadComplete(ProfileDownloader* downloader,
|
|
|
| string16 full_name = downloader->GetProfileFullName();
|
| SkBitmap bitmap = downloader->GetProfilePicture();
|
| + ProfileDownloader::PictureResult picture_result =
|
| + downloader->GetProfilePictureResult();
|
| + std::string picture_url = downloader->GetProfilePictureURL();
|
| profile_image_downloader_.reset();
|
|
|
| ProfileInfoCache& cache =
|
| @@ -112,8 +121,14 @@ void GAIAInfoUpdateService::OnDownloadComplete(ProfileDownloader* downloader,
|
| return;
|
|
|
| cache.SetGAIANameOfProfileAtIndex(profile_index, full_name);
|
| - gfx::Image gfx_image(new SkBitmap(bitmap));
|
| - cache.SetGAIAPictureOfProfileAtIndex(profile_index, &gfx_image);
|
| + if (picture_result == ProfileDownloader::PICTURE_SUCCESS) {
|
| + profile_->GetPrefs()->SetString(prefs::kProfileGAIAInfoPictureURL,
|
| + picture_url);
|
| + gfx::Image gfx_image(new SkBitmap(bitmap));
|
| + cache.SetGAIAPictureOfProfileAtIndex(profile_index, &gfx_image);
|
| + } else if (picture_result == ProfileDownloader::PICTURE_DEFAULT) {
|
| + cache.SetGAIAPictureOfProfileAtIndex(profile_index, NULL);
|
| + }
|
|
|
| // If this profile hasn't switched to using GAIA information for the profile
|
| // name and picture then switch it now. Once the profile has switched this
|
|
|