OLD | NEW |
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 <errno.h> | 7 #include <errno.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 bool result = certificate_manager_model_->Delete(cert); | 1070 bool result = certificate_manager_model_->Delete(cert); |
1071 if (!result) { | 1071 if (!result) { |
1072 // TODO(mattm): better error messages? | 1072 // TODO(mattm): better error messages? |
1073 ShowError( | 1073 ShowError( |
1074 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_DELETE_CERT_ERROR_TITLE), | 1074 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_DELETE_CERT_ERROR_TITLE), |
1075 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR)); | 1075 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR)); |
1076 } | 1076 } |
1077 } | 1077 } |
1078 | 1078 |
1079 void CertificateManagerHandler::OnCertificateManagerModelCreated( | 1079 void CertificateManagerHandler::OnCertificateManagerModelCreated( |
1080 scoped_ptr<CertificateManagerModel> model) { | 1080 std::unique_ptr<CertificateManagerModel> model) { |
1081 certificate_manager_model_ = std::move(model); | 1081 certificate_manager_model_ = std::move(model); |
1082 CertificateManagerModelReady(); | 1082 CertificateManagerModelReady(); |
1083 } | 1083 } |
1084 | 1084 |
1085 void CertificateManagerHandler::CertificateManagerModelReady() { | 1085 void CertificateManagerHandler::CertificateManagerModelReady() { |
1086 base::FundamentalValue user_db_available_value( | 1086 base::FundamentalValue user_db_available_value( |
1087 certificate_manager_model_->is_user_db_available()); | 1087 certificate_manager_model_->is_user_db_available()); |
1088 base::FundamentalValue tpm_available_value( | 1088 base::FundamentalValue tpm_available_value( |
1089 certificate_manager_model_->is_tpm_available()); | 1089 certificate_manager_model_->is_tpm_available()); |
1090 web_ui()->CallJavascriptFunction("CertificateManager.onModelReady", | 1090 web_ui()->CallJavascriptFunction("CertificateManager.onModelReady", |
(...skipping 24 matching lines...) Expand all Loading... |
1115 // We are already waiting for a CertificateManagerModel to be created, no need | 1115 // We are already waiting for a CertificateManagerModel to be created, no need |
1116 // to do anything. | 1116 // to do anything. |
1117 } | 1117 } |
1118 | 1118 |
1119 void CertificateManagerHandler::PopulateTree( | 1119 void CertificateManagerHandler::PopulateTree( |
1120 const std::string& tab_name, | 1120 const std::string& tab_name, |
1121 net::CertType type, | 1121 net::CertType type, |
1122 const net::CertificateList& web_trust_certs) { | 1122 const net::CertificateList& web_trust_certs) { |
1123 const std::string tree_name = tab_name + "-tree"; | 1123 const std::string tree_name = tab_name + "-tree"; |
1124 | 1124 |
1125 scoped_ptr<icu::Collator> collator; | 1125 std::unique_ptr<icu::Collator> collator; |
1126 UErrorCode error = U_ZERO_ERROR; | 1126 UErrorCode error = U_ZERO_ERROR; |
1127 collator.reset( | 1127 collator.reset( |
1128 icu::Collator::createInstance( | 1128 icu::Collator::createInstance( |
1129 icu::Locale(g_browser_process->GetApplicationLocale().c_str()), | 1129 icu::Locale(g_browser_process->GetApplicationLocale().c_str()), |
1130 error)); | 1130 error)); |
1131 if (U_FAILURE(error)) | 1131 if (U_FAILURE(error)) |
1132 collator.reset(NULL); | 1132 collator.reset(NULL); |
1133 DictionaryIdComparator comparator(collator.get()); | 1133 DictionaryIdComparator comparator(collator.get()); |
1134 CertificateManagerModel::OrgGroupingMap map; | 1134 CertificateManagerModel::OrgGroupingMap map; |
1135 | 1135 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 title_value, | 1226 title_value, |
1227 error_value, | 1227 error_value, |
1228 cert_error_list); | 1228 cert_error_list); |
1229 } | 1229 } |
1230 | 1230 |
1231 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { | 1231 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { |
1232 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); | 1232 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); |
1233 } | 1233 } |
1234 | 1234 |
1235 } // namespace options | 1235 } // namespace options |
OLD | NEW |