Index: chrome/renderer/print_web_view_helper_linux.cc |
diff --git a/chrome/renderer/print_web_view_helper_linux.cc b/chrome/renderer/print_web_view_helper_linux.cc |
index 6b6d9e6b43e07ed12894abc92ccb8b7ec177a9cc..8afe9f39efffcefdae4c5c490ac5be4f910d34a9 100644 |
--- a/chrome/renderer/print_web_view_helper_linux.cc |
+++ b/chrome/renderer/print_web_view_helper_linux.cc |
@@ -143,7 +143,9 @@ bool PrintWebViewHelper::RenderPages(const PrintMsg_PrintPages_Params& params, |
PrepareFrameAndViewForPrint* prepare, |
printing::Metafile* metafile) { |
PrintMsg_Print_Params print_params = params.params; |
- UpdatePrintableSizeInPrintParameters(frame, node, prepare, &print_params); |
+ UpdatePrintableSizeInPrintParameters(frame, node, prepare, print_params, |
+ ignore_frame_margins_css_, |
+ fit_to_page_); |
*page_count = prepare->GetExpectedPageCount(); |
if (!*page_count) |
@@ -181,9 +183,10 @@ void PrintWebViewHelper::PrintPageInternal( |
WebFrame* frame, |
printing::Metafile* metafile) { |
printing::PageSizeMargins page_layout_in_points; |
+ double scale_factor = 1.0f; |
GetPageSizeAndMarginsInPoints(frame, params.page_number, params.params, |
- &page_layout_in_points); |
- |
+ ignore_frame_margins_css_, fit_to_page_, |
+ &scale_factor, &page_layout_in_points); |
gfx::Size page_size( |
page_layout_in_points.content_width + |
page_layout_in_points.margin_right + |
@@ -195,9 +198,8 @@ void PrintWebViewHelper::PrintPageInternal( |
page_layout_in_points.margin_top, |
page_layout_in_points.content_width, |
page_layout_in_points.content_height); |
- |
SkDevice* device = metafile->StartPageForVectorCanvas( |
- page_size, content_area, 1.0f); |
+ page_size, content_area, scale_factor); |
if (!device) |
return; |
@@ -213,8 +215,9 @@ void PrintWebViewHelper::PrintPageInternal( |
// |page_number| is 0-based, so 1 is added. |
// The scale factor on Linux is 1. |
PrintHeaderAndFooter(canvas.get(), params.page_number + 1, |
- print_preview_context_.total_page_count(), 1, |
- page_layout_in_points, *header_footer_info_); |
+ print_preview_context_.total_page_count(), |
+ scale_factor, page_layout_in_points, |
+ *header_footer_info_); |
} |
// Done printing. Close the device context to retrieve the compiled metafile. |