Index: chrome/utility/chrome_content_utility_client.cc |
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc |
index 8e6a69ddb2146f028fcf53ba313e5d47b1397d4d..b2fb974ba5024f82a3422f2e7a3006389cecb558 100644 |
--- a/chrome/utility/chrome_content_utility_client.cc |
+++ b/chrome/utility/chrome_content_utility_client.cc |
@@ -21,6 +21,7 @@ |
#include "chrome/common/extensions/unpacker.h" |
#include "chrome/common/extensions/update_manifest.h" |
#include "chrome/common/web_resource/web_resource_unpacker.h" |
+#include "chrome/common/zip.h" |
#include "chrome/utility/profile_import_handler.h" |
#include "content/public/utility/utility_thread.h" |
#include "printing/backend/print_backend.h" |
@@ -88,6 +89,7 @@ bool ChromeContentUtilityClient::OnMessageReceived( |
IPC_MESSAGE_HANDLER(ChromeUtilityMsg_ParseJSON, OnParseJSON) |
IPC_MESSAGE_HANDLER(ChromeUtilityMsg_GetPrinterCapsAndDefaults, |
OnGetPrinterCapsAndDefaults) |
+ IPC_MESSAGE_HANDLER(ChromeUtilityMsg_CreateZipFile, OnCreateZipFile) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
@@ -186,6 +188,17 @@ void ChromeContentUtilityClient::OnDecodeImageBase64( |
OnDecodeImage(decoded_vector); |
} |
+void ChromeContentUtilityClient::OnCreateZipFile( |
+ const FilePath& src_dir, |
+ const std::vector<FilePath>& src_relative_paths, |
+ const FilePath& dest_file) { |
+ if (zip::ZipFiles(src_dir, src_relative_paths, dest_file)) |
palmer
2012/11/13 20:43:40
As it is, this function looks very dangerous.
zip
|
+ Send(new ChromeUtilityHostMsg_CreateZipFile_Succeeded()); |
+ else |
+ Send(new ChromeUtilityHostMsg_CreateZipFile_Failed()); |
+ content::UtilityThread::Get()->ReleaseProcessIfNeeded(); |
+} |
+ |
void ChromeContentUtilityClient::OnRenderPDFPagesToMetafile( |
base::PlatformFile pdf_file, |
const FilePath& metafile_path, |