refactor: have ShowSaveDialogSync() return a std::optional<base::FilePath> (#47428)

* refactor: have ShowSaveDialogSync() return a std::optional<base::FilePath>

* fixup! refactor: have ShowSaveDialogSync() return a std::optional<base::FilePath>
This commit is contained in:
Charles Kerr 2025-06-12 05:25:40 -05:00 committed by GitHub
commit 6f915e85e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 57 additions and 46 deletions

View file

@ -71,9 +71,8 @@ v8::Local<v8::Promise> ShowOpenDialog(
void ShowSaveDialogSync(const file_dialog::DialogSettings& settings,
gin::Arguments* args) {
base::FilePath path;
if (file_dialog::ShowSaveDialogSync(settings, &path))
args->Return(path);
if (const auto path = file_dialog::ShowSaveDialogSync(settings))
args->Return(*path);
}
v8::Local<v8::Promise> ShowSaveDialog(