| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 namespace fileSystem { | 5 namespace fileSystem { |
| 6 dictionary AcceptOption { | 6 dictionary AcceptOption { |
| 7 // This is the optional text description for this option. If not present, | 7 // This is the optional text description for this option. If not present, |
| 8 // a description will be automatically generated; typically containing an | 8 // a description will be automatically generated; typically containing an |
| 9 // expanded list of valid extensions (e.g. "text/html" may expand to | 9 // expanded list of valid extensions (e.g. "text/html" may expand to |
| 10 // "*.html, *.htm"). | 10 // "*.html, *.htm"). |
| 11 DOMString? description; | 11 DOMString? description; |
| 12 | 12 |
| 13 // Mime-types to accept, e.g. "image/jpeg" or "audio/*". One of mimeTypes or | 13 // Mime-types to accept, e.g. "image/jpeg" or "audio/*". One of mimeTypes or |
| 14 // extensions must contain at least one valid element. | 14 // extensions must contain at least one valid element. |
| 15 DOMString[]? mimeTypes; | 15 DOMString[]? mimeTypes; |
| 16 | 16 |
| 17 // Extensions to accept, e.g. "jpg", "gif", "crx". | 17 // Extensions to accept, e.g. "jpg", "gif", "crx". |
| 18 DOMString[]? extensions; | 18 DOMString[]? extensions; |
| 19 }; | 19 }; |
| 20 | 20 |
| 21 dictionary ChooseFileOptions { | 21 dictionary ChooseEntryOptions { |
| 22 // Type of the prompt to show. Valid types are 'openFile', | 22 // Type of the prompt to show. Valid types are 'openFile', |
| 23 // 'openWritableFile' or 'saveFile'. | 23 // 'openWritableFile' or 'saveFile'. |
| 24 // | 24 // |
| 25 // Both 'openFile' and 'openWritableFile' will prompt the user to open an | 25 // Both 'openFile' and 'openWritableFile' will prompt the user to open an |
| 26 // existing file, with 'openFile' returning a read-only FileEntry on | 26 // existing file, with 'openFile' returning a read-only FileEntry on |
| 27 // success. 'saveFile' will prompt the user to choose an existing file or | 27 // success. 'saveFile' will prompt the user to choose an existing file or |
| 28 // a new file, and will return a writable FileEntry. | 28 // a new file, and will return a writable FileEntry. |
| 29 // Calls to chooseFile with either 'openWritableFile' or 'saveFile' will | 29 // Calls to chooseFile with either 'openWritableFile' or 'saveFile' will |
| 30 // fail unless the application has the fileSystemWrite permission. | 30 // fail unless the application has the fileSystemWrite permission. |
| 31 // | 31 // |
| (...skipping 19 matching lines...) Expand all Loading... |
| 51 | 51 |
| 52 interface Functions { | 52 interface Functions { |
| 53 // Get the display path of a FileEntry object. The display path is based on | 53 // Get the display path of a FileEntry object. The display path is based on |
| 54 // the full path of the file on the local file system, but may be made more | 54 // the full path of the file on the local file system, but may be made more |
| 55 // readable for display purposes. | 55 // readable for display purposes. |
| 56 static void getDisplayPath([instanceOf=FileEntry] object fileEntry, | 56 static void getDisplayPath([instanceOf=FileEntry] object fileEntry, |
| 57 GetDisplayPathCallback callback); | 57 GetDisplayPathCallback callback); |
| 58 | 58 |
| 59 // Get a writable FileEntry from another FileEntry. This call will fail | 59 // Get a writable FileEntry from another FileEntry. This call will fail |
| 60 // if the application does not have the fileSystemWrite permission. | 60 // if the application does not have the fileSystemWrite permission. |
| 61 static void getWritableFileEntry([instanceOf=FileEntry] object fileEntry, | 61 static void getWritableEntry([instanceOf=FileEntry] object fileEntry, |
| 62 FileEntryCallback callback); | 62 FileEntryCallback callback); |
| 63 | 63 |
| 64 // Gets whether this FileEntry is writable or not. | 64 // Gets whether this FileEntry is writable or not. |
| 65 static void isWritableFileEntry([instanceOf=FileEntry] object fileEntry, | 65 static void isWritableEntry([instanceOf=FileEntry] object fileEntry, |
| 66 IsWritableCallback callback); | 66 IsWritableCallback callback); |
| 67 | 67 |
| 68 // Ask the user to choose a file. | 68 // Ask the user to choose a file. |
| 69 static void chooseFile(optional ChooseFileOptions options, | 69 static void chooseEntry(optional ChooseEntryOptions options, |
| 70 FileEntryCallback callback); | 70 FileEntryCallback callback); |
| 71 }; | 71 }; |
| 72 }; | 72 }; |
| OLD | NEW |