| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This file provides task related API functions. | 5 // This file provides task related API functions. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MOUNT_H_ | 7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MOUNT_H_ |
| 8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MOUNT_H_ | 8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MOUNT_H_ |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "chrome/browser/chromeos/drive/drive.pb.h" |
| 13 #include "chrome/browser/chromeos/drive/file_errors.h" | 14 #include "chrome/browser/chromeos/drive/file_errors.h" |
| 14 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h" | 15 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h" |
| 15 | 16 |
| 16 namespace ui { | 17 namespace ui { |
| 17 struct SelectedFileInfo; | 18 struct SelectedFileInfo; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace extensions { | 21 namespace extensions { |
| 21 | 22 |
| 22 // Implements chrome.fileManagerPrivate.addMount method. | 23 // Implements chrome.fileManagerPrivate.addMount method. |
| 23 // Mounts removable devices and archive files. | 24 // Mounts removable devices and archive files. |
| 24 class FileManagerPrivateAddMountFunction : public LoggedAsyncExtensionFunction { | 25 class FileManagerPrivateAddMountFunction : public LoggedAsyncExtensionFunction { |
| 25 public: | 26 public: |
| 26 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.addMount", | 27 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.addMount", |
| 27 FILEMANAGERPRIVATE_ADDMOUNT) | 28 FILEMANAGERPRIVATE_ADDMOUNT) |
| 28 | 29 |
| 29 protected: | 30 protected: |
| 30 virtual ~FileManagerPrivateAddMountFunction() {} | 31 virtual ~FileManagerPrivateAddMountFunction() {} |
| 31 | 32 |
| 32 // AsyncExtensionFunction overrides. | 33 // AsyncExtensionFunction overrides. |
| 33 virtual bool RunAsync() OVERRIDE; | 34 virtual bool RunAsync() OVERRIDE; |
| 34 | 35 |
| 35 private: | 36 private: |
| 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); |
| 42 |
| 36 // Part of Run(). Called after MarkCacheFielAsMounted for Drive File System. | 43 // Part of Run(). Called after MarkCacheFielAsMounted for Drive File System. |
| 37 // (or directly called from RunAsync() for other file system). | 44 // (or directly called from RunAsync() for other file system). |
| 38 void RunAfterMarkCacheFileAsMounted(const base::FilePath& display_name, | 45 void RunAfterMarkCacheFileAsMounted(const base::FilePath& display_name, |
| 39 drive::FileError error, | 46 drive::FileError error, |
| 40 const base::FilePath& file_path); | 47 const base::FilePath& file_path); |
| 41 }; | 48 }; |
| 42 | 49 |
| 43 // Implements chrome.fileManagerPrivate.removeMount method. | 50 // Implements chrome.fileManagerPrivate.removeMount method. |
| 44 // Unmounts selected volume. Expects volume id as an argument. | 51 // Unmounts selected volume. Expects volume id as an argument. |
| 45 class FileManagerPrivateRemoveMountFunction | 52 class FileManagerPrivateRemoveMountFunction |
| (...skipping 19 matching lines...) Expand all Loading... |
| 65 protected: | 72 protected: |
| 66 virtual ~FileManagerPrivateGetVolumeMetadataListFunction() {} | 73 virtual ~FileManagerPrivateGetVolumeMetadataListFunction() {} |
| 67 | 74 |
| 68 // AsyncExtensionFunction overrides. | 75 // AsyncExtensionFunction overrides. |
| 69 virtual bool RunAsync() OVERRIDE; | 76 virtual bool RunAsync() OVERRIDE; |
| 70 }; | 77 }; |
| 71 | 78 |
| 72 } // namespace extensions | 79 } // namespace extensions |
| 73 | 80 |
| 74 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MOUNT_H_ | 81 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MOUNT_H_ |
| OLD | NEW |