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:
parent
ba6f0358b0
commit
f72ec2c45a
6 changed files with 57 additions and 46 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue