mac: Add asynchronous ShowOpenDialog.

This commit is contained in:
Cheng Zhao 2013-09-23 19:22:36 +08:00
parent 7e86ee37f3
commit d3dd2b4332
2 changed files with 56 additions and 13 deletions

View file

@ -8,6 +8,7 @@
#include <string>
#include <vector>
#include "base/callback_forward.h"
#include "base/files/file_path.h"
namespace atom {
@ -23,12 +24,21 @@ enum FileDialogProperty {
FILE_DIALOG_CREATE_DIRECTORY = 8,
};
typedef base::Callback<void(
bool result, std::vector<base::FilePath> paths)> OpenDialogCallback;
bool ShowOpenDialog(atom::NativeWindow* parent_window,
const std::string& title,
const base::FilePath& default_path,
int properties,
std::vector<base::FilePath>* paths);
void ShowOpenDialog(atom::NativeWindow* parent_window,
const std::string& title,
const base::FilePath& default_path,
int properties,
const OpenDialogCallback& callback);
bool ShowSaveDialog(atom::NativeWindow* parent_window,
const std::string& title,
const base::FilePath& default_path,