Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: content/browser/ssl/ssl_policy_backend.cc

Issue 12041059: content: convert SSL notifications to observer usage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/ssl/ssl_policy_backend.h" 5 #include "content/browser/ssl/ssl_policy_backend.h"
6 6
7 #include "content/browser/ssl/ssl_host_state.h" 7 #include "content/browser/ssl/ssl_host_state.h"
8 #include "content/browser/web_contents/navigation_controller_impl.h" 8 #include "content/browser/web_contents/navigation_controller_impl.h"
9 #include "content/browser/web_contents/navigation_entry_impl.h"
9 #include "content/public/browser/browser_context.h" 10 #include "content/public/browser/browser_context.h"
10 11
11 namespace content { 12 namespace content {
12 13
13 SSLPolicyBackend::SSLPolicyBackend(NavigationControllerImpl* controller) 14 SSLPolicyBackend::SSLPolicyBackend(NavigationControllerImpl* controller)
14 : ssl_host_state_(SSLHostState::GetFor(controller->GetBrowserContext())), 15 : ssl_host_state_(SSLHostState::GetFor(controller->GetBrowserContext())),
15 controller_(controller) { 16 controller_(controller) {
16 DCHECK(controller_); 17 DCHECK(controller_);
17 } 18 }
18 19
19 void SSLPolicyBackend::HostRanInsecureContent(const std::string& host, int id) { 20 void SSLPolicyBackend::HostRanInsecureContent(const std::string& host, int id) {
20 ssl_host_state_->HostRanInsecureContent(host, id); 21 ssl_host_state_->HostRanInsecureContent(host, id);
21 SSLManager::NotifySSLInternalStateChanged(controller_); 22 controller_->ssl_manager()->DidChangeInternalSSLState();
22 } 23 }
23 24
24 bool SSLPolicyBackend::DidHostRunInsecureContent(const std::string& host, 25 bool SSLPolicyBackend::DidHostRunInsecureContent(const std::string& host,
25 int pid) const { 26 int pid) const {
26 return ssl_host_state_->DidHostRunInsecureContent(host, pid); 27 return ssl_host_state_->DidHostRunInsecureContent(host, pid);
27 } 28 }
28 29
29 void SSLPolicyBackend::DenyCertForHost(net::X509Certificate* cert, 30 void SSLPolicyBackend::DenyCertForHost(net::X509Certificate* cert,
30 const std::string& host) { 31 const std::string& host) {
31 ssl_host_state_->DenyCertForHost(cert, host); 32 ssl_host_state_->DenyCertForHost(cert, host);
32 } 33 }
33 34
34 void SSLPolicyBackend::AllowCertForHost(net::X509Certificate* cert, 35 void SSLPolicyBackend::AllowCertForHost(net::X509Certificate* cert,
35 const std::string& host) { 36 const std::string& host) {
36 ssl_host_state_->AllowCertForHost(cert, host); 37 ssl_host_state_->AllowCertForHost(cert, host);
37 } 38 }
38 39
39 net::CertPolicy::Judgment SSLPolicyBackend::QueryPolicy( 40 net::CertPolicy::Judgment SSLPolicyBackend::QueryPolicy(
40 net::X509Certificate* cert, const std::string& host) { 41 net::X509Certificate* cert, const std::string& host) {
41 return ssl_host_state_->QueryPolicy(cert, host); 42 return ssl_host_state_->QueryPolicy(cert, host);
42 } 43 }
43 44
44 } // namespace content 45 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698