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

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

Issue 14607023: Add support for persistent file access in apps. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 7 years, 7 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 0dad0c025d92e9ecfad31c502333abdc6307ddd8..9793e57982b9ee9cd1015e62a2dbc987ecdf63e9 100644
--- a/chrome/browser/extensions/api/file_system/file_system_api.h
+++ b/chrome/browser/extensions/api/file_system/file_system_api.h
@@ -44,6 +44,16 @@ class FileSystemEntryFunction : public AsyncExtensionFunction {
void RegisterFileSystemAndSendResponse(const base::FilePath& path,
EntryType entry_type);
+ // This will finish the choose file process. This is either called directly
+ // from FileSelected, or from CreateFileIfNecessary. It is called on the UI
+ // thread. |id_override| specifies the id to send in the response instead of
+ // the generated id. This can be useful for creating a file entry with an id
+ // matching another file entry, e.g. for restoreEntry.
+ void RegisterFileSystemAndSendResponseWithIdOverride(
+ const base::FilePath& path,
+ EntryType entry_type,
+ const std::string& id_override);
+
// called on the UI thread if there is a problem checking a writable file.
void HandleWritableFileError();
};
@@ -115,6 +125,38 @@ class FileSystemChooseEntryFunction : public FileSystemEntryFunction {
base::FilePath initial_path_;
};
+class FileSystemRetainEntryFunction : public SyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("fileSystem.retainEntry", FILESYSTEM_RETAINENTRY)
+
+ protected:
+ virtual ~FileSystemRetainEntryFunction() {}
+ virtual bool RunImpl() OVERRIDE;
+
+ 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);
+};
+
+class FileSystemIsRestorableFunction : public SyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("fileSystem.isRestorable", FILESYSTEM_ISRESTORABLE)
+
+ protected:
+ virtual ~FileSystemIsRestorableFunction() {}
+ virtual bool RunImpl() OVERRIDE;
+};
+
+class FileSystemRestoreEntryFunction : public FileSystemEntryFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("fileSystem.restoreEntry", FILESYSTEM_RESTOREENTRY)
+
+ protected:
+ virtual ~FileSystemRestoreEntryFunction() {}
+ virtual bool RunImpl() OVERRIDE;
+};
+
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_

Powered by Google App Engine
This is Rietveld 408576698