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

Unified Diff: ios/chrome/browser/tabs/tab.mm

Issue 2642463002: Implemented FormResubmissionTabHelper. (Closed)
Patch Set: Updated GN deps 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 | « no previous file | ios/chrome/browser/web/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/tab.mm
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm
index db9e457ccfcf1faff648d8faf70497230d8c6cbd..516349b238a1db2b654a6d5e2b0a751cac3f1aa1 100644
--- a/ios/chrome/browser/tabs/tab.mm
+++ b/ios/chrome/browser/tabs/tab.mm
@@ -74,6 +74,7 @@
#import "ios/chrome/browser/passwords/js_credential_manager.h"
#import "ios/chrome/browser/passwords/password_controller.h"
#import "ios/chrome/browser/passwords/passwords_ui_delegate_impl.h"
+#import "ios/chrome/browser/web/form_resubmission_tab_helper.h"
#include "ios/chrome/browser/pref_names.h"
#include "ios/chrome/browser/reading_list/reading_list_model_factory.h"
#include "ios/chrome/browser/reading_list/reading_list_web_state_observer.h"
@@ -98,7 +99,6 @@
#import "ios/chrome/browser/tabs/tab_snapshotting_delegate.h"
#include "ios/chrome/browser/translate/chrome_ios_translate_client.h"
#import "ios/chrome/browser/u2f/u2f_controller.h"
-#import "ios/chrome/browser/ui/alert_coordinator/form_resubmission_coordinator.h"
#import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h"
#import "ios/chrome/browser/ui/commands/generic_chrome_command.h"
#include "ios/chrome/browser/ui/commands/ios_command_ids.h"
@@ -113,7 +113,6 @@
#import "ios/chrome/browser/ui/reader_mode/reader_mode_controller.h"
#import "ios/chrome/browser/ui/sad_tab/sad_tab_view.h"
#include "ios/chrome/browser/ui/ui_util.h"
-#import "ios/chrome/browser/ui/util/top_view_controller.h"
#import "ios/chrome/browser/web/auto_reload_bridge.h"
#import "ios/chrome/browser/web/blocked_popup_handler.h"
#import "ios/chrome/browser/web/external_app_launcher.h"
@@ -297,10 +296,6 @@ enum class RendererTerminationTabState {
base::scoped_nsobject<WebControllerSnapshotHelper>
webControllerSnapshotHelper_;
- // Coordinates Form Resubmission dialog presentation.
- base::scoped_nsobject<FormResubmissionCoordinator>
- formResubmissionCoordinator_;
-
// Handles support for window.print JavaScript calls.
std::unique_ptr<PrintObserver> printObserver_;
@@ -1241,8 +1236,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
[readerModeController_ detachFromWebState];
readerModeController_.reset();
- formResubmissionCoordinator_.reset();
-
// Invalidate any snapshot stored for this session.
NSString* sessionID = [self currentSessionID];
DCHECK(sessionID);
@@ -1700,9 +1693,7 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
onFormResubmissionForRequest:(NSURLRequest*)request
continueBlock:(ProceduralBlock)continueBlock
cancelBlock:(ProceduralBlock)cancelBlock {
- UIViewController* topController =
- top_view_controller::TopPresentedViewControllerFrom(
- [UIApplication sharedApplication].keyWindow.rootViewController);
+ FormResubmissionTabHelper::CreateForWebState(webController.webState);
rohitrao (ping after 24h) 2017/01/17 21:07:31 This should go into initWithWebState, somewhere ar
Eugene But (OOO till 7-30) 2017/01/17 21:25:39 Form resubmission callback will move from Tab to B
rohitrao (ping after 24h) 2017/01/17 21:31:24 I'd like to follow desktop, which has https://cs.c
rohitrao (ping after 24h) 2017/01/17 21:32:49 This object needs to be one-per-WebState, right?
Eugene But (OOO till 7-30) 2017/01/17 21:48:59 I see. This makes total sense. Moved FormResubmiss
// Display the action sheet with the arrow pointing at the top center of the
// web contents.
@@ -1710,18 +1701,14 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
CGPointMake(CGRectGetMidX(webController.view.frame),
CGRectGetMinY(webController.view.frame) +
[self.tabHeadersDelegate headerHeightForTab:self]);
-
- formResubmissionCoordinator_.reset([[FormResubmissionCoordinator alloc]
- initWithBaseViewController:topController
- dialogLocation:dialogLocation
- webState:webController.webState
- completionHandler:^(BOOL shouldContinue) {
- if (shouldContinue)
- continueBlock();
- else
- cancelBlock();
- }]);
- [formResubmissionCoordinator_ start];
+ auto helper = FormResubmissionTabHelper::FromWebState(webController.webState);
+ helper->PresentFormResubmissionDialog(dialogLocation,
+ base::BindBlock(^(bool shouldContinue) {
+ if (shouldContinue)
+ continueBlock();
+ else
+ cancelBlock();
+ }));
}
// The web page wants to close its own window.
@@ -1744,7 +1731,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
transition:(ui::PageTransition)transition {
DCHECK(self.webController.loadPhase == web::LOAD_REQUESTED);
DCHECK([self navigationManager]);
- formResubmissionCoordinator_.reset();
// Move the toolbar to visible during page load.
[fullScreenController_ disableFullScreen];
« no previous file with comments | « no previous file | ios/chrome/browser/web/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698