| 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 | 10 |
| (...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 base::Unretained(this))); | 850 base::Unretained(this))); |
| 851 } | 851 } |
| 852 | 852 |
| 853 void CertificateManagerHandler::ImportPersonalSlotUnlocked() { | 853 void CertificateManagerHandler::ImportPersonalSlotUnlocked() { |
| 854 // Determine if the private key should be unextractable after the import. | 854 // Determine if the private key should be unextractable after the import. |
| 855 // We do this by checking the value of |use_hardware_backed_| which is set | 855 // We do this by checking the value of |use_hardware_backed_| which is set |
| 856 // to true if importing into a hardware module. Currently, this only happens | 856 // to true if importing into a hardware module. Currently, this only happens |
| 857 // for Chrome OS when the "Import and Bind" option is chosen. | 857 // for Chrome OS when the "Import and Bind" option is chosen. |
| 858 bool is_extractable = !use_hardware_backed_; | 858 bool is_extractable = !use_hardware_backed_; |
| 859 int result = certificate_manager_model_->ImportFromPKCS12( | 859 int result = certificate_manager_model_->ImportFromPKCS12( |
| 860 module_.get(), file_data_, password_, is_extractable); | 860 module_->os_module_handle(), file_data_, password_, is_extractable); |
| 861 ImportExportCleanup(); | 861 ImportExportCleanup(); |
| 862 web_ui()->CallJavascriptFunctionUnsafe("CertificateRestoreOverlay.dismiss"); | 862 web_ui()->CallJavascriptFunctionUnsafe("CertificateRestoreOverlay.dismiss"); |
| 863 int string_id; | 863 int string_id; |
| 864 switch (result) { | 864 switch (result) { |
| 865 case net::OK: | 865 case net::OK: |
| 866 return; | 866 return; |
| 867 case net::ERR_PKCS12_IMPORT_BAD_PASSWORD: | 867 case net::ERR_PKCS12_IMPORT_BAD_PASSWORD: |
| 868 // TODO(mattm): if the error was a bad password, we should reshow the | 868 // TODO(mattm): if the error was a bad password, we should reshow the |
| 869 // password dialog after the user dismisses the error dialog. | 869 // password dialog after the user dismisses the error dialog. |
| 870 string_id = IDS_CERT_MANAGER_BAD_PASSWORD; | 870 string_id = IDS_CERT_MANAGER_BAD_PASSWORD; |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 web_ui()->CallJavascriptFunctionUnsafe("CertificateImportErrorOverlay.show", | 1233 web_ui()->CallJavascriptFunctionUnsafe("CertificateImportErrorOverlay.show", |
| 1234 title_value, error_value, | 1234 title_value, error_value, |
| 1235 cert_error_list); | 1235 cert_error_list); |
| 1236 } | 1236 } |
| 1237 | 1237 |
| 1238 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { | 1238 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { |
| 1239 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); | 1239 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); |
| 1240 } | 1240 } |
| 1241 | 1241 |
| 1242 } // namespace options | 1242 } // namespace options |
| OLD | NEW |