diff options
author | aayushkumar@chromium.org <aayushkumar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-17 22:04:58 +0000 |
---|---|---|
committer | aayushkumar@chromium.org <aayushkumar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-17 22:04:58 +0000 |
commit | 540ac80c83db3f4865d007288a4f1b8524e0aa86 (patch) | |
tree | 949f85a92cd501baef2827c063e3476ae27bb97c /chrome/renderer/print_web_view_helper_mac.mm | |
parent | 6895bf926cba01ef455bb7327703aa5378a46488 (diff) | |
download | chromium_src-540ac80c83db3f4865d007288a4f1b8524e0aa86.zip chromium_src-540ac80c83db3f4865d007288a4f1b8524e0aa86.tar.gz chromium_src-540ac80c83db3f4865d007288a4f1b8524e0aa86.tar.bz2 |
Added Header and Footer support in Linux, Windows and Mac for Skia
BUG=67514
TEST=
In the preview tab, note added options for printing headers and footers. Toggle with the checkbox and ensure that the correct headers and footers are displayed.
Review URL: http://codereview.chromium.org/7348010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97219 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/print_web_view_helper_mac.mm')
-rw-r--r-- | chrome/renderer/print_web_view_helper_mac.mm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/renderer/print_web_view_helper_mac.mm b/chrome/renderer/print_web_view_helper_mac.mm index 95ccb7e..b6d28cb 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. |