Commit 7ad5ab37 authored by Anatoliy Potapchuk's avatar Anatoliy Potapchuk Committed by Commit Bot

[Kiosk] Remove LOGGED_IN_USER_ARC_KIOSK_APP to reduce duplications

LOGGED_IN_USER_ARC_KIOSK_APP was used in the same places as the one for
Chrome App and Web App kiosks. Let's reduce code redundancy and remove
it.

Bug: 1015383
Change-Id: I769aad5fc5e5df1415dd0f4c12c7cff2d70dba55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1975714Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarSergey Poromov <poromov@chromium.org>
Commit-Queue: Anatoliy Potapchuk <apotapchuk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726731}
parent 5c5f0c0d
...@@ -104,7 +104,7 @@ LoginState::LoggedInUserType ChromeUserManager::GetLoggedInUserType( ...@@ -104,7 +104,7 @@ LoginState::LoggedInUserType ChromeUserManager::GetLoggedInUserType(
case user_manager::USER_TYPE_CHILD: case user_manager::USER_TYPE_CHILD:
return LoginState::LOGGED_IN_USER_CHILD; return LoginState::LOGGED_IN_USER_CHILD;
case user_manager::USER_TYPE_ARC_KIOSK_APP: case user_manager::USER_TYPE_ARC_KIOSK_APP:
return LoginState::LOGGED_IN_USER_ARC_KIOSK_APP; return LoginState::LOGGED_IN_USER_KIOSK_APP;
case user_manager::USER_TYPE_ACTIVE_DIRECTORY: case user_manager::USER_TYPE_ACTIVE_DIRECTORY:
// NOTE(olsen) There's no LOGGED_IN_USER_ACTIVE_DIRECTORY - is it needed? // NOTE(olsen) There's no LOGGED_IN_USER_ACTIVE_DIRECTORY - is it needed?
return LoginState::LOGGED_IN_USER_REGULAR; return LoginState::LOGGED_IN_USER_REGULAR;
......
...@@ -439,13 +439,8 @@ int ConvertWifiSignalStrength(int signal_strength) { ...@@ -439,13 +439,8 @@ int ConvertWifiSignalStrength(int signal_strength) {
} }
bool IsKioskApp() { bool IsKioskApp() {
auto user_type = chromeos::LoginState::Get()->GetLoggedInUserType(); return chromeos::LoginState::Get()->GetLoggedInUserType() ==
// LOGGED_IN_USER_KIOSK_APP encapuslates both Chrome App kiosk and Web App chromeos::LoginState::LOGGED_IN_USER_KIOSK_APP;
// kiosk.
// TODO(crbug.com/1015383): Merge login states for normal kiosk and arc
// kiosks into one to reduce duplications.
return user_type == chromeos::LoginState::LOGGED_IN_USER_KIOSK_APP ||
user_type == chromeos::LoginState::LOGGED_IN_USER_ARC_KIOSK_APP;
} }
// Utility method to turn cpu_temp_fetcher_ to OnceCallback // Utility method to turn cpu_temp_fetcher_ to OnceCallback
......
...@@ -852,7 +852,7 @@ TEST_F(DeviceStatusCollectorTest, MixedStatesForArcKiosk) { ...@@ -852,7 +852,7 @@ TEST_F(DeviceStatusCollectorTest, MixedStatesForArcKiosk) {
}; };
chromeos::LoginState::Get()->SetLoggedInState( chromeos::LoginState::Get()->SetLoggedInState(
chromeos::LoginState::LOGGED_IN_ACTIVE, chromeos::LoginState::LOGGED_IN_ACTIVE,
chromeos::LoginState::LOGGED_IN_USER_ARC_KIOSK_APP); chromeos::LoginState::LOGGED_IN_USER_KIOSK_APP);
scoped_testing_cros_settings_.device_settings()->SetBoolean( scoped_testing_cros_settings_.device_settings()->SetBoolean(
chromeos::kReportDeviceActivityTimes, true); chromeos::kReportDeviceActivityTimes, true);
status_collector_->Simulate(test_states, status_collector_->Simulate(test_states,
......
...@@ -272,8 +272,6 @@ bool EnrollmentDialogAllowed(Profile* profile) { ...@@ -272,8 +272,6 @@ bool EnrollmentDialogAllowed(Profile* profile) {
return true; return true;
case LoginState::LOGGED_IN_USER_KIOSK_APP: case LoginState::LOGGED_IN_USER_KIOSK_APP:
return false; return false;
case LoginState::LOGGED_IN_USER_ARC_KIOSK_APP:
return false;
case LoginState::LOGGED_IN_USER_CHILD: case LoginState::LOGGED_IN_USER_CHILD:
return true; return true;
} }
......
...@@ -28,8 +28,8 @@ class COMPONENT_EXPORT(LOGIN_STATE) LoginState { ...@@ -28,8 +28,8 @@ class COMPONENT_EXPORT(LOGIN_STATE) LoginState {
LOGGED_IN_USER_PUBLIC_ACCOUNT, // A user is logged in to a public session. LOGGED_IN_USER_PUBLIC_ACCOUNT, // A user is logged in to a public session.
LOGGED_IN_USER_PUBLIC_ACCOUNT_MANAGED, // Public session v2. LOGGED_IN_USER_PUBLIC_ACCOUNT_MANAGED, // Public session v2.
LOGGED_IN_USER_SUPERVISED, // A supervised user is logged in LOGGED_IN_USER_SUPERVISED, // A supervised user is logged in
LOGGED_IN_USER_KIOSK_APP, // Is in kiosk app mode LOGGED_IN_USER_KIOSK_APP, // Is in one of the kiosk modes -- Chrome App,
LOGGED_IN_USER_ARC_KIOSK_APP, // Is in ARC kiosk mode // Arc or Web App
LOGGED_IN_USER_CHILD // A child is logged in LOGGED_IN_USER_CHILD // A child is logged in
}; };
......
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