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 // This file provides task related API functions.
7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MOUNT_H_
8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MOUNT_H_
12 #include "base/files/file_path.h"
13 #include "chrome/browser/chromeos/drive/drive.pb.h"
14 #include "chrome/browser/chromeos/drive/file_errors.h"
15 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h"
18 struct SelectedFileInfo
;
21 namespace extensions
{
23 // Implements chrome.fileManagerPrivate.addMount method.
24 // Mounts removable devices and archive files.
25 class FileManagerPrivateAddMountFunction
: public LoggedAsyncExtensionFunction
{
27 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.addMount",
28 FILEMANAGERPRIVATE_ADDMOUNT
)
31 ~FileManagerPrivateAddMountFunction() override
{}
33 // AsyncExtensionFunction overrides.
34 bool RunAsync() override
;
37 // Part of Run(). Called after GetFile for Drive File System.
38 void RunAfterGetDriveFile(const base::FilePath
& drive_path
,
39 drive::FileError error
,
40 const base::FilePath
& cache_path
,
41 scoped_ptr
<drive::ResourceEntry
> entry
);
43 // Part of Run(). Called after MarkCacheFielAsMounted for Drive File System.
44 // (or directly called from RunAsync() for other file system).
45 void RunAfterMarkCacheFileAsMounted(const base::FilePath
& display_name
,
46 drive::FileError error
,
47 const base::FilePath
& file_path
);
50 // Implements chrome.fileManagerPrivate.removeMount method.
51 // Unmounts selected volume. Expects volume id as an argument.
52 class FileManagerPrivateRemoveMountFunction
53 : public LoggedAsyncExtensionFunction
{
55 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.removeMount",
56 FILEMANAGERPRIVATE_REMOVEMOUNT
)
59 ~FileManagerPrivateRemoveMountFunction() override
{}
61 // AsyncExtensionFunction overrides.
62 bool RunAsync() override
;
65 // Implements chrome.fileManagerPrivate.getVolumeMetadataList method.
66 class FileManagerPrivateGetVolumeMetadataListFunction
67 : public LoggedAsyncExtensionFunction
{
69 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.getVolumeMetadataList",
70 FILEMANAGERPRIVATE_GETVOLUMEMETADATALIST
)
73 ~FileManagerPrivateGetVolumeMetadataListFunction() override
{}
75 // AsyncExtensionFunction overrides.
76 bool RunAsync() override
;
79 } // namespace extensions
81 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MOUNT_H_