From 146e1ed3ce5a4e8eac8f2dfd95f9e221f90a329f Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 4 Apr 2017 09:21:15 -0400 Subject: [PATCH] Don't pass the result through It's meaningless on macOS, at least. --- atom/browser/ui/certificate_trust.h | 2 +- atom/browser/ui/certificate_trust_mac.mm | 12 +++++------- docs/api/dialog.md | 1 - 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/atom/browser/ui/certificate_trust.h b/atom/browser/ui/certificate_trust.h index 085d04d103..7cbf31ea41 100644 --- a/atom/browser/ui/certificate_trust.h +++ b/atom/browser/ui/certificate_trust.h @@ -17,7 +17,7 @@ class NativeWindow; namespace certificate_trust { -typedef base::Callback ShowTrustCallback; +typedef base::Callback ShowTrustCallback; void ShowCertificateTrust(atom::NativeWindow* parent_window, const scoped_refptr& cert, diff --git a/atom/browser/ui/certificate_trust_mac.mm b/atom/browser/ui/certificate_trust_mac.mm index ad54eaa383..e0888dd3ea 100644 --- a/atom/browser/ui/certificate_trust_mac.mm +++ b/atom/browser/ui/certificate_trust_mac.mm @@ -66,14 +66,12 @@ - (void)panelDidEnd:(NSWindow*)sheet returnCode:(int)returnCode contextInfo:(void*)contextInfo { - if (returnCode == NSFileHandlingPanelOKButton) { - auto cert_db = net::CertDatabase::GetInstance(); - // This forces Chromium to reload the certificate since it might be trusted - // now. - cert_db->NotifyObserversCertDBChanged(cert_.get()); - } + auto cert_db = net::CertDatabase::GetInstance(); + // This forces Chromium to reload the certificate since it might be trusted + // now. + cert_db->NotifyObserversCertDBChanged(cert_.get()); - callback_.Run(returnCode == NSFileHandlingPanelOKButton ? true : false); + callback_.Run(); [self autorelease]; } diff --git a/docs/api/dialog.md b/docs/api/dialog.md index 17aa7341bb..58bbd05084 100644 --- a/docs/api/dialog.md +++ b/docs/api/dialog.md @@ -182,7 +182,6 @@ and no GUI dialog will appear. * `certificate` [Certificate](structures/certificate.md) - The certificate to trust/import. * `message` String - The message to display to the user. * `callback` Function - * `result` Boolean - Whether the user chose to cancel or continue. Displays a modal dialog that shows a message and certificate information, and gives the user the option of trusting/importing the certificate.