| 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 4659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4670 WKWebViewConfiguration* config = | 4670 WKWebViewConfiguration* config = |
| 4671 [self webViewConfigurationProvider].GetWebViewConfiguration(); | 4671 [self webViewConfigurationProvider].GetWebViewConfiguration(); |
| 4672 [self ensureWebViewCreatedWithConfiguration:config]; | 4672 [self ensureWebViewCreatedWithConfiguration:config]; |
| 4673 } | 4673 } |
| 4674 | 4674 |
| 4675 - (void)ensureWebViewCreatedWithConfiguration:(WKWebViewConfiguration*)config { | 4675 - (void)ensureWebViewCreatedWithConfiguration:(WKWebViewConfiguration*)config { |
| 4676 if (!_webView) { | 4676 if (!_webView) { |
| 4677 [self setWebView:[self webViewWithConfiguration:config]]; | 4677 [self setWebView:[self webViewWithConfiguration:config]]; |
| 4678 // The following is not called in -setWebView: as the latter used in unit | 4678 // The following is not called in -setWebView: as the latter used in unit |
| 4679 // tests with fake web view, which cannot be added to view hierarchy. | 4679 // tests with fake web view, which cannot be added to view hierarchy. |
| 4680 CHECK(_webUsageEnabled) << "Tried to create a web view while suspended!"; | 4680 // Tried to create a web view while suspended! |
| 4681 CHECK(_webUsageEnabled); |
| 4681 | 4682 |
| 4682 DCHECK(_webView); | 4683 DCHECK(_webView); |
| 4683 | 4684 |
| 4684 [_webView setTag:kWebViewTag]; | 4685 [_webView setTag:kWebViewTag]; |
| 4685 [_webView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | | 4686 [_webView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | |
| 4686 UIViewAutoresizingFlexibleHeight]; | 4687 UIViewAutoresizingFlexibleHeight]; |
| 4687 [_webView setBackgroundColor:[UIColor colorWithWhite:0.2 alpha:1.0]]; | 4688 [_webView setBackgroundColor:[UIColor colorWithWhite:0.2 alpha:1.0]]; |
| 4688 | 4689 |
| 4689 // Create a dependency between the |webView| pan gesture and BVC side swipe | 4690 // Create a dependency between the |webView| pan gesture and BVC side swipe |
| 4690 // gestures. Note: This needs to be added before the longPress recognizers | 4691 // gestures. Note: This needs to be added before the longPress recognizers |
| (...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5792 } | 5793 } |
| 5793 | 5794 |
| 5794 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 5795 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 5795 } | 5796 } |
| 5796 | 5797 |
| 5797 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { | 5798 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { |
| 5798 return [action.request valueForHTTPHeaderField:@"Referer"]; | 5799 return [action.request valueForHTTPHeaderField:@"Referer"]; |
| 5799 } | 5800 } |
| 5800 | 5801 |
| 5801 @end | 5802 @end |
| OLD | NEW |