diff options
author | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-30 00:05:32 +0000 |
---|---|---|
committer | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-30 00:05:32 +0000 |
commit | f9a4c41a40dc781ea6bbbeeeb77ee3713dc168e2 (patch) | |
tree | 2f06565b8aaf35996d1ff3a553801f6d5aa29565 /ppapi/api/dev/ppb_file_chooser_dev.idl | |
parent | 1e1184a4047adf5096a5597e4adf1ad07130445a (diff) | |
download | chromium_src-f9a4c41a40dc781ea6bbbeeeb77ee3713dc168e2.zip chromium_src-f9a4c41a40dc781ea6bbbeeeb77ee3713dc168e2.tar.gz chromium_src-f9a4c41a40dc781ea6bbbeeeb77ee3713dc168e2.tar.bz2 |
Modified the pepper file chooser API to support filtering files by extensions.
Previously you could filter only by MIME type. This adds support for filtering by specific extensions as well, e.g. .txt,.html. This change is aligned with the web platform which now allows filtering by file extension for <input> elements (http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#attr-input-accept).
This also changes the linux implementation of the file dialog (SelectFileDialogImplGTK). In the past, it would turn file extensions to filter into MIME types. However this is a bit silly because in FileSelectHelper we do the reverse (turn MIME types into a list of file extensions to filter by). It also prevents us from filtering by a specific extensions when this is really what is desired.
BUG=129251
TEST=
Review URL: https://chromiumcodereview.appspot.com/10414085
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139434 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/api/dev/ppb_file_chooser_dev.idl')
-rw-r--r-- | ppapi/api/dev/ppb_file_chooser_dev.idl | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/ppapi/api/dev/ppb_file_chooser_dev.idl b/ppapi/api/dev/ppb_file_chooser_dev.idl index 425154b..cd5678c 100644 --- a/ppapi/api/dev/ppb_file_chooser_dev.idl +++ b/ppapi/api/dev/ppb_file_chooser_dev.idl @@ -39,12 +39,14 @@ interface PPB_FileChooser_Dev { * of a module. * @param[in] mode A <code>PP_FileChooserMode_Dev</code> value that controls * the behavior of the file chooser dialog. - * @param[in] accept_mime_types A comma-separated list of MIME types such as - * "audio/ *,text/plain" (note there should be no space between the '/' and - * the '*', but one is added to avoid confusing C++ comments). The dialog - * may restrict selectable files to the specified MIME types. An empty string - * or an undefined var may be given to indicate that all types should be - * accepted. + * @param[in] accept_types A comma-separated list of MIME types and file + * extensions such as "audio/ *,text/plain,.html" (note there should be no + * space between the '/' and the '*', but one is added to avoid confusing C++ + * comments). The dialog may restrict selectable files to the specified MIME + * types and file extensions. If a string in the comma-separated list begins + * with a period (.) then the string is interpreted as a file extension, + * otherwise it is interpreted as a MIME-type. An empty string or an undefined + * var may be given to indicate that all types should be accepted. * * @return A <code>PP_Resource</code> containing the file chooser if * successful or 0 if it could not be created. @@ -52,7 +54,7 @@ interface PPB_FileChooser_Dev { PP_Resource Create( [in] PP_Instance instance, [in] PP_FileChooserMode_Dev mode, - [in] PP_Var accept_mime_types); + [in] PP_Var accept_types); /** * Determines if the provided resource is a file chooser. |