| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_error_info.h" | 5 #include "chrome/browser/ssl_error_info.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/browser/cert_store.h" | 8 #include "chrome/browser/cert_store.h" |
| 9 #include "chrome/common/l10n_util.h" | 9 #include "chrome/common/l10n_util.h" |
| 10 #include "chrome/common/resource_bundle.h" |
| 10 #include "chrome/common/time_format.h" | 11 #include "chrome/common/time_format.h" |
| 11 #include "net/base/cert_status_flags.h" | 12 #include "net/base/cert_status_flags.h" |
| 12 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
| 13 #include "net/base/ssl_info.h" | 14 #include "net/base/ssl_info.h" |
| 14 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 15 | 16 |
| 16 #include "chromium_strings.h" | 17 #include "chromium_strings.h" |
| 17 #include "generated_resources.h" | 18 #include "generated_resources.h" |
| 18 | 19 |
| 19 SSLErrorInfo::SSLErrorInfo(const std::wstring& title, | 20 SSLErrorInfo::SSLErrorInfo(const std::wstring& title, |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 CERT_AUTHORITY_INVALID, | 228 CERT_AUTHORITY_INVALID, |
| 228 CERT_NO_REVOCATION_MECHANISM, | 229 CERT_NO_REVOCATION_MECHANISM, |
| 229 CERT_UNABLE_TO_CHECK_REVOCATION, | 230 CERT_UNABLE_TO_CHECK_REVOCATION, |
| 230 CERT_REVOKED, | 231 CERT_REVOKED, |
| 231 CERT_INVALID | 232 CERT_INVALID |
| 232 }; | 233 }; |
| 233 DCHECK(arraysize(kErrorFlags) == arraysize(kErrorTypes)); | 234 DCHECK(arraysize(kErrorFlags) == arraysize(kErrorTypes)); |
| 234 | 235 |
| 235 scoped_refptr<net::X509Certificate> cert = NULL; | 236 scoped_refptr<net::X509Certificate> cert = NULL; |
| 236 int count = 0; | 237 int count = 0; |
| 237 for (size_t i = 0; i < arraysize(kErrorFlags); ++i) { | 238 for (int i = 0; i < arraysize(kErrorFlags); ++i) { |
| 238 if (cert_status & kErrorFlags[i]) { | 239 if (cert_status & kErrorFlags[i]) { |
| 239 count++; | 240 count++; |
| 240 if (!cert.get()) { | 241 if (!cert.get()) { |
| 241 bool r = CertStore::GetSharedInstance()->RetrieveCert(cert_id, &cert); | 242 bool r = CertStore::GetSharedInstance()->RetrieveCert(cert_id, &cert); |
| 242 DCHECK(r); | 243 DCHECK(r); |
| 243 } | 244 } |
| 244 if (errors) | 245 if (errors) |
| 245 errors->push_back(SSLErrorInfo::CreateError(kErrorTypes[i], cert, url)); | 246 errors->push_back(SSLErrorInfo::CreateError(kErrorTypes[i], cert, url)); |
| 246 } | 247 } |
| 247 } | 248 } |
| 248 return count; | 249 return count; |
| 249 } | 250 } |
| 250 | 251 |
| OLD | NEW |