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 "printing/printing_context_win.h" | 5 #include "printing/printing_context_win.h" |
6 | 6 |
7 #include <winspool.h> | 7 #include <winspool.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
11 #include "base/i18n/file_util_icu.h" | 11 #include "base/i18n/file_util_icu.h" |
12 #include "base/i18n/time_formatting.h" | 12 #include "base/i18n/time_formatting.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 #include "base/values.h" | 17 #include "base/values.h" |
18 #include "base/win/metro.h" | 18 #include "base/win/metro.h" |
19 #include "printing/backend/print_backend.h" | 19 #include "printing/backend/print_backend.h" |
20 #include "printing/backend/printing_info_win.h" | 20 #include "printing/backend/printing_info_win.h" |
21 #include "printing/backend/win_helper.h" | 21 #include "printing/backend/win_helper.h" |
22 #include "printing/print_job_constants.h" | 22 #include "printing/print_job_constants.h" |
23 #include "printing/print_settings_initializer_win.h" | 23 #include "printing/print_settings_initializer_win.h" |
24 #include "printing/printed_document.h" | 24 #include "printing/printed_document.h" |
| 25 #include "printing/printing_utils.h" |
25 #include "printing/units.h" | 26 #include "printing/units.h" |
26 #include "skia/ext/platform_device.h" | 27 #include "skia/ext/platform_device.h" |
27 #include "win8/util/win8_util.h" | 28 #include "win8/util/win8_util.h" |
28 | 29 |
29 #if defined(USE_AURA) | 30 #if defined(USE_AURA) |
30 #include "ui/aura/remote_root_window_host_win.h" | 31 #include "ui/aura/remote_root_window_host_win.h" |
31 #include "ui/aura/root_window.h" | 32 #include "ui/aura/root_window.h" |
32 #include "ui/aura/window.h" | 33 #include "ui/aura/window.h" |
33 #endif | 34 #endif |
34 | 35 |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 | 425 |
425 // Set the flag used by the AbortPrintJob dialog procedure. | 426 // Set the flag used by the AbortPrintJob dialog procedure. |
426 abort_printing_ = false; | 427 abort_printing_ = false; |
427 | 428 |
428 in_print_job_ = true; | 429 in_print_job_ = true; |
429 | 430 |
430 // Register the application's AbortProc function with GDI. | 431 // Register the application's AbortProc function with GDI. |
431 if (SP_ERROR == SetAbortProc(context_, &AbortProc)) | 432 if (SP_ERROR == SetAbortProc(context_, &AbortProc)) |
432 return OnError(); | 433 return OnError(); |
433 | 434 |
434 DCHECK(PrintBackend::SimplifyDocumentTitle(document_name) == document_name); | 435 DCHECK(SimplifyDocumentTitle(document_name) == document_name); |
435 DOCINFO di = { sizeof(DOCINFO) }; | 436 DOCINFO di = { sizeof(DOCINFO) }; |
436 const std::wstring& document_name_wide = UTF16ToWide(document_name); | 437 const std::wstring& document_name_wide = UTF16ToWide(document_name); |
437 di.lpszDocName = document_name_wide.c_str(); | 438 di.lpszDocName = document_name_wide.c_str(); |
438 | 439 |
439 // Is there a debug dump directory specified? If so, force to print to a file. | 440 // Is there a debug dump directory specified? If so, force to print to a file. |
440 base::FilePath debug_dump_path = PrintedDocument::debug_dump_path(); | 441 base::FilePath debug_dump_path = PrintedDocument::debug_dump_path(); |
441 if (!debug_dump_path.empty()) { | 442 if (!debug_dump_path.empty()) { |
442 // Create a filename. | 443 // Create a filename. |
443 std::wstring filename; | 444 std::wstring filename; |
444 Time now(Time::Now()); | 445 Time now(Time::Now()); |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 | 742 |
742 if (dialog_options.hDevMode != NULL) | 743 if (dialog_options.hDevMode != NULL) |
743 GlobalFree(dialog_options.hDevMode); | 744 GlobalFree(dialog_options.hDevMode); |
744 if (dialog_options.hDevNames != NULL) | 745 if (dialog_options.hDevNames != NULL) |
745 GlobalFree(dialog_options.hDevNames); | 746 GlobalFree(dialog_options.hDevNames); |
746 | 747 |
747 return context_ ? OK : FAILED; | 748 return context_ ? OK : FAILED; |
748 } | 749 } |
749 | 750 |
750 } // namespace printing | 751 } // namespace printing |
OLD | NEW |