diff --git a/lib/browser/api/dialog.js b/lib/browser/api/dialog.js index f775b9e9cf20..c9f713a28736 100644 --- a/lib/browser/api/dialog.js +++ b/lib/browser/api/dialog.js @@ -15,32 +15,6 @@ const fileDialogProperties = { treatPackageAsDirectory: 1 << 7 } -const messageBoxTypes = ['none', 'info', 'warning', 'error', 'question'] - -const messageBoxOptions = { - noLink: 1 << 0 -} - -const parseArgs = function (window, options, callback, ...args) { - if (window != null && window.constructor !== BrowserWindow) { - // Shift. - [callback, options, window] = [options, window, null] - } - - if ((callback == null) && typeof options === 'function') { - // Shift. - [callback, options] = [options, null] - } - - // Fallback to using very last argument as the callback function - const lastArgument = args[args.length - 1] - if ((callback == null) && typeof lastArgument === 'function') { - callback = lastArgument - } - - return [window, options, callback] -} - const normalizeAccessKey = (text) => { if (typeof text !== 'string') return text @@ -144,6 +118,9 @@ const messageBox = (sync, window, options) => { if (window && window.constructor !== BrowserWindow) options = window if (options == null) options = { type: 'none' } + const messageBoxTypes = ['none', 'info', 'warning', 'error', 'question'] + const messageBoxOptions = { noLink: 1 << 0 } + let { buttons = [], cancelId,