Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: chrome/service/cloud_print/print_system_win.cc

Issue 8146004: Added autorotate flag in PDF rendering and wiring it through service-utility channel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include <xpsprint.h> 9 #include <xpsprint.h>
10 10
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 // Called on the service process IO thread. 541 // Called on the service process IO thread.
542 void RenderPDFPagesInSandbox( 542 void RenderPDFPagesInSandbox(
543 const FilePath& pdf_path, const gfx::Rect& render_area, 543 const FilePath& pdf_path, const gfx::Rect& render_area,
544 int render_dpi, const std::vector<printing::PageRange>& page_ranges, 544 int render_dpi, const std::vector<printing::PageRange>& page_ranges,
545 const scoped_refptr<base::MessageLoopProxy>& 545 const scoped_refptr<base::MessageLoopProxy>&
546 client_message_loop_proxy) { 546 client_message_loop_proxy) {
547 DCHECK(g_service_process->io_thread()->message_loop_proxy()-> 547 DCHECK(g_service_process->io_thread()->message_loop_proxy()->
548 BelongsToCurrentThread()); 548 BelongsToCurrentThread());
549 scoped_ptr<ServiceUtilityProcessHost> utility_host( 549 scoped_ptr<ServiceUtilityProcessHost> utility_host(
550 new ServiceUtilityProcessHost(this, client_message_loop_proxy)); 550 new ServiceUtilityProcessHost(this, client_message_loop_proxy));
551 // TODO(gene): For now we disabling autorotation for CloudPrinting.
552 // Landscape/Portrait setting is passed in the print ticket and
553 // server is generating portrait PDF always.
554 // We should enable autorotation once server will be able to generate
555 // PDF that matches paper size and orientation.
551 if (utility_host->StartRenderPDFPagesToMetafile(pdf_path, 556 if (utility_host->StartRenderPDFPagesToMetafile(pdf_path,
552 render_area, 557 render_area,
553 render_dpi, 558 render_dpi,
559 false,
554 page_ranges)) { 560 page_ranges)) {
555 // The object will self-destruct when the child process dies. 561 // The object will self-destruct when the child process dies.
556 utility_host.release(); 562 utility_host.release();
557 } 563 }
558 } 564 }
559 bool PrintXPSDocument(const std::string& printer_name, 565 bool PrintXPSDocument(const std::string& printer_name,
560 const std::string& job_title, 566 const std::string& job_title,
561 const FilePath& print_data_file_path, 567 const FilePath& print_data_file_path,
562 const std::string& print_ticket) { 568 const std::string& print_ticket) {
563 if (!printing::XPSPrintModule::Init()) 569 if (!printing::XPSPrintModule::Init())
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string)); 873 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string));
868 return ret; 874 return ret;
869 } 875 }
870 876
871 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( 877 scoped_refptr<PrintSystem> PrintSystem::CreateInstance(
872 const base::DictionaryValue* print_system_settings) { 878 const base::DictionaryValue* print_system_settings) {
873 return new PrintSystemWin; 879 return new PrintSystemWin;
874 } 880 }
875 881
876 } // namespace cloud_print 882 } // namespace cloud_print
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698