| 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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 ULONG print_bytes_written = 0; | 633 ULONG print_bytes_written = 0; |
| 634 if (FAILED(print_ticket_stream->Write(print_ticket.c_str(), | 634 if (FAILED(print_ticket_stream->Write(print_ticket.c_str(), |
| 635 print_ticket.length(), | 635 print_ticket.length(), |
| 636 &print_bytes_written))) | 636 &print_bytes_written))) |
| 637 return false; | 637 return false; |
| 638 DCHECK_EQ(print_ticket.length(), print_bytes_written); | 638 DCHECK_EQ(print_ticket.length(), print_bytes_written); |
| 639 if (FAILED(print_ticket_stream->Close())) | 639 if (FAILED(print_ticket_stream->Close())) |
| 640 return false; | 640 return false; |
| 641 | 641 |
| 642 std::string document_data; | 642 std::string document_data; |
| 643 file_util::ReadFileToString(print_data_file_path, &document_data); | 643 base::ReadFileToString(print_data_file_path, &document_data); |
| 644 ULONG doc_bytes_written = 0; | 644 ULONG doc_bytes_written = 0; |
| 645 if (FAILED(doc_stream->Write(document_data.c_str(), | 645 if (FAILED(doc_stream->Write(document_data.c_str(), |
| 646 document_data.length(), | 646 document_data.length(), |
| 647 &doc_bytes_written))) | 647 &doc_bytes_written))) |
| 648 return false; | 648 return false; |
| 649 DCHECK_EQ(document_data.length(), doc_bytes_written); | 649 DCHECK_EQ(document_data.length(), doc_bytes_written); |
| 650 if (FAILED(doc_stream->Close())) | 650 if (FAILED(doc_stream->Close())) |
| 651 return false; | 651 return false; |
| 652 | 652 |
| 653 job_progress_watcher_.StartWatching(job_progress_event_.Get(), this); | 653 job_progress_watcher_.StartWatching(job_progress_event_.Get(), this); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 return "application/pdf"; | 897 return "application/pdf"; |
| 898 } | 898 } |
| 899 | 899 |
| 900 | 900 |
| 901 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( | 901 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( |
| 902 const base::DictionaryValue* print_system_settings) { | 902 const base::DictionaryValue* print_system_settings) { |
| 903 return new PrintSystemWin; | 903 return new PrintSystemWin; |
| 904 } | 904 } |
| 905 | 905 |
| 906 } // namespace cloud_print | 906 } // namespace cloud_print |
| OLD | NEW |