Merge pull request #6629 from electron/download-item-get-save-path

Set download item save path to selected path from dialog
This commit is contained in:
Cheng Zhao 2016-07-28 15:23:43 +09:00 committed by GitHub
commit e73bd00854
4 changed files with 22 additions and 6 deletions

View file

@ -85,6 +85,14 @@ void AtomDownloadManagerDelegate::OnDownloadPathGenerated(
download_manager_->GetBrowserContext());
browser_context->prefs()->SetFilePath(prefs::kDownloadDefaultDirectory,
path.DirName());
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::Locker locker(isolate);
v8::HandleScope handle_scope(isolate);
api::DownloadItem* download_item = api::DownloadItem::FromWrappedClass(
isolate, item);
if (download_item)
download_item->SetSavePath(path);
}
// Running the DownloadTargetCallback with an empty FilePath signals that the