Revert 268405 "Make sure that ScratchBuffer::Allocate() always r..."
[chromium-blink-merge.git] / content / browser / ssl / ssl_policy_backend.cc
blob3eb4f467e709d57621f9f7b59853d426c73a8f33
1 // Copyright (c) 2012 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.
5 #include "content/browser/ssl/ssl_policy_backend.h"
7 #include "content/browser/frame_host/navigation_controller_impl.h"
8 #include "content/browser/ssl/ssl_host_state.h"
9 #include "content/public/browser/browser_context.h"
11 namespace content {
13 SSLPolicyBackend::SSLPolicyBackend(NavigationControllerImpl* controller)
14 : ssl_host_state_(SSLHostState::GetFor(controller->GetBrowserContext())),
15 controller_(controller) {
16 DCHECK(controller_);
19 void SSLPolicyBackend::HostRanInsecureContent(const std::string& host, int id) {
20 ssl_host_state_->HostRanInsecureContent(host, id);
21 SSLManager::NotifySSLInternalStateChanged(controller_->GetBrowserContext());
24 bool SSLPolicyBackend::DidHostRunInsecureContent(const std::string& host,
25 int pid) const {
26 return ssl_host_state_->DidHostRunInsecureContent(host, pid);
29 void SSLPolicyBackend::DenyCertForHost(net::X509Certificate* cert,
30 const std::string& host,
31 net::CertStatus error) {
32 ssl_host_state_->DenyCertForHost(cert, host, error);
35 void SSLPolicyBackend::AllowCertForHost(net::X509Certificate* cert,
36 const std::string& host,
37 net::CertStatus error) {
38 ssl_host_state_->AllowCertForHost(cert, host, error);
41 net::CertPolicy::Judgment SSLPolicyBackend::QueryPolicy(
42 net::X509Certificate* cert,
43 const std::string& host,
44 net::CertStatus error) {
45 return ssl_host_state_->QueryPolicy(cert, host, error);
48 } // namespace content