Index: chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h |
diff --git a/chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h b/chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h |
index 064276fc449b5fba27ea4265967254c8e423dc38..fb92a8f61500642e0f20bcc4df119a3877ed82b0 100644 |
--- a/chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h |
+++ b/chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h |
@@ -10,6 +10,7 @@ |
#include "base/callback.h" |
#include "base/files/file.h" |
#include "base/files/file_path.h" |
+#include "base/memory/scoped_ptr.h" |
#include "base/memory/weak_ptr.h" |
#include "webkit/browser/fileapi/async_file_util.h" |
@@ -40,6 +41,10 @@ struct EntryMetadata { |
int64 size; |
base::Time modification_time; |
std::string mime_type; |
+ std::string thumbnail; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(EntryMetadata); |
}; |
// Interface for a provided file system. Acts as a proxy between providers |
@@ -49,6 +54,15 @@ struct EntryMetadata { |
// fails synchronously. |
class ProvidedFileSystemInterface { |
public: |
+ // Mode of opening a file. Used by OpenFile(). |
+ enum OpenFileMode { OPEN_FILE_MODE_READ, OPEN_FILE_MODE_WRITE }; |
+ |
+ // Extra fields to be fetched with metadata. |
+ enum MetadataField { |
+ METADATA_FIELD_DEFAULT = 0, |
+ METADATA_FIELD_THUMBNAIL = 1 << 0 |
+ }; |
+ |
typedef base::Callback<void(int file_handle, base::File::Error result)> |
OpenFileCallback; |
@@ -56,14 +70,14 @@ class ProvidedFileSystemInterface { |
void(int chunk_length, bool has_more, base::File::Error result)> |
ReadChunkReceivedCallback; |
- typedef base::Callback<void(const EntryMetadata& entry_metadata, |
+ typedef base::Callback<void(scoped_ptr<EntryMetadata> entry_metadata, |
base::File::Error result)> GetMetadataCallback; |
typedef base::Callback<void( |
const storage::AsyncFileUtil::StatusCallback& callback)> AbortCallback; |
- // Mode of opening a file. Used by OpenFile(). |
- enum OpenFileMode { OPEN_FILE_MODE_READ, OPEN_FILE_MODE_WRITE }; |
+ // Mask of fields requested from the GetMetadata() call. |
+ typedef int MetadataFieldMask; |
virtual ~ProvidedFileSystemInterface() {} |
@@ -73,8 +87,10 @@ class ProvidedFileSystemInterface { |
const storage::AsyncFileUtil::StatusCallback& callback) = 0; |
// Requests metadata of the passed |entry_path|. It can be either a file |
- // or a directory. |
+ // or a directory. All |fields| will be returned if supported. Note, that |
+ // default fields are always returned. |
virtual AbortCallback GetMetadata(const base::FilePath& entry_path, |
+ MetadataFieldMask fields, |
const GetMetadataCallback& callback) = 0; |
// Requests enumerating entries from the passed |directory_path|. The callback |