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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 DCHECK(pref_username.empty() || gaia::AreEmailsSame(username, pref_username)) | 83 DCHECK(pref_username.empty() || gaia::AreEmailsSame(username, pref_username)) |
| 84 << "username: " << username << "; pref_username: " << pref_username; | 84 << "username: " << username << "; pref_username: " << pref_username; |
| 85 authenticated_username_ = username; | 85 authenticated_username_ = username; |
| 86 client_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, username); | 86 client_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, username); |
| 87 NotifyDiagnosticsObservers(USERNAME, username); | 87 NotifyDiagnosticsObservers(USERNAME, username); |
| 88 | 88 |
| 89 // Go ahead and update the last signed in username here as well. Once a | 89 // Go ahead and update the last signed in username here as well. Once a |
| 90 // user is signed in the two preferences should match. Doing it here as | 90 // user is signed in the two preferences should match. Doing it here as |
| 91 // opposed to on signin allows us to catch the upgrade scenario. | 91 // opposed to on signin allows us to catch the upgrade scenario. |
| 92 client_->GetPrefs()->SetString(prefs::kGoogleServicesLastUsername, username); | 92 client_->GetPrefs()->SetString(prefs::kGoogleServicesLastUsername, username); |
| 93 client_->GetPrefs()->SetInt64(prefs::kSignedInTime, | |
| 94 base::Time::Now().ToInternalValue()); | |
|
Roger Tawa OOO till Jul 10th
2014/08/12 14:14:52
Seems like it would be better to put this in OnSig
Mike Lerman
2014/08/12 18:07:10
Done.
| |
| 93 } | 95 } |
| 94 | 96 |
| 95 void SigninManagerBase::clear_authenticated_username() { | 97 void SigninManagerBase::clear_authenticated_username() { |
| 96 authenticated_username_.clear(); | 98 authenticated_username_.clear(); |
| 97 } | 99 } |
| 98 | 100 |
| 99 bool SigninManagerBase::AuthInProgress() const { | 101 bool SigninManagerBase::AuthInProgress() const { |
| 100 // SigninManagerBase never kicks off auth processes itself. | 102 // SigninManagerBase never kicks off auth processes itself. |
| 101 return false; | 103 return false; |
| 102 } | 104 } |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 129 NotifySigninValueChanged(field, value)); | 131 NotifySigninValueChanged(field, value)); |
| 130 } | 132 } |
| 131 | 133 |
| 132 void SigninManagerBase::NotifyDiagnosticsObservers( | 134 void SigninManagerBase::NotifyDiagnosticsObservers( |
| 133 const TimedSigninStatusField& field, | 135 const TimedSigninStatusField& field, |
| 134 const std::string& value) { | 136 const std::string& value) { |
| 135 FOR_EACH_OBSERVER(SigninDiagnosticsObserver, | 137 FOR_EACH_OBSERVER(SigninDiagnosticsObserver, |
| 136 signin_diagnostics_observers_, | 138 signin_diagnostics_observers_, |
| 137 NotifySigninValueChanged(field, value)); | 139 NotifySigninValueChanged(field, value)); |
| 138 } | 140 } |
| OLD | NEW |