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.
5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_SYSTEM_PROVIDER_FILE_SYSTEM_PROVIDER_API_H_
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_SYSTEM_PROVIDER_FILE_SYSTEM_PROVIDER_API_H_
8 #include "chrome/browser/chromeos/extensions/file_system_provider/provider_function.h"
9 #include "chrome/browser/extensions/chrome_extension_function.h"
11 namespace extensions
{
13 class FileSystemProviderMountFunction
: public ChromeSyncExtensionFunction
{
15 DECLARE_EXTENSION_FUNCTION("fileSystemProvider.mount",
16 FILESYSTEMPROVIDER_MOUNT
)
19 ~FileSystemProviderMountFunction() override
{}
20 bool RunSync() override
;
23 class FileSystemProviderUnmountFunction
: public ChromeSyncExtensionFunction
{
25 DECLARE_EXTENSION_FUNCTION("fileSystemProvider.unmount",
26 FILESYSTEMPROVIDER_UNMOUNT
)
29 ~FileSystemProviderUnmountFunction() override
{}
30 bool RunSync() override
;
33 class FileSystemProviderGetAllFunction
: public ChromeSyncExtensionFunction
{
35 DECLARE_EXTENSION_FUNCTION("fileSystemProvider.getAll",
36 FILESYSTEMPROVIDER_GETALL
)
39 ~FileSystemProviderGetAllFunction() override
{}
40 bool RunSync() override
;
43 class FileSystemProviderGetFunction
: public ChromeSyncExtensionFunction
{
45 DECLARE_EXTENSION_FUNCTION("fileSystemProvider.get", FILESYSTEMPROVIDER_GET
)
48 ~FileSystemProviderGetFunction() override
{}
49 bool RunSync() override
;
52 class FileSystemProviderNotifyFunction
: public ChromeAsyncExtensionFunction
{
54 DECLARE_EXTENSION_FUNCTION("fileSystemProvider.notify",
55 FILESYSTEMPROVIDER_NOTIFY
)
58 ~FileSystemProviderNotifyFunction() override
{}
59 bool RunAsync() override
;
62 // Called when notifying is completed.
63 void OnNotifyCompleted(base::File::Error result
);
66 class FileSystemProviderInternalUnmountRequestedSuccessFunction
67 : public FileSystemProviderInternalFunction
{
69 DECLARE_EXTENSION_FUNCTION(
70 "fileSystemProviderInternal.unmountRequestedSuccess",
71 FILESYSTEMPROVIDERINTERNAL_UNMOUNTREQUESTEDSUCCESS
)
74 ~FileSystemProviderInternalUnmountRequestedSuccessFunction() override
{}
75 bool RunWhenValid() override
;
78 class FileSystemProviderInternalGetMetadataRequestedSuccessFunction
79 : public FileSystemProviderInternalFunction
{
81 DECLARE_EXTENSION_FUNCTION(
82 "fileSystemProviderInternal.getMetadataRequestedSuccess",
83 FILESYSTEMPROVIDERINTERNAL_GETMETADATAREQUESTEDSUCCESS
)
86 ~FileSystemProviderInternalGetMetadataRequestedSuccessFunction() override
{}
87 bool RunWhenValid() override
;
90 class FileSystemProviderInternalGetActionsRequestedSuccessFunction
91 : public FileSystemProviderInternalFunction
{
93 DECLARE_EXTENSION_FUNCTION(
94 "fileSystemProviderInternal.getActionsRequestedSuccess",
95 FILESYSTEMPROVIDERINTERNAL_GETACTIONSREQUESTEDSUCCESS
)
98 ~FileSystemProviderInternalGetActionsRequestedSuccessFunction() override
{}
99 bool RunWhenValid() override
;
102 class FileSystemProviderInternalReadDirectoryRequestedSuccessFunction
103 : public FileSystemProviderInternalFunction
{
105 DECLARE_EXTENSION_FUNCTION(
106 "fileSystemProviderInternal.readDirectoryRequestedSuccess",
107 FILESYSTEMPROVIDERINTERNAL_READDIRECTORYREQUESTEDSUCCESS
)
110 ~FileSystemProviderInternalReadDirectoryRequestedSuccessFunction() override
{}
111 bool RunWhenValid() override
;
114 class FileSystemProviderInternalReadFileRequestedSuccessFunction
115 : public FileSystemProviderInternalFunction
{
117 DECLARE_EXTENSION_FUNCTION(
118 "fileSystemProviderInternal.readFileRequestedSuccess",
119 FILESYSTEMPROVIDERINTERNAL_READFILEREQUESTEDSUCCESS
)
122 ~FileSystemProviderInternalReadFileRequestedSuccessFunction() override
{}
123 bool RunWhenValid() override
;
126 class FileSystemProviderInternalOperationRequestedSuccessFunction
127 : public FileSystemProviderInternalFunction
{
129 DECLARE_EXTENSION_FUNCTION(
130 "fileSystemProviderInternal.operationRequestedSuccess",
131 FILESYSTEMPROVIDERINTERNAL_OPERATIONREQUESTEDSUCCESS
)
134 ~FileSystemProviderInternalOperationRequestedSuccessFunction() override
{}
135 bool RunWhenValid() override
;
138 class FileSystemProviderInternalOperationRequestedErrorFunction
139 : public FileSystemProviderInternalFunction
{
141 DECLARE_EXTENSION_FUNCTION(
142 "fileSystemProviderInternal.operationRequestedError",
143 FILESYSTEMPROVIDERINTERNAL_OPERATIONREQUESTEDERROR
)
146 ~FileSystemProviderInternalOperationRequestedErrorFunction() override
{}
147 bool RunWhenValid() override
;
150 } // namespace extensions
152 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_SYSTEM_PROVIDER_FILE_SYSTEM_PROVIDER_API_H_