Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2074943002: [ios] Fixed dialogs suppression. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698