mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add the ability to observe and modify resource redirects (issue #346).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@416 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -109,6 +109,31 @@ bool CefRequestHandlerCToCpp::OnBeforeResourceLoad(
|
||||
}
|
||||
|
||||
|
||||
void CefRequestHandlerCToCpp::OnResourceRedirect(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& old_url, CefString& new_url)
|
||||
{
|
||||
if (CEF_MEMBER_MISSING(struct_, on_resource_redirect))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser.get());
|
||||
if (!browser.get())
|
||||
return;
|
||||
// Verify param: old_url; type: string_byref_const
|
||||
DCHECK(!old_url.empty());
|
||||
if (old_url.empty())
|
||||
return;
|
||||
|
||||
// Execute
|
||||
struct_->on_resource_redirect(struct_,
|
||||
CefBrowserCppToC::Wrap(browser),
|
||||
old_url.GetStruct(),
|
||||
new_url.GetWritableStruct());
|
||||
}
|
||||
|
||||
|
||||
void CefRequestHandlerCToCpp::OnResourceResponse(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& url, CefRefPtr<CefResponse> response,
|
||||
CefRefPtr<CefContentFilter>& filter)
|
||||
|
@@ -41,6 +41,8 @@ public:
|
||||
CefRefPtr<CefRequest> request, CefString& redirectUrl,
|
||||
CefRefPtr<CefStreamReader>& resourceStream,
|
||||
CefRefPtr<CefResponse> response, int loadFlags) OVERRIDE;
|
||||
virtual void OnResourceRedirect(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& old_url, CefString& new_url) OVERRIDE;
|
||||
virtual void OnResourceResponse(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& url, CefRefPtr<CefResponse> response,
|
||||
CefRefPtr<CefContentFilter>& filter) OVERRIDE;
|
||||
|
Reference in New Issue
Block a user