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

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

Issue 479353003: Add IsAuthenticated() method to SigninManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 6 years, 3 months 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) 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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc ('k') | chrome/browser/signin/signin_global_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698