Chromium Code Reviews| Index: chrome/renderer/print_web_view_helper.h |
| diff --git a/chrome/renderer/print_web_view_helper.h b/chrome/renderer/print_web_view_helper.h |
| index 8b4342dd672b34fe99e3235123da0f9b630870fc..92e62368422aa89ff8df38551ac5daa03efd072f 100644 |
| --- a/chrome/renderer/print_web_view_helper.h |
| +++ b/chrome/renderer/print_web_view_helper.h |
| @@ -27,6 +27,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.. |
| @@ -214,6 +219,7 @@ class PrintWebViewHelper : public RenderViewObserver, |
| void PrintPageInternal(const PrintMsg_PrintPage_Params& params, |
| const gfx::Size& canvas_size, |
| WebKit::WebFrame* frame, |
| + bool is_preview, |
| printing::Metafile* metafile); |
| #else |
| void PrintPageInternal(const PrintMsg_PrintPage_Params& params, |
| @@ -234,7 +240,8 @@ class PrintWebViewHelper : public RenderViewObserver, |
| #elif defined(OS_MACOSX) |
| void RenderPage(const gfx::Size& page_size, const gfx::Rect& content_area, |
| const float& scale_factor, int page_number, int page_slot, |
| - WebKit::WebFrame* frame, printing::Metafile* metafile); |
| + WebKit::WebFrame* frame, bool is_preview, |
| + printing::Metafile* metafile); |
| #elif defined(OS_POSIX) |
| bool RenderPages(const PrintMsg_PrintPages_Params& params, |
| WebKit::WebFrame* frame, WebKit::WebNode* node, |
| @@ -289,6 +296,19 @@ class PrintWebViewHelper : public RenderViewObserver, |
| // for pending preview requests. |
| void PreviewPageRendered(int page_number, printing::Metafile* metafile); |
| +#if defined(USE_SKIA) |
|
vandebo (ex-Chrome)
2011/08/01 21:07:37
nit: put this in the helper section with the other
Aayush Kumar
2011/08/02 00:18:13
Done.
|
| + // 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, |
|
vandebo (ex-Chrome)
2011/08/01 21:07:37
We don't use non-const references, make this const
Aayush Kumar
2011/08/02 00:18:13
Done.
|
| + int page_number, |
| + int total_pages, |
| + float webkit_scale_factor, |
| + const PageSizeMargins& page_layout_in_points, |
| + const base::DictionaryValue& header_footer_info); |
| +#endif // USE_SKIA |
| + |
| WebKit::WebView* print_web_view_; |
| scoped_ptr<PrintMsg_PrintPages_Params> print_pages_params_; |
| @@ -304,6 +324,10 @@ class PrintWebViewHelper : public RenderViewObserver, |
| scoped_ptr<PrintMsg_PrintPages_Params> old_print_pages_params_; |
| + // Contains 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: |