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

Unified Diff: chrome/browser/resources/settings/certificate_manager_page/ca_trust_edit_dialog.js

Issue 1772203002: MD Settings: Certificate manager, CA edit trust dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix presubmit error. Created 4 years, 9 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
Index: chrome/browser/resources/settings/certificate_manager_page/ca_trust_edit_dialog.js
diff --git a/chrome/browser/resources/settings/certificate_manager_page/ca_trust_edit_dialog.js b/chrome/browser/resources/settings/certificate_manager_page/ca_trust_edit_dialog.js
new file mode 100644
index 0000000000000000000000000000000000000000..019f8fd85d5ec5605e60c2f1911e407e69e3ab3c
--- /dev/null
+++ b/chrome/browser/resources/settings/certificate_manager_page/ca_trust_edit_dialog.js
@@ -0,0 +1,67 @@
+// 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
+ * 'settings-ca-trust-edit-dialog' is the a dialog allowing the user to edit the
+ * trust lever of a given certificate authority.
+ *
+ * @group Chrome Settings Elements
+ * @element settings-ca-trust-edit-dialog
+ */
+Polymer({
+ is: 'settings-ca-trust-edit-dialog',
+
+ properties: {
+ /** @private {!settings.CertificatesBrowserProxy} */
+ browserProxy_: Object,
+
+ /** @type {!CertificateSubnode} */
+ model: Object,
+
+ /** @private {?CaTrustInfo} */
+ trustInfo_: Object,
+
+ /** @private {string} */
+ explanationText_: String,
+ },
+
+ /** @override */
+ ready: function() {
+ this.browserProxy_ = settings.CertificatesBrowserProxyImpl.getInstance();
+ },
+
+ /** @override */
+ attached: function() {
+ this.explanationText_ = loadTimeData.getStringF(
+ 'certificateManagerCaTrustEditDialogExplanation',
+ this.model.name);
+ this.browserProxy_.getCaCertificateTrust(this.model.id).then(
+ /** @param {!CaTrustInfo} trustInfo */
+ function(trustInfo) {
+ this.trustInfo_ = trustInfo;
+ this.$.dialog.open();
+ }.bind(this));
+ },
+
+ /** @private */
+ onCancelTap_: function() {
+ this.$.dialog.close();
+ },
+
+ /** @private */
+ onOkTap_: function() {
+ this.$.spinner.active = true;
+ this.browserProxy_.editCaCertificateTrust(
+ this.model.id, this.$.ssl.checked,
+ this.$.email.checked, this.$.objSign.checked).then(function() {
+ this.$.spinner.active = false;
+ this.$.dialog.close();
+ }.bind(this),
+ /** @param {!CertificatesError} error */
+ function(error) {
+ // TODO(dpapad): Display error here.
+ });
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698