| 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 5327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5338 | 5338 |
| 5339 if (!isFormPOSTResubmission || | 5339 if (!isFormPOSTResubmission || |
| 5340 currentItem->ShouldSkipResubmitDataConfirmation()) { | 5340 currentItem->ShouldSkipResubmitDataConfirmation()) { |
| 5341 webViewNavigationBlock(); | 5341 webViewNavigationBlock(); |
| 5342 return; | 5342 return; |
| 5343 } | 5343 } |
| 5344 | 5344 |
| 5345 // If the request is form submission or resubmission, then prompt the | 5345 // If the request is form submission or resubmission, then prompt the |
| 5346 // user before proceeding. | 5346 // user before proceeding. |
| 5347 DCHECK(isFormPOSTResubmission); | 5347 DCHECK(isFormPOSTResubmission); |
| 5348 [self.delegate webController:self | 5348 _webStateImpl->ShowRepostFormWarningDialog( |
| 5349 onFormResubmissionForRequest:nil | 5349 base::BindBlock(^(bool shouldContinue) { |
| 5350 continueBlock:webViewNavigationBlock | 5350 if (shouldContinue) |
| 5351 cancelBlock:defaultNavigationBlock]; | 5351 webViewNavigationBlock(); |
| 5352 else |
| 5353 defaultNavigationBlock(); |
| 5354 })); |
| 5352 } | 5355 } |
| 5353 | 5356 |
| 5354 #pragma mark - | 5357 #pragma mark - |
| 5355 #pragma mark Testing-Only Methods | 5358 #pragma mark Testing-Only Methods |
| 5356 | 5359 |
| 5357 - (void)injectWebViewContentView:(CRWWebViewContentView*)webViewContentView { | 5360 - (void)injectWebViewContentView:(CRWWebViewContentView*)webViewContentView { |
| 5358 [self removeWebViewAllowingCachedReconstruction:NO]; | 5361 [self removeWebViewAllowingCachedReconstruction:NO]; |
| 5359 | 5362 |
| 5360 _lastRegisteredRequestURL = _defaultURL; | 5363 _lastRegisteredRequestURL = _defaultURL; |
| 5361 [_containerView displayWebViewContentView:webViewContentView]; | 5364 [_containerView displayWebViewContentView:webViewContentView]; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5429 } | 5432 } |
| 5430 | 5433 |
| 5431 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 5434 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 5432 } | 5435 } |
| 5433 | 5436 |
| 5434 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { | 5437 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { |
| 5435 return [action.request valueForHTTPHeaderField:@"Referer"]; | 5438 return [action.request valueForHTTPHeaderField:@"Referer"]; |
| 5436 } | 5439 } |
| 5437 | 5440 |
| 5438 @end | 5441 @end |
| OLD | NEW |