#ifndef CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_IMAGE_WRITER_PRIVATE_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_IMAGE_WRITER_PRIVATE_API_H_
#include "chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h"
#include "chrome/browser/extensions/chrome_extension_function.h"
#include "chrome/common/extensions/api/image_writer_private.h"
namespace extensions {
class ImageWriterPrivateWriteFromUrlFunction
: public ChromeAsyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("imageWriterPrivate.writeFromUrl",
IMAGEWRITER_WRITEFROMURL)
ImageWriterPrivateWriteFromUrlFunction();
private:
virtual ~ImageWriterPrivateWriteFromUrlFunction();
virtual bool RunImpl() OVERRIDE;
void OnWriteStarted(bool success, const std::string& error);
};
class ImageWriterPrivateWriteFromFileFunction
: public ChromeAsyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("imageWriterPrivate.writeFromFile",
IMAGEWRITER_WRITEFROMFILE)
ImageWriterPrivateWriteFromFileFunction();
private:
virtual ~ImageWriterPrivateWriteFromFileFunction();
virtual bool RunImpl() OVERRIDE;
void OnWriteStarted(bool success, const std::string& error);
};
class ImageWriterPrivateCancelWriteFunction
: public ChromeAsyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("imageWriterPrivate.cancelWrite",
IMAGEWRITER_CANCELWRITE)
ImageWriterPrivateCancelWriteFunction();
private:
virtual ~ImageWriterPrivateCancelWriteFunction();
virtual bool RunImpl() OVERRIDE;
void OnWriteCancelled(bool success, const std::string& error);
};
class ImageWriterPrivateDestroyPartitionsFunction
: public ChromeAsyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("imageWriterPrivate.destroyPartitions",
IMAGEWRITER_DESTROYPARTITIONS)
ImageWriterPrivateDestroyPartitionsFunction();
private:
virtual ~ImageWriterPrivateDestroyPartitionsFunction();
virtual bool RunImpl() OVERRIDE;
void OnDestroyComplete(bool success, const std::string& error);
};
class ImageWriterPrivateListRemovableStorageDevicesFunction
: public ChromeAsyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("imageWriterPrivate.listRemovableStorageDevices",
IMAGEWRITER_LISTREMOVABLESTORAGEDEVICES);
ImageWriterPrivateListRemovableStorageDevicesFunction();
private:
virtual ~ImageWriterPrivateListRemovableStorageDevicesFunction();
virtual bool RunImpl() OVERRIDE;
void OnDeviceListReady(scoped_refptr<StorageDeviceList> device_list,
bool success);
};
}
#endif