| 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 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |