summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-26 08:30:59 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-26 08:30:59 +0000
commit09843b5f0930b2f19a55a3b405aeacb48fc90f01 (patch)
tree8ed6ccd597fddd797541111d8e585eeed3a107ba /chrome
parent3ae92e96ba6e4b5761f2673ec6f28fd916951b70 (diff)
downloadchromium_src-09843b5f0930b2f19a55a3b405aeacb48fc90f01.zip
chromium_src-09843b5f0930b2f19a55a3b405aeacb48fc90f01.tar.gz
chromium_src-09843b5f0930b2f19a55a3b405aeacb48fc90f01.tar.bz2
Update our mixed content state with information from the new mixed content
APIs. This change is purely additive. I'll rip out the old mechanism in the next patch. R=agl Review URL: http://codereview.chromium.org/243012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27323 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc8
-rw-r--r--chrome/browser/ssl/ssl_manager.cc8
-rw-r--r--chrome/browser/ssl/ssl_manager.h4
-rw-r--r--chrome/browser/ssl/ssl_policy.cc13
-rw-r--r--chrome/browser/ssl/ssl_policy.h5
-rw-r--r--chrome/browser/ssl/ssl_policy_backend.h2
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc4
7 files changed, 41 insertions, 3 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index 48e8289..9a2b127 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -1066,10 +1066,18 @@ void RenderViewHost::OnMsgDidLoadResourceFromMemoryCache(
}
void RenderViewHost::OnMsgDidDisplayInsecureContent() {
+ RenderViewHostDelegate::Resource* resource_delegate =
+ delegate_->GetResourceDelegate();
+ if (resource_delegate)
+ resource_delegate->DidDisplayInsecureContent();
}
void RenderViewHost::OnMsgDidRunInsecureContent(
const std::string& security_origin) {
+ RenderViewHostDelegate::Resource* resource_delegate =
+ delegate_->GetResourceDelegate();
+ if (resource_delegate)
+ resource_delegate->DidRunInsecureContent(security_origin);
}
void RenderViewHost::OnMsgDidStartProvisionalLoadForFrame(bool is_main_frame,
diff --git a/chrome/browser/ssl/ssl_manager.cc b/chrome/browser/ssl/ssl_manager.cc
index 73c3b02..36b4127 100644
--- a/chrome/browser/ssl/ssl_manager.cc
+++ b/chrome/browser/ssl/ssl_manager.cc
@@ -87,6 +87,14 @@ void SSLManager::OnSSLCertificateError(ResourceDispatcherHost* rdh,
&SSLCertErrorHandler::Dispatch));
}
+void SSLManager::DidDisplayInsecureContent() {
+ policy()->DidDisplayInsecureContent(controller_->GetActiveEntry());
+}
+
+void SSLManager::DidRunInsecureContent(const std::string& security_origin) {
+ policy()->DidRunInsecureContent(security_origin);
+}
+
// static
bool SSLManager::ShouldStartRequest(ResourceDispatcherHost* rdh,
URLRequest* request,
diff --git a/chrome/browser/ssl/ssl_manager.h b/chrome/browser/ssl/ssl_manager.h
index b287ea6..4e96ce8 100644
--- a/chrome/browser/ssl/ssl_manager.h
+++ b/chrome/browser/ssl/ssl_manager.h
@@ -77,6 +77,10 @@ class SSLManager : public NotificationObserver {
URLRequest* request,
MessageLoop* ui_loop);
+ // Mixed content entry points.
+ void DidDisplayInsecureContent();
+ void DidRunInsecureContent(const std::string& security_origin);
+
// Entry point for navigation. This function begins the process of updating
// the security UI when the main frame navigates to a new URL.
//
diff --git a/chrome/browser/ssl/ssl_policy.cc b/chrome/browser/ssl/ssl_policy.cc
index a6ebfb8..bdb571b 100644
--- a/chrome/browser/ssl/ssl_policy.cc
+++ b/chrome/browser/ssl/ssl_policy.cc
@@ -133,6 +133,19 @@ void SSLPolicy::OnMixedContent(SSLMixedContentHandler* handler) {
AddMixedContentWarningToConsole(handler);
}
+void SSLPolicy::DidDisplayInsecureContent(NavigationEntry* entry) {
+ if (!entry)
+ return;
+
+ // TODO(abarth): We don't actually need to break the whole origin here,
+ // but we can handle that in a later patch.
+ AllowMixedContentForOrigin(entry->url().spec());
+}
+
+void SSLPolicy::DidRunInsecureContent(const std::string& security_origin) {
+ AllowMixedContentForOrigin(security_origin);
+}
+
void SSLPolicy::OnRequestStarted(SSLRequestInfo* info) {
if (net::IsCertStatusError(info->ssl_cert_status()))
UpdateStateForUnsafeContent(info);
diff --git a/chrome/browser/ssl/ssl_policy.h b/chrome/browser/ssl/ssl_policy.h
index 48a5f0d..df2e002 100644
--- a/chrome/browser/ssl/ssl_policy.h
+++ b/chrome/browser/ssl/ssl_policy.h
@@ -30,11 +30,16 @@ class SSLPolicy : public SSLBlockingPage::Delegate {
// An error occurred with the certificate in an SSL connection.
void OnCertError(SSLCertErrorHandler* handler);
+ // TODO(abarth) Remove this API once the new mixed content path is done.
+ //
// A request for a mixed-content resource was made. Note that the resource
// request was not started yet and the delegate is responsible for starting
// it.
void OnMixedContent(SSLMixedContentHandler* handler);
+ void DidDisplayInsecureContent(NavigationEntry* entry);
+ void DidRunInsecureContent(const std::string& security_origin);
+
// We have started a resource request with the given info.
void OnRequestStarted(SSLRequestInfo* info);
diff --git a/chrome/browser/ssl/ssl_policy_backend.h b/chrome/browser/ssl/ssl_policy_backend.h
index f8a829c..935ad9e 100644
--- a/chrome/browser/ssl/ssl_policy_backend.h
+++ b/chrome/browser/ssl/ssl_policy_backend.h
@@ -45,7 +45,7 @@ class SSLPolicyBackend {
//
// It will return true if the navigation entry was updated or false if
// nothing changed. The caller is responsible for broadcasting
- // NOTIFY_SSY_STATE_CHANGED if it returns true.
+ // NOTIFY_SSL_STATE_CHANGED if it returns true.
bool SetMaxSecurityStyle(SecurityStyle style);
// Logs a message to the console of the page.
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 8f927ac..24fd51a 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -1774,11 +1774,11 @@ void TabContents::DidLoadResourceFromMemoryCache(
}
void TabContents::DidDisplayInsecureContent() {
- // TODO(abarth): Update the HTTPS state.
+ controller_.ssl_manager()->DidDisplayInsecureContent();
}
void TabContents::DidRunInsecureContent(const std::string& security_origin) {
- // TODO(abarth): Update the HTTPS state.
+ controller_.ssl_manager()->DidRunInsecureContent(security_origin);
}
void TabContents::DidFailProvisionalLoadWithError(