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

Unified Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 7049002: Move the check to detect first login before adding the User to the UserManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code Review Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/login_utils.cc
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc
index 9567b9fe5289ad5ba82cbf58d2d45ee20f4ba5cb..a43fd27ea74f2105d272b07e05f44281a84326f5 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -169,6 +169,7 @@ class LoginUtilsImpl : public LoginUtils,
std::string password_;
GaiaAuthConsumer::ClientLoginResult credentials_;
bool pending_requests_;
+ bool first_login_;
// Delegate to be fired when the profile will be prepared.
LoginUtils::Delegate* delegate_;
@@ -220,6 +221,10 @@ void LoginUtilsImpl::PrepareProfile(
btl->AddLoginTimeMarker("StartedSession", false);
}
+ // Record whether this is the first login before we add the user to the
+ // UserManager.
+ first_login_ = !UserManager::Get()->IsKnownUser(username);
+
UserManager::Get()->UserLoggedIn(username);
btl->AddLoginTimeMarker("UserLoggedIn", false);
@@ -244,7 +249,6 @@ void LoginUtilsImpl::OnProfileCreated(Profile* profile) {
BootTimesLoader* btl = BootTimesLoader::Get();
btl->AddLoginTimeMarker("UserProfileGotten", false);
- bool first_login = !UserManager::Get()->IsKnownUser(username_);
// Change the proxy configuration service of the default request context to
// use the preference configuration from the logged-in profile. This ensures
// that requests done through the default context use the proxy configuration
@@ -320,7 +324,7 @@ void LoginUtilsImpl::OnProfileCreated(Profile* profile) {
RespectLocalePreference(profile);
- if (first_login) {
+ if (first_login_) {
Nikita (slow) 2011/05/20 09:33:46 Turns out that UserManager has bool current_user_i
Zachary Kuznia 2011/05/23 08:06:35 Done.
SetFirstLoginPrefs(profile->GetPrefs());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698