1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 #ifndef CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_IMAGE_WRITER_PRIVATE_API_H_
5 #define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_IMAGE_WRITER_PRIVATE_API_H_
7 #include "chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h"
8 #include "chrome/browser/extensions/chrome_extension_function.h"
9 #include "chrome/common/extensions/api/image_writer_private.h"
11 namespace extensions
{
13 class ImageWriterPrivateWriteFromUrlFunction
14 : public ChromeAsyncExtensionFunction
{
16 DECLARE_EXTENSION_FUNCTION("imageWriterPrivate.writeFromUrl",
17 IMAGEWRITER_WRITEFROMURL
)
18 ImageWriterPrivateWriteFromUrlFunction();
21 ~ImageWriterPrivateWriteFromUrlFunction() override
;
22 bool RunAsync() override
;
23 void OnWriteStarted(bool success
, const std::string
& error
);
26 class ImageWriterPrivateWriteFromFileFunction
27 : public ChromeAsyncExtensionFunction
{
29 DECLARE_EXTENSION_FUNCTION("imageWriterPrivate.writeFromFile",
30 IMAGEWRITER_WRITEFROMFILE
)
31 ImageWriterPrivateWriteFromFileFunction();
34 ~ImageWriterPrivateWriteFromFileFunction() override
;
35 bool RunAsync() override
;
36 void OnWriteStarted(bool success
, const std::string
& error
);
39 class ImageWriterPrivateCancelWriteFunction
40 : public ChromeAsyncExtensionFunction
{
42 DECLARE_EXTENSION_FUNCTION("imageWriterPrivate.cancelWrite",
43 IMAGEWRITER_CANCELWRITE
)
44 ImageWriterPrivateCancelWriteFunction();
47 ~ImageWriterPrivateCancelWriteFunction() override
;
48 bool RunAsync() override
;
49 void OnWriteCancelled(bool success
, const std::string
& error
);
52 class ImageWriterPrivateDestroyPartitionsFunction
53 : public ChromeAsyncExtensionFunction
{
55 DECLARE_EXTENSION_FUNCTION("imageWriterPrivate.destroyPartitions",
56 IMAGEWRITER_DESTROYPARTITIONS
)
57 ImageWriterPrivateDestroyPartitionsFunction();
60 ~ImageWriterPrivateDestroyPartitionsFunction() override
;
61 bool RunAsync() override
;
62 void OnDestroyComplete(bool success
, const std::string
& error
);
65 class ImageWriterPrivateListRemovableStorageDevicesFunction
66 : public ChromeAsyncExtensionFunction
{
68 DECLARE_EXTENSION_FUNCTION("imageWriterPrivate.listRemovableStorageDevices",
69 IMAGEWRITER_LISTREMOVABLESTORAGEDEVICES
);
70 ImageWriterPrivateListRemovableStorageDevicesFunction();
73 ~ImageWriterPrivateListRemovableStorageDevicesFunction() override
;
74 bool RunAsync() override
;
75 void OnDeviceListReady(scoped_refptr
<StorageDeviceList
> device_list
,
79 } // namespace extensions
81 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_IMAGE_WRITER_PRIVATE_API_H_