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

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2025-06-13 10:03:03 +02:00 committed by GitHub
commit f72ec2c45a
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(