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

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

Issue 10916094: Move the NSS functions out of CertDatabase into a new NSSCertDatabase class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 3 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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 ShowCertificateViewer(web_ui()->GetWebContents(), GetParentWindow(), cert); 518 ShowCertificateViewer(web_ui()->GetWebContents(), GetParentWindow(), cert);
519 } 519 }
520 520
521 void CertificateManagerHandler::GetCATrust(const ListValue* args) { 521 void CertificateManagerHandler::GetCATrust(const ListValue* args) {
522 net::X509Certificate* cert = cert_id_map_->CallbackArgsToCert(args); 522 net::X509Certificate* cert = cert_id_map_->CallbackArgsToCert(args);
523 if (!cert) { 523 if (!cert) {
524 web_ui()->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss"); 524 web_ui()->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss");
525 return; 525 return;
526 } 526 }
527 527
528 net::CertDatabase::TrustBits trust_bits = 528 net::NSSCertDatabase::TrustBits trust_bits =
529 certificate_manager_model_->cert_db().GetCertTrust(cert, net::CA_CERT); 529 certificate_manager_model_->cert_db()->GetCertTrust(cert, net::CA_CERT);
530 base::FundamentalValue ssl_value( 530 base::FundamentalValue ssl_value(
531 static_cast<bool>(trust_bits & net::CertDatabase::TRUSTED_SSL)); 531 static_cast<bool>(trust_bits & net::NSSCertDatabase::TRUSTED_SSL));
532 base::FundamentalValue email_value( 532 base::FundamentalValue email_value(
533 static_cast<bool>(trust_bits & net::CertDatabase::TRUSTED_EMAIL)); 533 static_cast<bool>(trust_bits & net::NSSCertDatabase::TRUSTED_EMAIL));
534 base::FundamentalValue obj_sign_value( 534 base::FundamentalValue obj_sign_value(
535 static_cast<bool>(trust_bits & net::CertDatabase::TRUSTED_OBJ_SIGN)); 535 static_cast<bool>(trust_bits & net::NSSCertDatabase::TRUSTED_OBJ_SIGN));
536 web_ui()->CallJavascriptFunction( 536 web_ui()->CallJavascriptFunction(
537 "CertificateEditCaTrustOverlay.populateTrust", 537 "CertificateEditCaTrustOverlay.populateTrust",
538 ssl_value, email_value, obj_sign_value); 538 ssl_value, email_value, obj_sign_value);
539 } 539 }
540 540
541 void CertificateManagerHandler::EditCATrust(const ListValue* args) { 541 void CertificateManagerHandler::EditCATrust(const ListValue* args) {
542 net::X509Certificate* cert = cert_id_map_->CallbackArgsToCert(args); 542 net::X509Certificate* cert = cert_id_map_->CallbackArgsToCert(args);
543 bool fail = !cert; 543 bool fail = !cert;
544 bool trust_ssl = false; 544 bool trust_ssl = false;
545 bool trust_email = false; 545 bool trust_email = false;
546 bool trust_obj_sign = false; 546 bool trust_obj_sign = false;
547 fail |= !CallbackArgsToBool(args, 1, &trust_ssl); 547 fail |= !CallbackArgsToBool(args, 1, &trust_ssl);
548 fail |= !CallbackArgsToBool(args, 2, &trust_email); 548 fail |= !CallbackArgsToBool(args, 2, &trust_email);
549 fail |= !CallbackArgsToBool(args, 3, &trust_obj_sign); 549 fail |= !CallbackArgsToBool(args, 3, &trust_obj_sign);
550 if (fail) { 550 if (fail) {
551 LOG(ERROR) << "EditCATrust args fail"; 551 LOG(ERROR) << "EditCATrust args fail";
552 web_ui()->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss"); 552 web_ui()->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss");
553 return; 553 return;
554 } 554 }
555 555
556 bool result = certificate_manager_model_->SetCertTrust( 556 bool result = certificate_manager_model_->SetCertTrust(
557 cert, 557 cert,
558 net::CA_CERT, 558 net::CA_CERT,
559 trust_ssl * net::CertDatabase::TRUSTED_SSL + 559 trust_ssl * net::NSSCertDatabase::TRUSTED_SSL +
560 trust_email * net::CertDatabase::TRUSTED_EMAIL + 560 trust_email * net::NSSCertDatabase::TRUSTED_EMAIL +
561 trust_obj_sign * net::CertDatabase::TRUSTED_OBJ_SIGN); 561 trust_obj_sign * net::NSSCertDatabase::TRUSTED_OBJ_SIGN);
562 web_ui()->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss"); 562 web_ui()->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss");
563 if (!result) { 563 if (!result) {
564 // TODO(mattm): better error messages? 564 // TODO(mattm): better error messages?
565 ShowError( 565 ShowError(
566 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_SET_TRUST_ERROR_TITLE), 566 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_SET_TRUST_ERROR_TITLE),
567 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR)); 567 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR));
568 } 568 }
569 } 569 }
570 570
571 void CertificateManagerHandler::EditServer(const ListValue* args) { 571 void CertificateManagerHandler::EditServer(const ListValue* args) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 browser::UnlockCertSlotIfNecessary( 622 browser::UnlockCertSlotIfNecessary(
623 selected_cert_list_[0].get(), 623 selected_cert_list_[0].get(),
624 browser::kCryptoModulePasswordCertExport, 624 browser::kCryptoModulePasswordCertExport,
625 "", // unused. 625 "", // unused.
626 base::Bind(&CertificateManagerHandler::ExportPersonalSlotsUnlocked, 626 base::Bind(&CertificateManagerHandler::ExportPersonalSlotsUnlocked,
627 base::Unretained(this))); 627 base::Unretained(this)));
628 } 628 }
629 629
630 void CertificateManagerHandler::ExportPersonalSlotsUnlocked() { 630 void CertificateManagerHandler::ExportPersonalSlotsUnlocked() {
631 std::string output; 631 std::string output;
632 int num_exported = certificate_manager_model_->cert_db().ExportToPKCS12( 632 int num_exported = certificate_manager_model_->cert_db()->ExportToPKCS12(
633 selected_cert_list_, 633 selected_cert_list_,
634 password_, 634 password_,
635 &output); 635 &output);
636 if (!num_exported) { 636 if (!num_exported) {
637 web_ui()->CallJavascriptFunction("CertificateRestoreOverlay.dismiss"); 637 web_ui()->CallJavascriptFunction("CertificateRestoreOverlay.dismiss");
638 ShowError( 638 ShowError(
639 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_PKCS12_EXPORT_ERROR_TITLE), 639 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_PKCS12_EXPORT_ERROR_TITLE),
640 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR)); 640 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR));
641 ImportExportCleanup(); 641 ImportExportCleanup();
642 return; 642 return;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 ShowError( 713 ShowError(
714 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_PKCS12_IMPORT_ERROR_TITLE), 714 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_PKCS12_IMPORT_ERROR_TITLE),
715 l10n_util::GetStringFUTF8(IDS_CERT_MANAGER_READ_ERROR_FORMAT, 715 l10n_util::GetStringFUTF8(IDS_CERT_MANAGER_READ_ERROR_FORMAT,
716 UTF8ToUTF16(safe_strerror(read_errno)))); 716 UTF8ToUTF16(safe_strerror(read_errno))));
717 return; 717 return;
718 } 718 }
719 719
720 file_data_ = data; 720 file_data_ = data;
721 721
722 if (use_hardware_backed_) { 722 if (use_hardware_backed_) {
723 module_ = certificate_manager_model_->cert_db().GetPrivateModule(); 723 module_ = certificate_manager_model_->cert_db()->GetPrivateModule();
724 } else { 724 } else {
725 module_ = certificate_manager_model_->cert_db().GetPublicModule(); 725 module_ = certificate_manager_model_->cert_db()->GetPublicModule();
726 } 726 }
727 727
728 net::CryptoModuleList modules; 728 net::CryptoModuleList modules;
729 modules.push_back(module_); 729 modules.push_back(module_);
730 browser::UnlockSlotsIfNecessary( 730 browser::UnlockSlotsIfNecessary(
731 modules, 731 modules,
732 browser::kCryptoModulePasswordCertImport, 732 browser::kCryptoModulePasswordCertImport,
733 "", // unused. 733 "", // unused.
734 base::Bind(&CertificateManagerHandler::ImportPersonalSlotUnlocked, 734 base::Bind(&CertificateManagerHandler::ImportPersonalSlotUnlocked,
735 base::Unretained(this))); 735 base::Unretained(this)));
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 selected_cert_list_ = net::X509Certificate::CreateCertificateListFromBytes( 826 selected_cert_list_ = net::X509Certificate::CreateCertificateListFromBytes(
827 data.data(), data.size(), net::X509Certificate::FORMAT_AUTO); 827 data.data(), data.size(), net::X509Certificate::FORMAT_AUTO);
828 if (selected_cert_list_.empty()) { 828 if (selected_cert_list_.empty()) {
829 ImportExportCleanup(); 829 ImportExportCleanup();
830 ShowError( 830 ShowError(
831 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_SERVER_IMPORT_ERROR_TITLE), 831 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_SERVER_IMPORT_ERROR_TITLE),
832 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CERT_PARSE_ERROR)); 832 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CERT_PARSE_ERROR));
833 return; 833 return;
834 } 834 }
835 835
836 net::CertDatabase::ImportCertFailureList not_imported; 836 net::NSSCertDatabase::ImportCertFailureList not_imported;
837 // TODO(mattm): Add UI for trust. http://crbug.com/76274 837 // TODO(mattm): Add UI for trust. http://crbug.com/76274
838 bool result = certificate_manager_model_->ImportServerCert( 838 bool result = certificate_manager_model_->ImportServerCert(
839 selected_cert_list_, 839 selected_cert_list_,
840 net::CertDatabase::TRUST_DEFAULT, 840 net::NSSCertDatabase::TRUST_DEFAULT,
841 &not_imported); 841 &not_imported);
842 if (!result) { 842 if (!result) {
843 ShowError( 843 ShowError(
844 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_SERVER_IMPORT_ERROR_TITLE), 844 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_SERVER_IMPORT_ERROR_TITLE),
845 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR)); 845 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR));
846 } else if (!not_imported.empty()) { 846 } else if (!not_imported.empty()) {
847 ShowImportErrors( 847 ShowImportErrors(
848 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_SERVER_IMPORT_ERROR_TITLE), 848 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_SERVER_IMPORT_ERROR_TITLE),
849 not_imported); 849 not_imported);
850 } 850 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 data.data(), data.size(), net::X509Certificate::FORMAT_AUTO); 885 data.data(), data.size(), net::X509Certificate::FORMAT_AUTO);
886 if (selected_cert_list_.empty()) { 886 if (selected_cert_list_.empty()) {
887 ImportExportCleanup(); 887 ImportExportCleanup();
888 ShowError( 888 ShowError(
889 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CA_IMPORT_ERROR_TITLE), 889 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CA_IMPORT_ERROR_TITLE),
890 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CERT_PARSE_ERROR)); 890 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CERT_PARSE_ERROR));
891 return; 891 return;
892 } 892 }
893 893
894 scoped_refptr<net::X509Certificate> root_cert = 894 scoped_refptr<net::X509Certificate> root_cert =
895 certificate_manager_model_->cert_db().FindRootInList(selected_cert_list_); 895 certificate_manager_model_->cert_db()->FindRootInList(
896 selected_cert_list_);
896 897
897 // TODO(mattm): check here if root_cert is not a CA cert and show error. 898 // TODO(mattm): check here if root_cert is not a CA cert and show error.
898 899
899 StringValue cert_name(root_cert->subject().GetDisplayName()); 900 StringValue cert_name(root_cert->subject().GetDisplayName());
900 web_ui()->CallJavascriptFunction("CertificateEditCaTrustOverlay.showImport", 901 web_ui()->CallJavascriptFunction("CertificateEditCaTrustOverlay.showImport",
901 cert_name); 902 cert_name);
902 } 903 }
903 904
904 void CertificateManagerHandler::ImportCATrustSelected(const ListValue* args) { 905 void CertificateManagerHandler::ImportCATrustSelected(const ListValue* args) {
905 bool fail = false; 906 bool fail = false;
906 bool trust_ssl = false; 907 bool trust_ssl = false;
907 bool trust_email = false; 908 bool trust_email = false;
908 bool trust_obj_sign = false; 909 bool trust_obj_sign = false;
909 fail |= !CallbackArgsToBool(args, 0, &trust_ssl); 910 fail |= !CallbackArgsToBool(args, 0, &trust_ssl);
910 fail |= !CallbackArgsToBool(args, 1, &trust_email); 911 fail |= !CallbackArgsToBool(args, 1, &trust_email);
911 fail |= !CallbackArgsToBool(args, 2, &trust_obj_sign); 912 fail |= !CallbackArgsToBool(args, 2, &trust_obj_sign);
912 if (fail) { 913 if (fail) {
913 LOG(ERROR) << "ImportCATrustSelected args fail"; 914 LOG(ERROR) << "ImportCATrustSelected args fail";
914 ImportExportCleanup(); 915 ImportExportCleanup();
915 web_ui()->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss"); 916 web_ui()->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss");
916 return; 917 return;
917 } 918 }
918 919
919 // TODO(mattm): add UI for setting explicit distrust, too. 920 // TODO(mattm): add UI for setting explicit distrust, too.
920 // http://crbug.com/128411 921 // http://crbug.com/128411
921 net::CertDatabase::ImportCertFailureList not_imported; 922 net::NSSCertDatabase::ImportCertFailureList not_imported;
922 bool result = certificate_manager_model_->ImportCACerts( 923 bool result = certificate_manager_model_->ImportCACerts(
923 selected_cert_list_, 924 selected_cert_list_,
924 trust_ssl * net::CertDatabase::TRUSTED_SSL + 925 trust_ssl * net::NSSCertDatabase::TRUSTED_SSL +
925 trust_email * net::CertDatabase::TRUSTED_EMAIL + 926 trust_email * net::NSSCertDatabase::TRUSTED_EMAIL +
926 trust_obj_sign * net::CertDatabase::TRUSTED_OBJ_SIGN, 927 trust_obj_sign * net::NSSCertDatabase::TRUSTED_OBJ_SIGN,
927 &not_imported); 928 &not_imported);
928 web_ui()->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss"); 929 web_ui()->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss");
929 if (!result) { 930 if (!result) {
930 ShowError( 931 ShowError(
931 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CA_IMPORT_ERROR_TITLE), 932 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CA_IMPORT_ERROR_TITLE),
932 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR)); 933 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR));
933 } else if (!not_imported.empty()) { 934 } else if (!not_imported.empty()) {
934 ShowImportErrors( 935 ShowImportErrors(
935 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CA_IMPORT_ERROR_TITLE), 936 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CA_IMPORT_ERROR_TITLE),
936 not_imported); 937 not_imported);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 ListValue* subnodes = new ListValue; 994 ListValue* subnodes = new ListValue;
994 for (net::CertificateList::const_iterator org_cert_it = i->second.begin(); 995 for (net::CertificateList::const_iterator org_cert_it = i->second.begin();
995 org_cert_it != i->second.end(); ++org_cert_it) { 996 org_cert_it != i->second.end(); ++org_cert_it) {
996 DictionaryValue* cert_dict = new DictionaryValue; 997 DictionaryValue* cert_dict = new DictionaryValue;
997 net::X509Certificate* cert = org_cert_it->get(); 998 net::X509Certificate* cert = org_cert_it->get();
998 cert_dict->SetString(kKeyId, cert_id_map_->CertToId(cert)); 999 cert_dict->SetString(kKeyId, cert_id_map_->CertToId(cert));
999 cert_dict->SetString(kNameId, certificate_manager_model_->GetColumnText( 1000 cert_dict->SetString(kNameId, certificate_manager_model_->GetColumnText(
1000 *cert, CertificateManagerModel::COL_SUBJECT_NAME)); 1001 *cert, CertificateManagerModel::COL_SUBJECT_NAME));
1001 cert_dict->SetBoolean( 1002 cert_dict->SetBoolean(
1002 kReadOnlyId, 1003 kReadOnlyId,
1003 certificate_manager_model_->cert_db().IsReadOnly(cert)); 1004 certificate_manager_model_->cert_db()->IsReadOnly(cert));
1004 cert_dict->SetBoolean( 1005 cert_dict->SetBoolean(
1005 kUntrustedId, 1006 kUntrustedId,
1006 certificate_manager_model_->cert_db().IsUntrusted(cert)); 1007 certificate_manager_model_->cert_db()->IsUntrusted(cert));
1007 // TODO(hshi): This should be determined by testing for PKCS #11 1008 // TODO(hshi): This should be determined by testing for PKCS #11
1008 // CKA_EXTRACTABLE attribute. We may need to use the NSS function 1009 // CKA_EXTRACTABLE attribute. We may need to use the NSS function
1009 // PK11_ReadRawAttribute to do that. 1010 // PK11_ReadRawAttribute to do that.
1010 cert_dict->SetBoolean( 1011 cert_dict->SetBoolean(
1011 kExtractableId, 1012 kExtractableId,
1012 !certificate_manager_model_->IsHardwareBacked(cert)); 1013 !certificate_manager_model_->IsHardwareBacked(cert));
1013 // TODO(mattm): Other columns. 1014 // TODO(mattm): Other columns.
1014 subnodes->Append(cert_dict); 1015 subnodes->Append(cert_dict);
1015 } 1016 }
1016 std::sort(subnodes->begin(), subnodes->end(), comparator); 1017 std::sort(subnodes->begin(), subnodes->end(), comparator);
(...skipping 17 matching lines...) Expand all
1034 args.push_back(Value::CreateStringValue(error)); 1035 args.push_back(Value::CreateStringValue(error));
1035 args.push_back(Value::CreateStringValue(l10n_util::GetStringUTF8(IDS_OK))); 1036 args.push_back(Value::CreateStringValue(l10n_util::GetStringUTF8(IDS_OK)));
1036 args.push_back(Value::CreateNullValue()); // cancelTitle 1037 args.push_back(Value::CreateNullValue()); // cancelTitle
1037 args.push_back(Value::CreateNullValue()); // okCallback 1038 args.push_back(Value::CreateNullValue()); // okCallback
1038 args.push_back(Value::CreateNullValue()); // cancelCallback 1039 args.push_back(Value::CreateNullValue()); // cancelCallback
1039 web_ui()->CallJavascriptFunction("AlertOverlay.show", args.get()); 1040 web_ui()->CallJavascriptFunction("AlertOverlay.show", args.get());
1040 } 1041 }
1041 1042
1042 void CertificateManagerHandler::ShowImportErrors( 1043 void CertificateManagerHandler::ShowImportErrors(
1043 const std::string& title, 1044 const std::string& title,
1044 const net::CertDatabase::ImportCertFailureList& not_imported) const { 1045 const net::NSSCertDatabase::ImportCertFailureList& not_imported) const {
1045 std::string error; 1046 std::string error;
1046 if (selected_cert_list_.size() == 1) 1047 if (selected_cert_list_.size() == 1)
1047 error = l10n_util::GetStringUTF8( 1048 error = l10n_util::GetStringUTF8(
1048 IDS_CERT_MANAGER_IMPORT_SINGLE_NOT_IMPORTED); 1049 IDS_CERT_MANAGER_IMPORT_SINGLE_NOT_IMPORTED);
1049 else if (not_imported.size() == selected_cert_list_.size()) 1050 else if (not_imported.size() == selected_cert_list_.size())
1050 error = l10n_util::GetStringUTF8(IDS_CERT_MANAGER_IMPORT_ALL_NOT_IMPORTED); 1051 error = l10n_util::GetStringUTF8(IDS_CERT_MANAGER_IMPORT_ALL_NOT_IMPORTED);
1051 else 1052 else
1052 error = l10n_util::GetStringUTF8(IDS_CERT_MANAGER_IMPORT_SOME_NOT_IMPORTED); 1053 error = l10n_util::GetStringUTF8(IDS_CERT_MANAGER_IMPORT_SOME_NOT_IMPORTED);
1053 1054
1054 ListValue cert_error_list; 1055 ListValue cert_error_list;
1055 for (size_t i = 0; i < not_imported.size(); ++i) { 1056 for (size_t i = 0; i < not_imported.size(); ++i) {
1056 const net::CertDatabase::ImportCertFailure& failure = not_imported[i]; 1057 const net::NSSCertDatabase::ImportCertFailure& failure = not_imported[i];
1057 DictionaryValue* dict = new DictionaryValue; 1058 DictionaryValue* dict = new DictionaryValue;
1058 dict->SetString(kNameId, failure.certificate->subject().GetDisplayName()); 1059 dict->SetString(kNameId, failure.certificate->subject().GetDisplayName());
1059 dict->SetString(kErrorId, NetErrorToString(failure.net_error)); 1060 dict->SetString(kErrorId, NetErrorToString(failure.net_error));
1060 cert_error_list.Append(dict); 1061 cert_error_list.Append(dict);
1061 } 1062 }
1062 1063
1063 StringValue title_value(title); 1064 StringValue title_value(title);
1064 StringValue error_value(error); 1065 StringValue error_value(error);
1065 web_ui()->CallJavascriptFunction("CertificateImportErrorOverlay.show", 1066 web_ui()->CallJavascriptFunction("CertificateImportErrorOverlay.show",
1066 title_value, 1067 title_value,
(...skipping 18 matching lines...) Expand all
1085 web_ui()->CallJavascriptFunction("CertificateManager.onCheckTpmTokenReady", 1086 web_ui()->CallJavascriptFunction("CertificateManager.onCheckTpmTokenReady",
1086 ready); 1087 ready);
1087 } 1088 }
1088 #endif 1089 #endif
1089 1090
1090 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { 1091 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const {
1091 return web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(); 1092 return web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow();
1092 } 1093 }
1093 1094
1094 } // namespace options 1095 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698