summaryrefslogtreecommitdiff
path: root/chromium/components/user_manager/user_manager_base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/user_manager/user_manager_base.cc')
-rw-r--r--chromium/components/user_manager/user_manager_base.cc17
1 files changed, 5 insertions, 12 deletions
diff --git a/chromium/components/user_manager/user_manager_base.cc b/chromium/components/user_manager/user_manager_base.cc
index 054949fff92..5805a9ca35b 100644
--- a/chromium/components/user_manager/user_manager_base.cc
+++ b/chromium/components/user_manager/user_manager_base.cc
@@ -242,6 +242,7 @@ void UserManagerBase::SwitchActiveUser(const AccountId& account_id) {
NotifyActiveUserHashChanged(active_user_->username_hash());
NotifyActiveUserChanged(active_user_);
+ CallUpdateLoginState();
}
void UserManagerBase::SwitchToLastActiveUser() {
@@ -508,17 +509,8 @@ void UserManagerBase::ParseUserList(const base::ListValue& users_list,
bool UserManagerBase::IsCurrentUserOwner() const {
DCHECK(task_runner_->RunsTasksOnCurrentThread());
- base::AutoLock lk(is_current_user_owner_lock_);
- return is_current_user_owner_;
-}
-
-void UserManagerBase::SetCurrentUserIsOwner(bool is_current_user_owner) {
- DCHECK(task_runner_->RunsTasksOnCurrentThread());
- {
- base::AutoLock lk(is_current_user_owner_lock_);
- is_current_user_owner_ = is_current_user_owner;
- }
- CallUpdateLoginState();
+ return !owner_account_id_.empty() && active_user_ &&
+ active_user_->GetAccountId() == owner_account_id_;
}
bool UserManagerBase::IsCurrentUserNew() const {
@@ -739,6 +731,7 @@ bool UserManagerBase::HasPendingBootstrap(const AccountId& account_id) const {
void UserManagerBase::SetOwnerId(const AccountId& owner_account_id) {
owner_account_id_ = owner_account_id;
+ CallUpdateLoginState();
}
const AccountId& UserManagerBase::GetPendingUserSwitchID() const {
@@ -1028,7 +1021,7 @@ void UserManagerBase::Initialize() {
}
void UserManagerBase::CallUpdateLoginState() {
- UpdateLoginState(active_user_, primary_user_, is_current_user_owner_);
+ UpdateLoginState(active_user_, primary_user_, IsCurrentUserOwner());
}
void UserManagerBase::SetLRUUser(User* user) {