| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/ssl/ssl_policy.h" | 5 #include "chrome/browser/ssl/ssl_policy.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "net/base/ssl_info.h" | 35 #include "net/base/ssl_info.h" |
| 36 #include "webkit/glue/resource_type.h" | 36 #include "webkit/glue/resource_type.h" |
| 37 | 37 |
| 38 SSLPolicy::SSLPolicy(SSLPolicyBackend* backend) | 38 SSLPolicy::SSLPolicy(SSLPolicyBackend* backend) |
| 39 : backend_(backend) { | 39 : backend_(backend) { |
| 40 DCHECK(backend_); | 40 DCHECK(backend_); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void SSLPolicy::OnCertError(SSLCertErrorHandler* handler) { | 43 void SSLPolicy::OnCertError(SSLCertErrorHandler* handler) { |
| 44 // First we check if we know the policy for this error. | 44 // First we check if we know the policy for this error. |
| 45 net::X509Certificate::Policy::Judgment judgment = | 45 net::CertPolicy::Judgment judgment = |
| 46 backend_->QueryPolicy(handler->ssl_info().cert, | 46 backend_->QueryPolicy(handler->ssl_info().cert, |
| 47 handler->request_url().host()); | 47 handler->request_url().host()); |
| 48 | 48 |
| 49 if (judgment == net::X509Certificate::Policy::ALLOWED) { | 49 if (judgment == net::CertPolicy::ALLOWED) { |
| 50 handler->ContinueRequest(); | 50 handler->ContinueRequest(); |
| 51 return; | 51 return; |
| 52 } | 52 } |
| 53 | 53 |
| 54 // The judgment is either DENIED or UNKNOWN. | 54 // The judgment is either DENIED or UNKNOWN. |
| 55 // For now we handle the DENIED as the UNKNOWN, which means a blocking | 55 // For now we handle the DENIED as the UNKNOWN, which means a blocking |
| 56 // page is shown to the user every time he comes back to the page. | 56 // page is shown to the user every time he comes back to the page. |
| 57 | 57 |
| 58 switch (handler->cert_error()) { | 58 switch (handler->cert_error()) { |
| 59 case net::ERR_CERT_COMMON_NAME_INVALID: | 59 case net::ERR_CERT_COMMON_NAME_INVALID: |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 entry->ssl().set_security_style(entry->url().SchemeIsSecure() ? | 239 entry->ssl().set_security_style(entry->url().SchemeIsSecure() ? |
| 240 SECURITY_STYLE_AUTHENTICATED : SECURITY_STYLE_UNAUTHENTICATED); | 240 SECURITY_STYLE_AUTHENTICATED : SECURITY_STYLE_UNAUTHENTICATED); |
| 241 } | 241 } |
| 242 | 242 |
| 243 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { | 243 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { |
| 244 GURL parsed_origin(origin); | 244 GURL parsed_origin(origin); |
| 245 if (parsed_origin.SchemeIsSecure()) | 245 if (parsed_origin.SchemeIsSecure()) |
| 246 backend_->HostRanInsecureContent(parsed_origin.host(), pid); | 246 backend_->HostRanInsecureContent(parsed_origin.host(), pid); |
| 247 } | 247 } |
| OLD | NEW |