Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: chrome/browser/ui/webui/options/certificate_manager_handler.cc

Issue 7338011: Linux Cert manager: improve PKCS #12 import error messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | net/base/cert_database_nss_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/certificate_manager_handler.cc
diff --git a/chrome/browser/ui/webui/options/certificate_manager_handler.cc b/chrome/browser/ui/webui/options/certificate_manager_handler.cc
index 7a29861c87441763d02fdd32e609fe416878d78d..fb4fc939163f471fb1e4066aa1108aa7cd2be44e 100644
--- a/chrome/browser/ui/webui/options/certificate_manager_handler.cc
+++ b/chrome/browser/ui/webui/options/certificate_manager_handler.cc
@@ -678,22 +678,31 @@ void CertificateManagerHandler::ImportPersonalSlotUnlocked() {
module_, file_data_, password_, is_extractable);
ImportExportCleanup();
web_ui_->CallJavascriptFunction("CertificateRestoreOverlay.dismiss");
+ int string_id;
switch (result) {
case net::OK:
- break;
+ return;
case net::ERR_PKCS12_IMPORT_BAD_PASSWORD:
- ShowError(
- l10n_util::GetStringUTF8(IDS_CERT_MANAGER_PKCS12_IMPORT_ERROR_TITLE),
- l10n_util::GetStringUTF8(IDS_CERT_MANAGER_BAD_PASSWORD));
// TODO(mattm): if the error was a bad password, we should reshow the
// password dialog after the user dismisses the error dialog.
+ string_id = IDS_CERT_MANAGER_BAD_PASSWORD;
+ break;
+ case net::ERR_PKCS12_IMPORT_INVALID_MAC:
+ string_id = IDS_CERT_MANAGER_PKCS12_IMPORT_INVALID_MAC;
+ break;
+ case net::ERR_PKCS12_IMPORT_INVALID_FILE:
+ string_id = IDS_CERT_MANAGER_PKCS12_IMPORT_INVALID_FILE;
+ break;
+ case net::ERR_PKCS12_IMPORT_UNSUPPORTED:
+ string_id = IDS_CERT_MANAGER_PKCS12_IMPORT_UNSUPPORTED;
break;
default:
- ShowError(
- l10n_util::GetStringUTF8(IDS_CERT_MANAGER_PKCS12_IMPORT_ERROR_TITLE),
- l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR));
+ string_id = IDS_CERT_MANAGER_UNKNOWN_ERROR;
break;
}
+ ShowError(
+ l10n_util::GetStringUTF8(IDS_CERT_MANAGER_PKCS12_IMPORT_ERROR_TITLE),
+ l10n_util::GetStringUTF8(string_id));
}
void CertificateManagerHandler::CancelImportExportProcess(
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | net/base/cert_database_nss_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698