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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 * this response. | 897 * this response. |
898 * @param {string} jobTitle The print job title | 898 * @param {string} jobTitle The print job title |
899 */ | 899 */ |
900 function onDidGetPreviewPageCount(pageCount, isModifiable, previewResponseId, | 900 function onDidGetPreviewPageCount(pageCount, isModifiable, previewResponseId, |
901 jobTitle) { | 901 jobTitle) { |
902 if (!isExpectedPreviewResponse(previewResponseId)) | 902 if (!isExpectedPreviewResponse(previewResponseId)) |
903 return; | 903 return; |
904 pageSettings.updateState(pageCount); | 904 pageSettings.updateState(pageCount); |
905 previewModifiable = isModifiable; | 905 previewModifiable = isModifiable; |
906 document.title = localStrings.getStringF('printPreviewTitleFormat', jobTitle); | 906 document.title = localStrings.getStringF('printPreviewTitleFormat', jobTitle); |
| 907 if (!previewModifiable && pageSettings.requestPrintPreviewIfNeeded()) |
| 908 return; |
| 909 |
907 cr.dispatchSimpleEvent(document, 'updateSummary'); | 910 cr.dispatchSimpleEvent(document, 'updateSummary'); |
908 } | 911 } |
909 | 912 |
910 function onDidGetDefaultPageLayout(pageLayout) { | 913 function onDidGetDefaultPageLayout(pageLayout) { |
911 // TODO(aayushkumar): Do something here! | 914 // TODO(aayushkumar): Do something here! |
912 } | 915 } |
913 | 916 |
914 /** | 917 /** |
915 * Called when no pipelining previewed pages. | 918 * Called when no pipelining previewed pages. |
916 * @param {string} previewUid Preview unique identifier. | 919 * @param {string} previewUid Preview unique identifier. |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 <include src="print_preview_animations.js"/> | 1088 <include src="print_preview_animations.js"/> |
1086 <include src="print_preview_cloud.js"/> | 1089 <include src="print_preview_cloud.js"/> |
1087 <include src="print_preview_utils.js"/> | 1090 <include src="print_preview_utils.js"/> |
1088 <include src="print_header.js"/> | 1091 <include src="print_header.js"/> |
1089 <include src="page_settings.js"/> | 1092 <include src="page_settings.js"/> |
1090 <include src="copies_settings.js"/> | 1093 <include src="copies_settings.js"/> |
1091 <include src="header_footer_settings.js"/> | 1094 <include src="header_footer_settings.js"/> |
1092 <include src="layout_settings.js"/> | 1095 <include src="layout_settings.js"/> |
1093 <include src="color_settings.js"/> | 1096 <include src="color_settings.js"/> |
1094 <include src="margin_settings.js"/> | 1097 <include src="margin_settings.js"/> |
OLD | NEW |