Commit 2e259e0b authored by Fabian Sommer's avatar Fabian Sommer Committed by Commit Bot

Refactor pin input field in ParentAccessView.

Add textfield for PINs with unknown length to ParentAccessView as
alternative to current field that needs to know pin length in advance.

Add option to hide entered pin.

Add binding of Escape key to closing the view.


These (independent) changes are part of a larger refactoring with the
aim to make the UI in this class reuseable, in particular for
smartcard login.

Bug: 1001288
Change-Id: Ib0d3879780affe5a09c5ea4f1b8864120ca210c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2007717Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: Fabian Sommer <fabiansommer@google.com>
Cr-Commit-Position: refs/heads/master@{#734873}
parent 0efb33cb
This diff is collapsed.
...@@ -155,6 +155,8 @@ class ASH_EXPORT ParentAccessView : public views::DialogDelegateView, ...@@ -155,6 +155,8 @@ class ASH_EXPORT ParentAccessView : public views::DialogDelegateView,
private: private:
class FocusableLabelButton; class FocusableLabelButton;
class AccessCodeInput; class AccessCodeInput;
class FlexCodeInput;
class FixedLengthCodeInput;
// Submits access code for validation. // Submits access code for validation.
void SubmitCode(); void SubmitCode();
...@@ -162,6 +164,9 @@ class ASH_EXPORT ParentAccessView : public views::DialogDelegateView, ...@@ -162,6 +164,9 @@ class ASH_EXPORT ParentAccessView : public views::DialogDelegateView,
// Updates state of the view. // Updates state of the view.
void UpdateState(State state); void UpdateState(State state);
// Closes the view.
void OnBack();
// Updates view's preferred size. // Updates view's preferred size.
void UpdatePreferredSize(); void UpdatePreferredSize();
...@@ -171,7 +176,7 @@ class ASH_EXPORT ParentAccessView : public views::DialogDelegateView, ...@@ -171,7 +176,7 @@ class ASH_EXPORT ParentAccessView : public views::DialogDelegateView,
// Called when access code input changes. |complete| brings information // Called when access code input changes. |complete| brings information
// whether current input code is complete. |last_field_active| contains // whether current input code is complete. |last_field_active| contains
// information whether last input field is currently active. // information whether last input field is currently active.
void OnInputChange(bool complete, bool last_field_active); void OnInputChange(bool last_field_active, bool complete);
// Callbacks to be called when user performs certain actions. // Callbacks to be called when user performs certain actions.
const Callbacks callbacks_; const Callbacks callbacks_;
......
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