diff --git a/atom/browser/api/atom_api_dialog.cc b/atom/browser/api/atom_api_dialog.cc index 3c4d02821d0..975c30963fa 100644 --- a/atom/browser/api/atom_api_dialog.cc +++ b/atom/browser/api/atom_api_dialog.cc @@ -103,6 +103,7 @@ void Initialize(v8::Handle exports, v8::Handle unused, v8::Handle context, void* priv) { mate::Dictionary dict(context->GetIsolate(), exports); dict.SetMethod("showMessageBox", &ShowMessageBox); + dict.SetMethod("showErrorBox", &atom::ShowErrorBox); dict.SetMethod("showOpenDialog", &ShowOpenDialog); dict.SetMethod("showSaveDialog", &ShowSaveDialog); } diff --git a/atom/browser/api/lib/dialog.coffee b/atom/browser/api/lib/dialog.coffee index 640db088cbb..0cdd3c38380 100644 --- a/atom/browser/api/lib/dialog.coffee +++ b/atom/browser/api/lib/dialog.coffee @@ -93,5 +93,8 @@ module.exports = window, callback + showErrorBox: (args...) -> + binding.showErrorBox args... + # Mark standard asynchronous functions. v8Util.setHiddenValue f, 'asynchronous', true for k, f of module.exports diff --git a/atom/browser/ui/message_box.h b/atom/browser/ui/message_box.h index c3d2c5d15d9..bdaa31ec6dc 100644 --- a/atom/browser/ui/message_box.h +++ b/atom/browser/ui/message_box.h @@ -9,6 +9,7 @@ #include #include "base/callback_forward.h" +#include "base/strings/string16.h" namespace atom { @@ -37,6 +38,10 @@ void ShowMessageBox(NativeWindow* parent_window, const std::string& detail, const MessageBoxCallback& callback); +// Like ShowMessageBox with simplest settings, but safe to call at very early +// stage of application. +void ShowErrorBox(const base::string16& title, const base::string16& content); + } // namespace atom #endif // ATOM_BROWSER_UI_MESSAGE_BOX_H_