| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ssl/ssl_host_state.h" |
| 6 |
| 7 SSLHostState::SSLHostState() { |
| 8 } |
| 9 |
| 10 SSLHostState::~SSLHostState() { |
| 11 } |
| 12 |
| 13 void SSLHostState::DenyCertForHost(net::X509Certificate* cert, |
| 14 const std::string& host) { |
| 15 DCHECK(CalledOnValidThread()); |
| 16 |
| 17 // Remember that we don't like this cert for this host. |
| 18 cert_policy_for_host_[host].Deny(cert); |
| 19 } |
| 20 |
| 21 void SSLHostState::AllowCertForHost(net::X509Certificate* cert, |
| 22 const std::string& host) { |
| 23 DCHECK(CalledOnValidThread()); |
| 24 |
| 25 // Remember that we do like this cert for this host. |
| 26 cert_policy_for_host_[host].Allow(cert); |
| 27 } |
| 28 |
| 29 net::X509Certificate::Policy::Judgment SSLHostState::QueryPolicy( |
| 30 net::X509Certificate* cert, const std::string& host) { |
| 31 DCHECK(CalledOnValidThread()); |
| 32 |
| 33 return cert_policy_for_host_[host].Check(cert); |
| 34 } |
| 35 |
| 36 bool SSLHostState::CanShowInsecureContent(const GURL& url) { |
| 37 DCHECK(CalledOnValidThread()); |
| 38 |
| 39 return (can_show_insecure_content_for_host_.find(url.host()) != |
| 40 can_show_insecure_content_for_host_.end()); |
| 41 } |
| 42 |
| 43 void SSLHostState::AllowShowInsecureContentForURL(const GURL& url) { |
| 44 DCHECK(CalledOnValidThread()); |
| 45 |
| 46 can_show_insecure_content_for_host_.insert(url.host()); |
| 47 } |
| OLD | NEW |