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

Unified Diff: components/user_manager/user_manager_base.cc

Issue 790503002: Methods and types rename for child accounts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
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 e289fadb0a18bae4ca5996c48411673d2d0c1ae5..1490e12e3bdd974e55f4451bf4d52fbecd6a5436 100644
--- a/components/user_manager/user_manager_base.cc
+++ b/components/user_manager/user_manager_base.cc
@@ -581,10 +581,10 @@ bool UserManagerBase::IsLoggedInAsUserWithGaiaAccount() const {
return IsUserLoggedIn() && active_user_->HasGaiaAccount();
}
-bool UserManagerBase::IsLoggedInAsRegularSupervisedUser() const {
+bool UserManagerBase::IsLoggedInAsChildUser() const {
DCHECK(task_runner_->RunsTasksOnCurrentThread());
return IsUserLoggedIn() && active_user_->GetType() ==
Marc Treib 2014/12/08 13:27:54 nit: Does this fit on one line now?
merkulova 2014/12/08 14:56:12 Done.
- USER_TYPE_REGULAR_SUPERVISED;
+ USER_TYPE_CHILD;
}
bool UserManagerBase::IsLoggedInAsDemoUser() const {
@@ -784,8 +784,8 @@ void UserManagerBase::EnsureUsersLoaded() {
user = User::CreateRegularUser(*it);
int user_type;
if (prefs_user_types->GetIntegerWithoutPathExpansion(*it, &user_type) &&
- user_type == USER_TYPE_REGULAR_SUPERVISED) {
- ChangeUserSupervisedStatus(user, true /* is supervised */);
+ user_type == USER_TYPE_CHILD) {
+ ChangeUserChildStatus(user, true /* is child */);
}
}
user->set_oauth_token_status(LoadUserOAuthStatus(*it));
@@ -990,16 +990,15 @@ void UserManagerBase::NotifyActiveUserHashChanged(const std::string& hash) {
ActiveUserHashChanged(hash));
}
-void UserManagerBase::ChangeUserSupervisedStatus(User* user,
- bool is_supervised) {
+void UserManagerBase::ChangeUserChildStatus(User* user, bool is_child) {
DCHECK(task_runner_->RunsTasksOnCurrentThread());
- user->SetIsSupervised(is_supervised);
- SaveUserType(user->email(), is_supervised
- ? user_manager::USER_TYPE_REGULAR_SUPERVISED
+ user->SetIsChild(is_child);
+ SaveUserType(user->email(), is_child
+ ? user_manager::USER_TYPE_CHILD
: user_manager::USER_TYPE_REGULAR);
FOR_EACH_OBSERVER(UserManager::UserSessionStateObserver,
session_state_observer_list_,
- UserChangedSupervisedStatus(user));
+ UserChangedChildStatus(user));
}
void UserManagerBase::UpdateLoginState() {

Powered by Google App Engine
This is Rietveld 408576698