Add support for JavaScript alert, confirm, prompt and onbeforeunload dialogs (issue #507).

- Add CefJSDialogHandler and CefJSDialogCallback interfaces.
- Add default dialog implementations for Windows and Mac OS-X.
- Add "JavaScript Dialogs" example to cefclient.
- Change TestHandler::AddResource to ignore the query component when matching URLs.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@594 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-04-16 21:15:27 +00:00
parent 7ce5e9924e
commit 07bba96106
43 changed files with 2107 additions and 17 deletions

View File

@ -13,6 +13,7 @@
#include "libcef_dll/cpptoc/client_cpptoc.h"
#include "libcef_dll/cpptoc/display_handler_cpptoc.h"
#include "libcef_dll/cpptoc/geolocation_handler_cpptoc.h"
#include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h"
#include "libcef_dll/cpptoc/life_span_handler_cpptoc.h"
#include "libcef_dll/cpptoc/load_handler_cpptoc.h"
#include "libcef_dll/cpptoc/request_handler_cpptoc.h"
@ -102,6 +103,22 @@ struct _cef_geolocation_handler_t* CEF_CALLBACK client_get_geolocation_handler(
return CefGeolocationHandlerCppToC::Wrap(_retval);
}
struct _cef_jsdialog_handler_t* CEF_CALLBACK client_get_jsdialog_handler(
struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefRefPtr<CefJSDialogHandler> _retval = CefClientCppToC::Get(
self)->GetJSDialogHandler();
// Return type: refptr_same
return CefJSDialogHandlerCppToC::Wrap(_retval);
}
int CEF_CALLBACK client_on_process_message_recieved(struct _cef_client_t* self,
cef_browser_t* browser, enum cef_process_id_t source_process,
struct _cef_process_message_t* message) {
@ -139,6 +156,7 @@ CefClientCppToC::CefClientCppToC(CefClient* cls)
struct_.struct_.get_request_handler = client_get_request_handler;
struct_.struct_.get_display_handler = client_get_display_handler;
struct_.struct_.get_geolocation_handler = client_get_geolocation_handler;
struct_.struct_.get_jsdialog_handler = client_get_jsdialog_handler;
struct_.struct_.on_process_message_recieved =
client_on_process_message_recieved;
}