| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/profiles/gaia_info_update_service.h" | 5 #include "chrome/browser/profiles/gaia_info_update_service.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 } | 56 } |
| 57 | 57 |
| 58 int GAIAInfoUpdateService::GetDesiredImageSideLength() { | 58 int GAIAInfoUpdateService::GetDesiredImageSideLength() { |
| 59 return 256; | 59 return 256; |
| 60 } | 60 } |
| 61 | 61 |
| 62 Profile* GAIAInfoUpdateService::GetBrowserProfile() { | 62 Profile* GAIAInfoUpdateService::GetBrowserProfile() { |
| 63 return profile_; | 63 return profile_; |
| 64 } | 64 } |
| 65 | 65 |
| 66 bool GAIAInfoUpdateService::GetShouldUseOAuthRefreshToken() { |
| 67 return true; |
| 68 } |
| 69 |
| 66 void GAIAInfoUpdateService::OnDownloadComplete(ProfileDownloader* downloader, | 70 void GAIAInfoUpdateService::OnDownloadComplete(ProfileDownloader* downloader, |
| 67 bool success) { | 71 bool success) { |
| 68 if (!success) { | 72 if (!success) { |
| 69 profile_image_downloader_.reset(); | 73 profile_image_downloader_.reset(); |
| 70 return; | 74 return; |
| 71 } | 75 } |
| 72 | 76 |
| 73 string16 full_name = downloader->GetProfileFullName(); | 77 string16 full_name = downloader->GetProfileFullName(); |
| 74 SkBitmap bitmap = downloader->GetProfilePicture(); | 78 SkBitmap bitmap = downloader->GetProfilePicture(); |
| 75 profile_image_downloader_.reset(); | 79 profile_image_downloader_.reset(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 86 | 90 |
| 87 // If this profile hasn't switched to using GAIA information for the profile | 91 // If this profile hasn't switched to using GAIA information for the profile |
| 88 // name and picture then switch it now. Once the profile has switched this | 92 // name and picture then switch it now. Once the profile has switched this |
| 89 // preference guards against clobbering the user's custom settings. | 93 // preference guards against clobbering the user's custom settings. |
| 90 if (!cache.GetHasMigratedToGAIAInfoOfProfileAtIndex(profile_index)) { | 94 if (!cache.GetHasMigratedToGAIAInfoOfProfileAtIndex(profile_index)) { |
| 91 cache.SetHasMigratedToGAIAInfoOfProfileAtIndex(profile_index, true); | 95 cache.SetHasMigratedToGAIAInfoOfProfileAtIndex(profile_index, true); |
| 92 cache.SetIsUsingGAIAPictureOfProfileAtIndex(profile_index, true); | 96 cache.SetIsUsingGAIAPictureOfProfileAtIndex(profile_index, true); |
| 93 cache.SetIsUsingGAIANameOfProfileAtIndex(profile_index, true); | 97 cache.SetIsUsingGAIANameOfProfileAtIndex(profile_index, true); |
| 94 } | 98 } |
| 95 } | 99 } |
| OLD | NEW |