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

Side by Side Diff: chrome/common/extensions/api/file_system.idl

Issue 10692104: Add isWritableFileEntry to the fileSystem API (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: added presubmit fix Created 8 years, 5 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 unified diff | Download patch
OLDNEW
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 // File-level comment to appease parser. Eventually this will not be necessary. 5 // File-level comment to appease parser. Eventually this will not be necessary.
6 6
7 namespace fileSystem { 7 namespace fileSystem {
8 dictionary ChooseFileOptions { 8 dictionary ChooseFileOptions {
9 // Type of the prompt to show. Valid types are 'openFile', 9 // Type of the prompt to show. Valid types are 'openFile',
10 // 'openWritableFile' or 'saveFile'. 10 // 'openWritableFile' or 'saveFile'.
11 // 11 //
12 // Both 'openFile' and 'openWritableFile' will prompt the user to open an 12 // Both 'openFile' and 'openWritableFile' will prompt the user to open an
13 // existing file, with 'openFile' returning a read-only FileEntry on 13 // existing file, with 'openFile' returning a read-only FileEntry on
14 // success. 'saveFile' will prompt the user to choose an existing file or 14 // success. 'saveFile' will prompt the user to choose an existing file or
15 // a new file, and will return a writable FileEntry. 15 // a new file, and will return a writable FileEntry.
16 // Calls to chooseFile with either 'openWritableFile' or 'saveFile' will 16 // Calls to chooseFile with either 'openWritableFile' or 'saveFile' will
17 // fail unless the application has the fileSystemWrite permission. 17 // fail unless the application has the fileSystemWrite permission.
18 // 18 //
19 // The default is 'openFile'. 19 // The default is 'openFile'.
20 DOMString? type; 20 DOMString? type;
21 21
22 // The suggested file name that will be presented to the user as the 22 // The suggested file name that will be presented to the user as the
23 // default name to read or write. This is optional. 23 // default name to read or write. This is optional.
24 DOMString? suggestedName; 24 DOMString? suggestedName;
25 }; 25 };
26 callback GetDisplayPathCallback = void (DOMString displayPath); 26 callback GetDisplayPathCallback = void (DOMString displayPath);
27 callback FileEntryCallback = void ([instanceOf=fileEntry] object fileEntry); 27 callback FileEntryCallback = void ([instanceOf=FileEntry] object fileEntry);
28 callback IsWritableCallback = void (boolean isWritable);
28 29
29 interface Functions { 30 interface Functions {
30 // Get the display path of a FileEntry object. The display path is based on 31 // Get the display path of a FileEntry object. The display path is based on
31 // the full path of the file on the local file system, but may be made more 32 // the full path of the file on the local file system, but may be made more
32 // readable for display purposes. 33 // readable for display purposes.
33 static void getDisplayPath([instanceOf=FileEntry] object fileEntry, 34 static void getDisplayPath([instanceOf=FileEntry] object fileEntry,
34 GetDisplayPathCallback callback); 35 GetDisplayPathCallback callback);
35 36
36 // Get a writable FileEntry from another FileEntry. This call will fail 37 // Get a writable FileEntry from another FileEntry. This call will fail
37 // if the application does not have the fileSystemWrite permission. 38 // if the application does not have the fileSystemWrite permission.
38 static void getWritableFileEntry([instanceOf=FileEntry] object fileEntry, 39 static void getWritableFileEntry([instanceOf=FileEntry] object fileEntry,
39 FileEntryCallback callback); 40 FileEntryCallback callback);
40 41
42 // Gets whether this FileEntry is writable or not.
43 static void isWritableFileEntry([instanceOf=FileEntry] object fileEntry,
44 IsWritableCallback callback);
45
41 // Ask the user to choose a file. 46 // Ask the user to choose a file.
42 static void chooseFile(optional ChooseFileOptions options, 47 static void chooseFile(optional ChooseFileOptions options,
43 FileEntryCallback callback); 48 FileEntryCallback callback);
44 }; 49 };
45 }; 50 };
OLDNEW
« no previous file with comments | « chrome/common/extensions/PRESUBMIT.py ('k') | chrome/renderer/resources/extensions/file_system_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698