summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl/ssl_manager.cc
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-13 08:48:30 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-13 08:48:30 +0000
commit52b56d1abe78e4a87b6c6a540b41d46961af0b61 (patch)
tree90b594101ee79f95e65284c7759321cece8687f0 /chrome/browser/ssl/ssl_manager.cc
parentd26f58aeca2d32c34ceeb84f905f81d9ba183438 (diff)
downloadchromium_src-52b56d1abe78e4a87b6c6a540b41d46961af0b61.zip
chromium_src-52b56d1abe78e4a87b6c6a540b41d46961af0b61.tar.gz
chromium_src-52b56d1abe78e4a87b6c6a540b41d46961af0b61.tar.bz2
Revert 9747
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9748 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ssl/ssl_manager.cc')
-rw-r--r--chrome/browser/ssl/ssl_manager.cc38
1 files changed, 21 insertions, 17 deletions
diff --git a/chrome/browser/ssl/ssl_manager.cc b/chrome/browser/ssl/ssl_manager.cc
index 195d25e..910d43f 100644
--- a/chrome/browser/ssl/ssl_manager.cc
+++ b/chrome/browser/ssl/ssl_manager.cc
@@ -12,7 +12,6 @@
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/resource_request_details.h"
#include "chrome/browser/ssl/ssl_error_info.h"
-#include "chrome/browser/ssl/ssl_host_state.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "chrome/browser/tab_contents/provisional_load_details.h"
@@ -44,14 +43,14 @@
class SSLInfoBarDelegate : public ConfirmInfoBarDelegate {
public:
- SSLInfoBarDelegate(TabContents* contents,
- const std::wstring message,
- const std::wstring& button_label,
- Task* task)
- : ConfirmInfoBarDelegate(contents),
- message_(message),
- button_label_(button_label),
- task_(task) {
+ SSLInfoBarDelegate(TabContents* contents,
+ const std::wstring message,
+ const std::wstring& button_label,
+ Task* task)
+ : ConfirmInfoBarDelegate(contents),
+ message_(message),
+ button_label_(button_label),
+ task_(task) {
}
virtual ~SSLInfoBarDelegate() {}
@@ -102,8 +101,7 @@ void SSLManager::RegisterUserPrefs(PrefService* prefs) {
SSLManager::SSLManager(NavigationController* controller, Delegate* delegate)
: delegate_(delegate),
- controller_(controller),
- ssl_host_state_(controller->profile()->GetSSLHostState()) {
+ controller_(controller) {
DCHECK(controller_);
// If do delegate is supplied, use the default policy.
@@ -193,27 +191,33 @@ void SSLManager::AddMessageToConsole(const std::wstring& msg,
void SSLManager::DenyCertForHost(net::X509Certificate* cert,
const std::string& host) {
// Remember that we don't like this cert for this host.
- ssl_host_state_->DenyCertForHost(cert, host);
+ // TODO(abarth): Do we want to persist this information in the user's profile?
+ cert_policy_for_host_[host].Deny(cert);
}
// Delegate API method.
void SSLManager::AllowCertForHost(net::X509Certificate* cert,
const std::string& host) {
- ssl_host_state_->AllowCertForHost(cert, host);
+ // Remember that we do like this cert for this host.
+ // TODO(abarth): Do we want to persist this information in the user's profile?
+ cert_policy_for_host_[host].Allow(cert);
}
// Delegate API method.
net::X509Certificate::Policy::Judgment SSLManager::QueryPolicy(
net::X509Certificate* cert, const std::string& host) {
- return ssl_host_state_->QueryPolicy(cert, host);
+ // TODO(abarth): Do we want to read this information from the user's profile?
+ return cert_policy_for_host_[host].Check(cert);
}
bool SSLManager::CanShowInsecureContent(const GURL& url) {
- return ssl_host_state_->CanShowInsecureContent(url);
+ // TODO(jcampan): Do we want to read this information from the user's profile?
+ return (can_show_insecure_content_for_host_.find(url.host()) !=
+ can_show_insecure_content_for_host_.end());
}
void SSLManager::AllowShowInsecureContentForURL(const GURL& url) {
- ssl_host_state_->AllowShowInsecureContentForURL(url);
+ can_show_insecure_content_for_host_.insert(url.host());
}
bool SSLManager::ProcessedSSLErrorFromRequest() const {
@@ -605,7 +609,7 @@ void SSLManager::DidCommitProvisionalLoad(
// If the frame has been blocked we keep our security style as
// authenticated in that case as nothing insecure is actually showing or
// loaded.
- if (!details->is_content_filtered &&
+ if (!details->is_content_filtered &&
!details->entry->ssl().has_mixed_content()) {
details->entry->ssl().set_has_mixed_content();
changed = true;