OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/file_util.h" // for FileAccessProvider | 7 #include "base/file_util.h" // for FileAccessProvider |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/safe_strerror_posix.h" | 9 #include "base/safe_strerror_posix.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 ShowError( | 629 ShowError( |
630 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_PKCS12_IMPORT_ERROR_TITLE), | 630 l10n_util::GetStringUTF8(IDS_CERT_MANAGER_PKCS12_IMPORT_ERROR_TITLE), |
631 l10n_util::GetStringFUTF8(IDS_CERT_MANAGER_READ_ERROR_FORMAT, | 631 l10n_util::GetStringFUTF8(IDS_CERT_MANAGER_READ_ERROR_FORMAT, |
632 UTF8ToUTF16(safe_strerror(read_errno)))); | 632 UTF8ToUTF16(safe_strerror(read_errno)))); |
633 return; | 633 return; |
634 } | 634 } |
635 | 635 |
636 file_data_ = data; | 636 file_data_ = data; |
637 | 637 |
638 // TODO(mattm): allow user to choose a slot to import to. | 638 // TODO(mattm): allow user to choose a slot to import to. |
639 module_ = certificate_manager_model_->cert_db().GetDefaultModule(); | 639 module_ = certificate_manager_model_->cert_db().GetPrivateModule(); |
640 | 640 |
641 net::CryptoModuleList modules; | 641 net::CryptoModuleList modules; |
642 modules.push_back(module_); | 642 modules.push_back(module_); |
643 browser::UnlockSlotsIfNecessary( | 643 browser::UnlockSlotsIfNecessary( |
644 modules, | 644 modules, |
645 browser::kCryptoModulePasswordCertImport, | 645 browser::kCryptoModulePasswordCertImport, |
646 "", // unused. | 646 "", // unused. |
647 NewCallback(this, | 647 NewCallback(this, |
648 &CertificateManagerHandler::ImportPersonalSlotUnlocked)); | 648 &CertificateManagerHandler::ImportPersonalSlotUnlocked)); |
649 } | 649 } |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 StringValue error_value(error); | 945 StringValue error_value(error); |
946 web_ui_->CallJavascriptFunction("CertificateImportErrorOverlay.show", | 946 web_ui_->CallJavascriptFunction("CertificateImportErrorOverlay.show", |
947 title_value, | 947 title_value, |
948 error_value, | 948 error_value, |
949 cert_error_list); | 949 cert_error_list); |
950 } | 950 } |
951 | 951 |
952 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { | 952 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { |
953 return web_ui_->tab_contents()->view()->GetTopLevelNativeWindow(); | 953 return web_ui_->tab_contents()->view()->GetTopLevelNativeWindow(); |
954 } | 954 } |
OLD | NEW |