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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 filename += L"_"; | 471 filename += L"_"; |
472 filename += UTF16ToWide(document_name); | 472 filename += UTF16ToWide(document_name); |
473 filename += L"_"; | 473 filename += L"_"; |
474 filename += L"buffer.prn"; | 474 filename += L"buffer.prn"; |
475 file_util::ReplaceIllegalCharactersInPath(&filename, '_'); | 475 file_util::ReplaceIllegalCharactersInPath(&filename, '_'); |
476 debug_dump_path.Append(filename); | 476 debug_dump_path.Append(filename); |
477 di.lpszOutput = debug_dump_path.value().c_str(); | 477 di.lpszOutput = debug_dump_path.value().c_str(); |
478 } | 478 } |
479 | 479 |
480 // No message loop running in unit tests. | 480 // No message loop running in unit tests. |
481 DCHECK(!MessageLoop::current() ? true : | 481 DCHECK(!base::MessageLoop::current() || |
482 !MessageLoop::current()->NestableTasksAllowed()); | 482 !base::MessageLoop::current()->NestableTasksAllowed()); |
483 | 483 |
484 // Begin a print job by calling the StartDoc function. | 484 // Begin a print job by calling the StartDoc function. |
485 // NOTE: StartDoc() starts a message loop. That causes a lot of problems with | 485 // NOTE: StartDoc() starts a message loop. That causes a lot of problems with |
486 // IPC. Make sure recursive task processing is disabled. | 486 // IPC. Make sure recursive task processing is disabled. |
487 if (StartDoc(context_, &di) <= 0) | 487 if (StartDoc(context_, &di) <= 0) |
488 return OnError(); | 488 return OnError(); |
489 | 489 |
490 return OK; | 490 return OK; |
491 } | 491 } |
492 | 492 |
(...skipping 260 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 |