| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/settings/certificates_handler.h" | 5 #include "chrome/browser/ui/webui/settings/certificates_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 | 10 |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 base::Unretained(this))); | 733 base::Unretained(this))); |
| 734 } | 734 } |
| 735 | 735 |
| 736 void CertificatesHandler::ImportPersonalSlotUnlocked() { | 736 void CertificatesHandler::ImportPersonalSlotUnlocked() { |
| 737 // Determine if the private key should be unextractable after the import. | 737 // Determine if the private key should be unextractable after the import. |
| 738 // We do this by checking the value of |use_hardware_backed_| which is set | 738 // We do this by checking the value of |use_hardware_backed_| which is set |
| 739 // to true if importing into a hardware module. Currently, this only happens | 739 // to true if importing into a hardware module. Currently, this only happens |
| 740 // for Chrome OS when the "Import and Bind" option is chosen. | 740 // for Chrome OS when the "Import and Bind" option is chosen. |
| 741 bool is_extractable = !use_hardware_backed_; | 741 bool is_extractable = !use_hardware_backed_; |
| 742 int result = certificate_manager_model_->ImportFromPKCS12( | 742 int result = certificate_manager_model_->ImportFromPKCS12( |
| 743 module_.get(), file_data_, password_, is_extractable); | 743 module_->os_module_handle(), file_data_, password_, is_extractable); |
| 744 ImportExportCleanup(); | 744 ImportExportCleanup(); |
| 745 int string_id; | 745 int string_id; |
| 746 switch (result) { | 746 switch (result) { |
| 747 case net::OK: | 747 case net::OK: |
| 748 ResolveCallback(*base::Value::CreateNullValue()); | 748 ResolveCallback(*base::Value::CreateNullValue()); |
| 749 return; | 749 return; |
| 750 case net::ERR_PKCS12_IMPORT_BAD_PASSWORD: | 750 case net::ERR_PKCS12_IMPORT_BAD_PASSWORD: |
| 751 // TODO(mattm): if the error was a bad password, we should reshow the | 751 // TODO(mattm): if the error was a bad password, we should reshow the |
| 752 // password dialog after the user dismisses the error dialog. | 752 // password dialog after the user dismisses the error dialog. |
| 753 string_id = IDS_SETTINGS_CERTIFICATE_MANAGER_BAD_PASSWORD; | 753 string_id = IDS_SETTINGS_CERTIFICATE_MANAGER_BAD_PASSWORD; |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 error_info->Set(kCertificateErrors, | 1140 error_info->Set(kCertificateErrors, |
| 1141 base::WrapUnique(cert_error_list.release())); | 1141 base::WrapUnique(cert_error_list.release())); |
| 1142 RejectCallback(*error_info); | 1142 RejectCallback(*error_info); |
| 1143 } | 1143 } |
| 1144 | 1144 |
| 1145 gfx::NativeWindow CertificatesHandler::GetParentWindow() const { | 1145 gfx::NativeWindow CertificatesHandler::GetParentWindow() const { |
| 1146 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); | 1146 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); |
| 1147 } | 1147 } |
| 1148 | 1148 |
| 1149 } // namespace settings | 1149 } // namespace settings |
| OLD | NEW |