| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 // Starts a process to render the specified pages in the given PDF file into | 82 // Starts a process to render the specified pages in the given PDF file into |
| 83 // a metafile. Currently only implemented for Windows. If the PDF has fewer | 83 // a metafile. Currently only implemented for Windows. If the PDF has fewer |
| 84 // pages than the specified page ranges, it will render as many as available. | 84 // pages than the specified page ranges, it will render as many as available. |
| 85 bool StartRenderPDFPagesToMetafile( | 85 bool StartRenderPDFPagesToMetafile( |
| 86 const FilePath& pdf_path, | 86 const FilePath& pdf_path, |
| 87 const gfx::Rect& render_area, | 87 const gfx::Rect& render_area, |
| 88 int render_dpi, | 88 int render_dpi, |
| 89 const std::vector<printing::PageRange>& page_ranges); | 89 const std::vector<printing::PageRange>& page_ranges); |
| 90 | 90 |
| 91 // Since we handle a sync IPC message (UtilityHostMsg_PreCacheFont), we need | |
| 92 // an Send method. | |
| 93 bool Send(IPC::Message* message) { | |
| 94 return SendOnChannel(message); | |
| 95 } | |
| 96 | |
| 97 protected: | 91 protected: |
| 98 // Allows this method to be overridden for tests. | 92 // Allows this method to be overridden for tests. |
| 99 virtual FilePath GetUtilityProcessCmd(); | 93 virtual FilePath GetUtilityProcessCmd(); |
| 100 | 94 |
| 101 // Overriden from ChildProcessHost. | 95 // Overriden from ChildProcessHost. |
| 102 virtual bool CanShutdown(); | 96 virtual bool CanShutdown(); |
| 103 virtual void OnChildDied(); | 97 virtual void OnChildDied(); |
| 104 | 98 |
| 105 private: | 99 private: |
| 106 // Starts a process. Returns true iff it succeeded. | 100 // Starts a process. Returns true iff it succeeded. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 124 bool waiting_for_reply_; | 118 bool waiting_for_reply_; |
| 125 // The path to the temp file where the metafile will be written to. | 119 // The path to the temp file where the metafile will be written to. |
| 126 FilePath metafile_path_; | 120 FilePath metafile_path_; |
| 127 // The temporary folder created for the metafile. | 121 // The temporary folder created for the metafile. |
| 128 scoped_ptr<ScopedTempDir> scratch_metafile_dir_; | 122 scoped_ptr<ScopedTempDir> scratch_metafile_dir_; |
| 129 | 123 |
| 130 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); | 124 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); |
| 131 }; | 125 }; |
| 132 | 126 |
| 133 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ | 127 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ |
| OLD | NEW |