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/page_info_model.h" | 5 #include "chrome/browser/page_info_model.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 52 } |
53 | 53 |
54 // Some of what IsCertStatusError classifies as errors we want to show as | 54 // Some of what IsCertStatusError classifies as errors we want to show as |
55 // warnings instead. | 55 // warnings instead. |
56 static const int cert_warnings = | 56 static const int cert_warnings = |
57 net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION | | 57 net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION | |
58 net::CERT_STATUS_NO_REVOCATION_MECHANISM; | 58 net::CERT_STATUS_NO_REVOCATION_MECHANISM; |
59 int status_with_warnings_removed = ssl.cert_status() & ~cert_warnings; | 59 int status_with_warnings_removed = ssl.cert_status() & ~cert_warnings; |
60 | 60 |
61 if (ssl.cert_id() && | 61 if (ssl.cert_id() && |
62 CertStore::GetSharedInstance()->RetrieveCert(ssl.cert_id(), &cert) && | 62 CertStore::GetInstance()->RetrieveCert(ssl.cert_id(), &cert) && |
63 !net::IsCertStatusError(status_with_warnings_removed)) { | 63 !net::IsCertStatusError(status_with_warnings_removed)) { |
64 // No error found so far, check cert_status warnings. | 64 // No error found so far, check cert_status warnings. |
65 int cert_status = ssl.cert_status(); | 65 int cert_status = ssl.cert_status(); |
66 if (cert_status & cert_warnings) { | 66 if (cert_status & cert_warnings) { |
67 string16 issuer_name(UTF8ToUTF16(cert->issuer().GetDisplayName())); | 67 string16 issuer_name(UTF8ToUTF16(cert->issuer().GetDisplayName())); |
68 if (issuer_name.empty()) { | 68 if (issuer_name.empty()) { |
69 issuer_name.assign(l10n_util::GetStringUTF16( | 69 issuer_name.assign(l10n_util::GetStringUTF16( |
70 IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY)); | 70 IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY)); |
71 } | 71 } |
72 description.assign(l10n_util::GetStringFUTF16( | 72 description.assign(l10n_util::GetStringFUTF16( |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 gfx::NativeImage PageInfoModel::GetBitmapNamed(int resource_id) { | 352 gfx::NativeImage PageInfoModel::GetBitmapNamed(int resource_id) { |
353 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 353 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
354 gfx::NativeImage image = rb.GetNativeImageNamed(resource_id); | 354 gfx::NativeImage image = rb.GetNativeImageNamed(resource_id); |
355 #if defined(OS_MACOSX) | 355 #if defined(OS_MACOSX) |
356 // Unlike other platforms, the Mac ResourceBundle does not keep a shared image | 356 // Unlike other platforms, the Mac ResourceBundle does not keep a shared image |
357 // cache. These are released in the dtor. | 357 // cache. These are released in the dtor. |
358 mac_util::NSObjectRetain(image); | 358 mac_util::NSObjectRetain(image); |
359 #endif | 359 #endif |
360 return image; | 360 return image; |
361 } | 361 } |
OLD | NEW |