Chromium Code Reviews| Index: ui/login/account_picker/screen_account_picker.js |
| diff --git a/ui/login/account_picker/screen_account_picker.js b/ui/login/account_picker/screen_account_picker.js |
| index 572404dfdd6dc4dedc3af414daadb228e75a6830..25776f95434506e4f81aa5b6e169414039e8ed1e 100644 |
| --- a/ui/login/account_picker/screen_account_picker.js |
| +++ b/ui/login/account_picker/screen_account_picker.js |
| @@ -37,7 +37,7 @@ login.createScreen('AccountPickerScreen', 'account-picker', function() { |
| 'hideUserPodCustomIcon', |
| 'setUserPodFingerprintIcon', |
| 'removeUserPodFingerprintIcon', |
| - 'disablePinKeyboardForUser', |
| + 'setPinEnabledForUser', |
| 'setAuthType', |
| 'setTouchViewState', |
| 'setPublicSessionDisplayName', |
| @@ -266,36 +266,7 @@ login.createScreen('AccountPickerScreen', 'account-picker', function() { |
| } |
| }, |
| - /** |
| - * Loads the PIN keyboard if any of the users can login with a PIN. Disables |
| - * the PIN keyboard for users who are not allowed to use PIN unlock. |
| - * @param {array} users Array of user instances. |
| - */ |
| - initializePinKeyboardStateForUsers_: function(users) { |
| - // It is possible that the PIN keyboard HTML has already been loaded. If |
| - // that is the case, we want to show the user pods with the PIN keyboard |
| - // immediately without running the PIN show/hide effect. |
| - document.body.classList.add('disable-pin-animation'); |
| - setTimeout(function() { |
| - document.body.classList.remove('disable-pin-animation'); |
| - }); |
| - |
| - for (var i = 0; i < users.length; ++i) { |
| - var user = users[i]; |
| - if (user.showPin) { |
| - showPinKeyboardAsync(); |
| - } else { |
| - // Disable pin for users who cannot authenticate with PIN. For |
| - // example, users who have not set up PIN or users who have not |
| - // entered their account recently. Otherwise, the PIN keyboard will |
| - // will appear for any user if there is at least one user who has PIN |
| - // enabled. |
| - this.disablePinKeyboardForUser(user.username); |
| - } |
| - } |
| - }, |
| - |
| - /** |
| + /** |
| * Loads given users in pod row. |
| * @param {array} users Array of user. |
| * @param {boolean} showGuest Whether to show guest session button. |
| @@ -306,8 +277,6 @@ login.createScreen('AccountPickerScreen', 'account-picker', function() { |
| // On Desktop, #login-header-bar has a shadow if there are 8+ profiles. |
| if (Oobe.getInstance().displayType == DISPLAY_TYPE.DESKTOP_USER_MANAGER) |
| $('login-header-bar').classList.toggle('shadow', users.length > 8); |
| - |
| - this.initializePinKeyboardStateForUsers_(users); |
| }, |
| /** |
| @@ -457,11 +426,13 @@ login.createScreen('AccountPickerScreen', 'account-picker', function() { |
| }, |
| /** |
| - * Removes the PIN keyboard so the user can no longer enter a PIN. |
| - * @param {!user} user The user who can no longer enter a PIN. |
| + * Enables or disables the pin keyboard for the given user. This may change |
| + * pin keyboard visibility. |
| + * @param {!user} user |
|
xiyuan
2017/04/03 21:21:43
nit: {!user} is not a valid type.
Looks like tha
jdufault
2017/04/10 21:06:31
Done.
|
| + * @param {boolean} enabled |
| */ |
| - disablePinKeyboardForUser: function(user) { |
| - $('pod-row').removePinKeyboard(user); |
| + setPinEnabledForUser: function(user, enabled) { |
| + $('pod-row').setPinEnabled(user, enabled); |
| }, |
| /** |