diff options
author | benwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-14 13:35:38 +0000 |
---|---|---|
committer | benwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-14 13:35:38 +0000 |
commit | 00b596bfd8bb3ec72dfa66bf987f3fa054929871 (patch) | |
tree | 4781b1a43011733c91917e3d6667f4244baf2ab9 /chrome/common | |
parent | 0a4439332b8ef6eb91a3532b7a1626d33a014fdb (diff) | |
download | chromium_src-00b596bfd8bb3ec72dfa66bf987f3fa054929871.zip chromium_src-00b596bfd8bb3ec72dfa66bf987f3fa054929871.tar.gz chromium_src-00b596bfd8bb3ec72dfa66bf987f3fa054929871.tar.bz2 |
Rename chrome.fileSystem apis to be expandable to directories if we wish.
The naming is currently all about files, this change makes it file / directory neutral to allow us to use the same APIs for directories at some point if we decide to.
BUG=149152
Review URL: https://chromiumcodereview.appspot.com/10914284
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156795 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/extensions/api/file_system.idl | 14 | ||||
-rw-r--r-- | chrome/common/extensions/docs/server2/templates/articles/app_storage.html | 8 |
2 files changed, 11 insertions, 11 deletions
diff --git a/chrome/common/extensions/api/file_system.idl b/chrome/common/extensions/api/file_system.idl index 999b68e..f101430 100644 --- a/chrome/common/extensions/api/file_system.idl +++ b/chrome/common/extensions/api/file_system.idl @@ -18,7 +18,7 @@ namespace fileSystem { DOMString[]? extensions; }; - dictionary ChooseFileOptions { + dictionary ChooseEntryOptions { // Type of the prompt to show. Valid types are 'openFile', // 'openWritableFile' or 'saveFile'. // @@ -59,15 +59,15 @@ namespace fileSystem { // Get a writable FileEntry from another FileEntry. This call will fail if // the application does not have the 'write' permission under 'fileSystem'. - static void getWritableFileEntry([instanceOf=FileEntry] object fileEntry, - FileEntryCallback callback); + static void getWritableEntry([instanceOf=FileEntry] object fileEntry, + FileEntryCallback callback); // Gets whether this FileEntry is writable or not. - static void isWritableFileEntry([instanceOf=FileEntry] object fileEntry, - IsWritableCallback callback); + static void isWritableEntry([instanceOf=FileEntry] object fileEntry, + IsWritableCallback callback); // Ask the user to choose a file. - static void chooseFile(optional ChooseFileOptions options, - FileEntryCallback callback); + static void chooseEntry(optional ChooseEntryOptions options, + FileEntryCallback callback); }; }; diff --git a/chrome/common/extensions/docs/server2/templates/articles/app_storage.html b/chrome/common/extensions/docs/server2/templates/articles/app_storage.html index 83ddc51..77c65d7 100644 --- a/chrome/common/extensions/docs/server2/templates/articles/app_storage.html +++ b/chrome/common/extensions/docs/server2/templates/articles/app_storage.html @@ -167,7 +167,7 @@ If the file doesn't exist, an error is thrown. var chosenFileEntry = null; chooseFileButton.addEventListener('click', function(e) { - chrome.fileSystem.chooseFile({type: 'openFile'}, function(readOnlyEntry) { + chrome.fileSystem.chooseEntry({type: 'openFile'}, function(readOnlyEntry) { readOnlyEntry.file(function(file) { var reader = new FileReader(); @@ -189,13 +189,13 @@ chooseFileButton.addEventListener('click', function(e) { The two common use-cases for writing a file are "Save" and "Save as". The following code creates a -<code>writableFileEntry</code> +<code>writableEntry</code> from the read-only <code>chosenFileEntry</code> and writes the selected file to it. </p> <pre> - chrome.fileSystem.getWritableFileEntry(chosenFileEntry, function(writableFileEntry) { + chrome.fileSystem.getWritableEntry(chosenFileEntry, function(writableFileEntry) { writableFileEntry.createWriter(function(writer) { writer.onerror = errorHandler; writer.onwriteend = callback; @@ -215,7 +215,7 @@ using the <code>writer.write()</code> method. </p> <pre> -chrome.fileSystem.chooseFile({type: 'saveFile'}, function(writableFileEntry) { +chrome.fileSystem.chooseEntry({type: 'saveFile'}, function(writableFileEntry) { writableFileEntry.createWriter(function(writer) { writer.onerror = errorHandler; writer.onwriteend = function(e) { |