Commit 81819b41 authored by Thomas Tellier's avatar Thomas Tellier Committed by Chromium LUCI CQ

[CrOS] Fix left icon transition of password login screen

Bug: 1003885
Change-Id: Iaaf0d34234e7b922e5e68be4e8c35d19aa4deb47
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2622174
Commit-Queue: Thomas Tellier <tellier@google.com>
Reviewed-by: default avatarDenis Kuznetsov [CET] <antrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842170}
parent 0f991c3f
......@@ -941,14 +941,22 @@ void LoginPasswordView::HandleLeftIconsVisibilities(bool handling_capslock) {
}
if (handled_should_show) {
// If the view that is currently handled should be shown, we immediately
// show it; if the other view should be shown as well, we make it invisible
// for the moment and start a cyclic animation that will show these two
// views alternatively.
handled_view->SetVisible(true);
if (other_should_show) {
other_view->SetVisible(false);
left_icon_->ScheduleAnimation(handled_view, other_view);
}
} else {
// If the view that is currently handled should now be invisible, we
// immediately hide it and we abort the cyclic animation if it was running.
// We also make the other view visible if needed, as its current state
// may depend on how long the animation has been running.
left_icon_->AbortAnimationIfAny();
other_view->SetVisible(should_show_easy_unlock_);
other_view->SetVisible(other_should_show);
handled_view->SetVisible(false);
}
password_row_->Layout();
......
......@@ -356,6 +356,12 @@ TEST_F(LoginPasswordViewTest, SwitchBetweenEasyUnlockAndCapsLock) {
base::string16() /*accessibility_label*/);
EXPECT_TRUE(test_api.easy_unlock_icon()->GetVisible());
EXPECT_FALSE(test_api.capslock_icon()->GetVisible());
// Hide the easy unlock icon, the capslock icon should be shown.
view_->SetEasyUnlockIcon(EasyUnlockIconId::NONE,
base::string16() /*accessibility_label*/);
EXPECT_FALSE(test_api.easy_unlock_icon()->GetVisible());
EXPECT_TRUE(test_api.capslock_icon()->GetVisible());
}
// Verifies that the password textfield clears after a delay when the display
......
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