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

Issue 10414085: Modified the pepper file chooser API to support filtering files by extensions. (Closed)

Created:
8 years, 7 months ago by raymes
Modified:
8 years, 6 months ago
Reviewers:
brettw, Evan Stade
CC:
chromium-reviews, jochen+watch-content_chromium.org, jam, yzshen+watch_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, ihf+watch_chromium.org
Visibility:
Public.

Description

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= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=139434

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : . #

Patch Set 4 : . #

Patch Set 5 : . #

Total comments: 5

Patch Set 6 : . #

Patch Set 7 : . #

Patch Set 8 : . #

Total comments: 1

Patch Set 9 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+147 lines, -115 lines) Patch
M chrome/browser/file_select_helper.h View 1 2 3 4 5 6 3 chunks +8 lines, -1 line 0 comments Download
M chrome/browser/file_select_helper.cc View 1 2 3 4 5 6 2 chunks +27 lines, -12 lines 0 comments Download
A chrome/browser/file_select_helper_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +19 lines, -0 lines 0 comments Download
M chrome/browser/ui/gtk/select_file_dialog_impl_gtk.cc View 1 2 3 3 chunks +4 lines, -21 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/file_chooser_params.h View 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -3 lines 0 comments Download
M ppapi/api/dev/ppb_file_chooser_dev.idl View 2 chunks +9 lines, -7 lines 0 comments Download
M ppapi/c/dev/ppb_file_chooser_dev.h View 3 chunks +11 lines, -9 lines 0 comments Download
M ppapi/cpp/dev/file_chooser_dev.h View 1 1 chunk +9 lines, -10 lines 0 comments Download
M ppapi/cpp/dev/file_chooser_dev.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M ppapi/cpp/trusted/file_chooser_trusted.h View 1 chunk +1 line, -1 line 0 comments Download
M ppapi/cpp/trusted/file_chooser_trusted.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ppapi/examples/file_chooser/file_chooser.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ppapi/proxy/ppapi_messages.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M ppapi/proxy/ppb_file_chooser_proxy.h View 2 chunks +2 lines, -2 lines 0 comments Download
M ppapi/proxy/ppb_file_chooser_proxy.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M ppapi/proxy/resource_creation_proxy.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M ppapi/proxy/resource_creation_proxy.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M ppapi/thunk/ppb_file_chooser_thunk.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ppapi/thunk/resource_creation_api.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_file_chooser_impl.h View 2 chunks +5 lines, -5 lines 0 comments Download
M webkit/plugins/ppapi/ppb_file_chooser_impl.cc View 1 4 chunks +25 lines, -21 lines 0 comments Download
M webkit/plugins/ppapi/resource_creation_impl.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/resource_creation_impl.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
raymes
brettw for ppapi related stuff estade for file chooser related stuff
8 years, 7 months ago (2012-05-25 17:12:24 UTC) #1
raymes
On 2012/05/25 17:12:24, raymes wrote: > brettw for ppapi related stuff > estade for file ...
8 years, 7 months ago (2012-05-25 17:14:00 UTC) #2
Evan Stade
https://chromiumcodereview.appspot.com/10414085/diff/17001/chrome/browser/file_select_helper.cc File chrome/browser/file_select_helper.cc (right): https://chromiumcodereview.appspot.com/10414085/diff/17001/chrome/browser/file_select_helper.cc#newcode259 chrome/browser/file_select_helper.cc:259: DCHECK(ascii_type[0] == '.' ? ascii_type.length() > 1 : true) ...
8 years, 7 months ago (2012-05-25 20:19:57 UTC) #3
raymes
http://codereview.chromium.org/10414085/diff/17001/chrome/browser/file_select_helper.cc File chrome/browser/file_select_helper.cc (right): http://codereview.chromium.org/10414085/diff/17001/chrome/browser/file_select_helper.cc#newcode259 chrome/browser/file_select_helper.cc:259: DCHECK(ascii_type[0] == '.' ? ascii_type.length() > 1 : true) ...
8 years, 7 months ago (2012-05-25 21:00:23 UTC) #4
Evan Stade
http://codereview.chromium.org/10414085/diff/17001/chrome/browser/file_select_helper.cc File chrome/browser/file_select_helper.cc (right): http://codereview.chromium.org/10414085/diff/17001/chrome/browser/file_select_helper.cc#newcode263 chrome/browser/file_select_helper.cc:263: DCHECK(TrimWhitespaceASCII(ascii_type, TRIM_ALL, &ascii_type) On 2012/05/25 21:00:23, raymes wrote: > ...
8 years, 7 months ago (2012-05-25 21:10:15 UTC) #5
raymes
On 2012/05/25 21:10:15, Evan Stade wrote: > http://codereview.chromium.org/10414085/diff/17001/chrome/browser/file_select_helper.cc > File chrome/browser/file_select_helper.cc (right): > > http://codereview.chromium.org/10414085/diff/17001/chrome/browser/file_select_helper.cc#newcode263 ...
8 years, 7 months ago (2012-05-25 23:40:36 UTC) #6
Evan Stade
thanks. chrome/ lgtm
8 years, 7 months ago (2012-05-25 23:52:05 UTC) #7
raymes
ping brettw On Fri, May 25, 2012 at 4:52 PM, <estade@chromium.org> wrote: > thanks. chrome/ ...
8 years, 6 months ago (2012-05-29 16:14:27 UTC) #8
brettw
Sorry I took so long. LGTM http://codereview.chromium.org/10414085/diff/13003/chrome/browser/file_select_helper_unittest.cc File chrome/browser/file_select_helper_unittest.cc (right): http://codereview.chromium.org/10414085/diff/13003/chrome/browser/file_select_helper_unittest.cc#newcode10 chrome/browser/file_select_helper_unittest.cc:10: TEST_F(FileSelectHelperTest, IsAcceptTypeValid) { ...
8 years, 6 months ago (2012-05-29 17:57:27 UTC) #9
raymes
On 2012/05/29 17:57:27, brettw wrote: > Sorry I took so long. LGTM > > http://codereview.chromium.org/10414085/diff/13003/chrome/browser/file_select_helper_unittest.cc ...
8 years, 6 months ago (2012-05-29 20:06:47 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/raymes@chromium.org/10414085/12003
8 years, 6 months ago (2012-05-29 20:10:55 UTC) #11
commit-bot: I haz the power
8 years, 6 months ago (2012-05-30 00:05:43 UTC) #12
Change committed as 139434

Powered by Google App Engine
This is Rietveld 408576698