summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 21:08:29 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 21:08:29 +0000
commite3d60e5dbbe1a30ee38ad470a5d6040011aea60a (patch)
tree7bbbc49baffe53a69b218782ec9ae9c9a5955119
parent62032c25bd0a89863af01c85c197e1fada71ac0c (diff)
downloadchromium_src-e3d60e5dbbe1a30ee38ad470a5d6040011aea60a.zip
chromium_src-e3d60e5dbbe1a30ee38ad470a5d6040011aea60a.tar.gz
chromium_src-e3d60e5dbbe1a30ee38ad470a5d6040011aea60a.tar.bz2
Plumb the new mixed content API callbacks to the tab contents. We'll actually
use these notifications in a future patch. No behavior change. R=agl Review URL: http://codereview.chromium.org/241004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27249 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc11
-rw-r--r--chrome/browser/renderer_host/render_view_host.h2
-rw-r--r--chrome/browser/renderer_host/render_view_host_delegate.h3
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc8
-rw-r--r--chrome/browser/tab_contents/tab_contents.h2
-rw-r--r--chrome/common/render_messages_internal.h7
-rw-r--r--chrome/renderer/render_view.cc12
-rw-r--r--chrome/renderer/render_view.h4
8 files changed, 47 insertions, 2 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index fba69fb..5e8b4a6 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -767,6 +767,10 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
OnMsgDocumentAvailableInMainFrame)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidLoadResourceFromMemoryCache,
OnMsgDidLoadResourceFromMemoryCache)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_DidDisplayInsecureContent,
+ OnMsgDidDisplayInsecureContent)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_DidRunInsecureContent,
+ OnMsgDidRunInsecureContent)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidRedirectProvisionalLoad,
OnMsgDidRedirectProvisionalLoad)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartProvisionalLoadForFrame,
@@ -1061,6 +1065,13 @@ void RenderViewHost::OnMsgDidLoadResourceFromMemoryCache(
}
}
+void RenderViewHost::OnMsgDidDisplayInsecureContent() {
+}
+
+void RenderViewHost::OnMsgDidRunInsecureContent(
+ const std::string& security_origin) {
+}
+
void RenderViewHost::OnMsgDidStartProvisionalLoadForFrame(bool is_main_frame,
const GURL& url) {
GURL validated_url(url);
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index 2044349..18f6021 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -489,6 +489,8 @@ class RenderViewHost : public RenderWidgetHost,
const std::string& frame_origin,
const std::string& main_frame_origin,
const std::string& security_info);
+ void OnMsgDidDisplayInsecureContent();
+ void OnMsgDidRunInsecureContent(const std::string& security_origin);
void OnMsgDidStartProvisionalLoadForFrame(bool main_frame,
const GURL& url);
void OnMsgDidFailProvisionalLoadWithError(bool main_frame,
diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h
index d38d4f6..416d608 100644
--- a/chrome/browser/renderer_host/render_view_host_delegate.h
+++ b/chrome/browser/renderer_host/render_view_host_delegate.h
@@ -255,6 +255,9 @@ class RenderViewHostDelegate {
const std::string& main_frame_origin,
const std::string& security_info) = 0;
+ virtual void DidDisplayInsecureContent() = 0;
+ virtual void DidRunInsecureContent(const std::string& security_origin) = 0;
+
// The RenderView failed a provisional load with an error.
virtual void DidFailProvisionalLoadWithError(
RenderViewHost* render_view_host,
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 80a7d8b..9b82671 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -1773,6 +1773,14 @@ void TabContents::DidLoadResourceFromMemoryCache(
Details<LoadFromMemoryCacheDetails>(&details));
}
+void TabContents::DidDisplayInsecureContent() {
+ // TODO(abarth): Update the HTTPS state.
+}
+
+void TabContents::DidRunInsecureContent(const std::string& security_origin) {
+ // TODO(abarth): Update the HTTPS state.
+}
+
void TabContents::DidFailProvisionalLoadWithError(
RenderViewHost* render_view_host,
bool is_main_frame,
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index 70989ad..72f050f 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -815,6 +815,8 @@ class TabContents : public PageNavigator,
const std::string& frame_origin,
const std::string& main_frame_origin,
const std::string& security_info);
+ virtual void DidDisplayInsecureContent();
+ virtual void DidRunInsecureContent(const std::string& security_origin);
virtual void DidFailProvisionalLoadWithError(
RenderViewHost* render_view_host,
bool is_main_frame,
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index 6259636..4eec034 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -868,6 +868,13 @@ IPC_BEGIN_MESSAGES(ViewHost)
std::string /* main_frame_origin */,
std::string /* security info */)
+ // Sent when the renderer displays insecure content in a secure page.
+ IPC_MESSAGE_ROUTED0(ViewHostMsg_DidDisplayInsecureContent)
+
+ // Sent when the renderer runs insecure content in a secure origin.
+ IPC_MESSAGE_ROUTED1(ViewHostMsg_DidRunInsecureContent,
+ std::string /* security_origin */)
+
// Sent when the renderer starts a provisional load for a frame.
IPC_MESSAGE_ROUTED2(ViewHostMsg_DidStartProvisionalLoadForFrame,
bool /* true if it is the main frame */,
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index a811503..842dfc0 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -130,6 +130,7 @@ using WebKit::WebPopupMenuInfo;
using WebKit::WebRange;
using WebKit::WebRect;
using WebKit::WebScriptSource;
+using WebKit::WebSecurityOrigin;
using WebKit::WebSettings;
using WebKit::WebSize;
using WebKit::WebString;
@@ -2299,6 +2300,17 @@ void RenderView::didLoadResourceFromMemoryCache(
response.securityInfo()));
}
+void RenderView::didDisplayInsecureContent(WebKit::WebFrame* frame) {
+ Send(new ViewHostMsg_DidDisplayInsecureContent(routing_id_));
+}
+
+void RenderView::didRunInsecureContent(
+ WebFrame* frame, const WebSecurityOrigin& origin) {
+ Send(new ViewHostMsg_DidRunInsecureContent(
+ routing_id_,
+ origin.toString().utf8()));
+}
+
void RenderView::didExhaustMemoryAvailableForScript(WebFrame* frame) {
Send(new ViewHostMsg_JSOutOfMemory(routing_id_));
}
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index b5158a4..aeb4562 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -352,9 +352,9 @@ class RenderView : public RenderWidget,
virtual void didLoadResourceFromMemoryCache(
WebKit::WebFrame* frame, const WebKit::WebURLRequest& request,
const WebKit::WebURLResponse&);
- virtual void didDisplayInsecureContent(WebKit::WebFrame* frame) {}
+ virtual void didDisplayInsecureContent(WebKit::WebFrame* frame);
virtual void didRunInsecureContent(
- WebKit::WebFrame* frame, const WebKit::WebSecurityOrigin& origin) {}
+ WebKit::WebFrame* frame, const WebKit::WebSecurityOrigin& origin);
virtual void didExhaustMemoryAvailableForScript(WebKit::WebFrame* frame);
virtual void didChangeContentsSize(
WebKit::WebFrame* frame, const WebKit::WebSize& size);