| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ios/web/web_state/ui/crw_web_controller.h" | 5 #import "ios/web/web_state/ui/crw_web_controller.h" |
| 6 | 6 |
| 7 #import <WebKit/WebKit.h> | 7 #import <WebKit/WebKit.h> |
| 8 | 8 |
| 9 #import <objc/runtime.h> | 9 #import <objc/runtime.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 4572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4583 } | 4583 } |
| 4584 | 4584 |
| 4585 - (void)didUpdateSSLStatusForCurrentNavigationItem { | 4585 - (void)didUpdateSSLStatusForCurrentNavigationItem { |
| 4586 if ([_delegate respondsToSelector: | 4586 if ([_delegate respondsToSelector: |
| 4587 @selector( | 4587 @selector( |
| 4588 webControllerDidUpdateSSLStatusForCurrentNavigationItem:)]) { | 4588 webControllerDidUpdateSSLStatusForCurrentNavigationItem:)]) { |
| 4589 [_delegate webControllerDidUpdateSSLStatusForCurrentNavigationItem:self]; | 4589 [_delegate webControllerDidUpdateSSLStatusForCurrentNavigationItem:self]; |
| 4590 } | 4590 } |
| 4591 } | 4591 } |
| 4592 | 4592 |
| 4593 - (void)didShowPasswordInputOnHTTP { |
| 4594 DCHECK(!web::IsOriginSecure(self.webState->GetLastCommittedURL())); |
| 4595 web::NavigationItem* item = |
| 4596 self.webState->GetNavigationManager()->GetLastCommittedItem(); |
| 4597 item->GetSSL().content_status |= |
| 4598 web::SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP; |
| 4599 [self didUpdateSSLStatusForCurrentNavigationItem]; |
| 4600 } |
| 4601 |
| 4593 - (void)handleSSLCertError:(NSError*)error { | 4602 - (void)handleSSLCertError:(NSError*)error { |
| 4594 CHECK(web::IsWKWebViewSSLCertError(error)); | 4603 CHECK(web::IsWKWebViewSSLCertError(error)); |
| 4595 | 4604 |
| 4596 net::SSLInfo info; | 4605 net::SSLInfo info; |
| 4597 web::GetSSLInfoFromWKWebViewSSLCertError(error, &info); | 4606 web::GetSSLInfoFromWKWebViewSSLCertError(error, &info); |
| 4598 | 4607 |
| 4599 if (!info.cert) { | 4608 if (!info.cert) { |
| 4600 // |info.cert| can be null if certChain in NSError is empty or can not be | 4609 // |info.cert| can be null if certChain in NSError is empty or can not be |
| 4601 // parsed, in this case do not ask delegate if error should be allowed, it | 4610 // parsed, in this case do not ask delegate if error should be allowed, it |
| 4602 // should not be. | 4611 // should not be. |
| (...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5768 } | 5777 } |
| 5769 | 5778 |
| 5770 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 5779 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 5771 } | 5780 } |
| 5772 | 5781 |
| 5773 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { | 5782 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { |
| 5774 return [action.request valueForHTTPHeaderField:@"Referer"]; | 5783 return [action.request valueForHTTPHeaderField:@"Referer"]; |
| 5775 } | 5784 } |
| 5776 | 5785 |
| 5777 @end | 5786 @end |
| OLD | NEW |