diff --git a/src/browser/file_select_helper.cc b/src/browser/file_select_helper.cc index 7361815a83..3f34eca45b 100644 --- a/src/browser/file_select_helper.cc +++ b/src/browser/file_select_helper.cc @@ -131,7 +131,8 @@ void FileSelectHelper::FileSelectedWithExtraInfo( } const base::FilePath& path = file.local_path; - if (dialog_type_ == ui::SelectFileDialog::SELECT_UPLOAD_FOLDER) { + if (dialog_type_ == ui::SelectFileDialog::SELECT_UPLOAD_FOLDER && + extract_directory_) { StartNewEnumeration(path, kFileSelectEnumerationId, render_view_host_); return; } @@ -359,6 +360,7 @@ void FileSelectHelper::RunFileChooser(content::WebContents* tab, // FileSelectHelper will keep itself alive until it sends the result message. scoped_refptr file_select_helper( new FileSelectHelper()); + file_select_helper->extract_directory_ = params.extract_directory; file_select_helper->RunFileChooser(tab->GetRenderViewHost(), tab, params); } @@ -437,7 +439,7 @@ void FileSelectHelper::RunFileChooserOnUIThread( dialog_type_ = ui::SelectFileDialog::SELECT_OPEN_MULTI_FILE; break; case FileChooserParams::UploadFolder: - dialog_type_ = ui::SelectFileDialog::SELECT_UPLOAD_FOLDER; + dialog_type_ = ui::SelectFileDialog::SELECT_FOLDER; break; case FileChooserParams::Save: dialog_type_ = ui::SelectFileDialog::SELECT_SAVEAS_FILE; diff --git a/src/browser/file_select_helper.h b/src/browser/file_select_helper.h index cb04dcafb5..35036d1ff4 100644 --- a/src/browser/file_select_helper.h +++ b/src/browser/file_select_helper.h @@ -196,6 +196,8 @@ class FileSelectHelper // these files when they are no longer needed. std::vector temporary_files_; + bool extract_directory_; + DISALLOW_COPY_AND_ASSIGN(FileSelectHelper); };