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

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2903883002: Added NavigationContext::IsPost. (Closed)
Patch Set: Self review Created 3 years, 7 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/web/web_state/navigation_context_impl_unittest.mm ('k') | ios/web/web_state/web_state_impl_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index a47f2f09c0313b26aee3637519152d132ccf324f..c36d77a20c9de4700220e46632e6ee6ce50ab1d1 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -1396,7 +1396,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
_pendingNavigationInfo
? [_pendingNavigationInfo HTTPMethod]
: [self currentBackForwardListItemHolder]->http_method();
- return [HTTPMethod isEqual:@"POST"];
+ return [HTTPMethod isEqual:@"POST"] || self.currentNavItem->HasPostData();
}
- (BOOL)isCurrentNavigationBackForward {
@@ -1540,6 +1540,7 @@ registerLoadRequestForURL:(const GURL&)requestURL
item = self.navigationManagerImpl->GetLastCommittedItem();
}
context->SetNavigationItemUniqueID(item->GetUniqueID());
+ context->SetIsPost([self isCurrentNavigationItemPOST]);
_webStateImpl->SetIsLoading(true);
_webStateImpl->OnNavigationStarted(context.get());
return context;
@@ -2049,6 +2050,8 @@ registerLoadRequestForURL:(const GURL&)requestURL
// using the web view's reload. This ensures state processing and delegate
// calls are consistent.
// TODO(eugenebut): revisit this for WKWebView.
+ self.navigationManagerImpl->GetLastCommittedItem()->SetTransitionType(
+ ui::PAGE_TRANSITION_RELOAD);
[self loadCurrentURL];
}
}
« no previous file with comments | « ios/web/web_state/navigation_context_impl_unittest.mm ('k') | ios/web/web_state/web_state_impl_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698