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 10:04:35 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-13 10:04:35 +0000
commit34cc84fd2e2c22194b88d652b7331846aa620a1b (patch)
tree6618582cf33a54974c547d309883c31f41d237e1 /chrome/browser/ssl/ssl_manager.cc
parent52b56d1abe78e4a87b6c6a540b41d46961af0b61 (diff)
downloadchromium_src-34cc84fd2e2c22194b88d652b7331846aa620a1b.zip
chromium_src-34cc84fd2e2c22194b88d652b7331846aa620a1b.tar.gz
chromium_src-34cc84fd2e2c22194b88d652b7331846aa620a1b.tar.bz2
Remember that we've white listed a certificate when we switch to a new tab.
R=wtc BUG=6456 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9749 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, 17 insertions, 21 deletions
diff --git a/chrome/browser/ssl/ssl_manager.cc b/chrome/browser/ssl/ssl_manager.cc
index 910d43f..195d25e 100644
--- a/chrome/browser/ssl/ssl_manager.cc
+++ b/chrome/browser/ssl/ssl_manager.cc
@@ -12,6 +12,7 @@
#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"
@@ -43,14 +44,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() {}
@@ -101,7 +102,8 @@ void SSLManager::RegisterUserPrefs(PrefService* prefs) {
SSLManager::SSLManager(NavigationController* controller, Delegate* delegate)
: delegate_(delegate),
- controller_(controller) {
+ controller_(controller),
+ ssl_host_state_(controller->profile()->GetSSLHostState()) {
DCHECK(controller_);
// If do delegate is supplied, use the default policy.
@@ -191,33 +193,27 @@ 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.
- // TODO(abarth): Do we want to persist this information in the user's profile?
- cert_policy_for_host_[host].Deny(cert);
+ ssl_host_state_->DenyCertForHost(cert, host);
}
// Delegate API method.
void SSLManager::AllowCertForHost(net::X509Certificate* cert,
const std::string& 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);
+ ssl_host_state_->AllowCertForHost(cert, host);
}
// Delegate API method.
net::X509Certificate::Policy::Judgment SSLManager::QueryPolicy(
net::X509Certificate* cert, const std::string& host) {
- // TODO(abarth): Do we want to read this information from the user's profile?
- return cert_policy_for_host_[host].Check(cert);
+ return ssl_host_state_->QueryPolicy(cert, host);
}
bool SSLManager::CanShowInsecureContent(const GURL& 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());
+ return ssl_host_state_->CanShowInsecureContent(url);
}
void SSLManager::AllowShowInsecureContentForURL(const GURL& url) {
- can_show_insecure_content_for_host_.insert(url.host());
+ ssl_host_state_->AllowShowInsecureContentForURL(url);
}
bool SSLManager::ProcessedSSLErrorFromRequest() const {
@@ -609,7 +605,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;