Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2191)

Unified Diff: chrome/browser/resources/chromeos/quick_unlock/pin_keyboard.js

Issue 2222583002: Lock screen pin keyboard ui upgrades. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fixed patch set 3 errors. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 9b9ba5dad8b5dc2ba8c528ddea38566061751d5e..1631b725823544f14443d67358d1abfbd0e2b574 100644
--- a/chrome/browser/resources/chromeos/quick_unlock/pin_keyboard.js
+++ b/chrome/browser/resources/chromeos/quick_unlock/pin_keyboard.js
@@ -47,6 +47,14 @@ Polymer({
value: false
},
+ /**
+ * Whether or not to show an error.
+ */
+ enableError: {
+ type: Boolean,
+ value: false
+ },
+
/** The value stored in the keyboard's input element. */
value: {
type: String,
@@ -70,6 +78,14 @@ Polymer({
},
/**
+ * Sets the error message to the new message.
+ * @param {string} newMessage
+ */
+ setMessage: function(newMessage) {
jdufault 2016/08/19 17:47:57 Remove this, use a property instead.
sammiequon 2016/08/22 20:43:59 Done.
+ this.$$('#error-message').innerHTML = newMessage;
+ },
+
+ /**
* Called when a keypad number has been tapped.
* @param {!{target: !PaperButtonElement}} event
* @private
@@ -127,12 +143,21 @@ Polymer({
},
/**
- * Changes the color of the submit button if PIN is ready.
+ * Changes the color of the input text if it is not empty.
* @param {string} value
* @private
*/
- getSubmitClass_: function(value) {
- return value.length > 0 ? 'ready-background' : '';
+ getContentClass_: function(value) {
+ return value.length > 0 ? 'has-content' : '';
+ },
+
+ /**
+ * Disables the submit and backspace button if nothing is entered.
+ * @param {string} value
+ * @private
+ */
+ hasInput_: function(value) {
+ return value.length > 0;
},
/**
@@ -156,6 +181,15 @@ Polymer({
},
/**
+ * Computes the value of the pin input placeholder.
+ * @param {boolean} enablePassword
+ * @private
+ */
+ getErrorClass_: function(showError) {
+ return showError ? 'error-show' : '';
+ },
+
+ /**
* Computes the direction of the pin input.
* @param {string} password
* @private
@@ -178,7 +212,7 @@ Polymer({
* @param {boolean} submitEnabled
* @private
*/
- getSubmitHiddenClass_: function(submitEnabled) {
+ getSubmitClass_: function(submitEnabled) {
return submitEnabled ? '' : 'submit-button-hidden';
}
});

Powered by Google App Engine
This is Rietveld 408576698