| Index: chrome/browser/resources/print_preview/print_preview.js
|
| diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js
|
| index d33f981a3798ea24a8d7cbb11cc393a67c37f591..ee6e3511dac46c3afcb96051503edd0969603b4f 100644
|
| --- a/chrome/browser/resources/print_preview/print_preview.js
|
| +++ b/chrome/browser/resources/print_preview/print_preview.js
|
| @@ -48,6 +48,10 @@ var isTabHidden = false;
|
| // True when draft preview data is requested for preview.
|
| var draftDocument = true;
|
|
|
| +// True if the user has click 'Advanced...' in order to open the system print
|
| +// dialog.
|
| +var showingSystemDialog = false;
|
| +
|
| /**
|
| * Window onload handler, sets up the page and starts print preview by getting
|
| * the printer list.
|
| @@ -169,13 +173,22 @@ function removeEventListeners() {
|
| $('portrait').onclick = null;
|
| $('printer-list').onchange = null;
|
|
|
| - // Controls that dont require preview rendering.
|
| + // Controls that don't require preview rendering.
|
| $('two-sided').onclick = null;
|
| $('color').onclick = null;
|
| $('bw').onclick = null;
|
| }
|
|
|
| /**
|
| + * Disables the input elements in the controls pane.
|
| + */
|
| +function disableInputElements() {
|
| + var els = document.querySelectorAll('input, button, select');
|
| + for (var i = 0; i < els.length; i++)
|
| + els[i].disabled = true;
|
| +}
|
| +
|
| +/**
|
| * Asks the browser to close the preview tab.
|
| */
|
| function handleCancelButtonClick() {
|
| @@ -186,6 +199,9 @@ function handleCancelButtonClick() {
|
| * Asks the browser to show the native print dialog for printing.
|
| */
|
| function showSystemDialog() {
|
| + showingSystemDialog = true;
|
| + disableInputElements();
|
| + $('system-dialog-throbber').classList.remove('hidden');
|
| chrome.send('showSystemDialog');
|
| }
|
|
|
| @@ -656,10 +672,6 @@ function updatePrintPreview(pageCount, jobTitle, modifiable, previewUid) {
|
| * @param {string} previewUid Preview unique identifier.
|
| */
|
| function createPDFPlugin(previewUid) {
|
| - // Enable the print button.
|
| - if (!$('printer-list').disabled)
|
| - $('print-button').disabled = false;
|
| -
|
| var pdfViewer = $('pdf-viewer');
|
| if (pdfViewer) {
|
| // Need to call this before the reload(), where the plugin resets its
|
| @@ -700,6 +712,9 @@ function checkCompatiblePluginExists() {
|
| * 2) The number of copies is valid (if applicable).
|
| */
|
| function updatePrintButtonState() {
|
| + if (showingSystemDialog)
|
| + return;
|
| +
|
| if (getSelectedPrinterName() == PRINT_TO_PDF) {
|
| $('print-button').disabled = !isSelectedPagesValid();
|
| } else {
|
|
|