| 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 4589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4600 } | 4600 } |
| 4601 | 4601 |
| 4602 - (void)didUpdateSSLStatusForCurrentNavigationItem { | 4602 - (void)didUpdateSSLStatusForCurrentNavigationItem { |
| 4603 if ([_delegate respondsToSelector: | 4603 if ([_delegate respondsToSelector: |
| 4604 @selector( | 4604 @selector( |
| 4605 webControllerDidUpdateSSLStatusForCurrentNavigationItem:)]) { | 4605 webControllerDidUpdateSSLStatusForCurrentNavigationItem:)]) { |
| 4606 [_delegate webControllerDidUpdateSSLStatusForCurrentNavigationItem:self]; | 4606 [_delegate webControllerDidUpdateSSLStatusForCurrentNavigationItem:self]; |
| 4607 } | 4607 } |
| 4608 } | 4608 } |
| 4609 | 4609 |
| 4610 - (void)didShowPasswordInputOnHTTP { |
| 4611 DCHECK(!web::IsOriginSecure(self.webState->GetLastCommittedURL())); |
| 4612 web::NavigationItem* item = |
| 4613 self.webState->GetNavigationManager()->GetLastCommittedItem(); |
| 4614 item->GetSSL().content_status |= |
| 4615 web::SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP; |
| 4616 [self didUpdateSSLStatusForCurrentNavigationItem]; |
| 4617 } |
| 4618 |
| 4610 - (void)handleSSLCertError:(NSError*)error { | 4619 - (void)handleSSLCertError:(NSError*)error { |
| 4611 CHECK(web::IsWKWebViewSSLCertError(error)); | 4620 CHECK(web::IsWKWebViewSSLCertError(error)); |
| 4612 | 4621 |
| 4613 net::SSLInfo info; | 4622 net::SSLInfo info; |
| 4614 web::GetSSLInfoFromWKWebViewSSLCertError(error, &info); | 4623 web::GetSSLInfoFromWKWebViewSSLCertError(error, &info); |
| 4615 | 4624 |
| 4616 if (!info.cert) { | 4625 if (!info.cert) { |
| 4617 // |info.cert| can be null if certChain in NSError is empty or can not be | 4626 // |info.cert| can be null if certChain in NSError is empty or can not be |
| 4618 // parsed, in this case do not ask delegate if error should be allowed, it | 4627 // parsed, in this case do not ask delegate if error should be allowed, it |
| 4619 // should not be. | 4628 // should not be. |
| (...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5792 } | 5801 } |
| 5793 | 5802 |
| 5794 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 5803 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 5795 } | 5804 } |
| 5796 | 5805 |
| 5797 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { | 5806 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { |
| 5798 return [action.request valueForHTTPHeaderField:@"Referer"]; | 5807 return [action.request valueForHTTPHeaderField:@"Referer"]; |
| 5799 } | 5808 } |
| 5800 | 5809 |
| 5801 @end | 5810 @end |
| OLD | NEW |