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 // require: cr/ui/print_preview_cloud.js | 5 // require: cr/ui/print_preview_cloud.js |
6 | 6 |
7 var localStrings = new LocalStrings(); | 7 var localStrings = new LocalStrings(); |
8 | 8 |
9 // If useCloudPrint is true we attempt to connect to cloud print | 9 // If useCloudPrint is true we attempt to connect to cloud print |
10 // and populate the list of printers with cloud print printers. | 10 // and populate the list of printers with cloud print printers. |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 selectedValue == MANAGE_LOCAL_PRINTERS) { | 242 selectedValue == MANAGE_LOCAL_PRINTERS) { |
243 printerList.selectedIndex = lastSelectedPrinterIndex; | 243 printerList.selectedIndex = lastSelectedPrinterIndex; |
244 chrome.send(selectedValue); | 244 chrome.send(selectedValue); |
245 skip_refresh = true; | 245 skip_refresh = true; |
246 } else if (selectedValue == PRINT_TO_PDF || | 246 } else if (selectedValue == PRINT_TO_PDF || |
247 selectedValue == PRINT_WITH_CLOUD_PRINT) { | 247 selectedValue == PRINT_WITH_CLOUD_PRINT) { |
248 updateWithPrinterCapabilities({ | 248 updateWithPrinterCapabilities({ |
249 'disableColorOption': true, | 249 'disableColorOption': true, |
250 'setColorAsDefault': true, | 250 'setColorAsDefault': true, |
251 'setDuplexAsDefault': false, | 251 'setDuplexAsDefault': false, |
252 'printerColorModelForColor': colorSettings.COLOR, | 252 'printerColorModelForColor': print_preview.ColorSettings.COLOR, |
253 'printerDefaultDuplexValue': copiesSettings.UNKNOWN_DUPLEX_MODE, | 253 'printerDefaultDuplexValue': copiesSettings.UNKNOWN_DUPLEX_MODE, |
254 'disableCopiesOption': true}); | 254 'disableCopiesOption': true}); |
255 } else { | 255 } else { |
256 // This message will call back to 'updateWithPrinterCapabilities' | 256 // This message will call back to 'updateWithPrinterCapabilities' |
257 // function. | 257 // function. |
258 chrome.send('getPrinterCapabilities', [selectedValue]); | 258 chrome.send('getPrinterCapabilities', [selectedValue]); |
259 } | 259 } |
260 if (!skip_refresh) { | 260 if (!skip_refresh) { |
261 lastSelectedPrinterIndex = selectedIndex; | 261 lastSelectedPrinterIndex = selectedIndex; |
262 | 262 |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 */ | 968 */ |
969 function createPDFPlugin(srcDataIndex) { | 969 function createPDFPlugin(srcDataIndex) { |
970 var pdfViewer = $('pdf-viewer'); | 970 var pdfViewer = $('pdf-viewer'); |
971 var srcURL = getPageSrcURL(currentPreviewUid, srcDataIndex); | 971 var srcURL = getPageSrcURL(currentPreviewUid, srcDataIndex); |
972 if (pdfViewer) { | 972 if (pdfViewer) { |
973 // Need to call this before the reload(), where the plugin resets its | 973 // Need to call this before the reload(), where the plugin resets its |
974 // internal page count. | 974 // internal page count. |
975 pdfViewer.goToPage('0'); | 975 pdfViewer.goToPage('0'); |
976 pdfViewer.resetPrintPreviewUrl(srcURL); | 976 pdfViewer.resetPrintPreviewUrl(srcURL); |
977 pdfViewer.reload(); | 977 pdfViewer.reload(); |
978 pdfViewer.grayscale(colorSettings.colorMode == colorSettings.GRAY); | 978 pdfViewer.grayscale( |
| 979 colorSettings.colorMode == print_preview.ColorSettings.GRAY); |
979 return; | 980 return; |
980 } | 981 } |
981 | 982 |
982 pdfViewer = document.createElement('embed'); | 983 pdfViewer = document.createElement('embed'); |
983 pdfViewer.setAttribute('id', 'pdf-viewer'); | 984 pdfViewer.setAttribute('id', 'pdf-viewer'); |
984 pdfViewer.setAttribute('type', | 985 pdfViewer.setAttribute('type', |
985 'application/x-google-chrome-print-preview-pdf'); | 986 'application/x-google-chrome-print-preview-pdf'); |
986 pdfViewer.setAttribute('src', srcURL); | 987 pdfViewer.setAttribute('src', srcURL); |
987 pdfViewer.setAttribute('aria-live', 'polite'); | 988 pdfViewer.setAttribute('aria-live', 'polite'); |
988 pdfViewer.setAttribute('aria-atomic', 'true'); | 989 pdfViewer.setAttribute('aria-atomic', 'true'); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 <include src="copies_settings.js"/> | 1106 <include src="copies_settings.js"/> |
1106 <include src="header_footer_settings.js"/> | 1107 <include src="header_footer_settings.js"/> |
1107 <include src="layout_settings.js"/> | 1108 <include src="layout_settings.js"/> |
1108 <include src="color_settings.js"/> | 1109 <include src="color_settings.js"/> |
1109 <include src="margin_settings.js"/> | 1110 <include src="margin_settings.js"/> |
1110 <include src="margin_textbox.js"/> | 1111 <include src="margin_textbox.js"/> |
1111 <include src="margin_line.js"/> | 1112 <include src="margin_line.js"/> |
1112 <include src="margin_utils.js"/> | 1113 <include src="margin_utils.js"/> |
1113 <include src="margins_ui.js"/> | 1114 <include src="margins_ui.js"/> |
1114 <include src="preview_area.js"/> | 1115 <include src="preview_area.js"/> |
OLD | NEW |