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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'pin-keyboard' is a keyboard that can be used to enter PINs or more generally 7 * 'pin-keyboard' is a keyboard that can be used to enter PINs or more generally
8 * numeric values. 8 * numeric values.
9 * 9 *
10 * Properties: 10 * Properties:
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 // Enter pressed. 121 // Enter pressed.
122 if (event.keyCode == 13) { 122 if (event.keyCode == 13) {
123 this.firePinSubmitEvent_(); 123 this.firePinSubmitEvent_();
124 event.preventDefault(); 124 event.preventDefault();
125 return; 125 return;
126 } 126 }
127 }, 127 },
128 128
129 /** 129 /**
130 * Changes the color of the submit button if PIN is ready. 130 * Changes the color of input text if a something is entered.
jdufault 2016/08/05 21:58:52 What about: Changes the color of the input text i
sammiequon 2016/08/05 23:34:50 Done.
131 * @param {string} value 131 * @param {string} value
132 * @private 132 * @private
133 */ 133 */
134 getSubmitClass_: function(value) { 134 getPasswordReadyClass_: function(value) {
135 return value.length > 0 ? 'ready-background' : ''; 135 return value.length > 0 ? 'ready-background' : '';
136 }, 136 },
137 137
138 /** 138 /**
139 * Disables the submit and backspace button if nothing is entered.
140 * @param {string} value
141 * @private
142 */
143 getButtonsDisabled_: function(value) {
jdufault 2016/08/05 21:58:52 Rename to hasInput_
sammiequon 2016/08/05 23:34:50 Done.
144 return value.length > 0 ? false : true;
jdufault 2016/08/05 21:58:51 return value.length == 0;
sammiequon 2016/08/05 23:34:50 Done.
145 },
146
147 /**
139 * Computes whether the input type for the pin input should be password or 148 * Computes whether the input type for the pin input should be password or
140 * numerical. 149 * numerical.
141 * @param {boolean} enablePassword 150 * @param {boolean} enablePassword
142 * @private 151 * @private
143 */ 152 */
144 getInputType_: function(enablePassword) { 153 getInputType_: function(enablePassword) {
145 return enablePassword ? 'password' : 'number'; 154 return enablePassword ? 'password' : 'number';
146 }, 155 },
147 156
148 /** 157 /**
(...skipping 22 matching lines...) Expand all
171 // (just numbers), if the document direction is rtl. 180 // (just numbers), if the document direction is rtl.
172 var enableRtl = (document.dir == 'rtl') && !Number.isInteger(+password); 181 var enableRtl = (document.dir == 'rtl') && !Number.isInteger(+password);
173 return enableRtl ? 'input-non-pin' : ''; 182 return enableRtl ? 'input-non-pin' : '';
174 }, 183 },
175 184
176 /** 185 /**
177 * Computes if the submit button is visible. 186 * Computes if the submit button is visible.
178 * @param {boolean} submitEnabled 187 * @param {boolean} submitEnabled
179 * @private 188 * @private
180 */ 189 */
181 getSubmitHiddenClass_: function(submitEnabled) { 190 getSubmitClass_: function(submitEnabled) {
182 return submitEnabled ? '' : 'submit-button-hidden'; 191 return submitEnabled ? '' : 'submit-button-hidden';
183 } 192 }
184 }); 193 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698