Add OnResourceReponse and CefContentFilter for viewing and filtering response content (issue #241).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@243 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-05-23 23:39:07 +00:00
parent 338b9c0cc9
commit 73f4d5a5e6
14 changed files with 603 additions and 5 deletions

View File

@@ -15,6 +15,7 @@
#include "libcef_dll/cpptoc/request_cpptoc.h"
#include "libcef_dll/cpptoc/response_cpptoc.h"
#include "libcef_dll/cpptoc/stream_reader_cpptoc.h"
#include "libcef_dll/ctocpp/content_filter_ctocpp.h"
#include "libcef_dll/ctocpp/download_handler_ctocpp.h"
#include "libcef_dll/ctocpp/request_handler_ctocpp.h"
@@ -54,6 +55,23 @@ bool CefRequestHandlerCToCpp::OnBeforeResourceLoad(
return (rv ? true : false);
}
void CefRequestHandlerCToCpp::OnResourceReponse(CefRefPtr<CefBrowser> browser,
const CefString& url, CefRefPtr<CefResponse> response,
CefRefPtr<CefContentFilter>& filter)
{
if (CEF_MEMBER_MISSING(struct_, on_resource_reponse))
return;
cef_content_filter_t* filterRet = NULL;
struct_->on_resource_reponse(struct_,
CefBrowserCppToC::Wrap(browser), url.GetStruct(),
CefResponseCppToC::Wrap(response), &filterRet);
if(filterRet)
filter = CefContentFilterCToCpp::Wrap(filterRet);
}
bool CefRequestHandlerCToCpp::OnProtocolExecution(CefRefPtr<CefBrowser> browser,
const CefString& url, bool& allowOSExecution)
{