| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(_WIN32_WINNT) | 9 #if defined(_WIN32_WINNT) |
| 10 #undef _WIN32_WINNT | 10 #undef _WIN32_WINNT |
| 11 #endif // defined(_WIN32_WINNT) | 11 #endif // defined(_WIN32_WINNT) |
| 12 #define _WIN32_WINNT _WIN32_WINNT_WIN7 | 12 #define _WIN32_WINNT _WIN32_WINNT_WIN7 |
| 13 #include <xpsprint.h> | 13 #include <xpsprint.h> |
| 14 | 14 |
| 15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
| 16 #include "base/file_util.h" | 16 #include "base/file_util.h" |
| 17 #include "base/scoped_ptr.h" | 17 #include "base/scoped_ptr.h" |
| 18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
| 19 #include "base/win/object_watcher.h" | 19 #include "base/win/object_watcher.h" |
| 20 #include "base/win/scoped_bstr.h" | 20 #include "base/win/scoped_bstr.h" |
| 21 #include "base/win/scoped_comptr.h" | 21 #include "base/win/scoped_comptr.h" |
| 22 #include "base/win/scoped_hdc.h" | 22 #include "base/win/scoped_hdc.h" |
| 23 #include "chrome/service/service_process.h" | 23 #include "chrome/service/service_process.h" |
| 24 #include "chrome/service/service_utility_process_host.h" | 24 #include "chrome/service/service_utility_process_host.h" |
| 25 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
| 26 #include "printing/backend/print_backend.h" | 26 #include "printing/backend/print_backend.h" |
| 27 #include "printing/backend/print_backend_consts.h" | 27 #include "printing/backend/print_backend_consts.h" |
| 28 #include "printing/backend/win_helper.h" | 28 #include "printing/backend/win_helper.h" |
| 29 #include "printing/native_metafile.h" | 29 #include "printing/emf_win.h" |
| 30 #include "printing/page_range.h" | 30 #include "printing/page_range.h" |
| 31 #include "ui/base/l10n/l10n_util.h" | 31 #include "ui/base/l10n/l10n_util.h" |
| 32 #include "ui/gfx/rect.h" | 32 #include "ui/gfx/rect.h" |
| 33 | 33 |
| 34 using base::win::ScopedBstr; | 34 using base::win::ScopedBstr; |
| 35 using base::win::ScopedComPtr; | 35 using base::win::ScopedComPtr; |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 class DevMode { | 39 class DevMode { |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 return ret; | 441 return ret; |
| 442 } else { | 442 } else { |
| 443 NOTREACHED(); | 443 NOTREACHED(); |
| 444 return false; | 444 return false; |
| 445 } | 445 } |
| 446 return true; | 446 return true; |
| 447 } | 447 } |
| 448 | 448 |
| 449 // ServiceUtilityProcessHost::Client implementation. | 449 // ServiceUtilityProcessHost::Client implementation. |
| 450 virtual void OnRenderPDFPagesToMetafileSucceeded( | 450 virtual void OnRenderPDFPagesToMetafileSucceeded( |
| 451 const printing::NativeMetafile& metafile, | 451 const printing::Emf& metafile, |
| 452 int highest_rendered_page_number) { | 452 int highest_rendered_page_number) { |
| 453 metafile.SafePlayback(printer_dc_.Get()); | 453 metafile.SafePlayback(printer_dc_.Get()); |
| 454 bool done_printing = (highest_rendered_page_number != | 454 bool done_printing = (highest_rendered_page_number != |
| 455 last_page_printed_ + kPageCountPerBatch); | 455 last_page_printed_ + kPageCountPerBatch); |
| 456 last_page_printed_ = highest_rendered_page_number; | 456 last_page_printed_ = highest_rendered_page_number; |
| 457 if (done_printing) | 457 if (done_printing) |
| 458 PrintJobDone(); | 458 PrintJobDone(); |
| 459 else | 459 else |
| 460 RenderNextPDFPages(); | 460 RenderNextPDFPages(); |
| 461 } | 461 } |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string)); | 863 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string)); |
| 864 return ret; | 864 return ret; |
| 865 } | 865 } |
| 866 | 866 |
| 867 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( | 867 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( |
| 868 const DictionaryValue* print_system_settings) { | 868 const DictionaryValue* print_system_settings) { |
| 869 return new PrintSystemWin; | 869 return new PrintSystemWin; |
| 870 } | 870 } |
| 871 | 871 |
| 872 } // namespace cloud_print | 872 } // namespace cloud_print |
| OLD | NEW |