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

Side by Side Diff: chrome/browser/profiles/gaia_info_update_service.cc

Issue 8746002: Use OAuth2 refresh token to download GAIA info (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: correct branch Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698