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:
Marshall Greenblatt
2011-12-12 17:34:24 +00:00
parent 956073100e
commit bfcc2dbb8c
7 changed files with 204 additions and 4 deletions

View File

@@ -1274,6 +1274,16 @@ public:
CefRefPtr<CefResponse> response,
int loadFlags) { return false; }
///
// Called on the IO thread when a resource load is redirected. The |old_url|
// parameter will contain the old URL. The |new_url| parameter will contain
// the new URL and can be changed if desired.
///
/*--cef()--*/
virtual void OnResourceRedirect(CefRefPtr<CefBrowser> browser,
const CefString& old_url,
CefString& new_url) {}
///
// Called on the UI thread after a response to the resource request is
// received. Set |filter| if response content needs to be monitored and/or

View File

@@ -1100,6 +1100,15 @@ typedef struct _cef_request_handler_t
struct _cef_stream_reader_t** resourceStream,
struct _cef_response_t* response, int loadFlags);
///
// Called on the IO thread when a resource load is redirected. The |old_url|
// parameter will contain the old URL. The |new_url| parameter will contain
// the new URL and can be changed if desired.
///
void (CEF_CALLBACK *on_resource_redirect)(struct _cef_request_handler_t* self,
struct _cef_browser_t* browser, const cef_string_t* old_url,
cef_string_t* new_url);
///
// Called on the UI thread after a response to the resource request is
// received. Set |filter| if response content needs to be monitored and/or