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

Unified Diff: ios/chrome/browser/ui/browser_view_controller.mm

Issue 2642233004: Removed Form Resubmission callback from CRWWebDelegate. (Closed)
Patch Set: Added ShowRepostFormWarningWithNoDelegateMethod test 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
« no previous file with comments | « ios/chrome/browser/ui/BUILD.gn ('k') | ios/web/public/test/fakes/test_web_state_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 da9d2434e5333764648ae8be4ed2903a242da2bd..a18b31dafbd3c4877d07e74474d01bce09a321b1 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();
« no previous file with comments | « ios/chrome/browser/ui/BUILD.gn ('k') | ios/web/public/test/fakes/test_web_state_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698