Index: chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc |
diff --git a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc |
index a3926844c06f2295441640f924429ac36c1a7af0..ace11a68590ef3c111689181ec791b262bd964df 100644 |
--- a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc |
+++ b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc |
@@ -151,10 +151,25 @@ bool ImageWriterPrivateDestroyPartitionsFunction::RunImpl() { |
image_writer_api::DestroyPartitions::Params::Create(*args_)); |
EXTENSION_FUNCTION_VALIDATE(params.get()); |
- SendResponse(true); |
+ image_writer::OperationManager::Get(GetProfile())->DestroyPartitions( |
+ extension_id(), |
+ params->storage_unit_id, |
+ base::Bind( |
+ &ImageWriterPrivateDestroyPartitionsFunction::OnDestroyComplete, |
+ this)); |
return true; |
} |
+void ImageWriterPrivateDestroyPartitionsFunction::OnDestroyComplete( |
+ bool success, |
+ const std::string& error) { |
+ if (!success) { |
+ error_ = error; |
+ } |
+ |
+ SendResponse(success); |
+} |
+ |
ImageWriterPrivateListRemovableStorageDevicesFunction:: |
ImageWriterPrivateListRemovableStorageDevicesFunction() { |
} |