mac: Add asynchronous ShowSaveDialog.

This commit is contained in:
Cheng Zhao 2013-09-23 20:08:32 +08:00
parent 30ca085fd8
commit c7637c78d1
2 changed files with 31 additions and 1 deletions

View file

@ -25,7 +25,10 @@ enum FileDialogProperty {
};
typedef base::Callback<void(
bool result, std::vector<base::FilePath> paths)> OpenDialogCallback;
bool result, const std::vector<base::FilePath>& paths)> OpenDialogCallback;
typedef base::Callback<void(
bool result, const base::FilePath& path)> SaveDialogCallback;
bool ShowOpenDialog(atom::NativeWindow* parent_window,
const std::string& title,
@ -44,6 +47,11 @@ bool ShowSaveDialog(atom::NativeWindow* parent_window,
const base::FilePath& default_path,
base::FilePath* path);
void ShowSaveDialog(atom::NativeWindow* parent_window,
const std::string& title,
const base::FilePath& default_path,
const SaveDialogCallback& callback);
} // namespace file_dialog
#endif // BROWSER_UI_FILE_DIALOG_H_