- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / extensions / file_manager / private_api_mount.h
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 //
5 // This file provides task related API functions.
6
7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MOUNT_H_
8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MOUNT_H_
9
10 #include <string>
11 #include <vector>
12
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"
16
17 namespace ui {
18 struct SelectedFileInfo;
19 }
20
21 namespace extensions {
22
23 // Implements chrome.fileBrowserPrivate.addMount method.
24 // Mounts a device or a file.
25 class FileBrowserPrivateAddMountFunction : public LoggedAsyncExtensionFunction {
26  public:
27   DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.addMount",
28                              FILEBROWSERPRIVATE_ADDMOUNT)
29
30  protected:
31   virtual ~FileBrowserPrivateAddMountFunction() {}
32
33   // AsyncExtensionFunction overrides.
34   virtual bool RunImpl() OVERRIDE;
35
36  private:
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);
42 };
43
44 // Implements chrome.fileBrowserPrivate.removeMount method.
45 // Unmounts selected device. Expects mount point path as an argument.
46 class FileBrowserPrivateRemoveMountFunction
47     : public LoggedAsyncExtensionFunction {
48  public:
49   DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.removeMount",
50                              FILEBROWSERPRIVATE_REMOVEMOUNT)
51
52  protected:
53   virtual ~FileBrowserPrivateRemoveMountFunction() {}
54
55   // AsyncExtensionFunction overrides.
56   virtual bool RunImpl() OVERRIDE;
57
58  private:
59   // A callback method to handle the result of GetSelectedFileInfo.
60   void GetSelectedFileInfoResponse(
61       const std::vector<ui::SelectedFileInfo>& files);
62 };
63
64 // Implements chrome.fileBrowserPrivate.getVolumeMetadataList method.
65 class FileBrowserPrivateGetVolumeMetadataListFunction
66     : public LoggedAsyncExtensionFunction {
67  public:
68   DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.getVolumeMetadataList",
69                              FILEBROWSERPRIVATE_GETVOLUMEMETADATALIST)
70
71  protected:
72   virtual ~FileBrowserPrivateGetVolumeMetadataListFunction() {}
73
74   // AsyncExtensionFunction overrides.
75   virtual bool RunImpl() OVERRIDE;
76 };
77
78 }  // namespace extensions
79
80 #endif  // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MOUNT_H_