Commit b67d3fd5 authored by Anatoliy Potapchuk's avatar Anatoliy Potapchuk Committed by Commit Bot

[Ash] Hide kiosk apps button when device is disabled

Bug: 1113137
Change-Id: I185e3d91861f9e0b9074d32930ab6735fb054f1b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2446054Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Anatoliy Potapchuk <apotapchuk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813606}
parent 07d89f31
......@@ -805,8 +805,10 @@ void LoginShelfView::UpdateUi() {
// Show kiosk apps button if:
// 1. It's in login screen.
// 2. There are Kiosk apps available.
// 3. Device is not currently blocked.
kiosk_apps_button_->SetVisible(kiosk_apps_button_->HasApps() &&
(is_login_primary || is_oobe));
(is_login_primary || is_oobe) &&
(dialog_state_ != OobeDialogState::BLOCKING));
// If there is no visible (and thus focusable) buttons, we shouldn't focus
// LoginShelfView. We update it here, so we don't need to check visibility
// every time we move focus to system tray.
......
......@@ -443,6 +443,7 @@ TEST_F(LoginShelfViewTest, ShouldUpdateUiAfterDialogStateChange) {
// Only Shutdown button should be available if some device blocking
// screen is shown (e.g. Device Disabled, or Update Required).
login_shelf_view_->SetKioskApps(kiosk_apps, {}, {});
login_shelf_view_->SetLoginDialogState(OobeDialogState::BLOCKING);
EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown}));
}
......
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