Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(947)

Side by Side Diff: chrome/browser/resources/print_preview/print_preview.js

Issue 8138020: PrintPreview: Fix printer color settings issues based on printer ppd/schema information. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 selectedValue == MANAGE_LOCAL_PRINTERS) { 227 selectedValue == MANAGE_LOCAL_PRINTERS) {
228 printerList.selectedIndex = lastSelectedPrinterIndex; 228 printerList.selectedIndex = lastSelectedPrinterIndex;
229 chrome.send(selectedValue); 229 chrome.send(selectedValue);
230 skip_refresh = true; 230 skip_refresh = true;
231 } else if (selectedValue == PRINT_TO_PDF || 231 } else if (selectedValue == PRINT_TO_PDF ||
232 selectedValue == PRINT_WITH_CLOUD_PRINT) { 232 selectedValue == PRINT_WITH_CLOUD_PRINT) {
233 updateWithPrinterCapabilities({ 233 updateWithPrinterCapabilities({
234 'disableColorOption': true, 234 'disableColorOption': true,
235 'setColorAsDefault': true, 235 'setColorAsDefault': true,
236 'setDuplexAsDefault': false, 236 'setDuplexAsDefault': false,
237 'printerColorModelForColor': colorSettings.COLOR, 237 'printerColorModelForColor': print_preview.ColorSettings.COLOR,
238 'printerDefaultDuplexValue': copiesSettings.UNKNOWN_DUPLEX_MODE, 238 'printerDefaultDuplexValue': copiesSettings.UNKNOWN_DUPLEX_MODE,
239 'disableCopiesOption': true}); 239 'disableCopiesOption': true});
240 } else { 240 } else {
241 // This message will call back to 'updateWithPrinterCapabilities' 241 // This message will call back to 'updateWithPrinterCapabilities'
242 // function. 242 // function.
243 chrome.send('getPrinterCapabilities', [selectedValue]); 243 chrome.send('getPrinterCapabilities', [selectedValue]);
244 } 244 }
245 if (!skip_refresh) { 245 if (!skip_refresh) {
246 lastSelectedPrinterIndex = selectedIndex; 246 lastSelectedPrinterIndex = selectedIndex;
247 247
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 */ 943 */
944 function createPDFPlugin(srcDataIndex) { 944 function createPDFPlugin(srcDataIndex) {
945 var pdfViewer = $('pdf-viewer'); 945 var pdfViewer = $('pdf-viewer');
946 var srcURL = getPageSrcURL(currentPreviewUid, srcDataIndex); 946 var srcURL = getPageSrcURL(currentPreviewUid, srcDataIndex);
947 if (pdfViewer) { 947 if (pdfViewer) {
948 // Need to call this before the reload(), where the plugin resets its 948 // Need to call this before the reload(), where the plugin resets its
949 // internal page count. 949 // internal page count.
950 pdfViewer.goToPage('0'); 950 pdfViewer.goToPage('0');
951 pdfViewer.resetPrintPreviewUrl(srcURL); 951 pdfViewer.resetPrintPreviewUrl(srcURL);
952 pdfViewer.reload(); 952 pdfViewer.reload();
953 pdfViewer.grayscale(colorSettings.colorMode == colorSettings.GRAY); 953 pdfViewer.grayscale(
954 colorSettings.colorMode == print_preview.ColorSettings.GRAY);
954 return; 955 return;
955 } 956 }
956 957
957 pdfViewer = document.createElement('embed'); 958 pdfViewer = document.createElement('embed');
958 pdfViewer.setAttribute('id', 'pdf-viewer'); 959 pdfViewer.setAttribute('id', 'pdf-viewer');
959 pdfViewer.setAttribute('type', 960 pdfViewer.setAttribute('type',
960 'application/x-google-chrome-print-preview-pdf'); 961 'application/x-google-chrome-print-preview-pdf');
961 pdfViewer.setAttribute('src', srcURL); 962 pdfViewer.setAttribute('src', srcURL);
962 pdfViewer.setAttribute('aria-live', 'polite'); 963 pdfViewer.setAttribute('aria-live', 'polite');
963 pdfViewer.setAttribute('aria-atomic', 'true'); 964 pdfViewer.setAttribute('aria-atomic', 'true');
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 <include src="print_preview_animations.js"/> 1029 <include src="print_preview_animations.js"/>
1029 <include src="print_preview_cloud.js"/> 1030 <include src="print_preview_cloud.js"/>
1030 <include src="print_preview_utils.js"/> 1031 <include src="print_preview_utils.js"/>
1031 <include src="print_header.js"/> 1032 <include src="print_header.js"/>
1032 <include src="page_settings.js"/> 1033 <include src="page_settings.js"/>
1033 <include src="copies_settings.js"/> 1034 <include src="copies_settings.js"/>
1034 <include src="header_footer_settings.js"/> 1035 <include src="header_footer_settings.js"/>
1035 <include src="layout_settings.js"/> 1036 <include src="layout_settings.js"/>
1036 <include src="color_settings.js"/> 1037 <include src="color_settings.js"/>
1037 <include src="margin_settings.js"/> 1038 <include src="margin_settings.js"/>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698