Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/signin/core/browser/signin_manager_base.h" | 5 #include "components/signin/core/browser/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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 209 info.gaia); | 209 info.gaia); |
| 210 } | 210 } |
| 211 | 211 |
| 212 // Go ahead and update the last signed in account info here as well. Once a | 212 // Go ahead and update the last signed in account info here as well. Once a |
| 213 // user is signed in the corresponding preferences should match. Doing it here | 213 // user is signed in the corresponding preferences should match. Doing it here |
| 214 // as opposed to on signin allows us to catch the upgrade scenario. | 214 // as opposed to on signin allows us to catch the upgrade scenario. |
| 215 client_->GetPrefs()->SetString(prefs::kGoogleServicesLastAccountId, | 215 client_->GetPrefs()->SetString(prefs::kGoogleServicesLastAccountId, |
| 216 account_id); | 216 account_id); |
| 217 client_->GetPrefs()->SetString(prefs::kGoogleServicesLastUsername, | 217 client_->GetPrefs()->SetString(prefs::kGoogleServicesLastUsername, |
| 218 info.email); | 218 info.email); |
| 219 | |
| 220 client_->GetPrefs()->CommitPendingWrite(); | |
|
xiyuan
2017/03/16 15:59:02
nit: Let's add a comment of why this is needed,
e
khmel
2017/03/16 16:19:43
Thanks, done
| |
| 219 } | 221 } |
| 220 | 222 |
| 221 bool SigninManagerBase::IsAuthenticated() const { | 223 bool SigninManagerBase::IsAuthenticated() const { |
| 222 return !authenticated_account_id_.empty(); | 224 return !authenticated_account_id_.empty(); |
| 223 } | 225 } |
| 224 | 226 |
| 225 bool SigninManagerBase::AuthInProgress() const { | 227 bool SigninManagerBase::AuthInProgress() const { |
| 226 // SigninManagerBase never kicks off auth processes itself. | 228 // SigninManagerBase never kicks off auth processes itself. |
| 227 return false; | 229 return false; |
| 228 } | 230 } |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 246 SigninDiagnosticsObserver* observer) { | 248 SigninDiagnosticsObserver* observer) { |
| 247 signin_diagnostics_observers_.RemoveObserver(observer); | 249 signin_diagnostics_observers_.RemoveObserver(observer); |
| 248 } | 250 } |
| 249 | 251 |
| 250 void SigninManagerBase::NotifyDiagnosticsObservers( | 252 void SigninManagerBase::NotifyDiagnosticsObservers( |
| 251 const TimedSigninStatusField& field, | 253 const TimedSigninStatusField& field, |
| 252 const std::string& value) { | 254 const std::string& value) { |
| 253 for (auto& observer : signin_diagnostics_observers_) | 255 for (auto& observer : signin_diagnostics_observers_) |
| 254 observer.NotifySigninValueChanged(field, value); | 256 observer.NotifySigninValueChanged(field, value); |
| 255 } | 257 } |
| OLD | NEW |