Browse Source

Don't pass the result through

It's meaningless on macOS, at least.
joshaber 8 years ago
parent
commit
146e1ed3ce

+ 1 - 1
atom/browser/ui/certificate_trust.h

@@ -17,7 +17,7 @@ class NativeWindow;
 
 namespace certificate_trust {
 
-typedef base::Callback<void(bool result)> ShowTrustCallback;
+typedef base::Callback<void(void)> ShowTrustCallback;
 
 void ShowCertificateTrust(atom::NativeWindow* parent_window,
                           const scoped_refptr<net::X509Certificate>& cert,

+ 5 - 7
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];
 }

+ 0 - 1
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.