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 |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 // Register the application's AbortProc function with GDI. | 453 // Register the application's AbortProc function with GDI. |
454 if (SP_ERROR == SetAbortProc(context_, &AbortProc)) | 454 if (SP_ERROR == SetAbortProc(context_, &AbortProc)) |
455 return OnError(); | 455 return OnError(); |
456 | 456 |
457 DCHECK(PrintBackend::SimplifyDocumentTitle(document_name) == document_name); | 457 DCHECK(PrintBackend::SimplifyDocumentTitle(document_name) == document_name); |
458 DOCINFO di = { sizeof(DOCINFO) }; | 458 DOCINFO di = { sizeof(DOCINFO) }; |
459 const std::wstring& document_name_wide = UTF16ToWide(document_name); | 459 const std::wstring& document_name_wide = UTF16ToWide(document_name); |
460 di.lpszDocName = document_name_wide.c_str(); | 460 di.lpszDocName = document_name_wide.c_str(); |
461 | 461 |
462 // Is there a debug dump directory specified? If so, force to print to a file. | 462 // Is there a debug dump directory specified? If so, force to print to a file. |
463 FilePath debug_dump_path = PrintedDocument::debug_dump_path(); | 463 base::FilePath debug_dump_path = PrintedDocument::debug_dump_path(); |
464 if (!debug_dump_path.empty()) { | 464 if (!debug_dump_path.empty()) { |
465 // Create a filename. | 465 // Create a filename. |
466 std::wstring filename; | 466 std::wstring filename; |
467 Time now(Time::Now()); | 467 Time now(Time::Now()); |
468 filename = base::TimeFormatShortDateNumeric(now); | 468 filename = base::TimeFormatShortDateNumeric(now); |
469 filename += L"_"; | 469 filename += L"_"; |
470 filename += base::TimeFormatTimeOfDay(now); | 470 filename += base::TimeFormatTimeOfDay(now); |
471 filename += L"_"; | 471 filename += L"_"; |
472 filename += UTF16ToWide(document_name); | 472 filename += UTF16ToWide(document_name); |
473 filename += L"_"; | 473 filename += L"_"; |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 | 753 |
754 if (dialog_options.hDevMode != NULL) | 754 if (dialog_options.hDevMode != NULL) |
755 GlobalFree(dialog_options.hDevMode); | 755 GlobalFree(dialog_options.hDevMode); |
756 if (dialog_options.hDevNames != NULL) | 756 if (dialog_options.hDevNames != NULL) |
757 GlobalFree(dialog_options.hDevNames); | 757 GlobalFree(dialog_options.hDevNames); |
758 | 758 |
759 return context_ ? OK : FAILED; | 759 return context_ ? OK : FAILED; |
760 } | 760 } |
761 | 761 |
762 } // namespace printing | 762 } // namespace printing |
OLD | NEW |