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/cpp/trusted | |
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/cpp/trusted')
-rw-r--r-- | ppapi/cpp/trusted/file_chooser_trusted.cc | 4 | ||||
-rw-r--r-- | ppapi/cpp/trusted/file_chooser_trusted.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/ppapi/cpp/trusted/file_chooser_trusted.cc b/ppapi/cpp/trusted/file_chooser_trusted.cc index 92fec74..caa1b73 100644 --- a/ppapi/cpp/trusted/file_chooser_trusted.cc +++ b/ppapi/cpp/trusted/file_chooser_trusted.cc @@ -30,10 +30,10 @@ FileChooser_Trusted::FileChooser_Trusted() : save_as_(false) { FileChooser_Trusted::FileChooser_Trusted(const InstanceHandle& instance, PP_FileChooserMode_Dev mode, - const Var& accept_mime_types, + const Var& accept_types, bool save_as, const std::string& suggested_file_name) - : FileChooser_Dev(instance, mode, accept_mime_types), + : FileChooser_Dev(instance, mode, accept_types), save_as_(save_as), suggested_file_name_(suggested_file_name) { } diff --git a/ppapi/cpp/trusted/file_chooser_trusted.h b/ppapi/cpp/trusted/file_chooser_trusted.h index 6b3c1c1..cdb70b0 100644 --- a/ppapi/cpp/trusted/file_chooser_trusted.h +++ b/ppapi/cpp/trusted/file_chooser_trusted.h @@ -18,7 +18,7 @@ class FileChooser_Trusted : public FileChooser_Dev { FileChooser_Trusted(const InstanceHandle& instance, PP_FileChooserMode_Dev mode, - const Var& accept_mime_types, + const Var& accept_types, bool save_as, const std::string& suggested_file_name); |