From 4da7d4d08b28b19cf5e600900bb1fd3818657c44 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 28 Aug 2012 10:01:00 -0500 Subject: [PATCH] Make AtomCefClient a JSDialogHandler and suppress dialog on reloads --- native/atom_cef_client.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/native/atom_cef_client.h b/native/atom_cef_client.h index 1ca42de70..1a180a1cb 100644 --- a/native/atom_cef_client.h +++ b/native/atom_cef_client.h @@ -16,6 +16,7 @@ class AtomCefClient : public CefClient, public CefContextMenuHandler, public CefDisplayHandler, + public CefJSDialogHandler, public CefKeyboardHandler, public CefLifeSpanHandler, public CefLoadHandler, @@ -33,6 +34,9 @@ class AtomCefClient : public CefClient, virtual CefRefPtr GetDisplayHandler() OVERRIDE { return this; } + virtual CefRefPtr GetJSDialogHandler() { + return this; + } virtual CefRefPtr GetKeyboardHandler() OVERRIDE { return this; } @@ -65,6 +69,14 @@ class AtomCefClient : public CefClient, int line) OVERRIDE; + // CefJsDialogHandlerMethods + virtual bool OnBeforeUnloadDialog(CefRefPtr browser, + const CefString& message_text, + bool is_reload, + CefRefPtr callback) { + callback->Continue(true, ""); + return true; + } // CefKeyboardHandler methods virtual bool OnKeyEvent(CefRefPtr browser,