| 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 <objc/runtime.h> | 7 #import <objc/runtime.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 | 1125 |
| 1126 - (void)webViewDidChange { | 1126 - (void)webViewDidChange { |
| 1127 CHECK(_webUsageEnabled) << "Tried to create a web view while suspended!"; | 1127 CHECK(_webUsageEnabled) << "Tried to create a web view while suspended!"; |
| 1128 | 1128 |
| 1129 UIView* webView = self.webView; | 1129 UIView* webView = self.webView; |
| 1130 DCHECK(webView); | 1130 DCHECK(webView); |
| 1131 | 1131 |
| 1132 [webView setTag:kWebViewTag]; | 1132 [webView setTag:kWebViewTag]; |
| 1133 [webView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | | 1133 [webView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | |
| 1134 UIViewAutoresizingFlexibleHeight]; | 1134 UIViewAutoresizingFlexibleHeight]; |
| 1135 [webView setBackgroundColor:[UIColor colorWithWhite:0.2 alpha:1.0]]; | |
| 1136 | 1135 |
| 1137 // Create a dependency between the |webView| pan gesture and BVC side swipe | 1136 // Create a dependency between the |webView| pan gesture and BVC side swipe |
| 1138 // gestures. Note: This needs to be added before the longPress recognizers | 1137 // gestures. Note: This needs to be added before the longPress recognizers |
| 1139 // below, or the longPress appears to deadlock the remaining recognizers, | 1138 // below, or the longPress appears to deadlock the remaining recognizers, |
| 1140 // thereby breaking scroll. | 1139 // thereby breaking scroll. |
| 1141 NSSet* recognizers = [_swipeRecognizerProvider swipeRecognizers]; | 1140 NSSet* recognizers = [_swipeRecognizerProvider swipeRecognizers]; |
| 1142 for (UISwipeGestureRecognizer* swipeRecognizer in recognizers) { | 1141 for (UISwipeGestureRecognizer* swipeRecognizer in recognizers) { |
| 1143 [self.webScrollView.panGestureRecognizer | 1142 [self.webScrollView.panGestureRecognizer |
| 1144 requireGestureRecognizerToFail:swipeRecognizer]; | 1143 requireGestureRecognizerToFail:swipeRecognizer]; |
| 1145 } | 1144 } |
| (...skipping 2769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3915 if ([MIMEType isEqualToString:@"text/html"] || | 3914 if ([MIMEType isEqualToString:@"text/html"] || |
| 3916 [MIMEType isEqualToString:@"application/xhtml+xml"] || | 3915 [MIMEType isEqualToString:@"application/xhtml+xml"] || |
| 3917 [MIMEType isEqualToString:@"application/xml"]) { | 3916 [MIMEType isEqualToString:@"application/xml"]) { |
| 3918 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; | 3917 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; |
| 3919 } | 3918 } |
| 3920 | 3919 |
| 3921 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 3920 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 3922 } | 3921 } |
| 3923 | 3922 |
| 3924 @end | 3923 @end |
| OLD | NEW |