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_
13 #include "base/files/file_path.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.fileBrowserPrivate.addMount method.
24 // Mounts a device or a file.
25 class FileBrowserPrivateAddMountFunction : public LoggedAsyncExtensionFunction {
27 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.addMount",
28 FILEBROWSERPRIVATE_ADDMOUNT)
31 virtual ~FileBrowserPrivateAddMountFunction() {}
33 // AsyncExtensionFunction overrides.
34 virtual bool RunImpl() OVERRIDE;
37 // Part of Run(). Called after MarkCacheFielAsMounted for Drive File System.
38 // (or directly called from RunImpl() for other file system).
39 void RunAfterMarkCacheFileAsMounted(const base::FilePath& display_name,
40 drive::FileError error,
41 const base::FilePath& file_path);
44 // Implements chrome.fileBrowserPrivate.removeMount method.
45 // Unmounts selected device. Expects mount point path as an argument.
46 class FileBrowserPrivateRemoveMountFunction
47 : public LoggedAsyncExtensionFunction {
49 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.removeMount",
50 FILEBROWSERPRIVATE_REMOVEMOUNT)
53 virtual ~FileBrowserPrivateRemoveMountFunction() {}
55 // AsyncExtensionFunction overrides.
56 virtual bool RunImpl() OVERRIDE;
59 // A callback method to handle the result of GetSelectedFileInfo.
60 void GetSelectedFileInfoResponse(
61 const std::vector<ui::SelectedFileInfo>& files);
64 // Implements chrome.fileBrowserPrivate.getVolumeMetadataList method.
65 class FileBrowserPrivateGetVolumeMetadataListFunction
66 : public LoggedAsyncExtensionFunction {
68 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.getVolumeMetadataList",
69 FILEBROWSERPRIVATE_GETVOLUMEMETADATALIST)
72 virtual ~FileBrowserPrivateGetVolumeMetadataListFunction() {}
74 // AsyncExtensionFunction overrides.
75 virtual bool RunImpl() OVERRIDE;
78 } // namespace extensions
80 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MOUNT_H_