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

Unified Diff: chrome/renderer/print_web_view_helper_linux.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_linux.cc
diff --git a/chrome/renderer/print_web_view_helper_linux.cc b/chrome/renderer/print_web_view_helper_linux.cc
index 0915681dfeef3b45a5f3b6a80981eab6f1be89b3..c07f76ba210099cabad39df1fe18997330c659ea 100644
--- a/chrome/renderer/print_web_view_helper_linux.cc
+++ b/chrome/renderer/print_web_view_helper_linux.cc
@@ -209,7 +209,13 @@ void PrintWebViewHelper::PrintPageInternal(
printing::MetafileSkiaWrapper::SetMetafileOnCanvas(canvas.get(), metafile);
frame->printPage(params.page_number, canvas.get());
- // TODO(myhuang): We should render the header and the footer.
+ if (params.params.display_header_footer) {
+ // |page_number| is 0-based, so 1 is added.
+ // The scale factor on Linux is 1.
+ PrintHeaderAndFooter(device, canvas.get(), params.page_number + 1,
+ print_preview_context_.total_page_count(), 1,
+ page_layout_in_points, *header_footer_info_);
+ }
// Done printing. Close the device context to retrieve the compiled metafile.
if (!metafile->FinishPage())

Powered by Google App Engine
This is Rietveld 408576698