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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 $('system-dialog-throbber').classList.add('hidden'); | 797 $('system-dialog-throbber').classList.add('hidden'); |
798 $('native-print-dialog-throbber').classList.add('hidden'); | 798 $('native-print-dialog-throbber').classList.add('hidden'); |
799 displayErrorMessage(errorMessage); | 799 displayErrorMessage(errorMessage); |
800 } | 800 } |
801 | 801 |
802 /** | 802 /** |
803 * Display an error message when print preview fails. | 803 * Display an error message when print preview fails. |
804 * Called from PrintPreviewMessageHandler::OnPrintPreviewFailed(). | 804 * Called from PrintPreviewMessageHandler::OnPrintPreviewFailed(). |
805 */ | 805 */ |
806 function printPreviewFailed() { | 806 function printPreviewFailed() { |
807 displayErrorMessage(localStrings.getString('previewFailed')); | 807 displayErrorMessageWithButton(localStrings.getString('previewFailed'), |
| 808 localStrings.getString('launchNativeDialog'), |
| 809 launchNativePrintDialog); |
808 } | 810 } |
809 | 811 |
810 /** | 812 /** |
811 * Called when the PDF plugin loads its document. | 813 * Called when the PDF plugin loads its document. |
812 */ | 814 */ |
813 function onPDFLoad() { | 815 function onPDFLoad() { |
814 if (previewModifiable) { | 816 if (previewModifiable) { |
815 setPluginPreviewPageCount(); | 817 setPluginPreviewPageCount(); |
816 } | 818 } |
817 $('pdf-viewer').fitToHeight(); | 819 $('pdf-viewer').fitToHeight(); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
980 <include src="print_preview_animations.js"/> | 982 <include src="print_preview_animations.js"/> |
981 <include src="print_preview_cloud.js"/> | 983 <include src="print_preview_cloud.js"/> |
982 <include src="print_preview_utils.js"/> | 984 <include src="print_preview_utils.js"/> |
983 <include src="print_header.js"/> | 985 <include src="print_header.js"/> |
984 <include src="page_settings.js"/> | 986 <include src="page_settings.js"/> |
985 <include src="copies_settings.js"/> | 987 <include src="copies_settings.js"/> |
986 <include src="header_footer_settings.js"/> | 988 <include src="header_footer_settings.js"/> |
987 <include src="layout_settings.js"/> | 989 <include src="layout_settings.js"/> |
988 <include src="color_settings.js"/> | 990 <include src="color_settings.js"/> |
989 <include src="margin_settings.js"/> | 991 <include src="margin_settings.js"/> |
OLD | NEW |