OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 } | 42 } |
43 | 43 |
44 GAIAInfoUpdateService::~GAIAInfoUpdateService() { | 44 GAIAInfoUpdateService::~GAIAInfoUpdateService() { |
45 DCHECK(!profile_) << "Shutdown not called before dtor"; | 45 DCHECK(!profile_) << "Shutdown not called before dtor"; |
46 } | 46 } |
47 | 47 |
48 void GAIAInfoUpdateService::Update() { | 48 void GAIAInfoUpdateService::Update() { |
49 // The user must be logged in. | 49 // The user must be logged in. |
50 SigninManagerBase* signin_manager = | 50 SigninManagerBase* signin_manager = |
51 SigninManagerFactory::GetForProfile(profile_); | 51 SigninManagerFactory::GetForProfile(profile_); |
52 if (signin_manager->GetAuthenticatedAccountId().empty()) | 52 if (!signin_manager->IsAuthenticated()) |
53 return; | 53 return; |
54 | 54 |
55 if (profile_image_downloader_) | 55 if (profile_image_downloader_) |
56 return; | 56 return; |
57 profile_image_downloader_.reset(new ProfileDownloader(this)); | 57 profile_image_downloader_.reset(new ProfileDownloader(this)); |
58 profile_image_downloader_->Start(); | 58 profile_image_downloader_->Start(); |
59 } | 59 } |
60 | 60 |
61 // static | 61 // static |
62 bool GAIAInfoUpdateService::ShouldUseGAIAProfileInfo(Profile* profile) { | 62 bool GAIAInfoUpdateService::ShouldUseGAIAProfileInfo(Profile* profile) { |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 205 |
206 void GAIAInfoUpdateService::GoogleSigninSucceeded( | 206 void GAIAInfoUpdateService::GoogleSigninSucceeded( |
207 const std::string& username, | 207 const std::string& username, |
208 const std::string& password) { | 208 const std::string& password) { |
209 OnUsernameChanged(username); | 209 OnUsernameChanged(username); |
210 } | 210 } |
211 | 211 |
212 void GAIAInfoUpdateService::GoogleSignedOut(const std::string& username) { | 212 void GAIAInfoUpdateService::GoogleSignedOut(const std::string& username) { |
213 OnUsernameChanged(std::string()); | 213 OnUsernameChanged(std::string()); |
214 } | 214 } |
OLD | NEW |