feat: promisify dialog.showSaveDialog() (#17054)

* feat: promisify dialog.showSaveDialog()

* address some feedback from review

* filename => filePath

* fix last filename => filePath
This commit is contained in:
Shelley Vohr 2019-03-05 13:48:20 -08:00 committed by GitHub
parent 92c9dbc179
commit 6cb7b8d3a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 166 additions and 135 deletions

View file

@ -382,7 +382,7 @@ void CommonWebContentsDelegate::DevToolsSaveToFile(const std::string& url,
settings.force_detached = offscreen_;
settings.title = url;
settings.default_path = base::FilePath::FromUTF8Unsafe(url);
if (!file_dialog::ShowSaveDialog(settings, &path)) {
if (!file_dialog::ShowSaveDialogSync(settings, &path)) {
base::Value url_value(url);
web_contents_->CallClientFunction("DevToolsAPI.canceledSaveURL",
&url_value, nullptr, nullptr);