Chromium Code Reviews| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 printerList.selectedIndex = lastSelectedPrinterIndex; | 229 printerList.selectedIndex = lastSelectedPrinterIndex; |
| 230 chrome.send(selectedValue); | 230 chrome.send(selectedValue); |
| 231 skip_refresh = true; | 231 skip_refresh = true; |
| 232 } else if (selectedValue == MORE_PRINTERS) { | 232 } else if (selectedValue == MORE_PRINTERS) { |
| 233 onSystemDialogLinkClicked(); | 233 onSystemDialogLinkClicked(); |
| 234 skip_refresh = true; | 234 skip_refresh = true; |
| 235 } else if (selectedValue == PRINT_TO_PDF) { | 235 } else if (selectedValue == PRINT_TO_PDF) { |
| 236 updateWithPrinterCapabilities({ | 236 updateWithPrinterCapabilities({ |
| 237 'disableColorOption': true, | 237 'disableColorOption': true, |
| 238 'setColorAsDefault': true, | 238 'setColorAsDefault': true, |
| 239 'setDuplexAsDefault': false, | 239 'printerDefaultDuplexValue': 0, |
|
dpapad
2011/09/02 03:01:07
Could you use copiesSettings.simplex_ here instead
kmadhusu
2011/09/03 00:34:00
Done.
| |
| 240 'disableCopiesOption': true}); | 240 'disableCopiesOption': true}); |
| 241 } else { | 241 } else { |
| 242 // This message will call back to 'updateWithPrinterCapabilities' | 242 // This message will call back to 'updateWithPrinterCapabilities' |
| 243 // function. | 243 // function. |
| 244 chrome.send('getPrinterCapabilities', [selectedValue]); | 244 chrome.send('getPrinterCapabilities', [selectedValue]); |
| 245 } | 245 } |
| 246 if (!skip_refresh) { | 246 if (!skip_refresh) { |
| 247 lastSelectedPrinterIndex = selectedIndex; | 247 lastSelectedPrinterIndex = selectedIndex; |
| 248 | 248 |
| 249 // Regenerate the preview data based on selected printer settings. | 249 // Regenerate the preview data based on selected printer settings. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 333 * | 333 * |
| 334 * @return {Object} Object containing print job settings. | 334 * @return {Object} Object containing print job settings. |
| 335 */ | 335 */ |
| 336 function getSettings() { | 336 function getSettings() { |
| 337 var deviceName = getSelectedPrinterName(); | 337 var deviceName = getSelectedPrinterName(); |
| 338 var printToPDF = (deviceName == PRINT_TO_PDF); | 338 var printToPDF = (deviceName == PRINT_TO_PDF); |
| 339 | 339 |
| 340 var settings = | 340 var settings = |
| 341 {'deviceName': deviceName, | 341 {'deviceName': deviceName, |
| 342 'pageRange': pageSettings.selectedPageRanges, | 342 'pageRange': pageSettings.selectedPageRanges, |
| 343 'duplex': copiesSettings.duplexMode, | 343 'duplexInfo': copiesSettings.duplexModeInfo, |
| 344 'copies': copiesSettings.numberOfCopies, | 344 'copies': copiesSettings.numberOfCopies, |
| 345 'collate': copiesSettings.isCollated(), | 345 'collate': copiesSettings.isCollated(), |
| 346 'landscape': layoutSettings.isLandscape(), | 346 'landscape': layoutSettings.isLandscape(), |
| 347 'color': colorSettings.isColor(), | 347 'color': colorSettings.isColor(), |
| 348 'printToPDF': printToPDF, | 348 'printToPDF': printToPDF, |
| 349 'isFirstRequest' : false, | 349 'isFirstRequest' : false, |
| 350 'headerFooterEnabled': headerFooterSettings.hasHeaderFooter(), | 350 'headerFooterEnabled': headerFooterSettings.hasHeaderFooter(), |
| 351 'defaultMarginsSelected': marginSettings.isDefaultMarginsSelected(), | 351 'defaultMarginsSelected': marginSettings.isDefaultMarginsSelected(), |
| 352 'margins': marginSettings.customMargins, | 352 'margins': marginSettings.customMargins, |
| 353 'requestID': -1, | 353 'requestID': -1, |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1077 <include src="print_preview_animations.js"/> | 1077 <include src="print_preview_animations.js"/> |
| 1078 <include src="print_preview_cloud.js"/> | 1078 <include src="print_preview_cloud.js"/> |
| 1079 <include src="print_preview_utils.js"/> | 1079 <include src="print_preview_utils.js"/> |
| 1080 <include src="print_header.js"/> | 1080 <include src="print_header.js"/> |
| 1081 <include src="page_settings.js"/> | 1081 <include src="page_settings.js"/> |
| 1082 <include src="copies_settings.js"/> | 1082 <include src="copies_settings.js"/> |
| 1083 <include src="header_footer_settings.js"/> | 1083 <include src="header_footer_settings.js"/> |
| 1084 <include src="layout_settings.js"/> | 1084 <include src="layout_settings.js"/> |
| 1085 <include src="color_settings.js"/> | 1085 <include src="color_settings.js"/> |
| 1086 <include src="margin_settings.js"/> | 1086 <include src="margin_settings.js"/> |
| OLD | NEW |