Chromium Code Reviews| 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/signin/signin_manager_base.h" | 5 #include "chrome/browser/signin/signin_manager_base.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 | 53 |
| 54 std::string user = profile_->GetPrefs()->GetString( | 54 std::string user = profile_->GetPrefs()->GetString( |
| 55 prefs::kGoogleServicesUsername); | 55 prefs::kGoogleServicesUsername); |
| 56 if (!user.empty()) | 56 if (!user.empty()) |
| 57 SetAuthenticatedUsername(user); | 57 SetAuthenticatedUsername(user); |
| 58 | 58 |
| 59 InitTokenService(); | 59 InitTokenService(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void SigninManagerBase::InitTokenService() { | 62 void SigninManagerBase::InitTokenService() { |
| 63 // TokenService can be null for unit tests. | |
| 64 TokenService* token_service = TokenServiceFactory::GetForProfile(profile_); | |
| 65 if (token_service) | |
| 66 token_service->Initialize(GaiaConstants::kChromeSource, profile_); | |
| 67 // Note: ChromeOS will kick off TokenService::LoadTokensFromDB from | |
|
Andrew T Wilson (Slow)
2013/11/14 10:34:57
Should we get rid of InitTokenService() in SigninM
Roger Tawa OOO till Jul 10th
2013/11/14 17:04:08
Yes good point, done.
| |
| 68 // OAuthLoginManager once the rest of the Profile is fully initialized. | |
| 69 } | 63 } |
| 70 | 64 |
| 71 bool SigninManagerBase::IsInitialized() const { | 65 bool SigninManagerBase::IsInitialized() const { |
| 72 return profile_ != NULL; | 66 return profile_ != NULL; |
| 73 } | 67 } |
| 74 | 68 |
| 75 bool SigninManagerBase::IsSigninAllowed() const { | 69 bool SigninManagerBase::IsSigninAllowed() const { |
| 76 return profile_->GetPrefs()->GetBoolean(prefs::kSigninAllowed); | 70 return profile_->GetPrefs()->GetBoolean(prefs::kSigninAllowed); |
| 77 } | 71 } |
| 78 | 72 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 NotifySigninValueChanged(field, value)); | 136 NotifySigninValueChanged(field, value)); |
| 143 } | 137 } |
| 144 | 138 |
| 145 void SigninManagerBase::NotifyDiagnosticsObservers( | 139 void SigninManagerBase::NotifyDiagnosticsObservers( |
| 146 const TimedSigninStatusField& field, | 140 const TimedSigninStatusField& field, |
| 147 const std::string& value) { | 141 const std::string& value) { |
| 148 FOR_EACH_OBSERVER(SigninDiagnosticsObserver, | 142 FOR_EACH_OBSERVER(SigninDiagnosticsObserver, |
| 149 signin_diagnostics_observers_, | 143 signin_diagnostics_observers_, |
| 150 NotifySigninValueChanged(field, value)); | 144 NotifySigninValueChanged(field, value)); |
| 151 } | 145 } |
| OLD | NEW |