Fix missing warning icon with dialog.showMessageBox() on macOS

Fixes #9183.
This commit is contained in:
Birunthan Mohanathas 2017-04-13 21:36:48 +03:00
parent 0c1d60381d
commit e7d71000ee
2 changed files with 10 additions and 5 deletions

View file

@ -71,10 +71,14 @@ NSAlert* CreateNSAlert(NativeWindow* parent_window,
switch (type) {
case MESSAGE_BOX_TYPE_INFORMATION:
[alert setAlertStyle:NSInformationalAlertStyle];
alert.alertStyle = NSInformationalAlertStyle;
break;
case MESSAGE_BOX_TYPE_WARNING:
[alert setAlertStyle:NSWarningAlertStyle];
case MESSAGE_BOX_TYPE_ERROR:
// NSWarningAlertStyle shows the app icon while NSCriticalAlertStyle
// shows a warning icon with an app icon badge. Since there is no
// error variant, lets just use NSCriticalAlertStyle.
alert.alertStyle = NSCriticalAlertStyle;
break;
default:
break;
@ -192,7 +196,7 @@ void ShowErrorBox(const base::string16& title, const base::string16& content) {
NSAlert* alert = [[NSAlert alloc] init];
[alert setMessageText:base::SysUTF16ToNSString(title)];
[alert setInformativeText:base::SysUTF16ToNSString(content)];
[alert setAlertStyle:NSWarningAlertStyle];
[alert setAlertStyle:NSCriticalAlertStyle];
[alert runModal];
[alert release];
}