Commit d11d5998 authored by Megumi Hattori's avatar Megumi Hattori Committed by Commit Bot

Focus password prompt only when AUTH_PASSWORD is added as AuthMethods.

Before this CL, |password_view_| is always focused when
HasAuthMethod(AUTH_PASSWORD) is true.

This CL limits the timing of focusing |password_view_| to only when
HasAuthMethod(AUTH_PASSWORD) is changed from false to true.

This CL also fixes a bug that users cannot focus inline reply using
virtual keyboard on the lock screen.

BUG=825781
TEST=manual

Change-Id: I7afa75af0b3c86bf0988d5cbd95edc192255785a
Reviewed-on: https://chromium-review.googlesource.com/980272Reviewed-by: default avatarJacob Dufault <jdufault@chromium.org>
Reviewed-by: default avatarTetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Megumi Hattori <megumihattori@google.com>
Cr-Commit-Position: refs/heads/master@{#547402}
parent 4059c745
...@@ -196,6 +196,8 @@ LoginAuthUserView::LoginAuthUserView(const mojom::LoginUserInfoPtr& user, ...@@ -196,6 +196,8 @@ LoginAuthUserView::LoginAuthUserView(const mojom::LoginUserInfoPtr& user,
LoginAuthUserView::~LoginAuthUserView() = default; LoginAuthUserView::~LoginAuthUserView() = default;
void LoginAuthUserView::SetAuthMethods(uint32_t auth_methods) { void LoginAuthUserView::SetAuthMethods(uint32_t auth_methods) {
bool had_password = HasAuthMethod(AUTH_PASSWORD);
auth_methods_ = static_cast<AuthMethods>(auth_methods); auth_methods_ = static_cast<AuthMethods>(auth_methods);
bool has_password = HasAuthMethod(AUTH_PASSWORD); bool has_password = HasAuthMethod(AUTH_PASSWORD);
bool has_pin = HasAuthMethod(AUTH_PIN); bool has_pin = HasAuthMethod(AUTH_PIN);
...@@ -205,7 +207,7 @@ void LoginAuthUserView::SetAuthMethods(uint32_t auth_methods) { ...@@ -205,7 +207,7 @@ void LoginAuthUserView::SetAuthMethods(uint32_t auth_methods) {
password_view_->SetFocusEnabledForChildViews(has_password); password_view_->SetFocusEnabledForChildViews(has_password);
password_view_->layer()->SetOpacity(has_password ? 1 : 0); password_view_->layer()->SetOpacity(has_password ? 1 : 0);
if (has_password) if (!had_password && has_password)
password_view_->RequestFocus(); password_view_->RequestFocus();
pin_view_->SetVisible(has_pin); pin_view_->SetVisible(has_pin);
......
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