From cbcd12edabcc989f9b5421763b0610730a0c7612 Mon Sep 17 00:00:00 2001 From: "jianli@chromium.org" Date: Thu, 16 Dec 2010 23:42:57 +0000 Subject: Fix bug 65780: Can't select file on mac with Accept parameter of 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 --- chrome/browser/file_select_helper.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'chrome/browser/file_select_helper.cc') 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); -- cgit v1.1