Commit 5b97e32f authored by Danila Kuzmin's avatar Danila Kuzmin Committed by Commit Bot

oobe: Fix focus for screens without LoginShelfView buttons

Bug: 1084447
Change-Id: Ifb3ac180c673fff6de349018e649cd0f1d67f847
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2364615Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Commit-Queue: Danila Kuzmin <dkuzmin@google.com>
Cr-Commit-Position: refs/heads/master@{#800175}
parent 360fe12e
......@@ -290,7 +290,7 @@ void LoginScreenController::FocusLoginShelf(bool reverse) {
Shelf* shelf = Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow());
// Tell the focus direction to the status area or the shelf so they can focus
// the correct child view.
if (reverse) {
if (reverse || !shelf->shelf_widget()->login_shelf_view()->IsFocusable()) {
if (!Shell::GetPrimaryRootWindowController()->IsSystemTrayVisible())
return;
shelf->GetStatusAreaWidget()
......
......@@ -780,7 +780,18 @@ void LoginShelfView::UpdateUi() {
// 2. There are Kiosk apps available.
kiosk_apps_button_->SetVisible(kiosk_apps_button_->HasApps() &&
(is_login_primary || is_oobe));
// 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.
bool is_anything_focusable = false;
for (auto* child : children()) {
if (child->IsFocusable()) {
is_anything_focusable = true;
break;
}
}
SetFocusBehavior(is_anything_focusable ? views::View::FocusBehavior::ALWAYS
: views::View::FocusBehavior::NEVER);
UpdateButtonColors(is_oobe);
Layout();
}
......
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