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

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

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

Powered by Google App Engine
This is Rietveld 408576698