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 "storage/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 storage::AsyncFileUtil for Drive File System. | 18 // The implementation of storage::AsyncFileUtil for Drive File System. |
19 class AsyncFileUtil : public storage::AsyncFileUtil { | 19 class AsyncFileUtil : public storage::AsyncFileUtil { |
20 public: | 20 public: |
21 AsyncFileUtil(); | 21 AsyncFileUtil(); |
22 virtual ~AsyncFileUtil(); | 22 virtual ~AsyncFileUtil(); |
23 | 23 |
24 // storage::AsyncFileUtil overrides. | 24 // storage::AsyncFileUtil overrides. |
25 virtual void CreateOrOpen( | 25 virtual void CreateOrOpen( |
26 scoped_ptr<storage::FileSystemOperationContext> context, | 26 scoped_ptr<storage::FileSystemOperationContext> context, |
27 const storage::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<storage::FileSystemOperationContext> context, | 31 scoped_ptr<storage::FileSystemOperationContext> context, |
32 const storage::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<storage::FileSystemOperationContext> context, | 35 scoped_ptr<storage::FileSystemOperationContext> context, |
36 const storage::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<storage::FileSystemOperationContext> context, | 41 scoped_ptr<storage::FileSystemOperationContext> context, |
42 const storage::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<storage::FileSystemOperationContext> context, | 45 scoped_ptr<storage::FileSystemOperationContext> context, |
46 const storage::FileSystemURL& url, | 46 const storage::FileSystemURL& url, |
47 const ReadDirectoryCallback& callback) OVERRIDE; | 47 const ReadDirectoryCallback& callback) override; |
48 virtual void Touch(scoped_ptr<storage::FileSystemOperationContext> context, | 48 virtual void Touch(scoped_ptr<storage::FileSystemOperationContext> context, |
49 const storage::FileSystemURL& url, | 49 const storage::FileSystemURL& url, |
50 const base::Time& last_access_time, | 50 const base::Time& last_access_time, |
51 const base::Time& last_modified_time, | 51 const base::Time& last_modified_time, |
52 const StatusCallback& callback) OVERRIDE; | 52 const StatusCallback& callback) override; |
53 virtual void Truncate(scoped_ptr<storage::FileSystemOperationContext> context, | 53 virtual void Truncate(scoped_ptr<storage::FileSystemOperationContext> context, |
54 const storage::FileSystemURL& url, | 54 const storage::FileSystemURL& url, |
55 int64 length, | 55 int64 length, |
56 const StatusCallback& callback) OVERRIDE; | 56 const StatusCallback& callback) override; |
57 virtual void CopyFileLocal( | 57 virtual void CopyFileLocal( |
58 scoped_ptr<storage::FileSystemOperationContext> context, | 58 scoped_ptr<storage::FileSystemOperationContext> context, |
59 const storage::FileSystemURL& src_url, | 59 const storage::FileSystemURL& src_url, |
60 const storage::FileSystemURL& dest_url, | 60 const storage::FileSystemURL& dest_url, |
61 CopyOrMoveOption option, | 61 CopyOrMoveOption option, |
62 const CopyFileProgressCallback& progress_callback, | 62 const CopyFileProgressCallback& progress_callback, |
63 const StatusCallback& callback) OVERRIDE; | 63 const StatusCallback& callback) override; |
64 virtual void MoveFileLocal( | 64 virtual void MoveFileLocal( |
65 scoped_ptr<storage::FileSystemOperationContext> context, | 65 scoped_ptr<storage::FileSystemOperationContext> context, |
66 const storage::FileSystemURL& src_url, | 66 const storage::FileSystemURL& src_url, |
67 const storage::FileSystemURL& dest_url, | 67 const storage::FileSystemURL& dest_url, |
68 CopyOrMoveOption option, | 68 CopyOrMoveOption option, |
69 const StatusCallback& callback) OVERRIDE; | 69 const StatusCallback& callback) override; |
70 virtual void CopyInForeignFile( | 70 virtual void CopyInForeignFile( |
71 scoped_ptr<storage::FileSystemOperationContext> context, | 71 scoped_ptr<storage::FileSystemOperationContext> context, |
72 const base::FilePath& src_file_path, | 72 const base::FilePath& src_file_path, |
73 const storage::FileSystemURL& dest_url, | 73 const storage::FileSystemURL& dest_url, |
74 const StatusCallback& callback) OVERRIDE; | 74 const StatusCallback& callback) override; |
75 virtual void DeleteFile( | 75 virtual void DeleteFile( |
76 scoped_ptr<storage::FileSystemOperationContext> context, | 76 scoped_ptr<storage::FileSystemOperationContext> context, |
77 const storage::FileSystemURL& url, | 77 const storage::FileSystemURL& url, |
78 const StatusCallback& callback) OVERRIDE; | 78 const StatusCallback& callback) override; |
79 virtual void DeleteDirectory( | 79 virtual void DeleteDirectory( |
80 scoped_ptr<storage::FileSystemOperationContext> context, | 80 scoped_ptr<storage::FileSystemOperationContext> context, |
81 const storage::FileSystemURL& url, | 81 const storage::FileSystemURL& url, |
82 const StatusCallback& callback) OVERRIDE; | 82 const StatusCallback& callback) override; |
83 virtual void DeleteRecursively( | 83 virtual void DeleteRecursively( |
84 scoped_ptr<storage::FileSystemOperationContext> context, | 84 scoped_ptr<storage::FileSystemOperationContext> context, |
85 const storage::FileSystemURL& url, | 85 const storage::FileSystemURL& url, |
86 const StatusCallback& callback) OVERRIDE; | 86 const StatusCallback& callback) override; |
87 virtual void CreateSnapshotFile( | 87 virtual void CreateSnapshotFile( |
88 scoped_ptr<storage::FileSystemOperationContext> context, | 88 scoped_ptr<storage::FileSystemOperationContext> context, |
89 const storage::FileSystemURL& url, | 89 const storage::FileSystemURL& url, |
90 const CreateSnapshotFileCallback& callback) OVERRIDE; | 90 const CreateSnapshotFileCallback& callback) override; |
91 | 91 |
92 private: | 92 private: |
93 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtil); | 93 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtil); |
94 }; | 94 }; |
95 | 95 |
96 } // namespace internal | 96 } // namespace internal |
97 } // namespace drive | 97 } // namespace drive |
98 | 98 |
99 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_ | 99 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_ |
OLD | NEW |