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

Side by Side Diff: chrome/browser/resources/settings/certificate_manager_page/certificate_delete_confirmation_dialog.js

Issue 2114663004: [MD settings] cast elements to cr_dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 /** 5 /**
6 * @fileoverview A confirmation dialog allowing the user to delete various types 6 * @fileoverview A confirmation dialog allowing the user to delete various types
7 * of certificates. 7 * of certificates.
8 */ 8 */
9 Polymer({ 9 Polymer({
10 is: 'settings-certificate-delete-confirmation-dialog', 10 is: 'settings-certificate-delete-confirmation-dialog',
11 11
12 properties: { 12 properties: {
13 /** @private {!settings.CertificatesBrowserProxy} */ 13 /** @private {!settings.CertificatesBrowserProxy} */
14 browserProxy_: Object, 14 browserProxy_: Object,
15 15
16 /** @type {!CertificateSubnode} */ 16 /** @type {!CertificateSubnode} */
17 model: Object, 17 model: Object,
18 18
19 /** @type {!CertificateType} */ 19 /** @type {!CertificateType} */
20 certificateType: String, 20 certificateType: String,
21 }, 21 },
22 22
23 /** @override */ 23 /** @override */
24 ready: function() { 24 ready: function() {
25 this.browserProxy_ = settings.CertificatesBrowserProxyImpl.getInstance(); 25 this.browserProxy_ = settings.CertificatesBrowserProxyImpl.getInstance();
26 }, 26 },
27 27
28 /** @override */ 28 /** @override */
29 attached: function() { 29 attached: function() {
30 this.$.dialog.open(); 30 /** @type {!CrDialogElement} */ (this.$.dialog).open();
31 }, 31 },
32 32
33 /** 33 /**
34 * @private 34 * @private
35 * @return {string} 35 * @return {string}
36 */ 36 */
37 getTitleText_: function() { 37 getTitleText_: function() {
38 /** 38 /**
39 * @param {string} localizedMessageId 39 * @param {string} localizedMessageId
40 * @return {string} 40 * @return {string}
(...skipping 29 matching lines...) Expand all
70 case CertificateType.CA: 70 case CertificateType.CA:
71 return getString('certificateManagerDeleteCaDescription'); 71 return getString('certificateManagerDeleteCaDescription');
72 case CertificateType.OTHER: 72 case CertificateType.OTHER:
73 return ''; 73 return '';
74 } 74 }
75 assertNotReached(); 75 assertNotReached();
76 }, 76 },
77 77
78 /** @private */ 78 /** @private */
79 onCancelTap_: function() { 79 onCancelTap_: function() {
80 this.$.dialog.close(); 80 /** @type {!CrDialogElement} */ (this.$.dialog).close();
81 }, 81 },
82 82
83 /** @private */ 83 /** @private */
84 onOkTap_: function() { 84 onOkTap_: function() {
85 this.browserProxy_.deleteCertificate(this.model.id).then( 85 this.browserProxy_.deleteCertificate(this.model.id).then(
86 function() { 86 function() {
87 this.$.dialog.close(); 87 /** @type {!CrDialogElement} */ (this.$.dialog).close();
88 }.bind(this), 88 }.bind(this),
89 /** @param {!CertificatesError} error */ 89 /** @param {!CertificatesError} error */
90 function(error) { 90 function(error) {
91 this.$.dialog.close(); 91 /** @type {!CrDialogElement} */ (this.$.dialog).close();
92 this.fire('certificates-error', error); 92 this.fire('certificates-error', error);
93 }.bind(this)); 93 }.bind(this));
94 }, 94 },
95 }); 95 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698