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

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

Issue 2027683003: Pin keyboard moved to under the user profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fixed patch set 3 errors. 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/user_pod_row.js
diff --git a/ui/login/account_picker/user_pod_row.js b/ui/login/account_picker/user_pod_row.js
index 88fa9278c24bbc0b6bfc51917402b1d18ee7b493..e2ee12f9239a48d38347dc9e8d6d65d82dc3dd03 100644
--- a/ui/login/account_picker/user_pod_row.js
+++ b/ui/login/account_picker/user_pod_row.js
@@ -735,13 +735,6 @@ cr.define('login', function() {
this.actionBoxRemoveUserWarningButtonElement.addEventListener('keydown',
this.handleRemoveUserConfirmationKeyDown_.bind(this));
- var pinKeyboard = $('pin-keyboard');
- // The pin keyboard is not present on the md user manager.
- if (pinKeyboard) {
- pinKeyboard.addEventListener('submit',
- this.handlePinSubmitted_.bind(this));
- }
-
var customIcon = this.customIconElement;
customIcon.parentNode.replaceChild(new UserPodCustomIcon(), customIcon);
},
@@ -755,6 +748,11 @@ cr.define('login', function() {
this.passwordElement.addEventListener('keypress',
this.handlePasswordKeyPress_.bind(this));
+ if (this.pinKeyboard) {
+ this.pinKeyboard.addEventListener('submit',
+ this.handlePinSubmitted_.bind(this));
+ }
+
this.imageElement.addEventListener('load',
this.parentNode.handlePodImageLoad.bind(this.parentNode, this));
@@ -781,7 +779,7 @@ cr.define('login', function() {
*/
handlePinSubmitted_: function(e) {
var pin = e.detail.pin;
- chrome.send('authenticateUser', [this.user.username, pin]);
+ chrome.send('authenticateUserWithPin', [this.user.username, pin]);
jdufault 2016/06/17 18:54:23 Undo this change
sammiequon 2016/06/22 23:26:17 Done.
},
/**
@@ -837,6 +835,14 @@ cr.define('login', function() {
},
/**
+ * Gets the authorization element of the pod.
+ * @type {!HTMLDivElement}
jdufault 2016/06/17 18:54:23 I think it makes sense to define the setPinVisible
sammiequon 2016/06/22 23:26:17 Done.
+ */
+ get authElement() {
+ return this.querySelector('.auth-container');
+ },
+
+ /**
* Gets image element.
* @type {!HTMLImageElement}
*/
@@ -886,6 +892,22 @@ cr.define('login', function() {
},
/**
+ * Gets the pin-container of the pod.
+ * @type {!HTMLDivElement}
+ */
+ get pinContainer() {
+ return this.querySelector('#pin-container');
+ },
+
+ /**
+ * Gets the pin-keyboard of the pod.
+ * @type {!HTMLElement}
+ */
+ get pinKeyboard() {
+ return this.querySelector('#pin-keyboard');
+ },
+
+ /**
* Gets user online sign in hint element.
* @type {!HTMLDivElement}
*/
@@ -894,6 +916,14 @@ cr.define('login', function() {
},
/**
+ * Gets the signed in indicator of the pod.
+ * @type {!HTMLDivElement}
+ */
+ get signInElement() {
+ return this.querySelector('.signed-in-indicator');
+ },
+
+ /**
* Gets the container holding the launch app button.
* @type {!HTMLButtonElement}
*/
@@ -2457,7 +2487,7 @@ cr.define('login', function() {
* @return {Object} Pod with the given username. null if pod hasn't been
* found.
*/
- getPodWithUsername_: function(username) {
+ getPodWithUsername: function(username) {
for (var i = 0, pod; pod = this.pods[i]; ++i) {
if (pod.user.username == username)
return pod;
@@ -2532,7 +2562,7 @@ cr.define('login', function() {
* @param {string} email User's email.
*/
removeUserPod: function(username) {
- var podToRemove = this.getPodWithUsername_(username);
+ var podToRemove = this.getPodWithUsername(username);
if (podToRemove == null) {
console.warn('Attempt to remove not existing pod for ' + username +
'.');
@@ -2692,7 +2722,7 @@ cr.define('login', function() {
* The icon parameters.
*/
showUserPodCustomIcon: function(username, icon) {
- var pod = this.getPodWithUsername_(username);
+ var pod = this.getPodWithUsername(username);
if (pod == null) {
console.error('Unable to show user pod button: user pod not found.');
return;
@@ -2754,7 +2784,7 @@ cr.define('login', function() {
* @param {string} username Username of pod to remove button
*/
hideUserPodCustomIcon: function(username) {
- var pod = this.getPodWithUsername_(username);
+ var pod = this.getPodWithUsername(username);
if (pod == null) {
console.error('Unable to hide user pod button: user pod not found.');
return;
@@ -2772,7 +2802,7 @@ cr.define('login', function() {
* @param {string} value The initial value to use for authentication.
*/
setAuthType: function(username, authType, value) {
- var pod = this.getPodWithUsername_(username);
+ var pod = this.getPodWithUsername(username);
if (pod == null) {
console.error('Unable to set auth type: user pod not found.');
return;
@@ -2797,7 +2827,7 @@ cr.define('login', function() {
* @param {string} displayName The new display name
*/
setPublicSessionDisplayName: function(userID, displayName) {
- var pod = this.getPodWithUsername_(userID);
+ var pod = this.getPodWithUsername(userID);
if (pod != null)
pod.setDisplayName(displayName);
},
@@ -2814,7 +2844,7 @@ cr.define('login', function() {
locales,
defaultLocale,
multipleRecommendedLocales) {
- var pod = this.getPodWithUsername_(userID);
+ var pod = this.getPodWithUsername(userID);
if (pod != null) {
pod.populateLanguageSelect(locales,
defaultLocale,
@@ -2830,7 +2860,7 @@ cr.define('login', function() {
* @param {!Object} list List of available keyboard layouts
*/
setPublicSessionKeyboardLayouts: function(userID, locale, list) {
- var pod = this.getPodWithUsername_(userID);
+ var pod = this.getPodWithUsername(userID);
if (pod != null)
pod.populateKeyboardSelect(locale, list);
},
@@ -3161,7 +3191,7 @@ cr.define('login', function() {
// Clear any error messages that might still be around.
Oobe.clearErrors();
this.disabled = true;
- this.lastFocusedPod_ = this.getPodWithUsername_(email);
+ this.lastFocusedPod_ = this.getPodWithUsername(email);
Oobe.showSigninUI(email);
},
@@ -3170,7 +3200,7 @@ cr.define('login', function() {
* @param {string} username User for which to update the image.
*/
updateUserImage: function(username) {
- var pod = this.getPodWithUsername_(username);
+ var pod = this.getPodWithUsername(username);
if (pod)
pod.updateUserImage();
},

Powered by Google App Engine
This is Rietveld 408576698