Skip to content

Commit

Permalink
Fix #2961: nwdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwang committed Feb 19, 2015
1 parent 37585d5 commit c5ef962
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/browser/file_select_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -359,6 +360,7 @@ void FileSelectHelper::RunFileChooser(content::WebContents* tab,
// FileSelectHelper will keep itself alive until it sends the result message.
scoped_refptr<FileSelectHelper> file_select_helper(
new FileSelectHelper());
file_select_helper->extract_directory_ = params.extract_directory;
file_select_helper->RunFileChooser(tab->GetRenderViewHost(), tab, params);
}

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/browser/file_select_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ class FileSelectHelper
// these files when they are no longer needed.
std::vector<base::FilePath> temporary_files_;

bool extract_directory_;

DISALLOW_COPY_AND_ASSIGN(FileSelectHelper);
};

Expand Down

0 comments on commit c5ef962

Please sign in to comment.