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