OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DRIVE_FILE_SYSTEM_INTERFACE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_INTERFACE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_INTERFACE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_INTERFACE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Used to open files from the file system. |file_path| is the path on the local | 65 // Used to open files from the file system. |file_path| is the path on the local |
66 // file system for the opened file. | 66 // file system for the opened file. |
67 typedef base::Callback<void(DriveFileError error, | 67 typedef base::Callback<void(DriveFileError error, |
68 const FilePath& file_path)> OpenFileCallback; | 68 const FilePath& file_path)> OpenFileCallback; |
69 | 69 |
70 // Used to get available space for the account from Drive. | 70 // Used to get available space for the account from Drive. |
71 typedef base::Callback<void(DriveFileError error, | 71 typedef base::Callback<void(DriveFileError error, |
72 int64 bytes_total, | 72 int64 bytes_total, |
73 int64 bytes_used)> GetAvailableSpaceCallback; | 73 int64 bytes_used)> GetAvailableSpaceCallback; |
74 | 74 |
| 75 // Used to get drive filesystem metadata. |
| 76 typedef base::Callback<void(const DriveFileSystemMetadata&)> |
| 77 GetFilesystemMetadataCallback; |
| 78 |
75 // Drive file system abstraction layer. | 79 // Drive file system abstraction layer. |
76 // The interface is defined to make DriveFileSystem mockable. | 80 // The interface is defined to make DriveFileSystem mockable. |
77 class DriveFileSystemInterface { | 81 class DriveFileSystemInterface { |
78 public: | 82 public: |
79 virtual ~DriveFileSystemInterface() {} | 83 virtual ~DriveFileSystemInterface() {} |
80 | 84 |
81 // Initializes the object. This function should be called before any | 85 // Initializes the object. This function should be called before any |
82 // other functions. | 86 // other functions. |
83 virtual void Initialize() = 0; | 87 virtual void Initialize() = 0; |
84 | 88 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 // |file_content_path| into the cache. | 338 // |file_content_path| into the cache. |
335 // | 339 // |
336 // |callback| will be called on the UI thread upon completion of operation. | 340 // |callback| will be called on the UI thread upon completion of operation. |
337 // |callback| must not be null. | 341 // |callback| must not be null. |
338 virtual void AddUploadedFile(const FilePath& directory_path, | 342 virtual void AddUploadedFile(const FilePath& directory_path, |
339 scoped_ptr<google_apis::ResourceEntry> doc_entry, | 343 scoped_ptr<google_apis::ResourceEntry> doc_entry, |
340 const FilePath& file_content_path, | 344 const FilePath& file_content_path, |
341 const FileOperationCallback& callback) = 0; | 345 const FileOperationCallback& callback) = 0; |
342 | 346 |
343 // Returns miscellaneous metadata of the file system like the largest | 347 // Returns miscellaneous metadata of the file system like the largest |
344 // timestamp. Used in chrome:drive-internals. | 348 // timestamp. Used in chrome:drive-internals. |callback| must not be null. |
345 virtual DriveFileSystemMetadata GetMetadata() const = 0; | 349 virtual void GetMetadata( |
| 350 const GetFilesystemMetadataCallback& callback) = 0; |
346 | 351 |
347 // Reloads the file system feeds from the server. | 352 // Reloads the file system feeds from the server. |
348 virtual void Reload() = 0; | 353 virtual void Reload() = 0; |
349 }; | 354 }; |
350 | 355 |
351 } // namespace drive | 356 } // namespace drive |
352 | 357 |
353 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_INTERFACE_H_ | 358 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_INTERFACE_H_ |
OLD | NEW |