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

Unified Diff: components/user_manager/user_manager_base.cc

Issue 2711113003: Track whether a given user session has completed initialization, and use (Closed)
Patch Set: Only expose known_user::RemovePrefsForTesting() for tests Created 3 years, 9 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 | « components/user_manager/user_manager_base.h ('k') | components/user_manager/user_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/user_manager/user_manager_base.cc
diff --git a/components/user_manager/user_manager_base.cc b/components/user_manager/user_manager_base.cc
index f0f17d2fca483b7d41369f3a90384f01eda19004..b06dba34ea09d0d1221c4d8a4b573eada752725d 100644
--- a/components/user_manager/user_manager_base.cc
+++ b/components/user_manager/user_manager_base.cc
@@ -264,6 +264,16 @@ void UserManagerBase::OnSessionStarted() {
GetLocalState()->CommitPendingWrite();
}
+void UserManagerBase::OnProfileInitialized(User* user) {
+ DCHECK(task_runner_->RunsTasksOnCurrentThread());
+
+ // Mark the user as having an initialized session and persist this in
+ // the known_user DB.
+ user->set_profile_ever_initialized(true);
+ known_user::SetProfileEverInitialized(user->GetAccountId(), true);
+ GetLocalState()->CommitPendingWrite();
+}
+
void UserManagerBase::RemoveUser(const AccountId& account_id,
RemoveUserDelegate* delegate) {
DCHECK(task_runner_->RunsTasksOnCurrentThread());
@@ -799,6 +809,8 @@ void UserManagerBase::EnsureUsersLoaded() {
const AccountId account_id = user->GetAccountId();
user->set_oauth_token_status(LoadUserOAuthStatus(*it));
user->set_force_online_signin(LoadForceOnlineSignin(*it));
+ user->set_profile_ever_initialized(
+ known_user::WasProfileEverInitialized(*it));
user->set_using_saml(known_user::IsUsingSAML(*it));
users_.push_back(user);
@@ -820,7 +832,6 @@ void UserManagerBase::EnsureUsersLoaded() {
user->set_display_email(display_email);
}
}
-
user_loading_stage_ = STAGE_LOADED;
PerformPostUserListLoadingActions();
@@ -883,6 +894,8 @@ void UserManagerBase::RegularUserLoggedIn(const AccountId& account_id) {
active_user_->set_oauth_token_status(LoadUserOAuthStatus(account_id));
SaveUserDisplayName(active_user_->GetAccountId(),
base::UTF8ToUTF16(active_user_->GetAccountName(true)));
+ known_user::SetProfileEverInitialized(
+ active_user_->GetAccountId(), active_user_->profile_ever_initialized());
}
AddUserRecord(active_user_);
« no previous file with comments | « components/user_manager/user_manager_base.h ('k') | components/user_manager/user_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698