Add DialogSettings helper struct

This commit is contained in:
Kevin Sawicki 2017-02-07 17:32:58 -08:00
parent e7410976f0
commit 867bb5a94e
9 changed files with 151 additions and 235 deletions

View file

@ -90,10 +90,11 @@ void AtomDownloadManagerDelegate::OnDownloadPathGenerated(
base::FilePath path;
GetItemSavePath(item, &path);
// Show save dialog if save path was not set already on item
if (path.empty() && file_dialog::ShowSaveDialog(window, item->GetURL().spec(),
"", default_path,
file_dialog::Filters(),
&path)) {
file_dialog::DialogSettings settings;
settings.parent_window = window;
settings.title = item->GetURL().spec();
settings.default_path = default_path;
if (path.empty() && file_dialog::ShowSaveDialog(settings, &path)) {
// Remember the last selected download directory.
AtomBrowserContext* browser_context = static_cast<AtomBrowserContext*>(
download_manager_->GetBrowserContext());