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

Side by Side Diff: chrome/service/cloud_print/print_system_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
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 "chrome/service/cloud_print/print_system.h" 5 #include "chrome/service/cloud_print/print_system.h"
6 6
7 #include <objidl.h> 7 #include <objidl.h>
8 #include <winspool.h> 8 #include <winspool.h>
9 #include <xpsprint.h> 9 #include <xpsprint.h>
10 10
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 423
424 HDC dc = CreateDC(L"WINSPOOL", UTF8ToWide(printer_name).c_str(), 424 HDC dc = CreateDC(L"WINSPOOL", UTF8ToWide(printer_name).c_str(),
425 NULL, pt_dev_mode.dm_); 425 NULL, pt_dev_mode.dm_);
426 if (!dc) { 426 if (!dc) {
427 NOTREACHED(); 427 NOTREACHED();
428 return false; 428 return false;
429 } 429 }
430 hr = E_FAIL; 430 hr = E_FAIL;
431 DOCINFO di = {0}; 431 DOCINFO di = {0};
432 di.cbSize = sizeof(DOCINFO); 432 di.cbSize = sizeof(DOCINFO);
433 std::wstring doc_name = UTF8ToWide(job_title); 433 string16 doc_name = UTF8ToUTF16(job_title);
434 DCHECK(printing::PrintBackend::SimplifyDocumentTitle(doc_name) ==
435 doc_name);
434 di.lpszDocName = doc_name.c_str(); 436 di.lpszDocName = doc_name.c_str();
435 job_id_ = StartDoc(dc, &di); 437 job_id_ = StartDoc(dc, &di);
436 if (job_id_ <= 0) 438 if (job_id_ <= 0)
437 return false; 439 return false;
438 440
439 printer_dc_.Set(dc); 441 printer_dc_.Set(dc);
440 saved_dc_ = SaveDC(printer_dc_.Get()); 442 saved_dc_ = SaveDC(printer_dc_.Get());
441 print_data_file_path_ = print_data_file_path; 443 print_data_file_path_ = print_data_file_path;
442 delegate_ = delegate; 444 delegate_ = delegate;
443 RenderNextPDFPages(); 445 RenderNextPDFPages();
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string)); 902 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string));
901 return ret; 903 return ret;
902 } 904 }
903 905
904 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( 906 scoped_refptr<PrintSystem> PrintSystem::CreateInstance(
905 const base::DictionaryValue* print_system_settings) { 907 const base::DictionaryValue* print_system_settings) {
906 return new PrintSystemWin; 908 return new PrintSystemWin;
907 } 909 }
908 910
909 } // namespace cloud_print 911 } // namespace cloud_print
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_job_worker.cc ('k') | chrome/service/cloud_print/printer_job_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698