| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "webkit/browser/fileapi/async_file_util.h" | 10 #include "storage/browser/fileapi/async_file_util.h" |
| 11 | 11 |
| 12 namespace drive { | 12 namespace drive { |
| 13 | 13 |
| 14 class FileSystemInterface; | 14 class FileSystemInterface; |
| 15 | 15 |
| 16 namespace internal { | 16 namespace internal { |
| 17 | 17 |
| 18 // The implementation of fileapi::AsyncFileUtil for Drive File System. | 18 // The implementation of storage::AsyncFileUtil for Drive File System. |
| 19 class AsyncFileUtil : public fileapi::AsyncFileUtil { | 19 class AsyncFileUtil : public storage::AsyncFileUtil { |
| 20 public: | 20 public: |
| 21 AsyncFileUtil(); | 21 AsyncFileUtil(); |
| 22 virtual ~AsyncFileUtil(); | 22 virtual ~AsyncFileUtil(); |
| 23 | 23 |
| 24 // fileapi::AsyncFileUtil overrides. | 24 // storage::AsyncFileUtil overrides. |
| 25 virtual void CreateOrOpen( | 25 virtual void CreateOrOpen( |
| 26 scoped_ptr<fileapi::FileSystemOperationContext> context, | 26 scoped_ptr<storage::FileSystemOperationContext> context, |
| 27 const fileapi::FileSystemURL& url, | 27 const storage::FileSystemURL& url, |
| 28 int file_flags, | 28 int file_flags, |
| 29 const CreateOrOpenCallback& callback) OVERRIDE; | 29 const CreateOrOpenCallback& callback) OVERRIDE; |
| 30 virtual void EnsureFileExists( | 30 virtual void EnsureFileExists( |
| 31 scoped_ptr<fileapi::FileSystemOperationContext> context, | 31 scoped_ptr<storage::FileSystemOperationContext> context, |
| 32 const fileapi::FileSystemURL& url, | 32 const storage::FileSystemURL& url, |
| 33 const EnsureFileExistsCallback& callback) OVERRIDE; | 33 const EnsureFileExistsCallback& callback) OVERRIDE; |
| 34 virtual void CreateDirectory( | 34 virtual void CreateDirectory( |
| 35 scoped_ptr<fileapi::FileSystemOperationContext> context, | 35 scoped_ptr<storage::FileSystemOperationContext> context, |
| 36 const fileapi::FileSystemURL& url, | 36 const storage::FileSystemURL& url, |
| 37 bool exclusive, | 37 bool exclusive, |
| 38 bool recursive, | 38 bool recursive, |
| 39 const StatusCallback& callback) OVERRIDE; | 39 const StatusCallback& callback) OVERRIDE; |
| 40 virtual void GetFileInfo( | 40 virtual void GetFileInfo( |
| 41 scoped_ptr<fileapi::FileSystemOperationContext> context, | 41 scoped_ptr<storage::FileSystemOperationContext> context, |
| 42 const fileapi::FileSystemURL& url, | 42 const storage::FileSystemURL& url, |
| 43 const GetFileInfoCallback& callback) OVERRIDE; | 43 const GetFileInfoCallback& callback) OVERRIDE; |
| 44 virtual void ReadDirectory( | 44 virtual void ReadDirectory( |
| 45 scoped_ptr<fileapi::FileSystemOperationContext> context, | 45 scoped_ptr<storage::FileSystemOperationContext> context, |
| 46 const fileapi::FileSystemURL& url, | 46 const storage::FileSystemURL& url, |
| 47 const ReadDirectoryCallback& callback) OVERRIDE; | 47 const ReadDirectoryCallback& callback) OVERRIDE; |
| 48 virtual void Touch( | 48 virtual void Touch(scoped_ptr<storage::FileSystemOperationContext> context, |
| 49 scoped_ptr<fileapi::FileSystemOperationContext> context, | 49 const storage::FileSystemURL& url, |
| 50 const fileapi::FileSystemURL& url, | 50 const base::Time& last_access_time, |
| 51 const base::Time& last_access_time, | 51 const base::Time& last_modified_time, |
| 52 const base::Time& last_modified_time, | 52 const StatusCallback& callback) OVERRIDE; |
| 53 const StatusCallback& callback) OVERRIDE; | 53 virtual void Truncate(scoped_ptr<storage::FileSystemOperationContext> context, |
| 54 virtual void Truncate( | 54 const storage::FileSystemURL& url, |
| 55 scoped_ptr<fileapi::FileSystemOperationContext> context, | 55 int64 length, |
| 56 const fileapi::FileSystemURL& url, | 56 const StatusCallback& callback) OVERRIDE; |
| 57 int64 length, | |
| 58 const StatusCallback& callback) OVERRIDE; | |
| 59 virtual void CopyFileLocal( | 57 virtual void CopyFileLocal( |
| 60 scoped_ptr<fileapi::FileSystemOperationContext> context, | 58 scoped_ptr<storage::FileSystemOperationContext> context, |
| 61 const fileapi::FileSystemURL& src_url, | 59 const storage::FileSystemURL& src_url, |
| 62 const fileapi::FileSystemURL& dest_url, | 60 const storage::FileSystemURL& dest_url, |
| 63 CopyOrMoveOption option, | 61 CopyOrMoveOption option, |
| 64 const CopyFileProgressCallback& progress_callback, | 62 const CopyFileProgressCallback& progress_callback, |
| 65 const StatusCallback& callback) OVERRIDE; | 63 const StatusCallback& callback) OVERRIDE; |
| 66 virtual void MoveFileLocal( | 64 virtual void MoveFileLocal( |
| 67 scoped_ptr<fileapi::FileSystemOperationContext> context, | 65 scoped_ptr<storage::FileSystemOperationContext> context, |
| 68 const fileapi::FileSystemURL& src_url, | 66 const storage::FileSystemURL& src_url, |
| 69 const fileapi::FileSystemURL& dest_url, | 67 const storage::FileSystemURL& dest_url, |
| 70 CopyOrMoveOption option, | 68 CopyOrMoveOption option, |
| 71 const StatusCallback& callback) OVERRIDE; | 69 const StatusCallback& callback) OVERRIDE; |
| 72 virtual void CopyInForeignFile( | 70 virtual void CopyInForeignFile( |
| 73 scoped_ptr<fileapi::FileSystemOperationContext> context, | 71 scoped_ptr<storage::FileSystemOperationContext> context, |
| 74 const base::FilePath& src_file_path, | 72 const base::FilePath& src_file_path, |
| 75 const fileapi::FileSystemURL& dest_url, | 73 const storage::FileSystemURL& dest_url, |
| 76 const StatusCallback& callback) OVERRIDE; | 74 const StatusCallback& callback) OVERRIDE; |
| 77 virtual void DeleteFile( | 75 virtual void DeleteFile( |
| 78 scoped_ptr<fileapi::FileSystemOperationContext> context, | 76 scoped_ptr<storage::FileSystemOperationContext> context, |
| 79 const fileapi::FileSystemURL& url, | 77 const storage::FileSystemURL& url, |
| 80 const StatusCallback& callback) OVERRIDE; | 78 const StatusCallback& callback) OVERRIDE; |
| 81 virtual void DeleteDirectory( | 79 virtual void DeleteDirectory( |
| 82 scoped_ptr<fileapi::FileSystemOperationContext> context, | 80 scoped_ptr<storage::FileSystemOperationContext> context, |
| 83 const fileapi::FileSystemURL& url, | 81 const storage::FileSystemURL& url, |
| 84 const StatusCallback& callback) OVERRIDE; | 82 const StatusCallback& callback) OVERRIDE; |
| 85 virtual void DeleteRecursively( | 83 virtual void DeleteRecursively( |
| 86 scoped_ptr<fileapi::FileSystemOperationContext> context, | 84 scoped_ptr<storage::FileSystemOperationContext> context, |
| 87 const fileapi::FileSystemURL& url, | 85 const storage::FileSystemURL& url, |
| 88 const StatusCallback& callback) OVERRIDE; | 86 const StatusCallback& callback) OVERRIDE; |
| 89 virtual void CreateSnapshotFile( | 87 virtual void CreateSnapshotFile( |
| 90 scoped_ptr<fileapi::FileSystemOperationContext> context, | 88 scoped_ptr<storage::FileSystemOperationContext> context, |
| 91 const fileapi::FileSystemURL& url, | 89 const storage::FileSystemURL& url, |
| 92 const CreateSnapshotFileCallback& callback) OVERRIDE; | 90 const CreateSnapshotFileCallback& callback) OVERRIDE; |
| 93 | 91 |
| 94 private: | 92 private: |
| 95 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtil); | 93 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtil); |
| 96 }; | 94 }; |
| 97 | 95 |
| 98 } // namespace internal | 96 } // namespace internal |
| 99 } // namespace drive | 97 } // namespace drive |
| 100 | 98 |
| 101 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_ | 99 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_ |
| OLD | NEW |