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

Unified Diff: ui/login/account_picker/screen_account_picker.js

Issue 2015413002: Enable the PIN keyboard on the lockscreen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Address comments Created 4 years, 6 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: 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 cccf72356ac1d4fab1bb801a2e754473a8d84c20..5d78fdc673dbcba8a2dcce7018f6c81bef8de759 100644
--- a/ui/login/account_picker/screen_account_picker.js
+++ b/ui/login/account_picker/screen_account_picker.js
@@ -28,6 +28,7 @@ login.createScreen('AccountPickerScreen', 'account-picker', function() {
'showBannerMessage',
'showUserPodCustomIcon',
'hideUserPodCustomIcon',
+ 'disablePinKeyboardForUser',
'setAuthType',
'setTouchViewState',
'setPublicSessionDisplayName',
@@ -196,11 +197,27 @@ login.createScreen('AccountPickerScreen', 'account-picker', function() {
},
/**
+ * Loads the PIN keyboard if any of the users can login with a PIN.
+ * @param {array} users Array of user instances.
+ */
+ loadPinKeyboardIfNeeded_: function(users) {
+ for (var i = 0; i < users.length; ++i) {
+ var user = users[i];
+ if (user.showPin) {
+ showPinKeyboardAsync();
+ return;
+ }
+ }
+ },
+
+ /**
* Loads given users in pod row.
* @param {array} users Array of user.
* @param {boolean} showGuest Whether to show guest session button.
*/
loadUsers: function(users, showGuest) {
+ this.loadPinKeyboardIfNeeded_(users);
+
$('pod-row').loadPods(users);
$('login-header-bar').showGuestButton = showGuest;
// On Desktop, #login-header-bar has a shadow if there are 8+ profiles.
@@ -338,6 +355,23 @@ login.createScreen('AccountPickerScreen', 'account-picker', function() {
},
/**
+ * Hides the PIN keyboard if it's active.
+ * @param {!user} user The user who can no longer enter a PIN.
+ */
+ disablePinKeyboardForUser: function(user) {
+ var pinContainer = $('pin-container');
+
+ // Transition opacity to 0, and when the transition is done hide the
+ // keyboard so it doesn't take layout space.
+ pinContainer.style.opacity = 0;
+ pinContainer.addEventListener('webkitTransitionEnd', function f(e) {
+ pinContainer.removeEventListener('webkitTransitionEnd', f);
+ pinContainer.hidden = true;
+ });
+ ensureTransitionEndEvent(pinContainer);
+ },
+
+ /**
* Updates the display name shown on a public session pod.
* @param {string} userID The user ID of the public session
* @param {string} displayName The new display name
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc ('k') | ui/login/account_picker/user_pod_row.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698