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 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/process_util.h" | 8 #include "base/process_util.h" |
9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
10 #include "chrome/common/render_messages_params.h" | 10 #include "chrome/common/render_messages_params.h" |
11 #include "chrome/renderer/render_view.h" | 11 #include "chrome/renderer/render_view.h" |
12 #include "gfx/gdi_util.h" | |
13 #include "gfx/size.h" | |
14 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
15 #include "printing/native_metafile.h" | 13 #include "printing/native_metafile.h" |
16 #include "printing/units.h" | 14 #include "printing/units.h" |
17 #include "skia/ext/vector_canvas.h" | 15 #include "skia/ext/vector_canvas.h" |
18 #include "skia/ext/vector_platform_device.h" | 16 #include "skia/ext/vector_platform_device.h" |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 18 #include "ui/gfx/gdi_util.h" |
| 19 #include "ui/gfx/size.h" |
20 | 20 |
21 using printing::ConvertUnitDouble; | 21 using printing::ConvertUnitDouble; |
22 using printing::kPointsPerInch; | 22 using printing::kPointsPerInch; |
23 using WebKit::WebFrame; | 23 using WebKit::WebFrame; |
24 using WebKit::WebString; | 24 using WebKit::WebString; |
25 | 25 |
26 int CALLBACK EnhMetaFileProc(HDC dc, | 26 int CALLBACK EnhMetaFileProc(HDC dc, |
27 HANDLETABLE* handle_table, | 27 HANDLETABLE* handle_table, |
28 const ENHMETARECORD *record, | 28 const ENHMETARECORD *record, |
29 int num_objects, | 29 int num_objects, |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 // Copy the bits into shared memory. | 321 // Copy the bits into shared memory. |
322 if (!metafile->GetData(shared_buf.memory(), buf_size)) { | 322 if (!metafile->GetData(shared_buf.memory(), buf_size)) { |
323 NOTREACHED() << "GetData() failed"; | 323 NOTREACHED() << "GetData() failed"; |
324 shared_buf.Unmap(); | 324 shared_buf.Unmap(); |
325 return false; | 325 return false; |
326 } | 326 } |
327 shared_buf.GiveToProcess(base::GetCurrentProcessHandle(), shared_mem_handle); | 327 shared_buf.GiveToProcess(base::GetCurrentProcessHandle(), shared_mem_handle); |
328 shared_buf.Unmap(); | 328 shared_buf.Unmap(); |
329 return true; | 329 return true; |
330 } | 330 } |
OLD | NEW |