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

Side by Side Diff: ui/login/account_picker/screen_account_picker.js

Issue 2427073002: cros: Fixed 3 bugs for pin unlock. (Closed)
Patch Set: Fixed patch set 2 errors. Created 4 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 Account picker screen implementation. 6 * @fileoverview Account picker screen implementation.
7 */ 7 */
8 8
9 login.createScreen('AccountPickerScreen', 'account-picker', function() { 9 login.createScreen('AccountPickerScreen', 'account-picker', function() {
10 /** 10 /**
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 error, 217 error,
218 BUBBLE_OFFSET, BUBBLE_PADDING); 218 BUBBLE_OFFSET, BUBBLE_PADDING);
219 }; 219 };
220 activatedPod.addEventListener("webkitTransitionEnd", showTopCallback); 220 activatedPod.addEventListener("webkitTransitionEnd", showTopCallback);
221 ensureTransitionEndEvent(activatedPod); 221 ensureTransitionEndEvent(activatedPod);
222 } 222 }
223 } 223 }
224 }, 224 },
225 225
226 /** 226 /**
227 * Loads the PIN keyboard if any of the users can login with a PIN. 227 * Loads the PIN keyboard if any of the users can login with a PIN. Disables
228 * the PIN keyboard for users who are not allowed to use PIN unlock.
228 * @param {array} users Array of user instances. 229 * @param {array} users Array of user instances.
229 */ 230 */
230 loadPinKeyboardIfNeeded_: function(users) { 231 initializePinKeyboardStateForUsers_: function(users) {
231 for (var i = 0; i < users.length; ++i) { 232 for (var i = 0; i < users.length; ++i) {
232 var user = users[i]; 233 var user = users[i];
233 if (user.showPin) { 234 if (user.showPin) {
234 showPinKeyboardAsync(); 235 showPinKeyboardAsync();
235 return; 236 } else {
237 // Disable pin for users which should not be able to access pin. Such
238 // users include those who have not set up pin as those who have not
jdufault 2016/10/21 19:09:56 I'm not sure we need to include a comment here. If
sammiequon 2016/10/21 22:07:51 Done.
239 // entered their password recently.
240 this.disablePinKeyboardForUser(user.username);
236 } 241 }
237 } 242 }
238 }, 243 },
239 244
240 /** 245 /**
241 * Loads given users in pod row. 246 * Loads given users in pod row.
242 * @param {array} users Array of user. 247 * @param {array} users Array of user.
243 * @param {boolean} showGuest Whether to show guest session button. 248 * @param {boolean} showGuest Whether to show guest session button.
244 */ 249 */
245 loadUsers: function(users, showGuest) { 250 loadUsers: function(users, showGuest) {
246 $('pod-row').loadPods(users); 251 $('pod-row').loadPods(users);
247 $('login-header-bar').showGuestButton = showGuest; 252 $('login-header-bar').showGuestButton = showGuest;
248 // On Desktop, #login-header-bar has a shadow if there are 8+ profiles. 253 // On Desktop, #login-header-bar has a shadow if there are 8+ profiles.
249 if (Oobe.getInstance().displayType == DISPLAY_TYPE.DESKTOP_USER_MANAGER) 254 if (Oobe.getInstance().displayType == DISPLAY_TYPE.DESKTOP_USER_MANAGER)
250 $('login-header-bar').classList.toggle('shadow', users.length > 8); 255 $('login-header-bar').classList.toggle('shadow', users.length > 8);
251 256
252 this.loadPinKeyboardIfNeeded_(users); 257 this.initializePinKeyboardStateForUsers_(users);
253 }, 258 },
254 259
255 /** 260 /**
256 * Runs app with a given id from the list of loaded apps. 261 * Runs app with a given id from the list of loaded apps.
257 * @param {!string} app_id of an app to run. 262 * @param {!string} app_id of an app to run.
258 * @param {boolean=} opt_diagnostic_mode Whether to run the app in 263 * @param {boolean=} opt_diagnostic_mode Whether to run the app in
259 * diagnostic mode. Default is false. 264 * diagnostic mode. Default is false.
260 */ 265 */
261 runAppForTesting: function(app_id, opt_diagnostic_mode) { 266 runAppForTesting: function(app_id, opt_diagnostic_mode) {
262 $('pod-row').findAndRunAppForTesting(app_id, opt_diagnostic_mode); 267 $('pod-row').findAndRunAppForTesting(app_id, opt_diagnostic_mode);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 * @param {string} userID The user ID of the public session 426 * @param {string} userID The user ID of the public session
422 * @param {string} locale The locale to which this list of keyboard layouts 427 * @param {string} locale The locale to which this list of keyboard layouts
423 * applies 428 * applies
424 * @param {!Object} list List of available keyboard layouts 429 * @param {!Object} list List of available keyboard layouts
425 */ 430 */
426 setPublicSessionKeyboardLayouts: function(userID, locale, list) { 431 setPublicSessionKeyboardLayouts: function(userID, locale, list) {
427 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); 432 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list);
428 } 433 }
429 }; 434 };
430 }); 435 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/login/lock.js ('k') | ui/login/account_picker/user_pod_row.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698