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 #ifndef CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ | 5 #ifndef CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ |
6 #define CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ | 6 #define CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
11 #if defined(OS_WIN) | 11 #if defined(OS_WIN) |
12 #include <windows.h> | 12 #include <windows.h> |
13 #endif // defined(OS_WIN) | 13 #endif // defined(OS_WIN) |
14 | 14 |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
19 #include "base/file_path.h" | 19 #include "base/file_path.h" |
20 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
21 #include "base/task.h" | 21 #include "base/task.h" |
22 #include "ipc/ipc_channel.h" | 22 #include "ipc/ipc_channel.h" |
23 #include "chrome/service/service_child_process_host.h" | 23 #include "chrome/service/service_child_process_host.h" |
| 24 #include "printing/pdf_render_settings.h" |
24 | 25 |
25 class CommandLine; | 26 class CommandLine; |
26 class ScopedTempDir; | 27 class ScopedTempDir; |
27 | 28 |
28 namespace base { | 29 namespace base { |
29 class MessageLoopProxy; | 30 class MessageLoopProxy; |
30 } // namespace base | 31 } // namespace base |
31 | 32 |
32 namespace gfx { | 33 namespace gfx { |
33 class Rect; | 34 class Rect; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 91 |
91 ServiceUtilityProcessHost(Client* client, | 92 ServiceUtilityProcessHost(Client* client, |
92 base::MessageLoopProxy* client_message_loop_proxy); | 93 base::MessageLoopProxy* client_message_loop_proxy); |
93 virtual ~ServiceUtilityProcessHost(); | 94 virtual ~ServiceUtilityProcessHost(); |
94 | 95 |
95 // Starts a process to render the specified pages in the given PDF file into | 96 // Starts a process to render the specified pages in the given PDF file into |
96 // a metafile. Currently only implemented for Windows. If the PDF has fewer | 97 // a metafile. Currently only implemented for Windows. If the PDF has fewer |
97 // pages than the specified page ranges, it will render as many as available. | 98 // pages than the specified page ranges, it will render as many as available. |
98 bool StartRenderPDFPagesToMetafile( | 99 bool StartRenderPDFPagesToMetafile( |
99 const FilePath& pdf_path, | 100 const FilePath& pdf_path, |
100 const gfx::Rect& render_area, | 101 const printing::PdfRenderSettings& render_settings, |
101 int render_dpi, | |
102 const std::vector<printing::PageRange>& page_ranges); | 102 const std::vector<printing::PageRange>& page_ranges); |
103 | 103 |
104 // Starts a process to get capabilities and defaults for the specified | 104 // Starts a process to get capabilities and defaults for the specified |
105 // printer. Used on Windows to isolate the service process from printer driver | 105 // printer. Used on Windows to isolate the service process from printer driver |
106 // crashes by executing this in a separate process. The process does not run | 106 // crashes by executing this in a separate process. The process does not run |
107 // in a sandbox. | 107 // in a sandbox. |
108 bool StartGetPrinterCapsAndDefaults(const std::string& printer_name); | 108 bool StartGetPrinterCapsAndDefaults(const std::string& printer_name); |
109 | 109 |
110 protected: | 110 protected: |
111 // Allows this method to be overridden for tests. | 111 // Allows this method to be overridden for tests. |
(...skipping 30 matching lines...) Expand all Loading... |
142 FilePath metafile_path_; | 142 FilePath metafile_path_; |
143 // The temporary folder created for the metafile. | 143 // The temporary folder created for the metafile. |
144 scoped_ptr<ScopedTempDir> scratch_metafile_dir_; | 144 scoped_ptr<ScopedTempDir> scratch_metafile_dir_; |
145 // The unique id created for the process. | 145 // The unique id created for the process. |
146 int process_id_; | 146 int process_id_; |
147 | 147 |
148 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); | 148 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); |
149 }; | 149 }; |
150 | 150 |
151 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ | 151 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ |
OLD | NEW |