| 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 c9d8f38f760d62a07d0485c7312a2a300f5b253a..544bec3c00f637900b896cbdc70e75e9718daf57 100644
|
| --- a/chrome/renderer/print_web_view_helper_linux.cc
|
| +++ b/chrome/renderer/print_web_view_helper_linux.cc
|
| @@ -157,6 +157,7 @@ bool PrintWebViewHelper::RenderPages(const PrintMsg_PrintPages_Params& params,
|
| PrintMsg_PrintPage_Params page_params;
|
| page_params.params = print_params;
|
| const gfx::Size& canvas_size = prepare->GetPrintCanvasSize();
|
| + page_params.params.display_header_footer = false;
|
| if (params.pages.empty()) {
|
| for (int i = 0; i < *page_count; ++i) {
|
| page_params.page_number = i;
|
| @@ -209,7 +210,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())
|
|
|