Commit 66601c4a authored by Fabian Sommer's avatar Fabian Sommer Committed by Commit Bot

Focus arrow when switching focus to smart card user in login screen

Also, change the focus indicator for the arrow button
from a rectangle to a circle that matches the button.

Bug: 1024254
Change-Id: Ie39a3fa98f1c39a62a7db70b90fa80b410668495
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1946471Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Fabian Sommer <fabiansommer@google.com>
Cr-Commit-Position: refs/heads/master@{#726338}
parent cdb39acf
......@@ -549,11 +549,14 @@ class LoginAuthUserView::ChallengeResponseView : public views::View,
views::BoxLayout::Orientation::kVertical));
layout->set_cross_axis_alignment(
views::BoxLayout::CrossAxisAlignment::kCenter);
arrow_button_ = AddChildView(std::make_unique<ArrowButtonView>(
/*listener=*/this, kChallengeResponseArrowSizeDp));
auto arrow_button_view = std::make_unique<ArrowButtonView>(
/*listener=*/this, kChallengeResponseArrowSizeDp);
arrow_button_view->SetInstallFocusRingOnFocus(true);
views::HighlightPathGenerator::Install(
arrow_button_view.get(),
std::make_unique<views::CircleHighlightPathGenerator>());
arrow_button_ = AddChildView(std::move(arrow_button_view));
arrow_button_->SetBackgroundColor(kChallengeResponseArrowBackgroundColor);
arrow_button_->SetFocusPainter(nullptr);
arrow_button_->SetAccessibleName(l10n_util::GetStringUTF16(
IDS_ASH_LOGIN_START_SMART_CARD_AUTH_BUTTON_ACCESSIBLE_NAME));
......@@ -614,6 +617,8 @@ class LoginAuthUserView::ChallengeResponseView : public views::View,
Layout();
}
void RequestFocus() override { arrow_button_->RequestFocus(); }
private:
int GetArrowToIconSpacerHeight() const {
int spacer_height = kSpacingBetweenChallengeResponseArrowAndIconDp;
......@@ -1098,6 +1103,9 @@ void LoginAuthUserView::SetAuthMethods(uint32_t auth_methods,
if (force_online_sign_in)
user_view_->RequestFocus();
if (has_challenge_response)
challenge_response_view_->RequestFocus();
PreferredSizeChanged();
}
......
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