Rewrite dialog API with our simpler blocking dialog implementations.
Fixed #9, fixed #10.
This commit is contained in:
parent
d19e62d867
commit
2bb33d8b32
6 changed files with 216 additions and 217 deletions
|
@ -5,42 +5,15 @@
|
|||
#ifndef ATOM_BROWSER_API_ATOM_API_DIALOG_H_
|
||||
#define ATOM_BROWSER_API_ATOM_API_DIALOG_H_
|
||||
|
||||
#include "browser/api/atom_api_event_emitter.h"
|
||||
#include "ui/shell_dialogs/select_file_dialog.h"
|
||||
#include "v8/include/v8.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
namespace api {
|
||||
|
||||
v8::Handle<v8::Value> ShowMessageBox(const v8::Arguments &args);
|
||||
|
||||
class FileDialog : public EventEmitter,
|
||||
public ui::SelectFileDialog::Listener {
|
||||
public:
|
||||
virtual ~FileDialog();
|
||||
|
||||
static void Initialize(v8::Handle<v8::Object> target);
|
||||
|
||||
// ui::SelectFileDialog::Listener implementations:
|
||||
virtual void FileSelected(const base::FilePath& path,
|
||||
int index, void* params) OVERRIDE;
|
||||
virtual void MultiFilesSelected(
|
||||
const std::vector<base::FilePath>& files, void* params) OVERRIDE;
|
||||
virtual void FileSelectionCanceled(void* params) OVERRIDE;
|
||||
|
||||
private:
|
||||
explicit FileDialog(v8::Handle<v8::Object> wrapper);
|
||||
|
||||
static void FillTypeInfo(ui::SelectFileDialog::FileTypeInfo* file_types,
|
||||
v8::Handle<v8::Array> v8_file_types);
|
||||
|
||||
static v8::Handle<v8::Value> New(const v8::Arguments &args);
|
||||
static v8::Handle<v8::Value> SelectFile(const v8::Arguments &args);
|
||||
|
||||
scoped_refptr<ui::SelectFileDialog> dialog_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(FileDialog);
|
||||
};
|
||||
v8::Handle<v8::Value> ShowOpenDialog(const v8::Arguments &args);
|
||||
v8::Handle<v8::Value> ShowSaveDialog(const v8::Arguments &args);
|
||||
|
||||
} // namespace api
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue