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

Unified Diff: components/printing/renderer/print_web_view_helper.cc

Issue 2633573002: Add Postscript Printing (Closed)
Patch Set: Merge Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/printing/renderer/print_web_view_helper.cc
diff --git a/components/printing/renderer/print_web_view_helper.cc b/components/printing/renderer/print_web_view_helper.cc
index 4f49e16676cf1ed35673a569f9a6e75afc4a3c02..89c46012034fd65df77e0d36a799fcc6edcc7889 100644
--- a/components/printing/renderer/print_web_view_helper.cc
+++ b/components/printing/renderer/print_web_view_helper.cc
@@ -1100,6 +1100,7 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
// printing and it expects real printable_area value.
// See http://crbug.com/123408
PrintMsg_Print_Params& print_params = print_pages_params_->params;
+ printer_printable_area_ = print_params.printable_area;
print_params.printable_area = gfx::Rect(print_params.page_size);
// Render Pages for printing.
@@ -1334,7 +1335,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
base::TimeTicks begin_time = base::TimeTicks::Now();
PrintPageInternal(page_params, print_preview_context_.prepared_frame(),
- initial_render_metafile, nullptr, nullptr);
+ initial_render_metafile, nullptr, nullptr, nullptr);
print_preview_context_.RenderedPreviewPage(
base::TimeTicks::Now() - begin_time);
if (draft_metafile.get()) {
@@ -1835,7 +1836,8 @@ void PrintWebViewHelper::PrintPageInternal(
blink::WebLocalFrame* frame,
PdfMetafileSkia* metafile,
gfx::Size* page_size_in_dpi,
- gfx::Rect* content_area_in_dpi) {
+ gfx::Rect* content_area_in_dpi,
+ gfx::Rect* printable_area_in_dpi) {
PageSizeMargins page_layout_in_points;
double css_scale_factor = 1.0f;
@@ -1865,6 +1867,9 @@ void PrintWebViewHelper::PrintPageInternal(
*content_area_in_dpi =
gfx::Rect(0, 0, page_size_in_dpi->width(), page_size_in_dpi->height());
}
+ if (printable_area_in_dpi) {
+ *printable_area_in_dpi = printer_printable_area_;
+ }
gfx::Rect canvas_area =
params.params.display_header_footer ? gfx::Rect(page_size) : content_area;
« no previous file with comments | « components/printing/renderer/print_web_view_helper.h ('k') | components/printing/renderer/print_web_view_helper_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698