| Index: chrome/browser/resources/print_preview/print_header.js
|
| ===================================================================
|
| --- chrome/browser/resources/print_preview/print_header.js (revision 104750)
|
| +++ chrome/browser/resources/print_preview/print_header.js (working copy)
|
| @@ -38,16 +38,27 @@
|
| */
|
| addEventListeners: function() {
|
| this.cancelButton_.onclick = function() {
|
| - chrome.send('closePrintPreviewTab');
|
| - };
|
| + this.disableCancelButton();
|
| + closePrintPreviewTab();
|
| + }.bind(this);
|
| this.printButton_.onclick = this.onPrintButtonClicked_.bind(this);
|
| document.addEventListener('updateSummary',
|
| this.updateSummary_.bind(this));
|
| document.addEventListener('updatePrintButton',
|
| this.updatePrintButton_.bind(this));
|
| + document.addEventListener('disableCancelButton',
|
| + this.disableCancelButton.bind(this));
|
| },
|
|
|
| /**
|
| + * Disables the cancel button and removes its keydown event listener.
|
| + */
|
| + disableCancelButton: function() {
|
| + window.onkeydown = null;
|
| + this.cancelButton_.disabled = true;
|
| + },
|
| +
|
| + /**
|
| * Listener executing whenever |this.printButton_| is clicked.
|
| * @private
|
| */
|
| @@ -58,6 +69,7 @@
|
| this.cancelButton_.classList.add('loading');
|
| this.summary_.innerHTML = localStrings.getString('printing');
|
| }
|
| + this.disableCancelButton();
|
| requestToPrintDocument();
|
| },
|
|
|
|
|