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 | |
11 #include <algorithm> | 10 #include <algorithm> |
12 #include <map> | 11 #include <map> |
| 12 #include <utility> |
13 | 13 |
14 #include "base/bind.h" | 14 #include "base/bind.h" |
15 #include "base/bind_helpers.h" | 15 #include "base/bind_helpers.h" |
16 #include "base/files/file_util.h" // for FileAccessProvider | 16 #include "base/files/file_util.h" // for FileAccessProvider |
17 #include "base/i18n/string_compare.h" | 17 #include "base/i18n/string_compare.h" |
18 #include "base/id_map.h" | 18 #include "base/id_map.h" |
19 #include "base/macros.h" | 19 #include "base/macros.h" |
20 #include "base/memory/scoped_vector.h" | 20 #include "base/memory/scoped_vector.h" |
21 #include "base/posix/safe_strerror.h" | 21 #include "base/posix/safe_strerror.h" |
22 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 if (!result) { | 1043 if (!result) { |
1044 // TODO(mattm): better error messages? | 1044 // TODO(mattm): better error messages? |
1045 ShowError( | 1045 ShowError( |
1046 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_DELETE_CERT_ERROR_TITLE), | 1046 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_DELETE_CERT_ERROR_TITLE), |
1047 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR)); | 1047 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR)); |
1048 } | 1048 } |
1049 } | 1049 } |
1050 | 1050 |
1051 void CertificateManagerHandler::OnCertificateManagerModelCreated( | 1051 void CertificateManagerHandler::OnCertificateManagerModelCreated( |
1052 scoped_ptr<CertificateManagerModel> model) { | 1052 scoped_ptr<CertificateManagerModel> model) { |
1053 certificate_manager_model_ = model.Pass(); | 1053 certificate_manager_model_ = std::move(model); |
1054 CertificateManagerModelReady(); | 1054 CertificateManagerModelReady(); |
1055 } | 1055 } |
1056 | 1056 |
1057 void CertificateManagerHandler::CertificateManagerModelReady() { | 1057 void CertificateManagerHandler::CertificateManagerModelReady() { |
1058 base::FundamentalValue user_db_available_value( | 1058 base::FundamentalValue user_db_available_value( |
1059 certificate_manager_model_->is_user_db_available()); | 1059 certificate_manager_model_->is_user_db_available()); |
1060 base::FundamentalValue tpm_available_value( | 1060 base::FundamentalValue tpm_available_value( |
1061 certificate_manager_model_->is_tpm_available()); | 1061 certificate_manager_model_->is_tpm_available()); |
1062 web_ui()->CallJavascriptFunction("CertificateManager.onModelReady", | 1062 web_ui()->CallJavascriptFunction("CertificateManager.onModelReady", |
1063 user_db_available_value, | 1063 user_db_available_value, |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 title_value, | 1198 title_value, |
1199 error_value, | 1199 error_value, |
1200 cert_error_list); | 1200 cert_error_list); |
1201 } | 1201 } |
1202 | 1202 |
1203 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { | 1203 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { |
1204 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); | 1204 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); |
1205 } | 1205 } |
1206 | 1206 |
1207 } // namespace options | 1207 } // namespace options |
OLD | NEW |