| 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 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1401 return scrollView.contentOffset.y == -scrollView.contentInset.top; | 1401 return scrollView.contentOffset.y == -scrollView.contentInset.top; |
| 1402 } | 1402 } |
| 1403 | 1403 |
| 1404 - (void)setShouldSuppressDialogs:(BOOL)shouldSuppressDialogs { | 1404 - (void)setShouldSuppressDialogs:(BOOL)shouldSuppressDialogs { |
| 1405 _shouldSuppressDialogs = shouldSuppressDialogs; | 1405 _shouldSuppressDialogs = shouldSuppressDialogs; |
| 1406 if (_webView) { | 1406 if (_webView) { |
| 1407 NSString* const kSetSuppressDialogs = [NSString | 1407 NSString* const kSetSuppressDialogs = [NSString |
| 1408 stringWithFormat:@"__gCrWeb.setSuppressGeolocationDialogs(%d);", | 1408 stringWithFormat:@"__gCrWeb.setSuppressGeolocationDialogs(%d);", |
| 1409 shouldSuppressDialogs]; | 1409 shouldSuppressDialogs]; |
| 1410 [self evaluateJavaScript:kSetSuppressDialogs stringResultHandler:nil]; | 1410 [self evaluateJavaScript:kSetSuppressDialogs stringResultHandler:nil]; |
| 1411 _shouldSuppressDialogsOnWindowIDInjection = NO; |
| 1411 } else { | 1412 } else { |
| 1412 _shouldSuppressDialogsOnWindowIDInjection = shouldSuppressDialogs; | 1413 _shouldSuppressDialogsOnWindowIDInjection = shouldSuppressDialogs; |
| 1413 } | 1414 } |
| 1414 } | 1415 } |
| 1415 | 1416 |
| 1416 - (GURL)currentURLWithTrustLevel:(web::URLVerificationTrustLevel*)trustLevel { | 1417 - (GURL)currentURLWithTrustLevel:(web::URLVerificationTrustLevel*)trustLevel { |
| 1417 DCHECK(trustLevel) << "Verification of the trustLevel state is mandatory"; | 1418 DCHECK(trustLevel) << "Verification of the trustLevel state is mandatory"; |
| 1418 if (_webView) { | 1419 if (_webView) { |
| 1419 GURL url([self webURLWithTrustLevel:trustLevel]); | 1420 GURL url([self webURLWithTrustLevel:trustLevel]); |
| 1420 // Web views treat all about: URLs as the same origin, which makes it | 1421 // Web views treat all about: URLs as the same origin, which makes it |
| (...skipping 4129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5550 } | 5551 } |
| 5551 | 5552 |
| 5552 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 5553 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 5553 } | 5554 } |
| 5554 | 5555 |
| 5555 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { | 5556 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { |
| 5556 return [action.request valueForHTTPHeaderField:@"Referer"]; | 5557 return [action.request valueForHTTPHeaderField:@"Referer"]; |
| 5557 } | 5558 } |
| 5558 | 5559 |
| 5559 @end | 5560 @end |
| OLD | NEW |