| 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 5305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5316 GURL webViewURL = net::GURLWithNSURL([_webView URL]); | 5316 GURL webViewURL = net::GURLWithNSURL([_webView URL]); |
| 5317 if (_loadPhase == web::LOAD_REQUESTED && | 5317 if (_loadPhase == web::LOAD_REQUESTED && |
| 5318 ![_pendingNavigationInfo cancelled]) { | 5318 ![_pendingNavigationInfo cancelled]) { |
| 5319 // A fast back/forward within the same origin does not call | 5319 // A fast back/forward within the same origin does not call |
| 5320 // |didCommitNavigation:|, so signal page change explicitly. | 5320 // |didCommitNavigation:|, so signal page change explicitly. |
| 5321 DCHECK_EQ(_documentURL.GetOrigin(), webViewURL.GetOrigin()); | 5321 DCHECK_EQ(_documentURL.GetOrigin(), webViewURL.GetOrigin()); |
| 5322 [self setDocumentURL:webViewURL]; | 5322 [self setDocumentURL:webViewURL]; |
| 5323 [self webPageChanged]; | 5323 [self webPageChanged]; |
| 5324 } | 5324 } |
| 5325 | 5325 |
| 5326 // Fast back forward navigation does not call |didFinishNavigation:|, so | 5326 [self updateSSLStatusForCurrentNavigationItem]; |
| 5327 |
| 5328 // Fast back forward navigation may not call |didFinishNavigation:|, so |
| 5327 // signal did finish navigation explicitly. | 5329 // signal did finish navigation explicitly. |
| 5328 [self updateSSLStatusForCurrentNavigationItem]; | 5330 if (_lastRegisteredRequestURL == _documentURL) { |
| 5329 [self didFinishNavigation]; | 5331 [self didFinishNavigation]; |
| 5332 } |
| 5330 } | 5333 } |
| 5331 | 5334 |
| 5332 - (void)webViewTitleDidChange { | 5335 - (void)webViewTitleDidChange { |
| 5333 // WKWebView's title becomes empty when the web process dies; ignore that | 5336 // WKWebView's title becomes empty when the web process dies; ignore that |
| 5334 // update. | 5337 // update. |
| 5335 if (_webProcessIsDead) { | 5338 if (_webProcessIsDead) { |
| 5336 DCHECK_EQ([_webView title].length, 0U); | 5339 DCHECK_EQ([_webView title].length, 0U); |
| 5337 return; | 5340 return; |
| 5338 } | 5341 } |
| 5339 | 5342 |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5655 } | 5658 } |
| 5656 | 5659 |
| 5657 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 5660 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 5658 } | 5661 } |
| 5659 | 5662 |
| 5660 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { | 5663 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { |
| 5661 return [action.request valueForHTTPHeaderField:@"Referer"]; | 5664 return [action.request valueForHTTPHeaderField:@"Referer"]; |
| 5662 } | 5665 } |
| 5663 | 5666 |
| 5664 @end | 5667 @end |
| OLD | NEW |