Make beforeunload work in webview

This commit is contained in:
Cheng Zhao 2015-05-01 13:48:39 +08:00
parent 36d2512ff8
commit bfac7f7a17
3 changed files with 13 additions and 1 deletions

View file

@ -7,6 +7,7 @@
#include <set>
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/atom_javascript_dialog_manager.h"
#include "atom/browser/native_window.h"
#include "atom/browser/web_dialog_helper.h"
#include "atom/browser/web_view_manager.h"
@ -146,6 +147,14 @@ content::WebContents* WebContents::OpenURLFromTab(
return web_contents();
}
content::JavaScriptDialogManager* WebContents::GetJavaScriptDialogManager(
content::WebContents* source) {
if (!dialog_manager_)
dialog_manager_.reset(new AtomJavaScriptDialogManager);
return dialog_manager_.get();
}
void WebContents::RunFileChooser(content::WebContents* guest,
const content::FileChooserParams& params) {
if (!web_dialog_helper_)