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

Unified Diff: chrome/renderer/print_web_view_helper_win.cc

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_win.cc
diff --git a/chrome/renderer/print_web_view_helper_win.cc b/chrome/renderer/print_web_view_helper_win.cc
index b43c22f6fc85f3d9c69d55abfa9736c119cdb2f8..cb70e4378d7ad033f3443349bca41277aa5fd11b 100644
--- a/chrome/renderer/print_web_view_helper_win.cc
+++ b/chrome/renderer/print_web_view_helper_win.cc
@@ -187,6 +187,15 @@ Metafile* PrintWebViewHelper::RenderPage(
printing::MetafileSkiaWrapper::SetMetafileOnCanvas(canvas.get(), metafile);
float webkit_scale_factor = frame->printPage(page_number, canvas.get());
+
+ if (params.display_header_footer) {
+ // |page_number| is 0-based, so 1 is added.
+ PrintHeaderAndFooter(device, canvas.get(), page_number + 1,
+ print_preview_context_.total_page_count(),
+ webkit_scale_factor, page_layout_in_points,
+ *header_footer_info_);
+ }
+
if (*scale_factor <= 0 || webkit_scale_factor <= 0) {
NOTREACHED() << "Printing page " << page_number << " failed.";
} else {

Powered by Google App Engine
This is Rietveld 408576698