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

Side by Side Diff: chrome/browser/ui/webui/options/certificate_manager_handler.cc

Issue 376753002: Fix webui cert viewer showing wrong cert chain on NSS and no chain on OpenSSL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 6 years, 5 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 "chrome/browser/ui/webui/options/certificate_manager_handler.h" 5 #include "chrome/browser/ui/webui/options/certificate_manager_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CA_IMPORT_ERROR_TITLE), 976 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CA_IMPORT_ERROR_TITLE),
977 not_imported); 977 not_imported);
978 } 978 }
979 ImportExportCleanup(); 979 ImportExportCleanup();
980 } 980 }
981 981
982 void CertificateManagerHandler::Export(const base::ListValue* args) { 982 void CertificateManagerHandler::Export(const base::ListValue* args) {
983 net::X509Certificate* cert = cert_id_map_->CallbackArgsToCert(args); 983 net::X509Certificate* cert = cert_id_map_->CallbackArgsToCert(args);
984 if (!cert) 984 if (!cert)
985 return; 985 return;
986 ShowCertExportDialog(web_ui()->GetWebContents(), GetParentWindow(), 986 net::X509Certificate::OSCertHandles cert_chain;
987 cert->os_cert_handle()); 987 cert->GetCertificateChain(&cert_chain);
988 ShowCertExportDialog(web_ui()->GetWebContents(),
989 GetParentWindow(),
990 cert_chain.begin(),
991 cert_chain.end());
988 } 992 }
989 993
990 void CertificateManagerHandler::Delete(const base::ListValue* args) { 994 void CertificateManagerHandler::Delete(const base::ListValue* args) {
991 net::X509Certificate* cert = cert_id_map_->CallbackArgsToCert(args); 995 net::X509Certificate* cert = cert_id_map_->CallbackArgsToCert(args);
992 if (!cert) 996 if (!cert)
993 return; 997 return;
994 bool result = certificate_manager_model_->Delete(cert); 998 bool result = certificate_manager_model_->Delete(cert);
995 if (!result) { 999 if (!result) {
996 // TODO(mattm): better error messages? 1000 // TODO(mattm): better error messages?
997 ShowError( 1001 ShowError(
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 title_value, 1154 title_value,
1151 error_value, 1155 error_value,
1152 cert_error_list); 1156 cert_error_list);
1153 } 1157 }
1154 1158
1155 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { 1159 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const {
1156 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); 1160 return web_ui()->GetWebContents()->GetTopLevelNativeWindow();
1157 } 1161 }
1158 1162
1159 } // namespace options 1163 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698