Index: content/browser/web_contents/web_contents_impl.cc |
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
index 4728e229c40b8a76dda82f08ff20f162195e4728..315435d35b786f89a571ea441e7e0d2dcf029d29 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -523,6 +523,7 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, |
OnDidDisplayInsecureContent) |
IPC_MESSAGE_HANDLER(ViewHostMsg_DidRunInsecureContent, |
OnDidRunInsecureContent) |
+ IPC_MESSAGE_HANDLER(ViewHostMsg_DidDetectXSS, OnDidDetectXSS) |
IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) |
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) |
IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) |
@@ -2552,6 +2553,21 @@ void WebContentsImpl::OnDidRunInsecureContent( |
GetController().GetBrowserContext()); |
} |
+void WebContentsImpl::OnDidDetectXSS(int32 page_id, |
+ const GURL& url, |
+ bool blocked_entire_page) { |
+ if (!blocked_entire_page) |
+ return; |
+ |
+ // Preserve the entry for a possible subsequent view-source operation. |
+ int entry_index = controller_.GetEntryIndexWithPageID( |
+ GetRenderViewHost()->GetSiteInstance(), page_id); |
+ NavigationEntry* entry = |
+ entry_index < 0 ? NULL : controller_.GetEntryAtIndex(entry_index); |
+ |
+ controller_.SetBlockedPageEntry(entry); |
+} |
+ |
void WebContentsImpl::OnDocumentLoadedInFrame() { |
CHECK(render_frame_message_source_); |
CHECK(!render_view_message_source_); |