summaryrefslogtreecommitdiffstats
path: root/ppapi/examples
diff options
context:
space:
mode:
authorraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 00:05:32 +0000
committerraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 00:05:32 +0000
commitf9a4c41a40dc781ea6bbbeeeb77ee3713dc168e2 (patch)
tree2f06565b8aaf35996d1ff3a553801f6d5aa29565 /ppapi/examples
parent1e1184a4047adf5096a5597e4adf1ad07130445a (diff)
downloadchromium_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/examples')
-rw-r--r--ppapi/examples/file_chooser/file_chooser.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/ppapi/examples/file_chooser/file_chooser.cc b/ppapi/examples/file_chooser/file_chooser.cc
index 959e649..fd207fe 100644
--- a/ppapi/examples/file_chooser/file_chooser.cc
+++ b/ppapi/examples/file_chooser/file_chooser.cc
@@ -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.
@@ -46,9 +46,9 @@ class MyInstance : public pp::InstancePrivate {
PP_FileChooserMode_Dev mode =
(multi_select ? PP_FILECHOOSERMODE_OPENMULTIPLE
: PP_FILECHOOSERMODE_OPEN);
- std::string accept_mime_types = (multi_select ? "" : "plain/text");
+ std::string accept_types = (multi_select ? "" : "plain/text");
- chooser_ = pp::FileChooser_Dev(this, mode, accept_mime_types);
+ chooser_ = pp::FileChooser_Dev(this, mode, accept_types);
chooser_.Show(callback_factory_.NewCallbackWithOutput(
&MyInstance::ShowSelectedFileNames));
}