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 #include "chrome/renderer/printing/print_web_view_helper.h" | 5 #include "chrome/renderer/printing/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" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 if (!device) | 123 if (!device) |
124 return; | 124 return; |
125 | 125 |
126 skia::RefPtr<skia::VectorCanvas> canvas = | 126 skia::RefPtr<skia::VectorCanvas> canvas = |
127 skia::AdoptRef(new skia::VectorCanvas(device)); | 127 skia::AdoptRef(new skia::VectorCanvas(device)); |
128 blink::WebCanvas* canvas_ptr = canvas.get(); | 128 blink::WebCanvas* canvas_ptr = canvas.get(); |
129 MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); | 129 MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); |
130 skia::SetIsDraftMode(*canvas, is_print_ready_metafile_sent_); | 130 skia::SetIsDraftMode(*canvas, is_print_ready_metafile_sent_); |
131 skia::SetIsPreviewMetafile(*canvas, is_preview); | 131 skia::SetIsPreviewMetafile(*canvas, is_preview); |
132 | 132 |
133 if (print_pages_params_->params.display_header_footer) { | 133 if (params.display_header_footer) { |
134 PrintHeaderAndFooter(canvas_ptr, page_number + 1, | 134 PrintHeaderAndFooter(canvas_ptr, |
| 135 page_number + 1, |
135 print_preview_context_.total_page_count(), | 136 print_preview_context_.total_page_count(), |
136 scale_factor, page_layout_in_points, | 137 *frame, |
137 *header_footer_info_, params); | 138 scale_factor, |
| 139 page_layout_in_points, |
| 140 params); |
138 } | 141 } |
139 RenderPageContent(frame, page_number, canvas_area, content_area, | 142 RenderPageContent(frame, page_number, canvas_area, content_area, |
140 scale_factor, canvas_ptr); | 143 scale_factor, canvas_ptr); |
141 } | 144 } |
142 | 145 |
143 // Done printing. Close the device context to retrieve the compiled metafile. | 146 // Done printing. Close the device context to retrieve the compiled metafile. |
144 metafile->FinishPage(); | 147 metafile->FinishPage(); |
145 } | 148 } |
146 | 149 |
147 } // namespace printing | 150 } // namespace printing |
OLD | NEW |