OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/browser/printing/win_printing_context.h" | 5 #include "chrome/browser/printing/win_printing_context.h" |
6 | 6 |
7 #include <winspool.h> | 7 #include <winspool.h> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/gfx/platform_device_win.h" | 10 #include "base/gfx/platform_device_win.h" |
11 #include "base/time_format.h" | 11 #include "base/time_format.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/printing/print_job_manager.h" | 13 #include "chrome/browser/printing/print_job_manager.h" |
14 #include "chrome/common/gfx/emf.h" | |
15 | 14 |
16 namespace { | 15 namespace { |
17 | 16 |
18 // Retrieves the content of a GetPrinter call. | 17 // Retrieves the content of a GetPrinter call. |
19 void GetPrinterHelper(HANDLE printer, int level, scoped_array<uint8>* buffer) { | 18 void GetPrinterHelper(HANDLE printer, int level, scoped_array<uint8>* buffer) { |
20 DWORD buf_size = 0; | 19 DWORD buf_size = 0; |
21 GetPrinter(printer, level, NULL, 0, &buf_size); | 20 GetPrinter(printer, level, NULL, 0, &buf_size); |
22 if (buf_size) { | 21 if (buf_size) { |
23 buffer->reset(new uint8[buf_size]); | 22 buffer->reset(new uint8[buf_size]); |
24 memset(buffer->get(), 0, buf_size); | 23 memset(buffer->get(), 0, buf_size); |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 if (dialog_options.hDevMode != NULL) | 595 if (dialog_options.hDevMode != NULL) |
597 GlobalFree(dialog_options.hDevMode); | 596 GlobalFree(dialog_options.hDevMode); |
598 if (dialog_options.hDevNames != NULL) | 597 if (dialog_options.hDevNames != NULL) |
599 GlobalFree(dialog_options.hDevNames); | 598 GlobalFree(dialog_options.hDevNames); |
600 | 599 |
601 return hdc_ ? OK : FAILED; | 600 return hdc_ ? OK : FAILED; |
602 } | 601 } |
603 | 602 |
604 } // namespace printing | 603 } // namespace printing |
605 | 604 |
OLD | NEW |