| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 5 #ifndef CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| 6 #define CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 6 #define CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 const WebKit::WebNode& node, | 184 const WebKit::WebNode& node, |
| 185 int expected_pages_count, | 185 int expected_pages_count, |
| 186 bool use_browser_overlays); | 186 bool use_browser_overlays); |
| 187 | 187 |
| 188 // Page Printing / Rendering ------------------------------------------------ | 188 // Page Printing / Rendering ------------------------------------------------ |
| 189 | 189 |
| 190 // Prints all the pages listed in |params|. | 190 // Prints all the pages listed in |params|. |
| 191 // It will implicitly revert the document to display CSS media type. | 191 // It will implicitly revert the document to display CSS media type. |
| 192 bool PrintPages(const PrintMsg_PrintPages_Params& params, | 192 bool PrintPages(const PrintMsg_PrintPages_Params& params, |
| 193 WebKit::WebFrame* frame, | 193 WebKit::WebFrame* frame, |
| 194 const WebKit::WebNode& node, | 194 const WebKit::WebNode& node); |
| 195 PrepareFrameAndViewForPrint* prepare); | |
| 196 | 195 |
| 197 // Prints the page listed in |params|. | 196 // Prints the page listed in |params|. |
| 198 #if defined(USE_X11) | 197 #if defined(USE_X11) |
| 199 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, | 198 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, |
| 200 const gfx::Size& canvas_size, | 199 const gfx::Size& canvas_size, |
| 201 WebKit::WebFrame* frame, | 200 WebKit::WebFrame* frame, |
| 202 printing::Metafile* metafile); | 201 printing::Metafile* metafile); |
| 203 #else | 202 #else |
| 204 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, | 203 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, |
| 205 const gfx::Size& canvas_size, | 204 const gfx::Size& canvas_size, |
| 206 WebKit::WebFrame* frame); | 205 WebKit::WebFrame* frame); |
| 207 #endif | 206 #endif |
| 208 | 207 |
| 209 // Render the frame for printing. | 208 // Render the frame for printing. |
| 210 bool RenderPagesForPrint(WebKit::WebFrame* frame, const WebKit::WebNode& node, | 209 bool RenderPagesForPrint(WebKit::WebFrame* frame, |
| 211 PrepareFrameAndViewForPrint* prepare); | 210 const WebKit::WebNode& node); |
| 212 | 211 |
| 213 // Platform specific helper function for rendering page(s) to |metafile|. | 212 // Platform specific helper function for rendering page(s) to |metafile|. |
| 214 #if defined(OS_WIN) | 213 #if defined(OS_WIN) |
| 215 // Because of mixed support for alpha channels on printers, this method may | 214 // Because of mixed support for alpha channels on printers, this method may |
| 216 // need to create a new metafile. The result may be either the passed | 215 // need to create a new metafile. The result may be either the passed |
| 217 // |metafile| or a new one. In either case, the caller owns both |metafile| | 216 // |metafile| or a new one. In either case, the caller owns both |metafile| |
| 218 // and the result. | 217 // and the result. |
| 219 printing::Metafile* RenderPage(const PrintMsg_Print_Params& params, | 218 printing::Metafile* RenderPage(const PrintMsg_Print_Params& params, |
| 220 float* scale_factor, int page_number, | 219 float* scale_factor, int page_number, |
| 221 bool is_preview, WebKit::WebFrame* frame, | 220 bool is_preview, WebKit::WebFrame* frame, |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 | 423 |
| 425 State state_; | 424 State state_; |
| 426 }; | 425 }; |
| 427 | 426 |
| 428 PrintPreviewContext print_preview_context_; | 427 PrintPreviewContext print_preview_context_; |
| 429 | 428 |
| 430 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 429 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
| 431 }; | 430 }; |
| 432 | 431 |
| 433 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 432 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| OLD | NEW |