Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: printing/printing_context_win.cc

Issue 10941025: Simplify document title for Windows printing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« printing/backend/win_helper.cc ('K') | « printing/printing.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 // Set the flag used by the AbortPrintJob dialog procedure. 498 // Set the flag used by the AbortPrintJob dialog procedure.
499 abort_printing_ = false; 499 abort_printing_ = false;
500 500
501 in_print_job_ = true; 501 in_print_job_ = true;
502 502
503 // Register the application's AbortProc function with GDI. 503 // Register the application's AbortProc function with GDI.
504 if (SP_ERROR == SetAbortProc(context_, &AbortProc)) 504 if (SP_ERROR == SetAbortProc(context_, &AbortProc))
505 return OnError(); 505 return OnError();
506 506
507 DOCINFO di = { sizeof(DOCINFO) }; 507 DOCINFO di = { sizeof(DOCINFO) };
508 const std::wstring& document_name_wide = UTF16ToWide(document_name); 508 std::wstring title_wide = SimplifyDocumentTitle(UTF16ToWide(document_name));
509 di.lpszDocName = document_name_wide.c_str(); 509 di.lpszDocName = title_wide.c_str();
510 510
511 // Is there a debug dump directory specified? If so, force to print to a file. 511 // Is there a debug dump directory specified? If so, force to print to a file.
512 FilePath debug_dump_path = PrintedDocument::debug_dump_path(); 512 FilePath debug_dump_path = PrintedDocument::debug_dump_path();
513 if (!debug_dump_path.empty()) { 513 if (!debug_dump_path.empty()) {
514 // Create a filename. 514 // Create a filename.
515 std::wstring filename; 515 std::wstring filename;
516 Time now(Time::Now()); 516 Time now(Time::Now());
517 filename = base::TimeFormatShortDateNumeric(now); 517 filename = base::TimeFormatShortDateNumeric(now);
518 filename += L"_"; 518 filename += L"_";
519 filename += base::TimeFormatTimeOfDay(now); 519 filename += base::TimeFormatTimeOfDay(now);
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 if (buf_size) { 818 if (buf_size) {
819 buffer->reset(new uint8[buf_size]); 819 buffer->reset(new uint8[buf_size]);
820 memset(buffer->get(), 0, buf_size); 820 memset(buffer->get(), 0, buf_size);
821 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) { 821 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) {
822 buffer->reset(); 822 buffer->reset();
823 } 823 }
824 } 824 }
825 } 825 }
826 826
827 } // namespace printing 827 } // namespace printing
OLDNEW
« printing/backend/win_helper.cc ('K') | « printing/printing.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698