Skip to content

Commit

Permalink
Add missing printExtension to print settings for print preview
Browse files Browse the repository at this point in the history
BUG=461888

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

Cr-Commit-Position: refs/heads/master@{#318852}
  • Loading branch information
tbarzic authored and Commit bot committed Mar 3, 2015
1 parent 6dcda57 commit 32b8f25
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions chrome/browser/resources/print_preview/native_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
11 changes: 8 additions & 3 deletions printing/printing_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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();
}
Expand All @@ -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()) {
Expand Down

0 comments on commit 32b8f25

Please sign in to comment.