| 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,13 +38,16 @@
|
| */
|
| 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));
|
| },
|
|
|
| /**
|
| @@ -58,10 +61,20 @@
|
| this.cancelButton_.classList.add('loading');
|
| this.summary_.innerHTML = localStrings.getString('printing');
|
| }
|
| + this.disableCancelButton_();
|
| requestToPrintDocument();
|
| },
|
|
|
| /**
|
| + * Disables the cancel button and removes its keydown event listener.
|
| + * @private
|
| + */
|
| + disableCancelButton_: function() {
|
| + window.onkeydown = null;
|
| + this.cancelButton_.disabled = true;
|
| + },
|
| +
|
| + /**
|
| * Updates the state of |this.printButton_| depending on the user selection.
|
| * The button is enabled only when the following conditions are true.
|
| * 1) The selected page ranges are valid.
|
|
|