* **Electron Version:**
  * v4.0.1
* **Operating System:**
  * macOS 10.13.6

### Expected Behavior
When you press the escape key on a confirm dialog, it should be the same as pressing cancel.

### Actual Behavior
When you press escape, it presses "OK". This has the potential to be pretty dangerous, as it may continue with a destructive action the user had not intended.

### To Reproduce

Open a window.confirm, then press escape.

### Additional Information

This seems to be due to [this line](https://github.com/electron/electron/blob/master/atom/browser/atom_javascript_dialog_manager.cc#L79), where `cancelId`([5th argument](https://github.com/electron/electron/blob/master/atom/browser/ui/message_box_mac.mm#L97)) is hardcoded to `0`.

For a confirm dialog, we [`push_back`](https://github.com/electron/electron/blob/master/atom/browser/atom_javascript_dialog_manager.cc#L57) the `Cancel` button, so this should be `1`.

atom/browser/atom_javascript_dialog_manager.cc
#include "atom/browser/atom_javascript_dialog_manager.h"
#include <string>
#include <utility>
#include <vector>
#include "atom/browser/api/atom_api_web_contents.h"
#include "atom/browser/native_window.h"
#include "atom/browser/ui/message_box.h"
#include "atom/browser/web_contents_preferences.h"
#include "atom/common/options_switches.h"
#include "base/bind.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/gfx/image/image_skia.h"
using content::JavaScriptDialogType;
namespace atom {
namespace {
constexpr int kUserWantsNoMoreDialogs = -1;
}  
AtomJavaScriptDialogManager::AtomJavaScriptDialogManager(