// 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 ShowMessageBox(const v8::Arguments &args); class FileDialog : public EventEmitter, public ui::SelectFileDialog::Listener { public: virtual ~FileDialog(); static void Initialize(v8::Handle target); // ui::SelectFileDialog::Listener implementations: virtual void FileSelected(const base::FilePath& path, int index, void* params) OVERRIDE; virtual void MultiFilesSelected( const std::vector& files, void* params) OVERRIDE; virtual void FileSelectionCanceled(void* params) OVERRIDE; private: explicit FileDialog(v8::Handle wrapper); static void FillTypeInfo(ui::SelectFileDialog::FileTypeInfo* file_types, v8::Handle v8_file_types); static v8::Handle New(const v8::Arguments &args); static v8::Handle SelectFile(const v8::Arguments &args); scoped_refptr dialog_; DISALLOW_COPY_AND_ASSIGN(FileDialog); }; } // namespace api } // namespace atom #endif // ATOM_BROWSER_API_ATOM_API_DIALOG_H_