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 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "chrome/browser/chromeos/drive/drive_cache.h" | 12 #include "chrome/browser/chromeos/drive/drive_cache.h" |
13 #include "chrome/browser/chromeos/drive/drive_resource_metadata.h" | 13 #include "chrome/browser/chromeos/drive/drive_resource_metadata.h" |
14 #include "chrome/browser/google_apis/gdata_operations.h" | 14 #include "chrome/browser/google_apis/gdata_operations.h" |
15 | 15 |
16 namespace gdata { | 16 namespace gdata { |
17 class DocumentEntry; | 17 class DocumentEntry; |
18 } | 18 } |
19 | 19 |
20 namespace drive { | 20 namespace drive { |
21 | 21 |
22 class DriveEntryProto; | 22 class DriveEntryProto; |
23 class DriveFileSystemObserver; | 23 class DriveFileSystemObserver; |
| 24 class DriveResourceMetadata; |
24 | 25 |
25 typedef std::vector<DriveEntryProto> DriveEntryProtoVector; | 26 typedef std::vector<DriveEntryProto> DriveEntryProtoVector; |
26 | 27 |
27 // Information about search result returned by Search Async callback. | 28 // Information about search result returned by Search Async callback. |
28 // This is data needed to create a file system entry that will be used by file | 29 // This is data needed to create a file system entry that will be used by file |
29 // browser. | 30 // browser. |
30 struct SearchResultInfo { | 31 struct SearchResultInfo { |
31 SearchResultInfo(const FilePath& in_path, bool in_is_directory) | 32 SearchResultInfo(const FilePath& in_path, bool in_is_directory) |
32 : path(in_path), | 33 : path(in_path), |
33 is_directory(in_is_directory) { | 34 is_directory(in_is_directory) { |
34 } | 35 } |
35 | 36 |
36 FilePath path; | 37 FilePath path; |
37 bool is_directory; | 38 bool is_directory; |
38 }; | 39 }; |
39 | 40 |
| 41 // Metadata of DriveFileSystem. Used by DriveFileSystem::GetMetadata(). |
| 42 struct DriveFileSystemMetadata { |
| 43 DriveFileSystemMetadata() : largest_changestamp(0) {} |
| 44 ~DriveFileSystemMetadata() {} |
| 45 |
| 46 int64 largest_changestamp; |
| 47 }; |
| 48 |
40 // Used to get files from the file system. | 49 // Used to get files from the file system. |
41 typedef base::Callback<void(DriveFileError error, | 50 typedef base::Callback<void(DriveFileError error, |
42 const FilePath& file_path, | 51 const FilePath& file_path, |
43 const std::string& mime_type, | 52 const std::string& mime_type, |
44 DriveFileType file_type)> GetFileCallback; | 53 DriveFileType file_type)> GetFileCallback; |
45 | 54 |
46 // Used to read a directory from the file system. | 55 // Used to read a directory from the file system. |
47 // Similar to ReadDirectoryCallback but this one provides | 56 // Similar to ReadDirectoryCallback but this one provides |
48 // |hide_hosted_documents| | 57 // |hide_hosted_documents| |
49 // If |error| is not DRIVE_FILE_OK, |entries| is set to NULL. | 58 // If |error| is not DRIVE_FILE_OK, |entries| is set to NULL. |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 | 348 |
340 // Updates the data associated with the file referenced by |resource_id| and | 349 // Updates the data associated with the file referenced by |resource_id| and |
341 // |md5|. The data is copied from |file_content_path|. | 350 // |md5|. The data is copied from |file_content_path|. |
342 // | 351 // |
343 // |callback| will be called on the UI thread upon completion of operation. | 352 // |callback| will be called on the UI thread upon completion of operation. |
344 virtual void UpdateEntryData(const std::string& resource_id, | 353 virtual void UpdateEntryData(const std::string& resource_id, |
345 const std::string& md5, | 354 const std::string& md5, |
346 scoped_ptr<gdata::DocumentEntry> entry, | 355 scoped_ptr<gdata::DocumentEntry> entry, |
347 const FilePath& file_content_path, | 356 const FilePath& file_content_path, |
348 const base::Closure& callback) = 0; | 357 const base::Closure& callback) = 0; |
| 358 |
| 359 // Returns metadata of the file system. |
| 360 virtual DriveFileSystemMetadata GetMetadata() const = 0; |
349 }; | 361 }; |
350 | 362 |
351 } // namespace drive | 363 } // namespace drive |
352 | 364 |
353 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_INTERFACE_H_ | 365 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_INTERFACE_H_ |
OLD | NEW |