Upstream version 7.36.149.0
[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 <vector>
11
12 #include "base/files/file_path.h"
13 #include "chrome/browser/chromeos/drive/file_errors.h"
14 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h"
15
16 namespace ui {
17 struct SelectedFileInfo;
18 }
19
20 namespace extensions {
21
22 // Implements chrome.fileBrowserPrivate.addMount method.
23 // Mounts removable devices and archive files.
24 class FileBrowserPrivateAddMountFunction : public LoggedAsyncExtensionFunction {
25  public:
26   DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.addMount",
27                              FILEBROWSERPRIVATE_ADDMOUNT)
28
29  protected:
30   virtual ~FileBrowserPrivateAddMountFunction() {}
31
32   // AsyncExtensionFunction overrides.
33   virtual bool RunAsync() OVERRIDE;
34
35  private:
36   // Part of Run(). Called after MarkCacheFielAsMounted for Drive File System.
37   // (or directly called from RunAsync() for other file system).
38   void RunAfterMarkCacheFileAsMounted(const base::FilePath& display_name,
39                                       drive::FileError error,
40                                       const base::FilePath& file_path);
41 };
42
43 // Implements chrome.fileBrowserPrivate.removeMount method.
44 // Unmounts selected volume. Expects volume id as an argument.
45 class FileBrowserPrivateRemoveMountFunction
46     : public LoggedAsyncExtensionFunction {
47  public:
48   DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.removeMount",
49                              FILEBROWSERPRIVATE_REMOVEMOUNT)
50
51  protected:
52   virtual ~FileBrowserPrivateRemoveMountFunction() {}
53
54   // AsyncExtensionFunction overrides.
55   virtual bool RunAsync() OVERRIDE;
56 };
57
58 // Implements chrome.fileBrowserPrivate.getVolumeMetadataList method.
59 class FileBrowserPrivateGetVolumeMetadataListFunction
60     : public LoggedAsyncExtensionFunction {
61  public:
62   DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.getVolumeMetadataList",
63                              FILEBROWSERPRIVATE_GETVOLUMEMETADATALIST)
64
65  protected:
66   virtual ~FileBrowserPrivateGetVolumeMetadataListFunction() {}
67
68   // AsyncExtensionFunction overrides.
69   virtual bool RunAsync() OVERRIDE;
70 };
71
72 }  // namespace extensions
73
74 #endif  // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MOUNT_H_