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

Unified Diff: ios/chrome/browser/ui/browser_view_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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/browser_view_controller.mm
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
index a9510f7d42cde6c73ca7e89c9500ccc719ec5746..d3dbfc81cae2f27a7c63a72947a219dcc66e78e4 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -147,6 +147,7 @@
#import "ios/chrome/browser/ui/voice/text_to_speech_player.h"
#include "ios/chrome/browser/upgrade/upgrade_center.h"
#import "ios/chrome/browser/web/error_page_content.h"
+#import "ios/chrome/browser/web/form_resubmission_tab_helper.h"
#import "ios/chrome/browser/web/passkit_dialog_provider.h"
#import "ios/chrome/browser/xcallback_parameters.h"
#import "ios/chrome/common/material_timing.h"
@@ -2569,6 +2570,22 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
return YES;
}
+- (void)webState:(web::WebState*)webState
+ runRepostFormDialogWithCompletionHandler:(void (^)(BOOL))handler {
+ // Display the action sheet with the arrow pointing at the top center of the
+ // web contents.
+ UIView* view = webState->GetView();
+ CGPoint dialogLocation =
+ CGPointMake(CGRectGetMidX(view.frame),
+ CGRectGetMinY(view.frame) +
+ [self headerHeightForTab:[self tabForWebState:webState]]);
+ auto helper = FormResubmissionTabHelper::FromWebState(webState);
+ helper->PresentFormResubmissionDialog(dialogLocation,
+ base::BindBlock(^(bool shouldContinue) {
+ handler(shouldContinue);
+ }));
+}
+
- (web::JavaScriptDialogPresenter*)javaScriptDialogPresenterForWebState:
(web::WebState*)webState {
return _javaScriptDialogPresenter.get();

Powered by Google App Engine
This is Rietveld 408576698