| 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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 return scrollView.contentOffset.y == -scrollView.contentInset.top; | 989 return scrollView.contentOffset.y == -scrollView.contentInset.top; |
| 990 } | 990 } |
| 991 | 991 |
| 992 - (void)setShouldSuppressDialogs:(BOOL)shouldSuppressDialogs { | 992 - (void)setShouldSuppressDialogs:(BOOL)shouldSuppressDialogs { |
| 993 _shouldSuppressDialogs = shouldSuppressDialogs; | 993 _shouldSuppressDialogs = shouldSuppressDialogs; |
| 994 if (self.webView) { | 994 if (self.webView) { |
| 995 NSString* const kSetSuppressDialogs = [NSString | 995 NSString* const kSetSuppressDialogs = [NSString |
| 996 stringWithFormat:@"__gCrWeb.setSuppressGeolocationDialogs(%d);", | 996 stringWithFormat:@"__gCrWeb.setSuppressGeolocationDialogs(%d);", |
| 997 shouldSuppressDialogs]; | 997 shouldSuppressDialogs]; |
| 998 [self evaluateJavaScript:kSetSuppressDialogs stringResultHandler:nil]; | 998 [self evaluateJavaScript:kSetSuppressDialogs stringResultHandler:nil]; |
| 999 _shouldSuppressDialogsOnWindowIDInjection = NO; |
| 999 } else { | 1000 } else { |
| 1000 _shouldSuppressDialogsOnWindowIDInjection = shouldSuppressDialogs; | 1001 _shouldSuppressDialogsOnWindowIDInjection = shouldSuppressDialogs; |
| 1001 } | 1002 } |
| 1002 } | 1003 } |
| 1003 | 1004 |
| 1004 - (void)presentSpoofingError { | 1005 - (void)presentSpoofingError { |
| 1005 UMA_HISTOGRAM_ENUMERATION("Web.URLVerificationFailure", | 1006 UMA_HISTOGRAM_ENUMERATION("Web.URLVerificationFailure", |
| 1006 [self webViewDocumentType], | 1007 [self webViewDocumentType], |
| 1007 web::WEB_VIEW_DOCUMENT_TYPE_COUNT); | 1008 web::WEB_VIEW_DOCUMENT_TYPE_COUNT); |
| 1008 if (self.webView) { | 1009 if (self.webView) { |
| (...skipping 2949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3958 if ([MIMEType isEqualToString:@"text/html"] || | 3959 if ([MIMEType isEqualToString:@"text/html"] || |
| 3959 [MIMEType isEqualToString:@"application/xhtml+xml"] || | 3960 [MIMEType isEqualToString:@"application/xhtml+xml"] || |
| 3960 [MIMEType isEqualToString:@"application/xml"]) { | 3961 [MIMEType isEqualToString:@"application/xml"]) { |
| 3961 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; | 3962 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; |
| 3962 } | 3963 } |
| 3963 | 3964 |
| 3964 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 3965 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 3965 } | 3966 } |
| 3966 | 3967 |
| 3967 @end | 3968 @end |
| OLD | NEW |