From 546ddd17b101f5a18e4cd55485378de9f6eea1c3 Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Thu, 25 Jun 2009 00:25:01 +0000 Subject: Don't disable view-source mode on cancellation. On error, we should turn off view-source mode not to show error page in view-source mode. However, on cancellation, it's not necessary and sometimes render non-error page with view-source: prefix in non view-source mode by mistake. In fixing this, I pushed down SetInViewSourceMode to RenderView from WebFrameImpl. We can control view-source state more precisely by this way. Patch by tyoshino@google.com Original review: http://codereview.chromium.org/122026 BUG=4516 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19205 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/webframe_impl.cc | 3 --- webkit/tools/test_shell/test_webview_delegate.cc | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'webkit') diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index 475eda8..98e0afb 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -1622,9 +1622,6 @@ void WebFrameImpl::DidReceiveData(DocumentLoader* loader, } void WebFrameImpl::DidFail(const ResourceError& error, bool was_provisional) { - // Make sure we never show errors in view source mode. - SetInViewSourceMode(false); - WebViewImpl* web_view = GetWebViewImpl(); WebViewDelegate* delegate = web_view->delegate(); if (delegate) { diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index da50f28..be1f75a 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -328,6 +328,9 @@ void TestWebViewDelegate::DidFailProvisionalLoadWithError( request.url().spec().data()); request.setURL(GURL("testshell-error:")); + // Make sure we never show errors in view source mode. + frame->SetInViewSourceMode(false); + frame->LoadAlternateHTMLString( request, error_text, error.unreachableURL, replace); } -- cgit v1.1