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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 // means that a pending print to pdf request exists. | 567 // means that a pending print to pdf request exists. |
568 disableInputElementsInSidebar(); | 568 disableInputElementsInSidebar(); |
569 previewArea.showCustomMessage( | 569 previewArea.showCustomMessage( |
570 localStrings.getString('printingToPDFInProgress')); | 570 localStrings.getString('printingToPDFInProgress')); |
571 } | 571 } |
572 | 572 |
573 /** | 573 /** |
574 * Set the default printer. If there is one, generate a print preview. | 574 * Set the default printer. If there is one, generate a print preview. |
575 * @param {string} printer Name of the default printer. Empty if none. | 575 * @param {string} printer Name of the default printer. Empty if none. |
576 * @param {string} cloudPrintData Cloud print related data to restore if | 576 * @param {string} cloudPrintData Cloud print related data to restore if |
577 * the default printer is a cloud printer. | 577 * the default printer is a cloud printer. |
| 578 * @param {number} lastUsedMarginsType Indicates the last used margins type |
| 579 * (matches enum MarginType in printing/print_job_constants.h. |
578 */ | 580 */ |
579 function setDefaultPrinter(printer_name, cloudPrintData) { | 581 function setDefaultPrinter(printer_name, cloudPrintData, lastUsedMarginsType) { |
| 582 // Setting the margin selection to the last used one. |
| 583 marginSettings.setLastUsedMarginsType(lastUsedMarginsType); |
580 // Add a placeholder value so the printer list looks valid. | 584 // Add a placeholder value so the printer list looks valid. |
581 addDestinationListOption('', '', true, true, true); | 585 addDestinationListOption('', '', true, true, true); |
582 if (printer_name) { | 586 if (printer_name) { |
583 defaultOrLastUsedPrinterName = printer_name; | 587 defaultOrLastUsedPrinterName = printer_name; |
584 if (cloudPrintData) { | 588 if (cloudPrintData) { |
585 cloudprint.setDefaultPrinter(printer_name, | 589 cloudprint.setDefaultPrinter(printer_name, |
586 cloudPrintData, | 590 cloudPrintData, |
587 addDestinationListOptionAtPosition, | 591 addDestinationListOptionAtPosition, |
588 doUpdateCloudPrinterCapabilities); | 592 doUpdateCloudPrinterCapabilities); |
589 } else { | 593 } else { |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 <include src="copies_settings.js"/> | 1097 <include src="copies_settings.js"/> |
1094 <include src="header_footer_settings.js"/> | 1098 <include src="header_footer_settings.js"/> |
1095 <include src="layout_settings.js"/> | 1099 <include src="layout_settings.js"/> |
1096 <include src="color_settings.js"/> | 1100 <include src="color_settings.js"/> |
1097 <include src="margin_settings.js"/> | 1101 <include src="margin_settings.js"/> |
1098 <include src="margin_textbox.js"/> | 1102 <include src="margin_textbox.js"/> |
1099 <include src="margin_utils.js"/> | 1103 <include src="margin_utils.js"/> |
1100 <include src="margins_ui.js"/> | 1104 <include src="margins_ui.js"/> |
1101 <include src="margins_ui_pair.js"/> | 1105 <include src="margins_ui_pair.js"/> |
1102 <include src="preview_area.js"/> | 1106 <include src="preview_area.js"/> |
OLD | NEW |