| Index: chrome/browser/resources/settings/certificate_manager_page/certificates_browser_proxy.js
|
| diff --git a/chrome/browser/resources/settings/certificate_manager_page/certificates_browser_proxy.js b/chrome/browser/resources/settings/certificate_manager_page/certificates_browser_proxy.js
|
| index eb8902059469bafbadfe96a9ef1cfec71d00a65c..3501b77acc1f9d248086df868ac0741758afd0b4 100644
|
| --- a/chrome/browser/resources/settings/certificate_manager_page/certificates_browser_proxy.js
|
| +++ b/chrome/browser/resources/settings/certificate_manager_page/certificates_browser_proxy.js
|
| @@ -83,36 +83,33 @@ var CertificateType = {
|
| var CertificatesImportError;
|
|
|
| cr.define('settings', function() {
|
| -
|
| /** @interface */
|
| - function CertificatesBrowserProxy() {}
|
| -
|
| - CertificatesBrowserProxy.prototype = {
|
| + class CertificatesBrowserProxy {
|
| /**
|
| * Triggers 5 events in the following order
|
| * 1x 'certificates-model-ready' event.
|
| * 4x 'certificates-changed' event, one for each certificate category.
|
| */
|
| - refreshCertificates: function() {},
|
| + refreshCertificates() {}
|
|
|
| /** @param {string} id */
|
| - viewCertificate: function(id) {},
|
| + viewCertificate(id) {}
|
|
|
| /** @param {string} id */
|
| - exportCertificate: function(id) {},
|
| + exportCertificate(id) {}
|
|
|
| /**
|
| * @param {string} id
|
| * @return {!Promise} A promise resolved when the certificate has been
|
| * deleted successfully or rejected with a CertificatesError.
|
| */
|
| - deleteCertificate: function(id) {},
|
| + deleteCertificate(id) {}
|
|
|
| /**
|
| * @param {string} id
|
| * @return {!Promise<!CaTrustInfo>}
|
| */
|
| - getCaCertificateTrust: function(id) {},
|
| + getCaCertificateTrust(id) {}
|
|
|
| /**
|
| * @param {string} id
|
| @@ -121,9 +118,9 @@ cr.define('settings', function() {
|
| * @param {boolean} objSign
|
| * @return {!Promise}
|
| */
|
| - editCaCertificateTrust: function(id, ssl, email, objSign) {},
|
| + editCaCertificateTrust(id, ssl, email, objSign) {}
|
|
|
| - cancelImportExportCertificate: function() {},
|
| + cancelImportExportCertificate() {}
|
|
|
| /**
|
| * @param {string} id
|
| @@ -133,13 +130,13 @@ cr.define('settings', function() {
|
| * passed back via a call to
|
| * exportPersonalCertificatePasswordSelected().
|
| */
|
| - exportPersonalCertificate: function(id) {},
|
| + exportPersonalCertificate(id) {}
|
|
|
| /**
|
| * @param {string} password
|
| * @return {!Promise}
|
| */
|
| - exportPersonalCertificatePasswordSelected: function(password) {},
|
| + exportPersonalCertificatePasswordSelected(password) {}
|
|
|
| /**
|
| * @param {boolean} useHardwareBacked
|
| @@ -148,13 +145,13 @@ cr.define('settings', function() {
|
| * the user, and the password should be passed back via a call to
|
| * importPersonalCertificatePasswordSelected().
|
| */
|
| - importPersonalCertificate: function(useHardwareBacked) {},
|
| + importPersonalCertificate(useHardwareBacked) {}
|
|
|
| /**
|
| * @param {string} password
|
| * @return {!Promise}
|
| */
|
| - importPersonalCertificatePasswordSelected: function(password) {},
|
| + importPersonalCertificatePasswordSelected(password) {}
|
|
|
| /**
|
| * @return {!Promise} A promise firing once the user has selected
|
| @@ -163,7 +160,7 @@ cr.define('settings', function() {
|
| * trust levels, and that information should be passed back via a call
|
| * to importCaCertificateTrustSelected().
|
| */
|
| - importCaCertificate: function() {},
|
| + importCaCertificate() {}
|
|
|
| /**
|
| * @param {boolean} ssl
|
| @@ -174,100 +171,98 @@ cr.define('settings', function() {
|
| * error occurred with either a CertificatesError or
|
| * CertificatesImportError.
|
| */
|
| - importCaCertificateTrustSelected: function(ssl, email, objSign) {},
|
| + importCaCertificateTrustSelected(ssl, email, objSign) {}
|
|
|
| /**
|
| * @return {!Promise} A promise firing once the certificate has been
|
| * imported. The promise is rejected if an error occurred, with either
|
| * a CertificatesError or CertificatesImportError.
|
| */
|
| - importServerCertificate: function() {},
|
| - };
|
| + importServerCertificate() {}
|
| + }
|
|
|
| /**
|
| - * @constructor
|
| * @implements {settings.CertificatesBrowserProxy}
|
| */
|
| - function CertificatesBrowserProxyImpl() {}
|
| - // The singleton instance_ is replaced with a test version of this wrapper
|
| - // during testing.
|
| - cr.addSingletonGetter(CertificatesBrowserProxyImpl);
|
| -
|
| - CertificatesBrowserProxyImpl.prototype = {
|
| + class CertificatesBrowserProxyImpl {
|
| /** @override */
|
| - refreshCertificates: function() {
|
| + refreshCertificates() {
|
| chrome.send('refreshCertificates');
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - viewCertificate: function(id) {
|
| + viewCertificate(id) {
|
| chrome.send('viewCertificate', [id]);
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - exportCertificate: function(id) {
|
| + exportCertificate(id) {
|
| chrome.send('exportCertificate', [id]);
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - deleteCertificate: function(id) {
|
| + deleteCertificate(id) {
|
| return cr.sendWithPromise('deleteCertificate', id);
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - exportPersonalCertificate: function(id) {
|
| + exportPersonalCertificate(id) {
|
| return cr.sendWithPromise('exportPersonalCertificate', id);
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - exportPersonalCertificatePasswordSelected: function(password) {
|
| + exportPersonalCertificatePasswordSelected(password) {
|
| return cr.sendWithPromise(
|
| 'exportPersonalCertificatePasswordSelected', password);
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - importPersonalCertificate: function(useHardwareBacked) {
|
| + importPersonalCertificate(useHardwareBacked) {
|
| return cr.sendWithPromise('importPersonalCertificate', useHardwareBacked);
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - importPersonalCertificatePasswordSelected: function(password) {
|
| + importPersonalCertificatePasswordSelected(password) {
|
| return cr.sendWithPromise(
|
| 'importPersonalCertificatePasswordSelected', password);
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - getCaCertificateTrust: function(id) {
|
| + getCaCertificateTrust(id) {
|
| return cr.sendWithPromise('getCaCertificateTrust', id);
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - editCaCertificateTrust: function(id, ssl, email, objSign) {
|
| + editCaCertificateTrust(id, ssl, email, objSign) {
|
| return cr.sendWithPromise(
|
| 'editCaCertificateTrust', id, ssl, email, objSign);
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - importCaCertificateTrustSelected: function(ssl, email, objSign) {
|
| + importCaCertificateTrustSelected(ssl, email, objSign) {
|
| return cr.sendWithPromise(
|
| 'importCaCertificateTrustSelected', ssl, email, objSign);
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - cancelImportExportCertificate: function() {
|
| + cancelImportExportCertificate() {
|
| chrome.send('cancelImportExportCertificate');
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - importCaCertificate: function() {
|
| + importCaCertificate() {
|
| return cr.sendWithPromise('importCaCertificate');
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - importServerCertificate: function() {
|
| + importServerCertificate() {
|
| return cr.sendWithPromise('importServerCertificate');
|
| - },
|
| - };
|
| + }
|
| + }
|
| +
|
| + // The singleton instance_ is replaced with a test version of this wrapper
|
| + // during testing.
|
| + cr.addSingletonGetter(CertificatesBrowserProxyImpl);
|
|
|
| return {
|
| CertificatesBrowserProxy: CertificatesBrowserProxy,
|
|
|