Add new CefRenderProcessHandler::OnBeforeNavigation callback (issue #722).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@904 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-11-09 18:47:09 +00:00
parent 255fdad295
commit 79f3683beb
15 changed files with 472 additions and 54 deletions

View File

@ -14,6 +14,7 @@
#include "libcef_dll/cpptoc/domnode_cpptoc.h"
#include "libcef_dll/cpptoc/frame_cpptoc.h"
#include "libcef_dll/cpptoc/process_message_cpptoc.h"
#include "libcef_dll/cpptoc/request_cpptoc.h"
#include "libcef_dll/cpptoc/v8context_cpptoc.h"
#include "libcef_dll/cpptoc/v8exception_cpptoc.h"
#include "libcef_dll/cpptoc/v8stack_trace_cpptoc.h"
@ -76,6 +77,40 @@ void CefRenderProcessHandlerCToCpp::OnBrowserDestroyed(
CefBrowserCppToC::Wrap(browser));
}
bool CefRenderProcessHandlerCToCpp::OnBeforeNavigation(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request, NavigationType navigation_type,
bool is_redirect) {
if (CEF_MEMBER_MISSING(struct_, on_before_navigation))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: browser; type: refptr_diff
DCHECK(browser.get());
if (!browser.get())
return false;
// Verify param: frame; type: refptr_diff
DCHECK(frame.get());
if (!frame.get())
return false;
// Verify param: request; type: refptr_diff
DCHECK(request.get());
if (!request.get())
return false;
// Execute
int _retval = struct_->on_before_navigation(struct_,
CefBrowserCppToC::Wrap(browser),
CefFrameCppToC::Wrap(frame),
CefRequestCppToC::Wrap(request),
navigation_type,
is_redirect);
// Return type: bool
return _retval?true:false;
}
void CefRenderProcessHandlerCToCpp::OnContextCreated(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Context> context) {