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 /webkit/plugins/ppapi/ppb_file_chooser_impl.h | |
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 'webkit/plugins/ppapi/ppb_file_chooser_impl.h')
-rw-r--r-- | webkit/plugins/ppapi/ppb_file_chooser_impl.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/webkit/plugins/ppapi/ppb_file_chooser_impl.h b/webkit/plugins/ppapi/ppb_file_chooser_impl.h index d5afc2d..dc34509 100644 --- a/webkit/plugins/ppapi/ppb_file_chooser_impl.h +++ b/webkit/plugins/ppapi/ppb_file_chooser_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -36,12 +36,12 @@ class PPB_FileChooser_Impl : public ::ppapi::Resource, public: PPB_FileChooser_Impl(PP_Instance instance, PP_FileChooserMode_Dev mode, - const char* accept_mime_types); + const char* accept_types); virtual ~PPB_FileChooser_Impl(); static PP_Resource Create(PP_Instance instance, PP_FileChooserMode_Dev mode, - const char* accept_mime_types); + const char* accept_types); // Resource overrides. virtual PPB_FileChooser_Impl* AsPPB_FileChooser_Impl(); @@ -78,15 +78,15 @@ class PPB_FileChooser_Impl : public ::ppapi::Resource, PP_Var suggested_file_name, const PP_CompletionCallback& callback) OVERRIDE; - // Splits a comma-separated MIME type list |accept_mime_types|, trims the + // Splits a comma-separated MIME type/extension list |accept_types|, trims the // resultant split types, makes them lowercase, and returns them. // Though this should be private, this is public for testing. WEBKIT_PLUGINS_EXPORT static std::vector<WebKit::WebString> ParseAcceptValue( - const std::string& accept_mime_types); + const std::string& accept_types); private: PP_FileChooserMode_Dev mode_; - std::string accept_mime_types_; + std::string accept_types_; scoped_refptr< ::ppapi::TrackedCallback> callback_; // When using the v0.6 of the API, this will contain the output for the |