| 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_MAX_VALUE(printing::DuplexMode, printing::SHORT_EDGE) | |
| 53 | |
| 54 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterSemanticCapsAndDefaults::Paper) | |
| 55 IPC_STRUCT_TRAITS_MEMBER(name) | |
| 56 IPC_STRUCT_TRAITS_MEMBER(size_um) | |
| 57 IPC_STRUCT_TRAITS_END() | |
| 58 | |
| 59 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterSemanticCapsAndDefaults) | |
| 60 IPC_STRUCT_TRAITS_MEMBER(collate_capable) | |
| 61 IPC_STRUCT_TRAITS_MEMBER(collate_default) | |
| 62 IPC_STRUCT_TRAITS_MEMBER(copies_capable) | |
| 63 IPC_STRUCT_TRAITS_MEMBER(duplex_capable) | |
| 64 IPC_STRUCT_TRAITS_MEMBER(duplex_default) | |
| 65 IPC_STRUCT_TRAITS_MEMBER(color_changeable) | |
| 66 IPC_STRUCT_TRAITS_MEMBER(color_default) | |
| 67 IPC_STRUCT_TRAITS_MEMBER(color_model) | |
| 68 IPC_STRUCT_TRAITS_MEMBER(bw_model) | |
| 69 IPC_STRUCT_TRAITS_MEMBER(papers) | |
| 70 IPC_STRUCT_TRAITS_MEMBER(default_paper) | |
| 71 IPC_STRUCT_TRAITS_MEMBER(dpis) | |
| 72 IPC_STRUCT_TRAITS_MEMBER(default_dpi) | |
| 73 IPC_STRUCT_TRAITS_END() | |
| 74 | |
| 75 IPC_ENUM_TRAITS(printing::PwgRasterTransformType); | |
| 76 | |
| 77 IPC_STRUCT_TRAITS_BEGIN(printing::PwgRasterSettings) | |
| 78 IPC_STRUCT_TRAITS_MEMBER(odd_page_transform) | |
| 79 IPC_STRUCT_TRAITS_MEMBER(rotate_all_pages) | |
| 80 IPC_STRUCT_TRAITS_MEMBER(reverse_page_order) | |
| 81 IPC_STRUCT_TRAITS_END() | |
| 82 | |
| 83 IPC_STRUCT_TRAITS_BEGIN(UpdateManifest::Result) | 35 IPC_STRUCT_TRAITS_BEGIN(UpdateManifest::Result) |
| 84 IPC_STRUCT_TRAITS_MEMBER(extension_id) | 36 IPC_STRUCT_TRAITS_MEMBER(extension_id) |
| 85 IPC_STRUCT_TRAITS_MEMBER(version) | 37 IPC_STRUCT_TRAITS_MEMBER(version) |
| 86 IPC_STRUCT_TRAITS_MEMBER(browser_min_version) | 38 IPC_STRUCT_TRAITS_MEMBER(browser_min_version) |
| 87 IPC_STRUCT_TRAITS_MEMBER(package_hash) | 39 IPC_STRUCT_TRAITS_MEMBER(package_hash) |
| 88 IPC_STRUCT_TRAITS_MEMBER(crx_url) | 40 IPC_STRUCT_TRAITS_MEMBER(crx_url) |
| 89 IPC_STRUCT_TRAITS_END() | 41 IPC_STRUCT_TRAITS_END() |
| 90 | 42 |
| 91 IPC_STRUCT_TRAITS_BEGIN(UpdateManifest::Results) | 43 IPC_STRUCT_TRAITS_BEGIN(UpdateManifest::Results) |
| 92 IPC_STRUCT_TRAITS_MEMBER(list) | 44 IPC_STRUCT_TRAITS_MEMBER(list) |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 125 |
| 174 // Tell the utility process to decode the given image data. | 126 // Tell the utility process to decode the given image data. |
| 175 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_DecodeImage, | 127 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_DecodeImage, |
| 176 std::vector<unsigned char>) // encoded image contents | 128 std::vector<unsigned char>) // encoded image contents |
| 177 | 129 |
| 178 // 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 |
| 179 // encoded. | 131 // encoded. |
| 180 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_DecodeImageBase64, | 132 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_DecodeImageBase64, |
| 181 std::string) // base64 encoded image contents | 133 std::string) // base64 encoded image contents |
| 182 | 134 |
| 183 // Tell the utility process to render the given PDF into a metafile. | |
| 184 // The metafile path will have ".%d" inserted where the %d is the page number. | |
| 185 // If no page range is specified, all pages will be converted. | |
| 186 IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToMetafiles, | |
| 187 IPC::PlatformFileForTransit, // PDF file | |
| 188 base::FilePath, // Base location for output metafile | |
| 189 printing::PdfRenderSettings, // PDF render settings | |
| 190 std::vector<printing::PageRange>) | |
| 191 | |
| 192 // Tell the utility process to render the given PDF into a PWGRaster. | |
| 193 IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToPWGRaster, | |
| 194 IPC::PlatformFileForTransit, /* Input PDF file */ | |
| 195 printing::PdfRenderSettings, /* PDF render settings */ | |
| 196 // PWG transform settings. | |
| 197 printing::PwgRasterSettings, | |
| 198 IPC::PlatformFileForTransit /* Output PWG file */) | |
| 199 | |
| 200 // 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 |
| 201 // libjpeg codec. | 136 // libjpeg codec. |
| 202 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_RobustJPEGDecodeImage, | 137 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_RobustJPEGDecodeImage, |
| 203 std::vector<unsigned char>) // encoded image contents | 138 std::vector<unsigned char>) // encoded image contents |
| 204 | 139 |
| 205 // 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. |
| 206 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_ParseJSON, | 141 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_ParseJSON, |
| 207 std::string /* JSON to parse */) | 142 std::string /* JSON to parse */) |
| 208 | 143 |
| 209 // Tells the utility process to get capabilities and defaults for the specified | |
| 210 // printer. Used on Windows to isolate the service process from printer driver | |
| 211 // crashes by executing this in a separate process. This does not run in a | |
| 212 // sandbox. | |
| 213 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterCapsAndDefaults, | |
| 214 std::string /* printer name */) | |
| 215 | |
| 216 // Tells the utility process to get capabilities and defaults for the specified | |
| 217 // printer. Used on Windows to isolate the service process from printer driver | |
| 218 // crashes by executing this in a separate process. This does not run in a | |
| 219 // sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults. | |
| 220 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults, | |
| 221 std::string /* printer name */) | |
| 222 | |
| 223 // 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| |
| 224 // 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 |
| 225 // algorithm (Courgette's version). | 146 // algorithm (Courgette's version). |
| 226 IPC_MESSAGE_CONTROL3(ChromeUtilityMsg_PatchFileBsdiff, | 147 IPC_MESSAGE_CONTROL3(ChromeUtilityMsg_PatchFileBsdiff, |
| 227 base::FilePath /* input_file */, | 148 base::FilePath /* input_file */, |
| 228 base::FilePath /* patch_file */, | 149 base::FilePath /* patch_file */, |
| 229 base::FilePath /* output_file */) | 150 base::FilePath /* output_file */) |
| 230 | 151 |
| 231 // 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| |
| 232 // 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... |
| 362 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseUpdateManifest_Failed, | 283 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseUpdateManifest_Failed, |
| 363 std::string /* error_message, if any */) | 284 std::string /* error_message, if any */) |
| 364 | 285 |
| 365 // Reply when the utility process has succeeded in decoding the image. | 286 // Reply when the utility process has succeeded in decoding the image. |
| 366 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_DecodeImage_Succeeded, | 287 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_DecodeImage_Succeeded, |
| 367 SkBitmap) // decoded image | 288 SkBitmap) // decoded image |
| 368 | 289 |
| 369 // Reply when an error occurred decoding the image. | 290 // Reply when an error occurred decoding the image. |
| 370 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_DecodeImage_Failed) | 291 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_DecodeImage_Failed) |
| 371 | 292 |
| 372 // Reply when the utility process has succeeded in rendering the PDF. | |
| 373 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_Succeeded, | |
| 374 std::vector<printing::PageRange>, // Pages rendered | |
| 375 double) // Scale factor | |
| 376 | |
| 377 // Reply when an error occurred rendering the PDF. | |
| 378 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToMetafile_Failed) | |
| 379 | |
| 380 // Reply when the utility process has succeeded in rendering the PDF to PWG. | |
| 381 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Succeeded) | |
| 382 | |
| 383 // Reply when an error occurred rendering the PDF to PWG. | |
| 384 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Failed) | |
| 385 | |
| 386 // Reply when the utility process successfully parsed a JSON string. | 293 // Reply when the utility process successfully parsed a JSON string. |
| 387 // | 294 // |
| 388 // 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 |
| 389 // 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, |
| 390 // 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 |
| 391 // first (and only) element of the ListValue for the actual result. | 298 // first (and only) element of the ListValue for the actual result. |
| 392 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseJSON_Succeeded, | 299 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseJSON_Succeeded, |
| 393 base::ListValue) | 300 base::ListValue) |
| 394 | 301 |
| 395 // Reply when the utility process failed in parsing a JSON string. | 302 // Reply when the utility process failed in parsing a JSON string. |
| 396 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseJSON_Failed, | 303 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseJSON_Failed, |
| 397 std::string /* error message, if any*/) | 304 std::string /* error message, if any*/) |
| 398 | 305 |
| 399 #if defined(ENABLE_FULL_PRINTING) | |
| 400 // Reply when the utility process has succeeded in obtaining the printer | |
| 401 // capabilities and defaults. | |
| 402 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded, | |
| 403 std::string /* printer name */, | |
| 404 printing::PrinterCapsAndDefaults) | |
| 405 | |
| 406 // Reply when the utility process has succeeded in obtaining the printer | |
| 407 // semantic capabilities and defaults. | |
| 408 IPC_MESSAGE_CONTROL2( | |
| 409 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Succeeded, | |
| 410 std::string /* printer name */, | |
| 411 printing::PrinterSemanticCapsAndDefaults) | |
| 412 #endif | |
| 413 | |
| 414 // Reply when a file has been patched successfully. | 306 // Reply when a file has been patched successfully. |
| 415 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_PatchFile_Succeeded) | 307 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_PatchFile_Succeeded) |
| 416 | 308 |
| 417 // Reply when patching a file failed. | 309 // Reply when patching a file failed. |
| 418 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_PatchFile_Failed, | 310 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_PatchFile_Failed, |
| 419 int /* error code */) | 311 int /* error code */) |
| 420 | 312 |
| 421 // Reply when the utility process has failed to obtain the printer | |
| 422 // capabilities and defaults. | |
| 423 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed, | |
| 424 std::string /* printer name */) | |
| 425 | |
| 426 // Reply when the utility process has failed to obtain the printer | |
| 427 // semantic capabilities and defaults. | |
| 428 IPC_MESSAGE_CONTROL1( | |
| 429 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed, | |
| 430 std::string /* printer name */) | |
| 431 | |
| 432 #if defined(OS_CHROMEOS) | 313 #if defined(OS_CHROMEOS) |
| 433 // 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. |
| 434 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_CreateZipFile_Succeeded) | 315 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_CreateZipFile_Succeeded) |
| 435 | 316 |
| 436 // Reply when an error occured in creating the zip file. | 317 // Reply when an error occured in creating the zip file. |
| 437 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_CreateZipFile_Failed) | 318 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_CreateZipFile_Failed) |
| 438 #endif // defined(OS_CHROMEOS) | 319 #endif // defined(OS_CHROMEOS) |
| 439 | 320 |
| 440 // Reply when the utility process has started. | 321 // Reply when the utility process has started. |
| 441 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_ProcessStarted) | 322 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_ProcessStarted) |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetAndEncryptWiFiCredentials, | 399 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetAndEncryptWiFiCredentials, |
| 519 std::string /* ssid */, | 400 std::string /* ssid */, |
| 520 std::vector<uint8> /* public_key */) | 401 std::vector<uint8> /* public_key */) |
| 521 | 402 |
| 522 // 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 |
| 523 // caller's public key. |success| is false if error occurred. | 404 // caller's public key. |success| is false if error occurred. |
| 524 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GotEncryptedWiFiCredentials, | 405 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GotEncryptedWiFiCredentials, |
| 525 std::vector<uint8> /* encrypted_key_data */, | 406 std::vector<uint8> /* encrypted_key_data */, |
| 526 bool /* success */) | 407 bool /* success */) |
| 527 #endif // defined(OS_WIN) | 408 #endif // defined(OS_WIN) |
| OLD | NEW |