parent
d7cf460918
commit
b1406fbad9
2 changed files with 7 additions and 4 deletions
|
@ -78,9 +78,9 @@ int ShowMessageBoxUTF16(HWND parent,
|
||||||
const base::string16& message,
|
const base::string16& message,
|
||||||
const base::string16& detail,
|
const base::string16& detail,
|
||||||
const gfx::ImageSkia& icon) {
|
const gfx::ImageSkia& icon) {
|
||||||
TASKDIALOG_FLAGS flags = TDF_SIZE_TO_CONTENT; // show all content.
|
TASKDIALOG_FLAGS flags =
|
||||||
if (cancel_id != 0)
|
TDF_SIZE_TO_CONTENT | // Show all content.
|
||||||
flags |= TDF_ALLOW_DIALOG_CANCELLATION; // allow dialog to be cancelled.
|
TDF_ALLOW_DIALOG_CANCELLATION; // Allow canceling the dialog.
|
||||||
|
|
||||||
TASKDIALOGCONFIG config = { 0 };
|
TASKDIALOGCONFIG config = { 0 };
|
||||||
config.cbSize = sizeof(config);
|
config.cbSize = sizeof(config);
|
||||||
|
|
|
@ -80,12 +80,15 @@ window.alert = (message, title='') ->
|
||||||
buttons = ['OK']
|
buttons = ['OK']
|
||||||
message = message.toString()
|
message = message.toString()
|
||||||
dialog.showMessageBox remote.getCurrentWindow(), {message, title, buttons}
|
dialog.showMessageBox remote.getCurrentWindow(), {message, title, buttons}
|
||||||
|
# Alert should always return undefined.
|
||||||
|
return
|
||||||
|
|
||||||
# And the confirm().
|
# And the confirm().
|
||||||
window.confirm = (message, title='') ->
|
window.confirm = (message, title='') ->
|
||||||
dialog = remote.require 'dialog'
|
dialog = remote.require 'dialog'
|
||||||
buttons = ['OK', 'Cancel']
|
buttons = ['OK', 'Cancel']
|
||||||
not dialog.showMessageBox remote.getCurrentWindow(), {message, title, buttons}
|
cancelId = 1
|
||||||
|
not dialog.showMessageBox remote.getCurrentWindow(), {message, title, buttons, cancelId}
|
||||||
|
|
||||||
# But we do not support prompt().
|
# But we do not support prompt().
|
||||||
window.prompt = ->
|
window.prompt = ->
|
||||||
|
|
Loading…
Reference in a new issue