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 <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 const gfx::Size& canvas_size, | 220 const gfx::Size& canvas_size, |
221 WebKit::WebFrame* frame); | 221 WebKit::WebFrame* frame); |
222 #endif | 222 #endif |
223 | 223 |
224 // Render the frame for printing. | 224 // Render the frame for printing. |
225 bool RenderPagesForPrint(WebKit::WebFrame* frame, WebKit::WebNode* node, | 225 bool RenderPagesForPrint(WebKit::WebFrame* frame, WebKit::WebNode* node, |
226 PrepareFrameAndViewForPrint* prepare); | 226 PrepareFrameAndViewForPrint* prepare); |
227 | 227 |
228 // Platform specific helper function for rendering page(s) to |metafile|. | 228 // Platform specific helper function for rendering page(s) to |metafile|. |
229 #if defined(OS_WIN) | 229 #if defined(OS_WIN) |
230 void RenderPage(const PrintMsg_Print_Params& params, float* scale_factor, | 230 // Because of mixed support for alpha channels on printers, this method may |
231 int page_number, bool is_preview, WebKit::WebFrame* frame, | 231 // need to create a new metafile. The result may be either the passed |
232 scoped_ptr<printing::Metafile>* metafile); | 232 // |metafile| or a new one. In either case, the caller owns both |metafile| |
| 233 // and the result. |
| 234 printing::Metafile* RenderPage(const PrintMsg_Print_Params& params, |
| 235 float* scale_factor, int page_number, |
| 236 bool is_preview, WebKit::WebFrame* frame, |
| 237 printing::Metafile* metafile); |
233 #elif defined(OS_MACOSX) | 238 #elif defined(OS_MACOSX) |
234 void RenderPage(const gfx::Size& page_size, const gfx::Rect& content_area, | 239 void RenderPage(const gfx::Size& page_size, const gfx::Rect& content_area, |
235 const float& scale_factor, int page_number, | 240 const float& scale_factor, int page_number, |
236 WebKit::WebFrame* frame, printing::Metafile* metafile); | 241 WebKit::WebFrame* frame, printing::Metafile* metafile); |
237 #elif defined(OS_POSIX) | 242 #elif defined(OS_POSIX) |
238 bool RenderPages(const PrintMsg_PrintPages_Params& params, | 243 bool RenderPages(const PrintMsg_PrintPages_Params& params, |
239 WebKit::WebFrame* frame, WebKit::WebNode* node, | 244 WebKit::WebFrame* frame, WebKit::WebNode* node, |
240 int* page_count, PrepareFrameAndViewForPrint* prepare, | 245 int* page_count, PrepareFrameAndViewForPrint* prepare, |
241 printing::Metafile* metafile); | 246 printing::Metafile* metafile); |
242 #endif // defined(OS_WIN) | 247 #endif // defined(OS_WIN) |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 | 394 |
390 State state_; | 395 State state_; |
391 }; | 396 }; |
392 | 397 |
393 PrintPreviewContext print_preview_context_; | 398 PrintPreviewContext print_preview_context_; |
394 | 399 |
395 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 400 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
396 }; | 401 }; |
397 | 402 |
398 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 403 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
OLD | NEW |