diff options
author | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-16 23:42:57 +0000 |
---|---|---|
committer | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-16 23:42:57 +0000 |
commit | cbcd12edabcc989f9b5421763b0610730a0c7612 (patch) | |
tree | 84825f3fcf1f0d03e8e13e982f34a29b07a7c6ae /chrome/browser/file_select_helper.cc | |
parent | 561513f949c9597f217e86bc2de8f3c8a0f945f6 (diff) | |
download | chromium_src-cbcd12edabcc989f9b5421763b0610730a0c7612.zip chromium_src-cbcd12edabcc989f9b5421763b0610730a0c7612.tar.gz chromium_src-cbcd12edabcc989f9b5421763b0610730a0c7612.tar.bz2 |
Fix bug 65780: Can't select file on mac with Accept parameter of <input type=file />
BUG=65780
TEST=Manual test
Review URL: http://codereview.chromium.org/5859007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69485 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/file_select_helper.cc')
-rw-r--r-- | chrome/browser/file_select_helper.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/file_select_helper.cc b/chrome/browser/file_select_helper.cc index a1b31cd..1604b0d 100644 --- a/chrome/browser/file_select_helper.cc +++ b/chrome/browser/file_select_helper.cc @@ -166,6 +166,10 @@ SelectFileDialog::FileTypeInfo* FileSelectHelper::GetFileTypesFromAcceptType( valid_type_count++; } + // If no valid extension is added, bail out. + if (valid_type_count == 0) + return NULL; + // Use a generic description "Custom Files" if either of the following is // true: // 1) There're multiple types specified, like "audio/*,video/*" @@ -227,7 +231,7 @@ void FileSelectHelper::RunFileChooser( params.title, default_file_name, file_types.get(), - 0, + file_types.get() ? 1 : 0, // 1-based index. FILE_PATH_LITERAL(""), owning_window, NULL); |