| 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 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1883 // Load the current URL in a native controller, retrieved from the native | 1883 // Load the current URL in a native controller, retrieved from the native |
| 1884 // provider. Call |loadNativeViewWithSuccess:YES| to load the native controller. | 1884 // provider. Call |loadNativeViewWithSuccess:YES| to load the native controller. |
| 1885 - (void)loadCurrentURLInNativeView { | 1885 - (void)loadCurrentURLInNativeView { |
| 1886 // Free the web view. | 1886 // Free the web view. |
| 1887 [self removeWebViewAllowingCachedReconstruction:NO]; | 1887 [self removeWebViewAllowingCachedReconstruction:NO]; |
| 1888 | 1888 |
| 1889 web::NavigationItem* item = [self currentNavItem]; | 1889 web::NavigationItem* item = [self currentNavItem]; |
| 1890 const GURL targetURL = item ? item->GetURL() : GURL::EmptyGURL(); | 1890 const GURL targetURL = item ? item->GetURL() : GURL::EmptyGURL(); |
| 1891 const web::Referrer referrer; | 1891 const web::Referrer referrer; |
| 1892 id<CRWNativeContent> nativeContent = | 1892 id<CRWNativeContent> nativeContent = |
| 1893 [_nativeProvider controllerForURL:targetURL]; | 1893 [_nativeProvider controllerForURL:targetURL webState:self.webState]; |
| 1894 // Unlike the WebView case, always create a new controller and view. | 1894 // Unlike the WebView case, always create a new controller and view. |
| 1895 // TODO(pinkerton): What to do if this does return nil? | 1895 // TODO(pinkerton): What to do if this does return nil? |
| 1896 [self setNativeController:nativeContent]; | 1896 [self setNativeController:nativeContent]; |
| 1897 if ([nativeContent respondsToSelector:@selector(virtualURL)]) { | 1897 if ([nativeContent respondsToSelector:@selector(virtualURL)]) { |
| 1898 item->SetVirtualURL([nativeContent virtualURL]); | 1898 item->SetVirtualURL([nativeContent virtualURL]); |
| 1899 } | 1899 } |
| 1900 | 1900 |
| 1901 [self registerLoadRequest:targetURL | 1901 [self registerLoadRequest:targetURL |
| 1902 referrer:referrer | 1902 referrer:referrer |
| 1903 transition:[self currentTransition]]; | 1903 transition:[self currentTransition]]; |
| (...skipping 3628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5532 } | 5532 } |
| 5533 | 5533 |
| 5534 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 5534 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 5535 } | 5535 } |
| 5536 | 5536 |
| 5537 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { | 5537 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { |
| 5538 return [action.request valueForHTTPHeaderField:@"Referer"]; | 5538 return [action.request valueForHTTPHeaderField:@"Referer"]; |
| 5539 } | 5539 } |
| 5540 | 5540 |
| 5541 @end | 5541 @end |
| OLD | NEW |