| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var localStrings = new LocalStrings(); | 5 var localStrings = new LocalStrings(); |
| 6 var hasPDFPlugin = true; | 6 var hasPDFPlugin = true; |
| 7 var expectedPageCount = 0; | 7 var expectedPageCount = 0; |
| 8 var pageRangesInfo = []; | 8 var pageRangesInfo = []; |
| 9 var printJobTitle = ''; | 9 var printJobTitle = ''; |
| 10 | 10 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 var printToPDF = (printerName == localStrings.getString('printToPDF')); | 208 var printToPDF = (printerName == localStrings.getString('printToPDF')); |
| 209 | 209 |
| 210 return JSON.stringify({'printerName': printerName, | 210 return JSON.stringify({'printerName': printerName, |
| 211 'pageRange': pageRangesInfo, | 211 'pageRange': pageRangesInfo, |
| 212 'printAll': printAll, | 212 'printAll': printAll, |
| 213 'twoSided': twoSided, | 213 'twoSided': twoSided, |
| 214 'copies': copies, | 214 'copies': copies, |
| 215 'collate': collate, | 215 'collate': collate, |
| 216 'landscape': landscape, | 216 'landscape': landscape, |
| 217 'color': color, | 217 'color': color, |
| 218 'printToPDF': printToPDF}); | 218 'printToPDF': printToPDF, |
| 219 'printJobTitle': printJobTitle}); |
| 219 } | 220 } |
| 220 | 221 |
| 221 /** | 222 /** |
| 222 * Asks the browser to print the preview PDF based on current print settings. | 223 * Asks the browser to print the preview PDF based on current print settings. |
| 223 */ | 224 */ |
| 224 function printFile() { | 225 function printFile() { |
| 225 chrome.send('print', [getSettingsJSON()]); | 226 chrome.send('print', [getSettingsJSON()]); |
| 226 } | 227 } |
| 227 | 228 |
| 228 /** | 229 /** |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 * Depending on the validity of 'copies' value, enables/disables the print | 391 * Depending on the validity of 'copies' value, enables/disables the print |
| 391 * button. | 392 * button. |
| 392 */ | 393 */ |
| 393 function updatePrintButtonState() { | 394 function updatePrintButtonState() { |
| 394 $('print-button').disabled = (!($('all-pages').checked || | 395 $('print-button').disabled = (!($('all-pages').checked || |
| 395 $('pages').checkValidity()) || | 396 $('pages').checkValidity()) || |
| 396 !$('copies').checkValidity()); | 397 !$('copies').checkValidity()); |
| 397 } | 398 } |
| 398 | 399 |
| 399 window.addEventListener('DOMContentLoaded', load); | 400 window.addEventListener('DOMContentLoaded', load); |
| OLD | NEW |