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

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

Issue 2072553002: [ios] Fixed dialogs suppression. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 <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 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 return scrollView.contentOffset.y == -scrollView.contentInset.top; 1411 return scrollView.contentOffset.y == -scrollView.contentInset.top;
1412 } 1412 }
1413 1413
1414 - (void)setShouldSuppressDialogs:(BOOL)shouldSuppressDialogs { 1414 - (void)setShouldSuppressDialogs:(BOOL)shouldSuppressDialogs {
1415 _shouldSuppressDialogs = shouldSuppressDialogs; 1415 _shouldSuppressDialogs = shouldSuppressDialogs;
1416 if (_webView) { 1416 if (_webView) {
1417 NSString* const kSetSuppressDialogs = [NSString 1417 NSString* const kSetSuppressDialogs = [NSString
1418 stringWithFormat:@"__gCrWeb.setSuppressGeolocationDialogs(%d);", 1418 stringWithFormat:@"__gCrWeb.setSuppressGeolocationDialogs(%d);",
1419 shouldSuppressDialogs]; 1419 shouldSuppressDialogs];
1420 [self evaluateJavaScript:kSetSuppressDialogs stringResultHandler:nil]; 1420 [self evaluateJavaScript:kSetSuppressDialogs stringResultHandler:nil];
1421 _shouldSuppressDialogsOnWindowIDInjection = NO;
1421 } else { 1422 } else {
1422 _shouldSuppressDialogsOnWindowIDInjection = shouldSuppressDialogs; 1423 _shouldSuppressDialogsOnWindowIDInjection = shouldSuppressDialogs;
1423 } 1424 }
1424 } 1425 }
1425 1426
1426 - (GURL)currentURLWithTrustLevel:(web::URLVerificationTrustLevel*)trustLevel { 1427 - (GURL)currentURLWithTrustLevel:(web::URLVerificationTrustLevel*)trustLevel {
1427 DCHECK(trustLevel) << "Verification of the trustLevel state is mandatory"; 1428 DCHECK(trustLevel) << "Verification of the trustLevel state is mandatory";
1428 if (_webView) { 1429 if (_webView) {
1429 GURL url([self webURLWithTrustLevel:trustLevel]); 1430 GURL url([self webURLWithTrustLevel:trustLevel]);
1430 // Web views treat all about: URLs as the same origin, which makes it 1431 // Web views treat all about: URLs as the same origin, which makes it
(...skipping 4156 matching lines...) Expand 10 before | Expand all | Expand 10 after
5587 } 5588 }
5588 5589
5589 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; 5590 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
5590 } 5591 }
5591 5592
5592 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { 5593 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action {
5593 return [action.request valueForHTTPHeaderField:@"Referer"]; 5594 return [action.request valueForHTTPHeaderField:@"Referer"];
5594 } 5595 }
5595 5596
5596 @end 5597 @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