| 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 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 Loading... |
| 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 |
| OLD | NEW |