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 #include "chrome/renderer/print_web_view_helper.h" | 5 #include "chrome/renderer/print_web_view_helper.h" |
6 | 6 |
7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/scoped_nsautorelease_pool.h" | 10 #include "base/mac/scoped_nsautorelease_pool.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "chrome/common/print_messages.h" | 12 #include "chrome/common/print_messages.h" |
13 #include "printing/metafile.h" | 13 #include "printing/metafile.h" |
14 #include "printing/metafile_impl.h" | 14 #include "printing/metafile_impl.h" |
15 #include "printing/page_size_margins.h" | 15 #include "printing/page_size_margins.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
17 | 17 |
18 #if defined(USE_SKIA) | 18 #if defined(USE_SKIA) |
19 #include "printing/metafile_skia_wrapper.h" | 19 #include "printing/metafile_skia_wrapper.h" |
20 #include "skia/ext/platform_device.h" | 20 #include "skia/ext/platform_device.h" |
21 #include "skia/ext/vector_canvas.h" | 21 #include "skia/ext/vector_canvas.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCanvas.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCanvas.h" |
23 #endif | 23 #endif |
24 | 24 |
25 using WebKit::WebFrame; | 25 using WebKit::WebFrame; |
26 | 26 |
27 void PrintWebViewHelper::PrintPageInternal( | 27 void PrintWebViewHelper::PrintPageInternal( |
28 const PrintMsg_PrintPage_Params& params, | 28 const PrintMsg_PrintPage_Params& params, |
29 const gfx::Size& canvas_size, | 29 const gfx::Size& canvas_size, |
30 WebFrame* frame) { | 30 WebFrame* frame) { |
31 printing::NativeMetafile metafile; | 31 printing::NativeMetafile metafile; |
32 if (!metafile.Init()) | 32 if (!metafile.Init()) |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 print_preview_context_.total_page_count(), | 199 print_preview_context_.total_page_count(), |
200 scale_factor, page_layout_in_points, | 200 scale_factor, page_layout_in_points, |
201 *header_footer_info_); | 201 *header_footer_info_); |
202 } | 202 } |
203 #endif // defined(USE_SKIA) | 203 #endif // defined(USE_SKIA) |
204 } | 204 } |
205 | 205 |
206 // Done printing. Close the device context to retrieve the compiled metafile. | 206 // Done printing. Close the device context to retrieve the compiled metafile. |
207 metafile->FinishPage(); | 207 metafile->FinishPage(); |
208 } | 208 } |
OLD | NEW |