Add the generialized showMessageBox API.
This commit is contained in:
parent
4aeb5e1388
commit
ec43f740a7
7 changed files with 129 additions and 26 deletions
49
browser/api/atom_api_dialog.h
Normal file
49
browser/api/atom_api_dialog.h
Normal file
|
@ -0,0 +1,49 @@
|
|||
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#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"
|
||||
|
||||
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);
|
||||
};
|
||||
|
||||
} // namespace api
|
||||
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_BROWSER_API_ATOM_API_DIALOG_H_
|
Loading…
Add table
Add a link
Reference in a new issue