| Index: chrome/browser/resources/settings/device_page/display_overscan_dialog.js
|
| diff --git a/chrome/browser/resources/settings/device_page/display_overscan_dialog.js b/chrome/browser/resources/settings/device_page/display_overscan_dialog.js
|
| index 4cb019fcabdedb1d74e988030345aaf1032ed325..109301b9c8aad571af0e6ae51c6cadc5e92efa16 100644
|
| --- a/chrome/browser/resources/settings/device_page/display_overscan_dialog.js
|
| +++ b/chrome/browser/resources/settings/device_page/display_overscan_dialog.js
|
| @@ -30,23 +30,16 @@ Polymer({
|
| */
|
| keyHandler_: null,
|
|
|
| - /** @override */
|
| - attached: function() {
|
| - this.keyHandler_ = this.handleKeyEvent_.bind(this);
|
| - window.addEventListener('keydown', this.keyHandler_);
|
| - },
|
| -
|
| - /** @override */
|
| - detached: function() {
|
| - window.removeEventListener('keydown', this.keyHandler_);
|
| - },
|
| -
|
| open: function() {
|
| + this.keyHandler_ = this.handleKeyEvent_.bind(this);
|
| + this.addEventListener('keydown', this.keyHandler_);
|
| this.comitted_ = false;
|
| this.$.dialog.showModal();
|
| },
|
|
|
| close: function() {
|
| + this.removeEventListener('keydown', this.keyHandler_);
|
| +
|
| this.displayId = ''; // Will trigger displayIdChanged_.
|
|
|
| if (this.$.dialog.open)
|
| @@ -83,6 +76,8 @@ Polymer({
|
| * @private
|
| */
|
| handleKeyEvent_: function(event) {
|
| + if (event.altKey || event.ctrlKey || event.metaKey)
|
| + return;
|
| switch (event.keyCode) {
|
| case 37: // left arrow
|
| if (event.shiftKey)
|
| @@ -109,6 +104,7 @@ Polymer({
|
| this.resize_(0, 1);
|
| break;
|
| default:
|
| + // Allow unhandled key events to propagate.
|
| return;
|
| }
|
| event.preventDefault();
|
|
|