summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/test_webview_delegate.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-04 17:36:55 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-04 17:36:55 +0000
commit7ccddb8cc40f885a50541c4f45afc4253ce3c065 (patch)
treea82976f8905298f6c320ff72331fd41697bc1aa5 /webkit/tools/test_shell/test_webview_delegate.cc
parentb881ade17222078ce4e0c4dc6cb296ac34ee7387 (diff)
downloadchromium_src-7ccddb8cc40f885a50541c4f45afc4253ce3c065.zip
chromium_src-7ccddb8cc40f885a50541c4f45afc4253ce3c065.tar.gz
chromium_src-7ccddb8cc40f885a50541c4f45afc4253ce3c065.tar.bz2
Move alternate 404 error page loading out of WebFrame and into RenderView.
This involved adding a new method on WebViewDelegate to allow the embedder to intercept data being loaded for a document. I also had to plumb a few more FrameLoaderClient notifications through WebViewDelegate. See DidReceiveResponse and DidFinishLoading. R=tony BUG=15648 TEST=covered by errorpage_uitest.cc Review URL: http://codereview.chromium.org/160578 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22389 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/test_webview_delegate.cc')
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc
index 197cc16..003a8396 100644
--- a/webkit/tools/test_shell/test_webview_delegate.cc
+++ b/webkit/tools/test_shell/test_webview_delegate.cc
@@ -217,7 +217,7 @@ WebNavigationPolicy TestWebViewDelegate::PolicyForNavigationAction(
}
void TestWebViewDelegate::AssignIdentifierToRequest(
- WebView* webview,
+ WebFrame* webframe,
uint32 identifier,
const WebURLRequest& request) {
if (shell_->ShouldDumpResourceLoadCallbacks())
@@ -229,7 +229,7 @@ std::string TestWebViewDelegate::GetResourceDescription(uint32 identifier) {
return it != resource_identifier_map_.end() ? it->second : "<unknown>";
}
-void TestWebViewDelegate::WillSendRequest(WebView* webview,
+void TestWebViewDelegate::WillSendRequest(WebFrame* webframe,
uint32 identifier,
WebURLRequest* request) {
GURL url = request->url();
@@ -242,6 +242,14 @@ void TestWebViewDelegate::WillSendRequest(WebView* webview,
request_url.c_str());
}
+ if (block_redirects_) {
+ printf("Returning null for this redirect\n");
+
+ // To block the request, we set its URL to an empty one.
+ request->setURL(WebURL());
+ return;
+ }
+
if (TestShell::layout_test_mode() && !host.empty() &&
(url.SchemeIs("http") || url.SchemeIs("https")) &&
host != "127.0.0.1" &&
@@ -260,7 +268,7 @@ void TestWebViewDelegate::WillSendRequest(WebView* webview,
request->setURL(GURL(TestShell::RewriteLocalUrl(request_url)));
}
-void TestWebViewDelegate::DidFinishLoading(WebView* webview,
+void TestWebViewDelegate::DidFinishLoading(WebFrame* webframe,
uint32 identifier) {
TRACE_EVENT_END("url.load", identifier, "");
if (shell_->ShouldDumpResourceLoadCallbacks()) {
@@ -271,7 +279,7 @@ void TestWebViewDelegate::DidFinishLoading(WebView* webview,
resource_identifier_map_.erase(identifier);
}
-void TestWebViewDelegate::DidFailLoadingWithError(WebView* webview,
+void TestWebViewDelegate::DidFailLoadingWithError(WebFrame* webframe,
uint32 identifier,
const WebURLError& error) {
if (shell_->ShouldDumpResourceLoadCallbacks()) {