| Index: chrome/browser/resources/chromeos/quick_unlock/pin_keyboard.js
|
| diff --git a/chrome/browser/resources/chromeos/quick_unlock/pin_keyboard.js b/chrome/browser/resources/chromeos/quick_unlock/pin_keyboard.js
|
| index dfc111d4c5fcd7c32df8aa1e7a95762d0894bfbb..a4204294e8d91c277bd003b3d7195f2304d7ecd6 100644
|
| --- a/chrome/browser/resources/chromeos/quick_unlock/pin_keyboard.js
|
| +++ b/chrome/browser/resources/chromeos/quick_unlock/pin_keyboard.js
|
| @@ -35,15 +35,42 @@ Polymer({
|
| }
|
| },
|
|
|
| + // Flag to check focus on next focus.
|
| + checkFocus_: false,
|
| + // The current focused element.
|
| + focusedElement_: undefined,
|
| +
|
| /** Transfers focus to the input element. */
|
| focus: function() {
|
| this.$$('#pin-input').focus();
|
| + this.focusedElement_ = document.activeElement;
|
| + },
|
| +
|
| + /** Called when a pin keyboard button has focus. */
|
| + onButtonFocus_: function(event, detail) {
|
| + // If the button has been tabbed here it is the current element with focus.
|
| + if (this.checkFocus_) {
|
| + this.focusedElement_ = document.activeElement;
|
| + this.checkFocus_ = false;
|
| + }
|
| + },
|
| +
|
| + /** Called when a pin keyboard has a key pressed. */
|
| + onButtonKeyDown_: function(event, detail) {
|
| + // Only if tab has been pressed do we want change the focus.
|
| + if (event.keyCode == 9)
|
| + this.checkFocus_ = true;
|
| },
|
|
|
| /** Called when a keypad number has been tapped. */
|
| onNumberTap_: function(event, detail) {
|
| var numberValue = event.target.getAttribute('value');
|
| this.value += numberValue;
|
| +
|
| + // If the tabbed element is clicked we want to keep the focus, otherwise
|
| + // transfer focus to the input.
|
| + if (this.focusedElement_ != event.target)
|
| + this.focus();
|
| },
|
|
|
| /** Fires a submit event with the current PIN value. */
|
|
|