* **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
content::WebContents* web_contents,
    content::RenderFrameHost* rfh,
    bool is_reload,
    DialogClosedCallback callback) {
  bool default_prevented = api_web_contents_->Emit("will-prevent-unload");
  std::move(callback).Run(default_prevented, base::string16());
  return;
}
void AtomJavaScriptDialogManager::CancelDialogs(
    content::WebContents* web_contents,
    bool reset_state) {}
void AtomJavaScriptDialogManager::OnMessageBoxCallback(
    DialogClosedCallback callback,
    const std::string& origin,
    int code,
    bool checkbox_checked) {
  if (checkbox_checked)
    origin_counts_[origin] = kUserWantsNoMoreDialogs;
  std::move(callback).Run(code == 0, base::string16());
}
}