OLD | NEW |
1 // Copyright (c) 2011 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 |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 gfx::Rect render_area(0, 0, dc_width, dc_height); | 524 gfx::Rect render_area(0, 0, dc_width, dc_height); |
525 g_service_process->io_thread()->message_loop_proxy()->PostTask( | 525 g_service_process->io_thread()->message_loop_proxy()->PostTask( |
526 FROM_HERE, | 526 FROM_HERE, |
527 NewRunnableMethod( | 527 NewRunnableMethod( |
528 this, | 528 this, |
529 &JobSpoolerWin::Core::RenderPDFPagesInSandbox, | 529 &JobSpoolerWin::Core::RenderPDFPagesInSandbox, |
530 print_data_file_path_, | 530 print_data_file_path_, |
531 render_area, | 531 render_area, |
532 printer_dpi, | 532 printer_dpi, |
533 page_ranges, | 533 page_ranges, |
534 base::MessageLoopProxy::CreateForCurrentThread())); | 534 base::MessageLoopProxy::current())); |
535 } | 535 } |
536 // Called on the service process IO thread. | 536 // Called on the service process IO thread. |
537 void RenderPDFPagesInSandbox( | 537 void RenderPDFPagesInSandbox( |
538 const FilePath& pdf_path, const gfx::Rect& render_area, | 538 const FilePath& pdf_path, const gfx::Rect& render_area, |
539 int render_dpi, const std::vector<printing::PageRange>& page_ranges, | 539 int render_dpi, const std::vector<printing::PageRange>& page_ranges, |
540 const scoped_refptr<base::MessageLoopProxy>& | 540 const scoped_refptr<base::MessageLoopProxy>& |
541 client_message_loop_proxy) { | 541 client_message_loop_proxy) { |
542 DCHECK(g_service_process->io_thread()->message_loop_proxy()-> | 542 DCHECK(g_service_process->io_thread()->message_loop_proxy()-> |
543 BelongsToCurrentThread()); | 543 BelongsToCurrentThread()); |
544 scoped_ptr<ServiceUtilityProcessHost> utility_host( | 544 scoped_ptr<ServiceUtilityProcessHost> utility_host( |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 const std::string& printer_name, | 642 const std::string& printer_name, |
643 PrinterCapsAndDefaultsCallback* callback) | 643 PrinterCapsAndDefaultsCallback* callback) |
644 : printer_name_(printer_name), callback_(callback) { | 644 : printer_name_(printer_name), callback_(callback) { |
645 } | 645 } |
646 virtual void Start() { | 646 virtual void Start() { |
647 g_service_process->io_thread()->message_loop_proxy()->PostTask( | 647 g_service_process->io_thread()->message_loop_proxy()->PostTask( |
648 FROM_HERE, | 648 FROM_HERE, |
649 NewRunnableMethod( | 649 NewRunnableMethod( |
650 this, | 650 this, |
651 &PrinterCapsHandler::GetPrinterCapsAndDefaultsImpl, | 651 &PrinterCapsHandler::GetPrinterCapsAndDefaultsImpl, |
652 base::MessageLoopProxy::CreateForCurrentThread())); | 652 base::MessageLoopProxy::current())); |
653 } | 653 } |
654 | 654 |
655 virtual void OnChildDied() { | 655 virtual void OnChildDied() { |
656 OnGetPrinterCapsAndDefaultsFailed(printer_name_); | 656 OnGetPrinterCapsAndDefaultsFailed(printer_name_); |
657 } | 657 } |
658 virtual void OnGetPrinterCapsAndDefaultsSucceeded( | 658 virtual void OnGetPrinterCapsAndDefaultsSucceeded( |
659 const std::string& printer_name, | 659 const std::string& printer_name, |
660 const printing::PrinterCapsAndDefaults& caps_and_defaults) { | 660 const printing::PrinterCapsAndDefaults& caps_and_defaults) { |
661 callback_->Run(true, printer_name, caps_and_defaults); | 661 callback_->Run(true, printer_name, caps_and_defaults); |
662 callback_.reset(); | 662 callback_.reset(); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string)); | 862 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string)); |
863 return ret; | 863 return ret; |
864 } | 864 } |
865 | 865 |
866 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( | 866 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( |
867 const base::DictionaryValue* print_system_settings) { | 867 const base::DictionaryValue* print_system_settings) { |
868 return new PrintSystemWin; | 868 return new PrintSystemWin; |
869 } | 869 } |
870 | 870 |
871 } // namespace cloud_print | 871 } // namespace cloud_print |
OLD | NEW |