Implement improvements for request handling (issue #1327).

- Add a new CefRequestHandler::OnResourceResponse() method for inspecting the request/response headers and potentially restarting or redirecting the request.
- Add a new CefRequest::GetIdentifier() method for tracking a request across multiple CefRequestHandler callbacks.
- Pass a CefRequest object instead of just the old URL to CefRequestHandler::OnResourceRedirect().

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2073 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2015-03-11 18:44:11 +00:00
parent 0b36550786
commit 558a8a3658
21 changed files with 745 additions and 48 deletions

View File

@@ -762,10 +762,11 @@ class RedirectTestHandler : public TestHandler {
void OnResourceRedirect(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& old_url,
CefRefPtr<CefRequest> request,
CefString& new_url) override {
// Should be called for each redirected URL.
const std::string& old_url = request->GetURL();
if (old_url == kRNav1 && new_url == kRNav2) {
// Called due to the nav1 redirect response.
got_nav1_redirect_.yes();
@@ -1670,8 +1671,14 @@ class LoadNavTestHandler : public TestHandler {
CefMouseEvent mouse_event;
mouse_event.x = 20;
mouse_event.y = 20;
#if defined(OS_MACOSX)
// Use cmd instead of ctrl on OS X.
mouse_event.modifiers =
(mode_ == CTRL_LEFT_CLICK ? EVENTFLAG_COMMAND_DOWN : 0);
#else
mouse_event.modifiers =
(mode_ == CTRL_LEFT_CLICK ? EVENTFLAG_CONTROL_DOWN : 0);
#endif
cef_mouse_button_type_t button_type =
(mode_ == MIDDLE_CLICK ? MBT_MIDDLE : MBT_LEFT);