Commit 2024abf6 authored by Rachel Carpenter's avatar Rachel Carpenter Committed by Commit Bot

Be consistent in the types of users we consider want to see help.

At the moment child accounts do not see the help app open after OOBE,
which is not the desired behaviour.

Bug: b/155444436
Change-Id: Ia73ff0f301b6bb7a6f25f7d710dd0aab28abe8b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2172734Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Rachel Carpenter <carpenterr@google.com>
Cr-Commit-Position: refs/heads/master@{#765312}
parent fbf45ae1
...@@ -64,14 +64,13 @@ void LaunchApp(Profile* profile, std::string app_id) { ...@@ -64,14 +64,13 @@ void LaunchApp(Profile* profile, std::string app_id) {
profile->GetPrefs()->SetBoolean(prefs::kFirstRunTutorialShown, true); profile->GetPrefs()->SetBoolean(prefs::kFirstRunTutorialShown, true);
} }
// Getting started module is shown to unmanaged regular and child accounts. // Returns true if this user type is probably a human who wants to configure
bool ShouldShowGetStarted(Profile* profile, // their device through the help app. Other user types are robots, guests or
user_manager::UserManager* user_manager) { // public accounts.
if (profile->GetProfilePolicyConnector()->IsManaged()) bool IsRegularUserOrSupervisedChild(user_manager::UserManager* user_manager) {
return false;
switch (user_manager->GetActiveUser()->GetType()) { switch (user_manager->GetActiveUser()->GetType()) {
case user_manager::USER_TYPE_REGULAR: case user_manager::USER_TYPE_REGULAR:
case user_manager::USER_TYPE_SUPERVISED:
case user_manager::USER_TYPE_CHILD: case user_manager::USER_TYPE_CHILD:
return true; return true;
default: default:
...@@ -79,6 +78,15 @@ bool ShouldShowGetStarted(Profile* profile, ...@@ -79,6 +78,15 @@ bool ShouldShowGetStarted(Profile* profile,
} }
} }
// Getting started module is shown to unmanaged regular, supervised and child
// accounts.
bool ShouldShowGetStarted(Profile* profile,
user_manager::UserManager* user_manager) {
if (profile->GetProfilePolicyConnector()->IsManaged())
return false;
return IsRegularUserOrSupervisedChild(user_manager);
}
// Object of this class waits for system web apps to load. Then it launches the // Object of this class waits for system web apps to load. Then it launches the
// help app. The object deletes itself if the app is launched or the profile is // help app. The object deletes itself if the app is launched or the profile is
// destroyed. // destroyed.
...@@ -136,8 +144,7 @@ bool ShouldLaunchHelpApp(Profile* profile) { ...@@ -136,8 +144,7 @@ bool ShouldLaunchHelpApp(Profile* profile) {
profile->GetPrefs()->SetBoolean(prefs::kHelpAppTabletModeDuringOobe, profile->GetPrefs()->SetBoolean(prefs::kHelpAppTabletModeDuringOobe,
ash::TabletMode::Get()->InTabletMode()); ash::TabletMode::Get()->InTabletMode());
if (user_manager->GetActiveUser()->GetType() != if (!IsRegularUserOrSupervisedChild(user_manager))
user_manager::USER_TYPE_REGULAR)
return false; return false;
if (chromeos::switches::ShouldSkipOobePostLogin()) if (chromeos::switches::ShouldSkipOobePostLogin())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment