Don't pass the result through
It's meaningless on macOS, at least.
This commit is contained in:
parent
0cab8a3322
commit
146e1ed3ce
3 changed files with 6 additions and 9 deletions
|
@ -17,7 +17,7 @@ class NativeWindow;
|
||||||
|
|
||||||
namespace certificate_trust {
|
namespace certificate_trust {
|
||||||
|
|
||||||
typedef base::Callback<void(bool result)> ShowTrustCallback;
|
typedef base::Callback<void(void)> ShowTrustCallback;
|
||||||
|
|
||||||
void ShowCertificateTrust(atom::NativeWindow* parent_window,
|
void ShowCertificateTrust(atom::NativeWindow* parent_window,
|
||||||
const scoped_refptr<net::X509Certificate>& cert,
|
const scoped_refptr<net::X509Certificate>& cert,
|
||||||
|
|
|
@ -66,14 +66,12 @@
|
||||||
- (void)panelDidEnd:(NSWindow*)sheet
|
- (void)panelDidEnd:(NSWindow*)sheet
|
||||||
returnCode:(int)returnCode
|
returnCode:(int)returnCode
|
||||||
contextInfo:(void*)contextInfo {
|
contextInfo:(void*)contextInfo {
|
||||||
if (returnCode == NSFileHandlingPanelOKButton) {
|
auto cert_db = net::CertDatabase::GetInstance();
|
||||||
auto cert_db = net::CertDatabase::GetInstance();
|
// This forces Chromium to reload the certificate since it might be trusted
|
||||||
// This forces Chromium to reload the certificate since it might be trusted
|
// now.
|
||||||
// now.
|
cert_db->NotifyObserversCertDBChanged(cert_.get());
|
||||||
cert_db->NotifyObserversCertDBChanged(cert_.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
callback_.Run(returnCode == NSFileHandlingPanelOKButton ? true : false);
|
callback_.Run();
|
||||||
|
|
||||||
[self autorelease];
|
[self autorelease];
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,7 +182,6 @@ and no GUI dialog will appear.
|
||||||
* `certificate` [Certificate](structures/certificate.md) - The certificate to trust/import.
|
* `certificate` [Certificate](structures/certificate.md) - The certificate to trust/import.
|
||||||
* `message` String - The message to display to the user.
|
* `message` String - The message to display to the user.
|
||||||
* `callback` Function
|
* `callback` Function
|
||||||
* `result` Boolean - Whether the user chose to cancel or continue.
|
|
||||||
|
|
||||||
Displays a modal dialog that shows a message and certificate information, and
|
Displays a modal dialog that shows a message and certificate information, and
|
||||||
gives the user the option of trusting/importing the certificate.
|
gives the user the option of trusting/importing the certificate.
|
||||||
|
|
Loading…
Reference in a new issue