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 "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 Loading... |
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 std::string doc_name = |
| 434 printing::SimplifyDocumentTitle(UTF8ToWide(job_title)); |
434 di.lpszDocName = doc_name.c_str(); | 435 di.lpszDocName = doc_name.c_str(); |
435 job_id_ = StartDoc(dc, &di); | 436 job_id_ = StartDoc(dc, &di); |
436 if (job_id_ <= 0) | 437 if (job_id_ <= 0) |
437 return false; | 438 return false; |
438 | 439 |
439 printer_dc_.Set(dc); | 440 printer_dc_.Set(dc); |
440 saved_dc_ = SaveDC(printer_dc_.Get()); | 441 saved_dc_ = SaveDC(printer_dc_.Get()); |
441 print_data_file_path_ = print_data_file_path; | 442 print_data_file_path_ = print_data_file_path; |
442 delegate_ = delegate; | 443 delegate_ = delegate; |
443 RenderNextPDFPages(); | 444 RenderNextPDFPages(); |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string)); | 901 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string)); |
901 return ret; | 902 return ret; |
902 } | 903 } |
903 | 904 |
904 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( | 905 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( |
905 const base::DictionaryValue* print_system_settings) { | 906 const base::DictionaryValue* print_system_settings) { |
906 return new PrintSystemWin; | 907 return new PrintSystemWin; |
907 } | 908 } |
908 | 909 |
909 } // namespace cloud_print | 910 } // namespace cloud_print |
OLD | NEW |