| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 const gfx::Size& canvas_size, | 262 const gfx::Size& canvas_size, |
| 263 WebKit::WebFrame* frame); | 263 WebKit::WebFrame* frame); |
| 264 #endif | 264 #endif |
| 265 | 265 |
| 266 // Render the frame for printing. | 266 // Render the frame for printing. |
| 267 bool RenderPagesForPrint(WebKit::WebFrame* frame, | 267 bool RenderPagesForPrint(WebKit::WebFrame* frame, |
| 268 const WebKit::WebNode& node); | 268 const WebKit::WebNode& node); |
| 269 | 269 |
| 270 // Platform specific helper function for rendering page(s) to |metafile|. | 270 // Platform specific helper function for rendering page(s) to |metafile|. |
| 271 #if defined(OS_WIN) | 271 #if defined(OS_WIN) |
| 272 // Because of mixed support for alpha channels on printers, this method may | 272 void RenderPage(const PrintMsg_Print_Params& params, |
| 273 // need to create a new metafile. The result may be either the passed | 273 int page_number, |
| 274 // |metafile| or a new one. In either case, the caller owns both |metafile| | 274 WebKit::WebFrame* frame, |
| 275 // and the result. | 275 bool is_preview, |
| 276 printing::Metafile* RenderPage(const PrintMsg_Print_Params& params, | 276 printing::Metafile* metafile, |
| 277 int page_number, | 277 double* scale_factor, |
| 278 WebKit::WebFrame* frame, | 278 gfx::Size* page_size_in_dpi, |
| 279 bool is_preview, | 279 gfx::Rect* content_area_in_dpi); |
| 280 printing::Metafile* metafile, | |
| 281 double* scale_factor, | |
| 282 gfx::Size* page_size_in_dpi, | |
| 283 gfx::Rect* content_area_in_dpi); | |
| 284 #elif defined(OS_MACOSX) | 280 #elif defined(OS_MACOSX) |
| 285 void RenderPage(const PrintMsg_Print_Params& params, int page_number, | 281 void RenderPage(const PrintMsg_Print_Params& params, int page_number, |
| 286 WebKit::WebFrame* frame, bool is_preview, | 282 WebKit::WebFrame* frame, bool is_preview, |
| 287 printing::Metafile* metafile, gfx::Size* page_size, | 283 printing::Metafile* metafile, gfx::Size* page_size, |
| 288 gfx::Rect* content_rect); | 284 gfx::Rect* content_rect); |
| 289 #elif defined(OS_POSIX) | 285 #elif defined(OS_POSIX) |
| 290 bool RenderPages(const PrintMsg_PrintPages_Params& params, | 286 bool RenderPages(const PrintMsg_PrintPages_Params& params, |
| 291 WebKit::WebFrame* frame, const WebKit::WebNode& node, | 287 WebKit::WebFrame* frame, const WebKit::WebNode& node, |
| 292 int* page_count, PrepareFrameAndViewForPrint* prepare, | 288 int* page_count, PrepareFrameAndViewForPrint* prepare, |
| 293 printing::Metafile* metafile); | 289 printing::Metafile* metafile); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 enum PrintPreviewErrorBuckets error_; | 480 enum PrintPreviewErrorBuckets error_; |
| 485 | 481 |
| 486 State state_; | 482 State state_; |
| 487 }; | 483 }; |
| 488 | 484 |
| 489 PrintPreviewContext print_preview_context_; | 485 PrintPreviewContext print_preview_context_; |
| 490 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 486 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
| 491 }; | 487 }; |
| 492 | 488 |
| 493 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 489 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| OLD | NEW |