Commit 32b8f25c authored by tbarzic's avatar tbarzic Committed by Commit bot

Add missing printExtension to print settings for print preview

BUG=461888

Review URL: https://codereview.chromium.org/957123002

Cr-Commit-Position: refs/heads/master@{#318852}
parent 6dcda57d
......@@ -265,6 +265,7 @@ cr.define('print_preview', function() {
print_preview.Destination.GooglePromotedId.SAVE_AS_PDF,
'printWithCloudPrint': destination != null && !destination.isLocal,
'printWithPrivet': destination != null && destination.isPrivet,
'printWithExtension': destination != null && destination.isExtension,
'deviceName': destination == null ? 'foo' : destination.id,
'generateDraftData': documentInfo.isModifiable,
'fitToPageEnabled': printTicketStore.fitToPage.getValue(),
......
......@@ -63,6 +63,7 @@ PrintingContext::Result PrintingContext::UsePdfSettings() {
pdf_settings->SetBoolean(kSettingPrintToPDF, true);
pdf_settings->SetBoolean(kSettingCloudPrintDialog, false);
pdf_settings->SetBoolean(kSettingPrintWithPrivet, false);
pdf_settings->SetBoolean(kSettingPrintWithExtension, false);
return UpdatePrintSettings(*pdf_settings);
}
......@@ -78,10 +79,13 @@ PrintingContext::Result PrintingContext::UpdatePrintSettings(
bool print_to_pdf = false;
bool is_cloud_dialog = false;
bool print_with_privet = false;
bool print_with_extension = false;
if (!job_settings.GetBoolean(kSettingPrintToPDF, &print_to_pdf) ||
!job_settings.GetBoolean(kSettingCloudPrintDialog, &is_cloud_dialog) ||
!job_settings.GetBoolean(kSettingPrintWithPrivet, &print_with_privet)) {
!job_settings.GetBoolean(kSettingPrintWithPrivet, &print_with_privet) ||
!job_settings.GetBoolean(kSettingPrintWithExtension,
&print_with_extension)) {
NOTREACHED();
return OnError();
}
......@@ -90,8 +94,9 @@ PrintingContext::Result PrintingContext::UpdatePrintSettings(
bool open_in_external_preview =
job_settings.HasKey(kSettingOpenPDFInPreview);
if (!open_in_external_preview && (print_to_pdf || print_to_cloud ||
is_cloud_dialog || print_with_privet)) {
if (!open_in_external_preview &&
(print_to_pdf || print_to_cloud || is_cloud_dialog || print_with_privet ||
print_with_extension)) {
settings_.set_dpi(kDefaultPdfDpi);
gfx::Size paper_size(GetPdfPaperSizeDeviceUnits());
if (!settings_.requested_media().size_microns.IsEmpty()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment