Commit 576dabdc authored by dpapad's avatar dpapad Committed by Commit bot

MD Settings: Certificate manager, error dialog.

BUG=547073

Review URL: https://codereview.chromium.org/1812673002

Cr-Commit-Position: refs/heads/master@{#381884}
parent 77db6f78
...@@ -241,6 +241,9 @@ ...@@ -241,6 +241,9 @@
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_YOU_HAVE_CERTIFICATES" desc="Label for your certificates subtitle tab in certificate manager."> <message name="IDS_SETTINGS_CERTIFICATE_MANAGER_YOU_HAVE_CERTIFICATES" desc="Label for your certificates subtitle tab in certificate manager.">
You have certificates from these organizations that identify you: You have certificates from these organizations that identify you:
</message> </message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_USAGE_SSL_CLIENT" desc="The description of a certificate that is verified for use as an SSL client">
SSL Client Certificate
</message>
<!-- Certificate Manager Page, edit certificate authority trust dialog--> <!-- Certificate Manager Page, edit certificate authority trust dialog-->
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_CA_TRUST_EDIT_DIALOG_TITLE" desc="Title of the certificate manager edit trust dialog"> <message name="IDS_SETTINGS_CERTIFICATE_MANAGER_CA_TRUST_EDIT_DIALOG_TITLE" desc="Title of the certificate manager edit trust dialog">
...@@ -302,6 +305,74 @@ ...@@ -302,6 +305,74 @@
Confirm Password Confirm Password
</message> </message>
<!-- Certificate Manager Page, error dialog -->
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_BAD_PASSWORD" desc="The text in the error dialog for entering an incorrect password when importing an encrypted certificate file.">
Incorrect password.
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_CA_IMPORT_ERROR_TITLE" desc="The title in the error dialog for Certification Authority file import errors.">
Certification Authority Import Error
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_CERT_PARSE_ERROR" desc="The message in the certificate manager error dialog for importing invalid certificate files.">
Unable to parse file.
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE_CERT_ERROR_TITLE" desc="The title in the error dialog for certificate delete errors.">
Certificate Deletion Error
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_ERROR_CERT_ALREADY_EXISTS" desc="The error message when trying to import certificate which already exists.">
Certificate already exists.
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_ERROR_NOT_CA" desc="The error message when trying to import certificate authorities and a certificate is not a certification authority">
Not a Certification Authority.
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT_ALL_NOT_IMPORTED" desc="The header in certificate manager error dialog for list of certificates that could not be imported, when none were successfully imported.">
The file contained multiple certificates, none of which were imported:
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT_ERROR_TITLE" desc="The title in the error dialog for certificate file import errors.">
Certificate Import Error
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT_INVALID_FILE" desc="The message in the error dialog for corrupt certificate files.">
Invalid or corrupt file.
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT_INVALID_MAC" desc="The message in the error dialog for certificate files with invalid MAC.">
Incorrect password or corrupt file.
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT_MISSING_KEY" desc="The message in the error dialog for certificates without a local private key.">
The Private Key for this Client Certificate is missing or invalid.
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT_SINGLE_NOT_IMPORTED" desc="The header in certificate manager error dialog for single certificates that could not be imported.">
The file contained one certificate, which was not imported:
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT_SOME_NOT_IMPORTED" desc="The header in certificate manager error dialog for list of certificates that could not be imported, even though others were.">
The file contained multiple certificates, some of which were not imported:
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT_UNSUPPORTED" desc="The message in the error dialog for unsupported certificate files.">
File uses unsupported features.
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_PKCS12_EXPORT_ERROR_TITLE" desc="The title in the error dialog for PKCS #12 file export errors.">
PKCS #12 Export Error
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_PKCS12_FILES" desc="The label in the file selector dialog for PKCS #12 file type.">
PKCS #12 Files
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_READ_ERROR_FORMAT" desc="The text in the error dialog for certificate file read errors.">
There was an error while trying to read the file: <ph name="ERROR_TEXT">$1<ex>File not found.</ex></ph>.
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT_ERROR_FORMAT" desc="The format of per-certificate error messages in import failure dialog">
<ph name="CERTIFICATE_NAME">$1<ex>www.example.com</ex></ph>: <ph name="ERROR">$2<ex>Not a Certification Authority</ex></ph>
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_SERVER_IMPORT_ERROR_TITLE" desc="The title in the error dialog for Certification Authority file import errors.">
Server Certificate Import Error
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_SET_TRUST_ERROR_TITLE" desc="The title in the error dialog for certificate trust editing errors.">
Error Setting Certificate Trust
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_UNKNOWN_ERROR" desc="The text in the error dialog when an unknown error occurs during an operation on the certificate database.">
Unknown error.
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_WRITE_ERROR_FORMAT" desc="The text in the error dialog for PKCS #12 file write errors.">
There was an error while trying to write the file: <ph name="ERROR_TEXT">$1<ex>Permission denied.</ex></ph>.
</message>
<!-- Clear Browsing Data --> <!-- Clear Browsing Data -->
<message name="IDS_SETTINGS_CLEAR_FOLLOWING_ITEMS_FROM" desc="Label at the top of the client area of the dialog, preceding the period combo box"> <message name="IDS_SETTINGS_CLEAR_FOLLOWING_ITEMS_FROM" desc="Label at the top of the client area of the dialog, preceding the period combo box">
Clear the following items from Clear the following items from
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
<link rel="import" href="chrome://md-settings/i18n_setup.html">
<link rel="import" href="chrome://md-settings/settings_dialog.html">
<link rel="import" href="chrome://md-settings/settings_shared_css.html">
<dom-module id="settings-certificates-error-dialog">
<template>
<style include="settings-shared"></style>
<settings-dialog id="dialog">
<div class="title">[[model.title]]</div>
<div class="body">
<div>[[model.description]]</div>
<template is="dom-if" if="[[model.certificateErrors]]">
<template is="dom-repeat" items="[[model.certificateErrors]]">
<div>[[getCertificateErrorText_(item)]]</div>
</template>
</template>
</div>
<div class="button-container">
<paper-button id="ok" class="action-button" on-tap="onOkTap_">
$i18n{ok}
</paper-button>
</div>
</settings-dialog>
</template>
<script src="certificates_error_dialog.js"></script>
</dom-module>
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview A dialog for showing SSL certificate related error messages.
* The user can only close the dialog, there is no other possible interaction.
*/
Polymer({
is: 'settings-certificates-error-dialog',
properties: {
/** @type {!CertificatesError|!CertificatesImportError} */
model: Object,
},
/** @override */
attached: function() {
this.$.dialog.open();
},
/** @private */
onOkTap_: function() {
this.$.dialog.close();
},
/**
* @param {{certificateName: string, error: string}} importError
* @return {string}
* @private
*/
getCertificateErrorText_: function(importError) {
return loadTimeData.getStringF(
'certificateImportErrorFormat',
importError.certificateName, importError.error);
},
});
...@@ -203,6 +203,12 @@ ...@@ -203,6 +203,12 @@
<structure name="IDR_SETTINGS_CERTIFICATE_PASSWORD_DECRYPTION_DIALOG_HTML" <structure name="IDR_SETTINGS_CERTIFICATE_PASSWORD_DECRYPTION_DIALOG_HTML"
file="certificate_manager_page/certificate_password_decryption_dialog.html" file="certificate_manager_page/certificate_password_decryption_dialog.html"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_SETTINGS_CERTIFICATES_ERROR_DIALOG_JS"
file="certificate_manager_page/certificates_error_dialog.js"
type="chrome_html" />
<structure name="IDR_SETTINGS_CERTIFICATES_ERROR_DIALOG_HTML"
file="certificate_manager_page/certificates_error_dialog.html"
type="chrome_html" />
<structure name="IDR_SETTINGS_CLEAR_BROWSING_DATA_DIALOG_HTML" <structure name="IDR_SETTINGS_CLEAR_BROWSING_DATA_DIALOG_HTML"
file="clear_browsing_data_dialog/clear_browsing_data_dialog.html" file="clear_browsing_data_dialog/clear_browsing_data_dialog.html"
type="chrome_html" /> type="chrome_html" />
......
...@@ -256,6 +256,8 @@ void AddCertificateManagerStrings(content::WebUIDataSource* html_source) { ...@@ -256,6 +256,8 @@ void AddCertificateManagerStrings(content::WebUIDataSource* html_source) {
IDS_SETTINGS_CERTIFICATE_MANAGER_PASSWORD}, IDS_SETTINGS_CERTIFICATE_MANAGER_PASSWORD},
{"certificateManagerConfirmPassword", {"certificateManagerConfirmPassword",
IDS_SETTINGS_CERTIFICATE_MANAGER_CONFIRM_PASSWORD}, IDS_SETTINGS_CERTIFICATE_MANAGER_CONFIRM_PASSWORD},
{"certificateImportErrorFormat",
IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT_ERROR_FORMAT},
}; };
AddLocalizedStringsBulk(html_source, localized_strings, AddLocalizedStringsBulk(html_source, localized_strings,
arraysize(localized_strings)); arraysize(localized_strings));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment