Add certificate-error event

This commit is contained in:
Cheng Zhao 2015-11-18 10:39:25 +08:00
parent 341341bf28
commit e432abfb42
7 changed files with 87 additions and 39 deletions

View file

@ -238,12 +238,6 @@ void SetProxyInIO(net::URLRequestContextGetter* getter,
RunCallbackInUI(callback);
}
void PassVerificationResult(
scoped_refptr<AtomCertVerifier::CertVerifyRequest> request,
bool success) {
request->ContinueWithResult(success ? net::OK : net::ERR_FAILED);
}
} // namespace
Session::Session(AtomBrowserContext* browser_context)
@ -262,19 +256,6 @@ Session::~Session() {
Destroy();
}
void Session::RequestCertVerification(
const scoped_refptr<AtomCertVerifier::CertVerifyRequest>& request) {
bool prevent_default = Emit(
"untrusted-certificate",
request->args().hostname,
request->args().cert,
base::Bind(&PassVerificationResult, request));
if (!prevent_default)
// Tell the request to use the result of default verifier.
request->ContinueWithResult(net::ERR_IO_PENDING);
}
void Session::OnDownloadCreated(content::DownloadManager* manager,
content::DownloadItem* item) {
auto web_contents = item->GetWebContents();