OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 5 #ifndef CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
6 #define CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 6 #define CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
11 #include "content/public/utility/content_utility_client.h" | 11 #include "content/public/utility/content_utility_client.h" |
12 #include "printing/pdf_render_settings.h" | 12 #include "printing/pdf_render_settings.h" |
13 | 13 |
14 class FilePath; | |
15 class Importer; | 14 class Importer; |
16 | 15 |
17 namespace base { | 16 namespace base { |
18 class DictionaryValue; | 17 class DictionaryValue; |
| 18 class FilePath; |
19 class Thread; | 19 class Thread; |
20 struct FileDescriptor; | 20 struct FileDescriptor; |
21 } | 21 } |
22 | 22 |
23 namespace gfx { | 23 namespace gfx { |
24 class Rect; | 24 class Rect; |
25 } | 25 } |
26 | 26 |
27 namespace importer { | 27 namespace importer { |
28 struct SourceProfile; | 28 struct SourceProfile; |
(...skipping 12 matching lines...) Expand all Loading... |
41 ChromeContentUtilityClient(); | 41 ChromeContentUtilityClient(); |
42 ~ChromeContentUtilityClient(); | 42 ~ChromeContentUtilityClient(); |
43 | 43 |
44 virtual void UtilityThreadStarted() OVERRIDE; | 44 virtual void UtilityThreadStarted() OVERRIDE; |
45 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 45 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
46 | 46 |
47 private: | 47 private: |
48 virtual bool Send(IPC::Message* message); | 48 virtual bool Send(IPC::Message* message); |
49 | 49 |
50 // IPC message handlers. | 50 // IPC message handlers. |
51 void OnUnpackExtension(const FilePath& extension_path, | 51 void OnUnpackExtension(const base::FilePath& extension_path, |
52 const std::string& extension_id, | 52 const std::string& extension_id, |
53 int location, int creation_flags); | 53 int location, int creation_flags); |
54 void OnUnpackWebResource(const std::string& resource_data); | 54 void OnUnpackWebResource(const std::string& resource_data); |
55 void OnParseUpdateManifest(const std::string& xml); | 55 void OnParseUpdateManifest(const std::string& xml); |
56 void OnDecodeImage(const std::vector<unsigned char>& encoded_data); | 56 void OnDecodeImage(const std::vector<unsigned char>& encoded_data); |
57 void OnDecodeImageBase64(const std::string& encoded_data); | 57 void OnDecodeImageBase64(const std::string& encoded_data); |
58 void OnRenderPDFPagesToMetafile( | 58 void OnRenderPDFPagesToMetafile( |
59 base::PlatformFile pdf_file, | 59 base::PlatformFile pdf_file, |
60 const FilePath& metafile_path, | 60 const base::FilePath& metafile_path, |
61 const printing::PdfRenderSettings& pdf_render_settings, | 61 const printing::PdfRenderSettings& pdf_render_settings, |
62 const std::vector<printing::PageRange>& page_ranges); | 62 const std::vector<printing::PageRange>& page_ranges); |
63 void OnRobustJPEGDecodeImage( | 63 void OnRobustJPEGDecodeImage( |
64 const std::vector<unsigned char>& encoded_data); | 64 const std::vector<unsigned char>& encoded_data); |
65 void OnParseJSON(const std::string& json); | 65 void OnParseJSON(const std::string& json); |
66 | 66 |
67 #if defined(OS_CHROMEOS) | 67 #if defined(OS_CHROMEOS) |
68 void OnCreateZipFile(const FilePath& src_dir, | 68 void OnCreateZipFile(const base::FilePath& src_dir, |
69 const std::vector<FilePath>& src_relative_paths, | 69 const std::vector<base::FilePath>& src_relative_paths, |
70 const base::FileDescriptor& dest_fd); | 70 const base::FileDescriptor& dest_fd); |
71 #endif // defined(OS_CHROMEOS) | 71 #endif // defined(OS_CHROMEOS) |
72 | 72 |
73 #if defined(OS_WIN) | 73 #if defined(OS_WIN) |
74 // Helper method for Windows. | 74 // Helper method for Windows. |
75 // |highest_rendered_page_number| is set to -1 on failure to render any page. | 75 // |highest_rendered_page_number| is set to -1 on failure to render any page. |
76 bool RenderPDFToWinMetafile( | 76 bool RenderPDFToWinMetafile( |
77 base::PlatformFile pdf_file, | 77 base::PlatformFile pdf_file, |
78 const FilePath& metafile_path, | 78 const base::FilePath& metafile_path, |
79 const gfx::Rect& render_area, | 79 const gfx::Rect& render_area, |
80 int render_dpi, | 80 int render_dpi, |
81 bool autorotate, | 81 bool autorotate, |
82 const std::vector<printing::PageRange>& page_ranges, | 82 const std::vector<printing::PageRange>& page_ranges, |
83 int* highest_rendered_page_number, | 83 int* highest_rendered_page_number, |
84 double* scale_factor); | 84 double* scale_factor); |
85 #endif // defined(OS_WIN) | 85 #endif // defined(OS_WIN) |
86 | 86 |
87 void OnGetPrinterCapsAndDefaults(const std::string& printer_name); | 87 void OnGetPrinterCapsAndDefaults(const std::string& printer_name); |
88 | 88 |
89 scoped_ptr<ProfileImportHandler> import_handler_; | 89 scoped_ptr<ProfileImportHandler> import_handler_; |
90 }; | 90 }; |
91 | 91 |
92 } // namespace chrome | 92 } // namespace chrome |
93 | 93 |
94 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 94 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
OLD | NEW |