Commit 994fa731 authored by eugenebut's avatar eugenebut Committed by Commit bot

iOS Web Shell: Implemented warning dialog for invalid SSL certs.

This change is needed for testing recoverable SSL interstitials for
WKWebView.

BUG=462427

Review URL: https://codereview.chromium.org/1358033002

Cr-Commit-Position: refs/heads/master@{#351177}
parent 1fd62112
...@@ -293,11 +293,31 @@ bool UseWKWebView() { ...@@ -293,11 +293,31 @@ bool UseWKWebView() {
- (BOOL)openExternalURL:(const GURL&)url { - (BOOL)openExternalURL:(const GURL&)url {
return NO; return NO;
} }
- (void)presentSSLError:(const net::SSLInfo&)info - (void)presentSSLError:(const net::SSLInfo&)info
forSSLStatus:(const web::SSLStatus&)status forSSLStatus:(const web::SSLStatus&)status
recoverable:(BOOL)recoverable recoverable:(BOOL)recoverable
callback:(SSLErrorCallback)shouldContinue { callback:(SSLErrorCallback)shouldContinue {
UIAlertController* alert = [UIAlertController
alertControllerWithTitle:@"Your connection is not private"
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
[alert addAction:[UIAlertAction actionWithTitle:@"Go Back"
style:UIAlertActionStyleCancel
handler:^(UIAlertAction*) {
shouldContinue(NO);
}]];
if (recoverable) {
[alert addAction:[UIAlertAction actionWithTitle:@"Continue"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction*) {
shouldContinue(YES);
}]];
}
[self presentViewController:alert animated:YES completion:nil];
} }
- (void)presentSpoofingError { - (void)presentSpoofingError {
} }
- (void)webLoadCancelled:(const GURL&)url { - (void)webLoadCancelled:(const GURL&)url {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment