#include <string>
#include <vector>
+#include "base/callback_forward.h"
+
namespace atom {
class NativeWindow;
MESSAGE_BOX_TYPE_WARNING
};
+typedef base::Callback<void(int)> MessageBoxCallback;
+
int ShowMessageBox(NativeWindow* parent_window,
MessageBoxType type,
const std::vector<std::string>& buttons,
const std::string& message,
const std::string& detail);
+void ShowMessageBox(NativeWindow* parent_window,
+ MessageBoxType type,
+ const std::vector<std::string>& buttons,
+ const std::string& title,
+ const std::string& message,
+ const std::string& detail,
+ const MessageBoxCallback& callback);
+
} // namespace atom
#endif // BROWSER_UI_MESSAGE_BOX_H_
#import <Cocoa/Cocoa.h>
+#include "base/callback.h"
#include "base/strings/sys_string_conversions.h"
#include "browser/native_window.h"
#include "browser/ui/nsalert_synchronous_sheet_mac.h"
return [alert runModal];
}
+void ShowMessageBox(NativeWindow* parent_window,
+ MessageBoxType type,
+ const std::vector<std::string>& buttons,
+ const std::string& title,
+ const std::string& message,
+ const std::string& detail,
+ const MessageBoxCallback& callback) {
+ callback.Run(ShowMessageBox(
+ parent_window, type, buttons, title, message, detail));
+}
+
} // namespace atom
#include "browser/ui/message_box.h"
+#include "base/callback.h"
#include "base/message_loop.h"
#include "base/run_loop.h"
#include "base/string_util.h"
}
}
+void ShowMessageBox(NativeWindow* parent_window,
+ MessageBoxType type,
+ const std::vector<std::string>& buttons,
+ const std::string& title,
+ const std::string& message,
+ const std::string& detail,
+ const MessageBoxCallback& callback) {
+ callback.Run(ShowMessageBox(
+ parent_window, type, buttons, title, message, detail));
+}
+
} // namespace atom