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

Unified Diff: chrome/browser/extensions/api/file_system/file_system_api.h

Issue 23146016: Add support for directory access to the file system API. (Closed) Base URL: http://git.chromium.org/chromium/src.git@simpler-write-permissions
Patch Set: Created 7 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/extensions/api/file_system/file_system_api.h
diff --git a/chrome/browser/extensions/api/file_system/file_system_api.h b/chrome/browser/extensions/api/file_system/file_system_api.h
index f44d8c6e0eb1f52b339030fa8e0f029d604841eb..2a65fa52b3e810b8304ce3df493d53655e198465 100644
--- a/chrome/browser/extensions/api/file_system/file_system_api.h
+++ b/chrome/browser/extensions/api/file_system/file_system_api.h
@@ -74,6 +74,9 @@ class FileSystemEntryFunction : public AsyncExtensionFunction {
// Whether multiple entries have been requested.
bool multiple_;
+ // Whether a directory has been requested.
+ bool is_directory_;
+
// The dictionary to send as the response.
base::DictionaryValue* response_;
};
@@ -86,6 +89,13 @@ class FileSystemGetWritableEntryFunction : public FileSystemEntryFunction {
protected:
virtual ~FileSystemGetWritableEntryFunction() {}
virtual bool RunImpl() OVERRIDE;
+
+ private:
+ void CheckPermissionAndSendResponse();
+ void SetIsDirectoryOnFileThread();
+
+ // The path to the file for which a writable entry has been requested.
+ base::FilePath path_;
};
class FileSystemIsWritableEntryFunction : public SyncExtensionFunction {
@@ -146,7 +156,7 @@ class FileSystemChooseEntryFunction : public FileSystemEntryFunction {
base::FilePath initial_path_;
};
-class FileSystemRetainEntryFunction : public SyncExtensionFunction {
+class FileSystemRetainEntryFunction : public AsyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("fileSystem.retainEntry", FILESYSTEM_RETAINENTRY)
@@ -157,7 +167,15 @@ class FileSystemRetainEntryFunction : public SyncExtensionFunction {
private:
// Retains the file entry referenced by |entry_id| in apps::SavedFilesService.
// |entry_id| must refer to an entry in an isolated file system.
- bool RetainFileEntry(const std::string& entry_id);
+ void RetainFileEntry(const std::string& entry_id);
+
+ void SetIsDirectoryOnFileThread();
+
+ // Whether the file being retained is a directory.
+ bool is_directory_;
+
+ // The path to the file to retain.
+ base::FilePath path_;
};
class FileSystemIsRestorableFunction : public SyncExtensionFunction {

Powered by Google App Engine
This is Rietveld 408576698