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 // Multiply-included message file, so no include guard. | 5 // Multiply-included message file, so no include guard. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/platform_file.h" | 12 #include "base/platform_file.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "base/tuple.h" | 14 #include "base/tuple.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "chrome/common/extensions/update_manifest.h" | 16 #include "chrome/common/extensions/update_manifest.h" |
17 #include "chrome/common/media_galleries/iphoto_library.h" | 17 #include "chrome/common/media_galleries/iphoto_library.h" |
18 #include "chrome/common/media_galleries/itunes_library.h" | 18 #include "chrome/common/media_galleries/itunes_library.h" |
19 #include "chrome/common/media_galleries/metadata_types.h" | 19 #include "chrome/common/media_galleries/metadata_types.h" |
20 #include "chrome/common/media_galleries/picasa_types.h" | 20 #include "chrome/common/media_galleries/picasa_types.h" |
21 #include "chrome/common/safe_browsing/zip_analyzer.h" | 21 #include "chrome/common/safe_browsing/zip_analyzer.h" |
22 #include "ipc/ipc_message_macros.h" | 22 #include "ipc/ipc_message_macros.h" |
23 #include "ipc/ipc_platform_file.h" | 23 #include "ipc/ipc_platform_file.h" |
24 #include "printing/backend/print_backend.h" | |
25 #include "printing/page_range.h" | |
26 #include "printing/pdf_render_settings.h" | |
27 #include "printing/pwg_raster_settings.h" | |
28 #include "third_party/skia/include/core/SkBitmap.h" | 24 #include "third_party/skia/include/core/SkBitmap.h" |
29 | 25 |
30 #define IPC_MESSAGE_START ChromeUtilityMsgStart | 26 #define IPC_MESSAGE_START ChromeUtilityMsgStart |
31 | 27 |
32 #ifndef CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_ | 28 #ifndef CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_ |
33 #define CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_ | 29 #define CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_ |
34 | 30 |
35 typedef std::vector<Tuple2<SkBitmap, base::FilePath> > DecodedImages; | 31 typedef std::vector<Tuple2<SkBitmap, base::FilePath> > DecodedImages; |
36 | 32 |
37 #endif // CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_ | 33 #endif // CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_ |
38 | 34 |
39 IPC_STRUCT_TRAITS_BEGIN(printing::PageRange) | |
40 IPC_STRUCT_TRAITS_MEMBER(from) | |
41 IPC_STRUCT_TRAITS_MEMBER(to) | |
42 IPC_STRUCT_TRAITS_END() | |
43 | |
44 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults) | |
45 IPC_STRUCT_TRAITS_MEMBER(printer_capabilities) | |
46 IPC_STRUCT_TRAITS_MEMBER(caps_mime_type) | |
47 IPC_STRUCT_TRAITS_MEMBER(printer_defaults) | |
48 IPC_STRUCT_TRAITS_MEMBER(defaults_mime_type) | |
49 IPC_STRUCT_TRAITS_END() | |
50 | |
51 IPC_ENUM_TRAITS_MAX_VALUE(printing::ColorModel, printing::PROCESSCOLORMODEL_RGB) | |
52 IPC_ENUM_TRAITS_MIN_MAX_VALUE(printing::DuplexMode, | |
53 printing::UNKNOWN_DUPLEX_MODE, | |
54 printing::SHORT_EDGE) | |
55 | |
56 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterSemanticCapsAndDefaults::Paper) | |
57 IPC_STRUCT_TRAITS_MEMBER(display_name) | |
58 IPC_STRUCT_TRAITS_MEMBER(vendor_id) | |
59 IPC_STRUCT_TRAITS_MEMBER(size_um) | |
60 IPC_STRUCT_TRAITS_END() | |
61 | |
62 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterSemanticCapsAndDefaults) | |
63 IPC_STRUCT_TRAITS_MEMBER(collate_capable) | |
64 IPC_STRUCT_TRAITS_MEMBER(collate_default) | |
65 IPC_STRUCT_TRAITS_MEMBER(copies_capable) | |
66 IPC_STRUCT_TRAITS_MEMBER(duplex_capable) | |
67 IPC_STRUCT_TRAITS_MEMBER(duplex_default) | |
68 IPC_STRUCT_TRAITS_MEMBER(color_changeable) | |
69 IPC_STRUCT_TRAITS_MEMBER(color_default) | |
70 IPC_STRUCT_TRAITS_MEMBER(color_model) | |
71 IPC_STRUCT_TRAITS_MEMBER(bw_model) | |
72 IPC_STRUCT_TRAITS_MEMBER(papers) | |
73 IPC_STRUCT_TRAITS_MEMBER(default_paper) | |
74 IPC_STRUCT_TRAITS_MEMBER(dpis) | |
75 IPC_STRUCT_TRAITS_MEMBER(default_dpi) | |
76 IPC_STRUCT_TRAITS_END() | |
77 | |
78 IPC_ENUM_TRAITS(printing::PwgRasterTransformType); | |
79 | |
80 IPC_STRUCT_TRAITS_BEGIN(printing::PwgRasterSettings) | |
81 IPC_STRUCT_TRAITS_MEMBER(odd_page_transform) | |
82 IPC_STRUCT_TRAITS_MEMBER(rotate_all_pages) | |
83 IPC_STRUCT_TRAITS_MEMBER(reverse_page_order) | |
84 IPC_STRUCT_TRAITS_END() | |
85 | |
86 IPC_STRUCT_TRAITS_BEGIN(UpdateManifest::Result) | 35 IPC_STRUCT_TRAITS_BEGIN(UpdateManifest::Result) |
87 IPC_STRUCT_TRAITS_MEMBER(extension_id) | 36 IPC_STRUCT_TRAITS_MEMBER(extension_id) |
88 IPC_STRUCT_TRAITS_MEMBER(version) | 37 IPC_STRUCT_TRAITS_MEMBER(version) |
89 IPC_STRUCT_TRAITS_MEMBER(browser_min_version) | 38 IPC_STRUCT_TRAITS_MEMBER(browser_min_version) |
90 IPC_STRUCT_TRAITS_MEMBER(package_hash) | 39 IPC_STRUCT_TRAITS_MEMBER(package_hash) |
91 IPC_STRUCT_TRAITS_MEMBER(crx_url) | 40 IPC_STRUCT_TRAITS_MEMBER(crx_url) |
92 IPC_STRUCT_TRAITS_END() | 41 IPC_STRUCT_TRAITS_END() |
93 | 42 |
94 IPC_STRUCT_TRAITS_BEGIN(UpdateManifest::Results) | 43 IPC_STRUCT_TRAITS_BEGIN(UpdateManifest::Results) |
95 IPC_STRUCT_TRAITS_MEMBER(list) | 44 IPC_STRUCT_TRAITS_MEMBER(list) |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 125 |
177 // Tell the utility process to decode the given image data. | 126 // Tell the utility process to decode the given image data. |
178 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_DecodeImage, | 127 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_DecodeImage, |
179 std::vector<unsigned char>) // encoded image contents | 128 std::vector<unsigned char>) // encoded image contents |
180 | 129 |
181 // Tell the utility process to decode the given image data, which is base64 | 130 // Tell the utility process to decode the given image data, which is base64 |
182 // encoded. | 131 // encoded. |
183 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_DecodeImageBase64, | 132 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_DecodeImageBase64, |
184 std::string) // base64 encoded image contents | 133 std::string) // base64 encoded image contents |
185 | 134 |
186 // Tell the utility process to render the given PDF into a metafile. | |
187 // The metafile path will have ".%d" inserted where the %d is the page number. | |
188 // If no page range is specified, all pages will be converted. | |
189 IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToMetafiles, | |
190 IPC::PlatformFileForTransit, // PDF file | |
191 base::FilePath, // Base location for output metafile | |
192 printing::PdfRenderSettings, // PDF render settings | |
193 std::vector<printing::PageRange>) | |
194 | |
195 // Tell the utility process to render the given PDF into a PWGRaster. | |
196 IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToPWGRaster, | |
197 IPC::PlatformFileForTransit, /* Input PDF file */ | |
198 printing::PdfRenderSettings, /* PDF render settings */ | |
199 // PWG transform settings. | |
200 printing::PwgRasterSettings, | |
201 IPC::PlatformFileForTransit /* Output PWG file */) | |
202 | |
203 // Tell the utility process to decode the given JPEG image data with a robust | 135 // Tell the utility process to decode the given JPEG image data with a robust |
204 // libjpeg codec. | 136 // libjpeg codec. |
205 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_RobustJPEGDecodeImage, | 137 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_RobustJPEGDecodeImage, |
206 std::vector<unsigned char>) // encoded image contents | 138 std::vector<unsigned char>) // encoded image contents |
207 | 139 |
208 // Tell the utility process to parse a JSON string into a Value object. | 140 // Tell the utility process to parse a JSON string into a Value object. |
209 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_ParseJSON, | 141 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_ParseJSON, |
210 std::string /* JSON to parse */) | 142 std::string /* JSON to parse */) |
211 | 143 |
212 // Tells the utility process to get capabilities and defaults for the specified | |
213 // printer. Used on Windows to isolate the service process from printer driver | |
214 // crashes by executing this in a separate process. This does not run in a | |
215 // sandbox. | |
216 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterCapsAndDefaults, | |
217 std::string /* printer name */) | |
218 | |
219 // Tells the utility process to get capabilities and defaults for the specified | |
220 // printer. Used on Windows to isolate the service process from printer driver | |
221 // crashes by executing this in a separate process. This does not run in a | |
222 // sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults. | |
223 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults, | |
224 std::string /* printer name */) | |
225 | |
226 // Tell the utility process to patch the given |input_file| using |patch_file| | 144 // Tell the utility process to patch the given |input_file| using |patch_file| |
227 // and place the output in |output_file|. The patch should use the bsdiff | 145 // and place the output in |output_file|. The patch should use the bsdiff |
228 // algorithm (Courgette's version). | 146 // algorithm (Courgette's version). |
229 IPC_MESSAGE_CONTROL3(ChromeUtilityMsg_PatchFileBsdiff, | 147 IPC_MESSAGE_CONTROL3(ChromeUtilityMsg_PatchFileBsdiff, |
230 base::FilePath /* input_file */, | 148 base::FilePath /* input_file */, |
231 base::FilePath /* patch_file */, | 149 base::FilePath /* patch_file */, |
232 base::FilePath /* output_file */) | 150 base::FilePath /* output_file */) |
233 | 151 |
234 // Tell the utility process to patch the given |input_file| using |patch_file| | 152 // Tell the utility process to patch the given |input_file| using |patch_file| |
235 // and place the output in |output_file|. The patch should use the Courgette | 153 // and place the output in |output_file|. The patch should use the Courgette |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseUpdateManifest_Failed, | 283 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseUpdateManifest_Failed, |
366 std::string /* error_message, if any */) | 284 std::string /* error_message, if any */) |
367 | 285 |
368 // Reply when the utility process has succeeded in decoding the image. | 286 // Reply when the utility process has succeeded in decoding the image. |
369 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_DecodeImage_Succeeded, | 287 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_DecodeImage_Succeeded, |
370 SkBitmap) // decoded image | 288 SkBitmap) // decoded image |
371 | 289 |
372 // Reply when an error occurred decoding the image. | 290 // Reply when an error occurred decoding the image. |
373 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_DecodeImage_Failed) | 291 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_DecodeImage_Failed) |
374 | 292 |
375 // Reply when the utility process has succeeded in rendering the PDF. | |
376 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_Succeeded, | |
377 std::vector<printing::PageRange>, // Pages rendered | |
378 double) // Scale factor | |
379 | |
380 // Reply when an error occurred rendering the PDF. | |
381 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToMetafile_Failed) | |
382 | |
383 // Reply when the utility process has succeeded in rendering the PDF to PWG. | |
384 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Succeeded) | |
385 | |
386 // Reply when an error occurred rendering the PDF to PWG. | |
387 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Failed) | |
388 | |
389 // Reply when the utility process successfully parsed a JSON string. | 293 // Reply when the utility process successfully parsed a JSON string. |
390 // | 294 // |
391 // WARNING: The result can be of any Value subclass type, but we can't easily | 295 // WARNING: The result can be of any Value subclass type, but we can't easily |
392 // pass indeterminate value types by const object reference with our IPC macros, | 296 // pass indeterminate value types by const object reference with our IPC macros, |
393 // so we put the result Value into a ListValue. Handlers should examine the | 297 // so we put the result Value into a ListValue. Handlers should examine the |
394 // first (and only) element of the ListValue for the actual result. | 298 // first (and only) element of the ListValue for the actual result. |
395 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseJSON_Succeeded, | 299 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseJSON_Succeeded, |
396 base::ListValue) | 300 base::ListValue) |
397 | 301 |
398 // Reply when the utility process failed in parsing a JSON string. | 302 // Reply when the utility process failed in parsing a JSON string. |
399 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseJSON_Failed, | 303 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseJSON_Failed, |
400 std::string /* error message, if any*/) | 304 std::string /* error message, if any*/) |
401 | 305 |
402 #if defined(ENABLE_FULL_PRINTING) | |
403 // Reply when the utility process has succeeded in obtaining the printer | |
404 // capabilities and defaults. | |
405 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded, | |
406 std::string /* printer name */, | |
407 printing::PrinterCapsAndDefaults) | |
408 | |
409 // Reply when the utility process has succeeded in obtaining the printer | |
410 // semantic capabilities and defaults. | |
411 IPC_MESSAGE_CONTROL2( | |
412 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Succeeded, | |
413 std::string /* printer name */, | |
414 printing::PrinterSemanticCapsAndDefaults) | |
415 #endif | |
416 | |
417 // Reply when a file has been patched successfully. | 306 // Reply when a file has been patched successfully. |
418 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_PatchFile_Succeeded) | 307 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_PatchFile_Succeeded) |
419 | 308 |
420 // Reply when patching a file failed. | 309 // Reply when patching a file failed. |
421 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_PatchFile_Failed, | 310 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_PatchFile_Failed, |
422 int /* error code */) | 311 int /* error code */) |
423 | 312 |
424 // Reply when the utility process has failed to obtain the printer | |
425 // capabilities and defaults. | |
426 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed, | |
427 std::string /* printer name */) | |
428 | |
429 // Reply when the utility process has failed to obtain the printer | |
430 // semantic capabilities and defaults. | |
431 IPC_MESSAGE_CONTROL1( | |
432 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed, | |
433 std::string /* printer name */) | |
434 | |
435 #if defined(OS_CHROMEOS) | 313 #if defined(OS_CHROMEOS) |
436 // Reply when the utility process has succeeded in creating the zip file. | 314 // Reply when the utility process has succeeded in creating the zip file. |
437 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_CreateZipFile_Succeeded) | 315 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_CreateZipFile_Succeeded) |
438 | 316 |
439 // Reply when an error occured in creating the zip file. | 317 // Reply when an error occured in creating the zip file. |
440 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_CreateZipFile_Failed) | 318 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_CreateZipFile_Failed) |
441 #endif // defined(OS_CHROMEOS) | 319 #endif // defined(OS_CHROMEOS) |
442 | 320 |
443 // Reply when the utility process has started. | 321 // Reply when the utility process has started. |
444 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_ProcessStarted) | 322 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_ProcessStarted) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetAndEncryptWiFiCredentials, | 399 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetAndEncryptWiFiCredentials, |
522 std::string /* ssid */, | 400 std::string /* ssid */, |
523 std::vector<uint8> /* public_key */) | 401 std::vector<uint8> /* public_key */) |
524 | 402 |
525 // Reply after getting WiFi credentials from the system and encrypting them with | 403 // Reply after getting WiFi credentials from the system and encrypting them with |
526 // caller's public key. |success| is false if error occurred. | 404 // caller's public key. |success| is false if error occurred. |
527 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GotEncryptedWiFiCredentials, | 405 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GotEncryptedWiFiCredentials, |
528 std::vector<uint8> /* encrypted_key_data */, | 406 std::vector<uint8> /* encrypted_key_data */, |
529 bool /* success */) | 407 bool /* success */) |
530 #endif // defined(OS_WIN) | 408 #endif // defined(OS_WIN) |
OLD | NEW |