OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/process/process_handle.h" | 9 #include "base/process/process_handle.h" |
10 #include "chrome/common/print_messages.h" | 10 #include "chrome/common/print_messages.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 skia::RefPtr<skia::VectorCanvas> canvas = | 195 skia::RefPtr<skia::VectorCanvas> canvas = |
196 skia::AdoptRef(new skia::VectorCanvas(device)); | 196 skia::AdoptRef(new skia::VectorCanvas(device)); |
197 MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); | 197 MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); |
198 skia::SetIsDraftMode(*canvas, is_print_ready_metafile_sent_); | 198 skia::SetIsDraftMode(*canvas, is_print_ready_metafile_sent_); |
199 | 199 |
200 if (params.params.display_header_footer) { | 200 if (params.params.display_header_footer) { |
201 // |page_number| is 0-based, so 1 is added. | 201 // |page_number| is 0-based, so 1 is added. |
202 PrintHeaderAndFooter(canvas.get(), | 202 PrintHeaderAndFooter(canvas.get(), |
203 params.page_number + 1, | 203 params.page_number + 1, |
204 print_preview_context_.total_page_count(), | 204 print_preview_context_.total_page_count(), |
| 205 *frame, |
205 scale_factor, | 206 scale_factor, |
206 page_layout_in_points, | 207 page_layout_in_points, |
207 *header_footer_info_, | |
208 params.params); | 208 params.params); |
209 } | 209 } |
210 | 210 |
211 float webkit_scale_factor = RenderPageContent(frame, | 211 float webkit_scale_factor = RenderPageContent(frame, |
212 params.page_number, | 212 params.page_number, |
213 canvas_area, | 213 canvas_area, |
214 content_area, | 214 content_area, |
215 scale_factor, | 215 scale_factor, |
216 canvas.get()); | 216 canvas.get()); |
217 DCHECK_GT(webkit_scale_factor, 0.0f); | 217 DCHECK_GT(webkit_scale_factor, 0.0f); |
(...skipping 20 matching lines...) Expand all Loading... |
238 } | 238 } |
239 shared_buf.GiveToProcess(base::GetCurrentProcessHandle(), shared_mem_handle); | 239 shared_buf.GiveToProcess(base::GetCurrentProcessHandle(), shared_mem_handle); |
240 shared_buf.Unmap(); | 240 shared_buf.Unmap(); |
241 | 241 |
242 Send(new PrintHostMsg_DuplicateSection(routing_id(), *shared_mem_handle, | 242 Send(new PrintHostMsg_DuplicateSection(routing_id(), *shared_mem_handle, |
243 shared_mem_handle)); | 243 shared_mem_handle)); |
244 return true; | 244 return true; |
245 } | 245 } |
246 | 246 |
247 } // namespace printing | 247 } // namespace printing |
OLD | NEW |