summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-20 17:31:17 +0000
committerflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-20 17:31:17 +0000
commita73179ae99d66c01dd92d795a474159b806aa87d (patch)
tree8c5a1eb23e9b0fefe909409df2f4b9ee5c1bd79c
parentf7d0685b99c9f34a54649dbf94956ba56fe4844c (diff)
downloadchromium_src-a73179ae99d66c01dd92d795a474159b806aa87d.zip
chromium_src-a73179ae99d66c01dd92d795a474159b806aa87d.tar.gz
chromium_src-a73179ae99d66c01dd92d795a474159b806aa87d.tar.bz2
Handle blur events from user pod elements.
Avoid having the appearance of focus when we do not have focus. Clicking on the menu removes focus from the user pod but visually does not do so. This should make it less painful in the cases where the lock screen password element loses focus on resume as well. BUG=114810 TEST=Click on a status area menu, and when the blur event is sent to the password element (or guest enter button) the pod loses focus. Review URL: http://codereview.chromium.org/9423011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122765 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/resources/chromeos/login/user_pod_row.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/resources/chromeos/login/user_pod_row.js b/chrome/browser/resources/chromeos/login/user_pod_row.js
index 0892698..1137360 100644
--- a/chrome/browser/resources/chromeos/login/user_pod_row.js
+++ b/chrome/browser/resources/chromeos/login/user_pod_row.js
@@ -99,6 +99,10 @@ cr.define('login', function() {
* Initializes the pod after its properties set and added to a pod row.
*/
initialize: function() {
+ // TODO(flackr): Get rid of multiple blur listeners. We should be able to
+ // use a single focusout listener on the pod or entire row but this is not
+ // being sent for some reason when you open the status area menus despite
+ // blur being sent.
if (!this.isGuest) {
this.passwordEmpty = true;
this.passwordElement.addEventListener('keydown',
@@ -107,6 +111,11 @@ cr.define('login', function() {
this.handlePasswordKeyPress_.bind(this));
this.passwordElement.addEventListener('keyup',
this.handlePasswordKeyUp_.bind(this));
+ this.passwordElement.addEventListener('blur',
+ this.parentNode.handleBlur.bind(this.parentNode));
+ } else {
+ this.enterButtonElement.addEventListener('blur',
+ this.parentNode.handleBlur.bind(this.parentNode));
}
},
@@ -738,6 +747,15 @@ cr.define('login', function() {
},
/**
+ * Handles a blur event.
+ * @param {Event} e Blur Event object.
+ */
+ handleBlur: function(e) {
+ // Clear focus when the pod input is blurred.
+ this.focusPod();
+ },
+
+ /**
* Handler of keydown event.
* @param {Event} e KeyDown Event object.
* @public