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

Unified Diff: chrome/renderer/print_web_view_helper_mac.mm

Issue 7348010: Added Header and Footer support using Skia (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added SK_API to vector platform device skia Created 9 years, 4 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: chrome/renderer/print_web_view_helper_mac.mm
diff --git a/chrome/renderer/print_web_view_helper_mac.mm b/chrome/renderer/print_web_view_helper_mac.mm
index 95ccb7e69bf215ae5c209aa90778ffbca79b6649..b6d28cbb5952d45d1089dff949662f5ae2895b6e 100644
--- a/chrome/renderer/print_web_view_helper_mac.mm
+++ b/chrome/renderer/print_web_view_helper_mac.mm
@@ -148,6 +148,20 @@ void PrintWebViewHelper::RenderPage(
CGContextRef canvasPtr = cgContext;
#endif
frame->printPage(page_number, canvasPtr);
+#if defined(USE_SKIA)
+ const PrintMsg_Print_Params& printParams =
+ print_preview_context_.print_params();
+ if (printParams.display_header_footer) {
+ PageSizeMargins page_layout_in_points;
+ GetPageSizeAndMarginsInPoints(frame, page_number, printParams,
+ &page_layout_in_points);
+ // |page_number| is 0-based, so 1 is added.
+ PrintHeaderAndFooter(device, canvas.get(), page_number + 1,
+ print_preview_context_.total_page_count(),
+ scale_factor, page_layout_in_points,
+ *header_footer_info_);
+ }
+#endif // defined(USE_SKIA)
}
// Done printing. Close the device context to retrieve the compiled metafile.

Powered by Google App Engine
This is Rietveld 408576698