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

Side by Side Diff: components/user_manager/user_manager_base.cc

Issue 866763002: User class update made independent of profile state update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resetting user status to same as existing one prevented. Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/supervised_user/child_accounts/child_account_service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/user_manager/user_manager_base.h" 5 #include "components/user_manager/user_manager_base.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 975
976 void UserManagerBase::NotifyActiveUserHashChanged(const std::string& hash) { 976 void UserManagerBase::NotifyActiveUserHashChanged(const std::string& hash) {
977 DCHECK(task_runner_->RunsTasksOnCurrentThread()); 977 DCHECK(task_runner_->RunsTasksOnCurrentThread());
978 FOR_EACH_OBSERVER(UserManager::UserSessionStateObserver, 978 FOR_EACH_OBSERVER(UserManager::UserSessionStateObserver,
979 session_state_observer_list_, 979 session_state_observer_list_,
980 ActiveUserHashChanged(hash)); 980 ActiveUserHashChanged(hash));
981 } 981 }
982 982
983 void UserManagerBase::ChangeUserChildStatus(User* user, bool is_child) { 983 void UserManagerBase::ChangeUserChildStatus(User* user, bool is_child) {
984 DCHECK(task_runner_->RunsTasksOnCurrentThread()); 984 DCHECK(task_runner_->RunsTasksOnCurrentThread());
985 if (user->IsSupervised() == is_child)
986 return;
985 user->SetIsChild(is_child); 987 user->SetIsChild(is_child);
986 SaveUserType(user->email(), is_child 988 SaveUserType(user->email(), is_child ? user_manager::USER_TYPE_CHILD
987 ? user_manager::USER_TYPE_CHILD 989 : user_manager::USER_TYPE_REGULAR);
988 : user_manager::USER_TYPE_REGULAR);
989 FOR_EACH_OBSERVER(UserManager::UserSessionStateObserver, 990 FOR_EACH_OBSERVER(UserManager::UserSessionStateObserver,
990 session_state_observer_list_, 991 session_state_observer_list_,
991 UserChangedChildStatus(user)); 992 UserChangedChildStatus(user));
992 } 993 }
993 994
994 void UserManagerBase::UpdateLoginState() { 995 void UserManagerBase::UpdateLoginState() {
995 if (!chromeos::LoginState::IsInitialized()) 996 if (!chromeos::LoginState::IsInitialized())
996 return; // LoginState may not be initialized in tests. 997 return; // LoginState may not be initialized in tests.
997 998
998 chromeos::LoginState::LoggedInState logged_in_state; 999 chromeos::LoginState::LoggedInState logged_in_state;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 } 1086 }
1086 1087
1087 void UserManagerBase::DeleteUser(User* user) { 1088 void UserManagerBase::DeleteUser(User* user) {
1088 const bool is_active_user = (user == active_user_); 1089 const bool is_active_user = (user == active_user_);
1089 delete user; 1090 delete user;
1090 if (is_active_user) 1091 if (is_active_user)
1091 active_user_ = NULL; 1092 active_user_ = NULL;
1092 } 1093 }
1093 1094
1094 } // namespace user_manager 1095 } // namespace user_manager
OLDNEW
« no previous file with comments | « chrome/browser/supervised_user/child_accounts/child_account_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698