Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Unified Diff: chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h

Issue 513683002: [fsp] Add support for providing thumbnails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..740ad119a68018d47ed7838a2beff82a63b88e94 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
@@ -40,6 +40,7 @@ struct EntryMetadata {
int64 size;
base::Time modification_time;
std::string mime_type;
+ std::string thumbnail;
};
// Interface for a provided file system. Acts as a proxy between providers
@@ -49,6 +50,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;
@@ -62,8 +72,8 @@ class ProvidedFileSystemInterface {
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 +83,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

Powered by Google App Engine
This is Rietveld 408576698