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

Unified Diff: chrome/common/extensions/api/file_system.idl

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/common/extensions/api/file_system.idl
diff --git a/chrome/common/extensions/api/file_system.idl b/chrome/common/extensions/api/file_system.idl
index 3ddec881ded528dc134b019bd4f00050c5019424..7e3d6d6184b79c31751b4ee3635baf4e08c0ce02 100644
--- a/chrome/common/extensions/api/file_system.idl
+++ b/chrome/common/extensions/api/file_system.idl
@@ -38,7 +38,14 @@ namespace fileSystem {
// Prompts the user to open an existing file or a new file and returns a
// writable FileEntry on success. Calls using this type will fail unless the
// application has the 'write' permission under 'fileSystem'.
- saveFile
+ saveFile,
+
+ // Prompts the user to open a directory and returns a DirectoryEntry on
+ // success. Calls using this type will fail unless the application has the
+ // 'directory' permission under 'fileSystem'. If the application has the
+ // 'write' permission under 'fileSystem', the returned DirectoryEntry will
+ // be writable; otherwise it will be read-only. New in Chrome 31.
+ openDirectory
};
dictionary ChooseEntryOptions {
@@ -68,36 +75,38 @@ namespace fileSystem {
boolean? acceptsMultiple;
};
callback GetDisplayPathCallback = void (DOMString displayPath);
- callback FileEntryCallback = void ([instanceOf=FileEntry] object fileEntry);
- callback FileEntriesCallback = void (
- [instanceOf=FileEntry] optional object fileEntry,
+ callback EntryCallback = void ([instanceOf=Entry] object entry);
+ callback EntriesCallback = void (
+ [instanceOf=Entry] optional object entry,
[instanceOf=FileEntry] optional object[] fileEntries);
callback IsWritableCallback = void (boolean isWritable);
callback IsRestorableCallback = void (boolean isRestorable);
interface Functions {
- // Get the display path of a FileEntry object. The display path is based on
- // the full path of the file on the local file system, but may be made more
- // readable for display purposes.
- static void getDisplayPath([instanceOf=FileEntry] object fileEntry,
+ // Get the display path of an Entry object. The display path is based on
+ // the full path of the file or directory on the local file system, but may
+ // be made more readable for display purposes.
+ static void getDisplayPath([instanceOf=Entry] object entry,
GetDisplayPathCallback callback);
- // Get a writable FileEntry from another FileEntry. This call will fail if
- // the application does not have the 'write' permission under 'fileSystem'.
- static void getWritableEntry([instanceOf=FileEntry] object fileEntry,
- FileEntryCallback callback);
+ // Get a writable Entry from another Entry. This call will fail if the
+ // application does not have the 'write' permission under 'fileSystem'. If
+ // entry is a DirectoryEntry, this call will fail if the application does
+ // not have the 'directory' permission under 'fileSystem'.
+ static void getWritableEntry([instanceOf=Entry] object entry,
+ EntryCallback callback);
- // Gets whether this FileEntry is writable or not.
- static void isWritableEntry([instanceOf=FileEntry] object fileEntry,
+ // Gets whether this Entry is writable or not.
+ static void isWritableEntry([instanceOf=Entry] object entry,
IsWritableCallback callback);
- // Ask the user to choose a file.
+ // Ask the user to choose a file or directory.
static void chooseEntry(optional ChooseEntryOptions options,
- FileEntriesCallback callback);
+ EntriesCallback callback);
// Returns the file entry with the given id if it can be restored. This call
// will fail otherwise. This method is new in Chrome 30.
- static void restoreEntry(DOMString id, FileEntryCallback callback);
+ static void restoreEntry(DOMString id, EntryCallback callback);
// Returns whether a file entry for the given id can be restored, i.e.
// whether restoreEntry would succeed with this id now. This method is new
@@ -111,6 +120,6 @@ namespace fileSystem {
// to dev channel), entries are retained indefinitely. Otherwise, entries
// are retained only while the app is running and across restarts. This
// method is new in Chrome 30.
- static DOMString retainEntry([instanceOf=FileEntry] object fileEntry);
+ static DOMString retainEntry([instanceOf=Entry] object entry);
};
};
« no previous file with comments | « chrome/common/extensions/api/_permission_features.json ('k') | chrome/common/extensions/permissions/api_permission.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698