| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/json/json_writer.h" | 5 #include "base/json/json_writer.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
| 8 #include "chrome/browser/ui/webui/certificate_viewer.h" | 8 #include "chrome/browser/ui/webui/certificate_viewer.h" |
| 9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 : cert_(cert) { | 47 : cert_(cert) { |
| 48 // Construct the JSON string with a pointer to the stored certificate. | 48 // Construct the JSON string with a pointer to the stored certificate. |
| 49 DictionaryValue args; | 49 DictionaryValue args; |
| 50 args.SetString("cert", PointerToHexString(cert_)); | 50 args.SetString("cert", PointerToHexString(cert_)); |
| 51 base::JSONWriter::Write(&args, false, &json_args_); | 51 base::JSONWriter::Write(&args, false, &json_args_); |
| 52 | 52 |
| 53 // Construct the dialog title from the certificate. | 53 // Construct the dialog title from the certificate. |
| 54 net::X509Certificate::OSCertHandles cert_chain; | 54 net::X509Certificate::OSCertHandles cert_chain; |
| 55 x509_certificate_model::GetCertChainFromCert(cert_->os_cert_handle(), | 55 x509_certificate_model::GetCertChainFromCert(cert_->os_cert_handle(), |
| 56 &cert_chain); | 56 &cert_chain); |
| 57 title_ = UTF16ToWide(l10n_util::GetStringFUTF16( | 57 title_ = l10n_util::GetStringFUTF16(IDS_CERT_INFO_DIALOG_TITLE, |
| 58 IDS_CERT_INFO_DIALOG_TITLE, UTF8ToUTF16(x509_certificate_model::GetTitle( | 58 UTF8ToUTF16(x509_certificate_model::GetTitle(cert_chain.front()))); |
| 59 cert_chain.front())))); | |
| 60 } | 59 } |
| 61 | 60 |
| 62 bool CertificateViewerDialog::IsDialogModal() const { | 61 bool CertificateViewerDialog::IsDialogModal() const { |
| 63 return false; | 62 return false; |
| 64 } | 63 } |
| 65 | 64 |
| 66 std::wstring CertificateViewerDialog::GetDialogTitle() const { | 65 string16 CertificateViewerDialog::GetDialogTitle() const { |
| 67 return title_; | 66 return title_; |
| 68 } | 67 } |
| 69 | 68 |
| 70 GURL CertificateViewerDialog::GetDialogContentURL() const { | 69 GURL CertificateViewerDialog::GetDialogContentURL() const { |
| 71 return GURL(chrome::kChromeUICertificateViewerURL); | 70 return GURL(chrome::kChromeUICertificateViewerURL); |
| 72 } | 71 } |
| 73 | 72 |
| 74 void CertificateViewerDialog::GetWebUIMessageHandlers( | 73 void CertificateViewerDialog::GetWebUIMessageHandlers( |
| 75 std::vector<WebUIMessageHandler*>* handlers) const { | 74 std::vector<WebUIMessageHandler*>* handlers) const { |
| 76 } | 75 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 94 } | 93 } |
| 95 | 94 |
| 96 bool CertificateViewerDialog::ShouldShowDialogTitle() const { | 95 bool CertificateViewerDialog::ShouldShowDialogTitle() const { |
| 97 return true; | 96 return true; |
| 98 } | 97 } |
| 99 | 98 |
| 100 bool CertificateViewerDialog::HandleContextMenu( | 99 bool CertificateViewerDialog::HandleContextMenu( |
| 101 const ContextMenuParams& params) { | 100 const ContextMenuParams& params) { |
| 102 return true; | 101 return true; |
| 103 } | 102 } |
| OLD | NEW |