summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/print_web_view_helper.h
diff options
context:
space:
mode:
authoraayushkumar@chromium.org <aayushkumar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-17 22:04:58 +0000
committeraayushkumar@chromium.org <aayushkumar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-17 22:04:58 +0000
commit540ac80c83db3f4865d007288a4f1b8524e0aa86 (patch)
tree949f85a92cd501baef2827c063e3476ae27bb97c /chrome/renderer/print_web_view_helper.h
parent6895bf926cba01ef455bb7327703aa5378a46488 (diff)
downloadchromium_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.h')
-rw-r--r--chrome/renderer/print_web_view_helper.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/renderer/print_web_view_helper.h b/chrome/renderer/print_web_view_helper.h
index 0407c85..cc04bd3 100644
--- a/chrome/renderer/print_web_view_helper.h
+++ b/chrome/renderer/print_web_view_helper.h
@@ -28,6 +28,11 @@ struct PrintMsg_PrintPages_Params;
namespace base {
class DictionaryValue;
}
+#if defined(USE_SKIA)
+namespace skia {
+class VectorCanvas;
+}
+#endif
// Class that calls the Begin and End print functions on the frame and changes
// the size of the view temporarily to support full page printing..
@@ -266,6 +271,19 @@ class PrintWebViewHelper : public RenderViewObserver,
PrepareFrameAndViewForPrint* prepare,
PrintMsg_Print_Params* params);
+#if defined(USE_SKIA)
+ // Given the |device| and |canvas| to draw on, prints the appropriate headers
+ // and footers using strings from |header_footer_info| on to the canvas.
+ static void PrintHeaderAndFooter(
+ SkDevice* device,
+ skia::VectorCanvas* canvas,
+ int page_number,
+ int total_pages,
+ float webkit_scale_factor,
+ const PageSizeMargins& page_layout_in_points,
+ const base::DictionaryValue& header_footer_info);
+#endif // defined(USE_SKIA)
+
bool GetPrintFrame(WebKit::WebFrame** frame);
// This reports the current time - |start_time| as the time to render a page.
@@ -309,6 +327,10 @@ class PrintWebViewHelper : public RenderViewObserver,
scoped_ptr<PrintMsg_PrintPages_Params> old_print_pages_params_;
+ // Strings generated by the browser process to be printed as headers and
+ // footers if requested by the user.
+ scoped_ptr<base::DictionaryValue> header_footer_info_;
+
// Keeps track of the state of print preview between messages.
class PrintPreviewContext {
public: