Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc

Issue 109793006: Adds ImageWriterPrivate.destroyPartitions operation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes up DBusThreadManager initialization. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 fffd1ac0fb200439a8bb903fc65b85a0498830ed..3d7fd423688ddbdcc07fa89df1ada1072e419dfb 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() {
}

Powered by Google App Engine
This is Rietveld 408576698