Commit 9201dc00 authored by sadrul@chromium.org's avatar sadrul@chromium.org

login-webui: Close any bubble when window loses focus.

If there is an error bubble on the login screen, and the user clicks
on the status-tray, then the bubble should close. Instead of sending
complicated messages from the UI to the login webui code, it is much
simpler to just close the bubbles when the login window loses focus.

BUG=127092
TEST=manually

Review URL: https://chromiumcodereview.appspot.com/10827015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148866 0039d316-1c4b-4281-b951-d872f2087c98
parent 82e41413
...@@ -38,6 +38,7 @@ cr.define('cr.ui', function() { ...@@ -38,6 +38,7 @@ cr.define('cr.ui', function() {
this.handleDocClick_.bind(this)); this.handleDocClick_.bind(this));
this.ownerDocument.addEventListener('keydown', this.ownerDocument.addEventListener('keydown',
this.handleDocKeyDown_.bind(this)); this.handleDocKeyDown_.bind(this));
window.addEventListener('blur', this.handleWindowBlur_.bind(this));
this.addEventListener('webkitTransitionEnd', this.addEventListener('webkitTransitionEnd',
this.handleTransitionEnd_.bind(this)); this.handleTransitionEnd_.bind(this));
}, },
...@@ -215,6 +216,15 @@ cr.define('cr.ui', function() { ...@@ -215,6 +216,15 @@ cr.define('cr.ui', function() {
handleDocKeyDown_: function(e) { handleDocKeyDown_: function(e) {
if (!this.hidden) if (!this.hidden)
this.hide(); this.hide();
},
/**
* Handler of window blur event.
* @private
*/
handleWindowBlur_: function(e) {
if (!this.hidden)
this.hide();
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment