Commit c3a9ed64 authored by Alexander Alekseev's avatar Alexander Alekseev Committed by Commit Bot

Chrome OS: Disable Pin Setup input field in incognito UI.

This Cl disables pin input field whan it is displayed in incognito UI.

Bug: 900351
Change-Id: I7aae9f08403933f12cae5345075e5e94e775e3a4
Reviewed-on: https://chromium-review.googlesource.com/c/1332929
Commit-Queue: Alexander Alekseev <alemate@chromium.org>
Reviewed-by: default avatarWenzhao (Colin) Zang <wzang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607469}
parent 81775c6b
......@@ -134,7 +134,8 @@
set-modes="{{setModes}}"
quick-unlock-private="[[quickUnlockPrivate_]]"
write-uma="[[writeUma_]]"
class="focus-on-show">
class="focus-on-show"
is-incognito-ui>
</setup-pin-keyboard>
<img id="done-illustration" hidden="[[isStepHidden_(step_, 'done')]]"
srcset="images/pin_illustration_1x.svg 1x,
......
......@@ -182,6 +182,7 @@
}
#pinInput[has-content] {
--cr-disabled-opacity: var(--dark-primary-opacity);
opacity: var(--dark-primary-opacity);
}
......@@ -203,7 +204,8 @@
has-content$="[[hasInput_(value)]]" invalid="[[hasError]]"
placeholder="[[getInputPlaceholder_(enablePassword,
enablePlaceholder)]]"
on-keydown="onInputKeyDown_" force-underline$="[[forceUnderline_]]">
on-keydown="onInputKeyDown_" force-underline$="[[forceUnderline_]]"
disabled="[[isIncognitoUi]]">
</cr-input>
</div>
<slot select="[problem]"></slot>
......
......@@ -29,7 +29,7 @@
* @type {number}
* @const
*/
var REPEAT_BACKSPACE_DELAY_MS = 150;
const REPEAT_BACKSPACE_DELAY_MS = 150;
/**
* How long the backspace button must be held down before auto backspace
......@@ -37,7 +37,7 @@ var REPEAT_BACKSPACE_DELAY_MS = 150;
* @type {number}
* @const
*/
var INITIAL_BACKSPACE_DELAY_MS = 500;
const INITIAL_BACKSPACE_DELAY_MS = 500;
/**
* The key codes of the keys allowed to be used on the pin input, in addition to
......@@ -45,7 +45,7 @@ var INITIAL_BACKSPACE_DELAY_MS = 500;
* @type {Array<number>}
* @const
*/
var PIN_INPUT_ALLOWED_NON_NUMBER_KEY_CODES = [8, 9, 37, 39];
const PIN_INPUT_ALLOWED_NON_NUMBER_KEY_CODES = [8, 9, 37, 39];
Polymer({
is: 'pin-keyboard',
......@@ -119,6 +119,15 @@ Polymer({
type: Boolean,
value: false,
},
/**
* Turns on "incognito mode". (FIXME after https://crbug.com/900351 is
* fixed).
*/
isIncognitoUi: {
type: Boolean,
value: false,
},
},
listeners: {
......@@ -211,11 +220,11 @@ Polymer({
* @private
*/
onNumberTap_: function(event) {
var numberValue = event.target.getAttribute('value');
let numberValue = event.target.getAttribute('value');
// Add the number where the caret is, then update the selection range of the
// input element.
var selectionStart = this.selectionStart_;
let selectionStart = this.selectionStart_;
this.value = this.value.substring(0, this.selectionStart_) + numberValue +
this.value.substring(this.selectionEnd_);
......@@ -254,8 +263,8 @@ Polymer({
// If the input is shown, clear the text based on the caret location or
// selected region of the input element. If it is just a caret, remove the
// character in front of the caret.
var selectionStart = this.selectionStart_;
var selectionEnd = this.selectionEnd_;
let selectionStart = this.selectionStart_;
let selectionEnd = this.selectionEnd_;
if (selectionStart == selectionEnd && selectionStart)
selectionStart--;
......
......@@ -82,7 +82,8 @@ Where:
<pin-keyboard id="pinKeyboard" on-pin-change="onPinChange_"
on-submit="onPinSubmit_" value="{{pinKeyboardValue_}}"
has-error="[[hasError_(problemMessageId_, problemClass_)]]"
enable-placeholder="[[enablePlaceholder]]">
enable-placeholder="[[enablePlaceholder]]"
is-incognito-ui="[[isIncognitoUi]]">
<!-- Warning/error; only shown if title is hidden. -->
<div id="problemDiv" class$="[[problemClass_]]"
invisible$="[[!problemMessageId_]]" problem>
......
......@@ -135,6 +135,15 @@ Polymer({
type: Boolean,
value: false,
},
/**
* Turns on "incognito mode". (FIXME after https://crbug.com/900351 is
* fixed).
*/
isIncognitoUi: {
type: Boolean,
value: false,
},
},
focus: function() {
......
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