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

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

Issue 2524143003: Print Preview: Add option to rasterize PDFs and add JPEG compression. (Closed)
Patch Set: Clean up JS Created 4 years 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 cr.exportPath('print_preview'); 5 cr.exportPath('print_preview');
6 6
7 /** 7 /**
8 * @typedef {{selectSaveAsPdfDestination: boolean, 8 * @typedef {{selectSaveAsPdfDestination: boolean,
9 * layoutSettings.portrait: boolean, 9 * layoutSettings.portrait: boolean,
10 * pageRange: string, 10 * pageRange: string,
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 destination != null && 281 destination != null &&
282 destination.id == 282 destination.id ==
283 print_preview.Destination.GooglePromotedId.SAVE_AS_PDF, 283 print_preview.Destination.GooglePromotedId.SAVE_AS_PDF,
284 'printWithCloudPrint': destination != null && !destination.isLocal, 284 'printWithCloudPrint': destination != null && !destination.isLocal,
285 'printWithPrivet': destination != null && destination.isPrivet, 285 'printWithPrivet': destination != null && destination.isPrivet,
286 'printWithExtension': destination != null && destination.isExtension, 286 'printWithExtension': destination != null && destination.isExtension,
287 'deviceName': destination == null ? 'foo' : destination.id, 287 'deviceName': destination == null ? 'foo' : destination.id,
288 'generateDraftData': documentInfo.isModifiable, 288 'generateDraftData': documentInfo.isModifiable,
289 'fitToPageEnabled': printTicketStore.fitToPage.getValue(), 289 'fitToPageEnabled': printTicketStore.fitToPage.getValue(),
290 'scaleFactor': printTicketStore.scaling.getValueAsNumber(), 290 'scaleFactor': printTicketStore.scaling.getValueAsNumber(),
291 'rasterizePDF': printTicketStore.rasterize.getValue(),
291 // NOTE: Even though the following fields don't directly relate to the 292 // NOTE: Even though the following fields don't directly relate to the
292 // preview, they still need to be included. 293 // preview, they still need to be included.
293 'duplex': printTicketStore.duplex.getValue() ? 294 'duplex': printTicketStore.duplex.getValue() ?
294 NativeLayer.DuplexMode.LONG_EDGE : NativeLayer.DuplexMode.SIMPLEX, 295 NativeLayer.DuplexMode.LONG_EDGE : NativeLayer.DuplexMode.SIMPLEX,
295 'copies': 1, 296 'copies': 1,
296 'collate': true, 297 'collate': true,
297 'shouldPrintBackgrounds': printTicketStore.cssBackground.getValue(), 298 'shouldPrintBackgrounds': printTicketStore.cssBackground.getValue(),
298 'shouldPrintSelectionOnly': printTicketStore.selectionOnly.getValue() 299 'shouldPrintSelectionOnly': printTicketStore.selectionOnly.getValue()
299 }; 300 };
300 301
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 'copies': printTicketStore.copies.getValueAsNumber(), 361 'copies': printTicketStore.copies.getValueAsNumber(),
361 'collate': printTicketStore.collate.getValue(), 362 'collate': printTicketStore.collate.getValue(),
362 'shouldPrintBackgrounds': printTicketStore.cssBackground.getValue(), 363 'shouldPrintBackgrounds': printTicketStore.cssBackground.getValue(),
363 'shouldPrintSelectionOnly': printTicketStore.selectionOnly.getValue(), 364 'shouldPrintSelectionOnly': printTicketStore.selectionOnly.getValue(),
364 'previewModifiable': documentInfo.isModifiable, 365 'previewModifiable': documentInfo.isModifiable,
365 'printToPDF': destination.id == 366 'printToPDF': destination.id ==
366 print_preview.Destination.GooglePromotedId.SAVE_AS_PDF, 367 print_preview.Destination.GooglePromotedId.SAVE_AS_PDF,
367 'printWithCloudPrint': !destination.isLocal, 368 'printWithCloudPrint': !destination.isLocal,
368 'printWithPrivet': destination.isPrivet, 369 'printWithPrivet': destination.isPrivet,
369 'printWithExtension': destination.isExtension, 370 'printWithExtension': destination.isExtension,
371 'rasterizePDF': printTicketStore.rasterize.getValue(),
370 'scaleFactor': printTicketStore.scaling.getValueAsNumber(), 372 'scaleFactor': printTicketStore.scaling.getValueAsNumber(),
371 'deviceName': destination.id, 373 'deviceName': destination.id,
372 'isFirstRequest': false, 374 'isFirstRequest': false,
373 'requestID': -1, 375 'requestID': -1,
374 'fitToPageEnabled': printTicketStore.fitToPage.getValue(), 376 'fitToPageEnabled': printTicketStore.fitToPage.getValue(),
375 'pageWidth': documentInfo.pageSize.width, 377 'pageWidth': documentInfo.pageSize.width,
376 'pageHeight': documentInfo.pageSize.height, 378 'pageHeight': documentInfo.pageSize.height,
377 'showSystemDialog': opt_showSystemDialog 379 'showSystemDialog': opt_showSystemDialog
378 }; 380 };
379 381
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 return this.serializedDefaultDestinationSelectionRulesStr_; 1095 return this.serializedDefaultDestinationSelectionRulesStr_;
1094 } 1096 }
1095 }; 1097 };
1096 1098
1097 // Export 1099 // Export
1098 return { 1100 return {
1099 NativeInitialSettings: NativeInitialSettings, 1101 NativeInitialSettings: NativeInitialSettings,
1100 NativeLayer: NativeLayer 1102 NativeLayer: NativeLayer
1101 }; 1103 };
1102 }); 1104 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698