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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 function cancelPendingPrintRequest() { | 454 function cancelPendingPrintRequest() { |
455 chrome.send('cancelPendingPrintRequest'); | 455 chrome.send('cancelPendingPrintRequest'); |
456 } | 456 } |
457 | 457 |
458 /** | 458 /** |
459 * Sends a message to initiate print workflow. | 459 * Sends a message to initiate print workflow. |
460 */ | 460 */ |
461 function sendPrintDocumentRequest() { | 461 function sendPrintDocumentRequest() { |
462 var printerList = $('printer-list'); | 462 var printerList = $('printer-list'); |
463 var printer = printerList[printerList.selectedIndex]; | 463 var printer = printerList[printerList.selectedIndex]; |
464 chrome.send('saveLastPrinter', [printer.textContent, | 464 chrome.send('saveLastPrinter', [printer.value, cloudprint.getData(printer)]); |
465 cloudprint.getData(printer)]); | |
466 chrome.send('print', [JSON.stringify(getSettings()), | 465 chrome.send('print', [JSON.stringify(getSettings()), |
467 cloudprint.getPrintTicketJSON(printer)]); | 466 cloudprint.getPrintTicketJSON(printer)]); |
468 } | 467 } |
469 | 468 |
470 /** | 469 /** |
471 * Asks the browser to generate a preview PDF based on current print settings. | 470 * Asks the browser to generate a preview PDF based on current print settings. |
472 */ | 471 */ |
473 function requestPrintPreview() { | 472 function requestPrintPreview() { |
474 hasPendingPreviewRequest = true; | 473 hasPendingPreviewRequest = true; |
475 layoutSettings.updateState(); | 474 layoutSettings.updateState(); |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 <include src="print_preview_animations.js"/> | 985 <include src="print_preview_animations.js"/> |
987 <include src="print_preview_cloud.js"/> | 986 <include src="print_preview_cloud.js"/> |
988 <include src="print_preview_utils.js"/> | 987 <include src="print_preview_utils.js"/> |
989 <include src="print_header.js"/> | 988 <include src="print_header.js"/> |
990 <include src="page_settings.js"/> | 989 <include src="page_settings.js"/> |
991 <include src="copies_settings.js"/> | 990 <include src="copies_settings.js"/> |
992 <include src="header_footer_settings.js"/> | 991 <include src="header_footer_settings.js"/> |
993 <include src="layout_settings.js"/> | 992 <include src="layout_settings.js"/> |
994 <include src="color_settings.js"/> | 993 <include src="color_settings.js"/> |
995 <include src="margin_settings.js"/> | 994 <include src="margin_settings.js"/> |
OLD | NEW |