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

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

Issue 2741413007: Refactoring Reload in NavigationManager and CRWWebController. (Closed)
Patch Set: Rebase and Remove DCHECK in |loadWithParams| as it has already been taken care of Created 3 years, 9 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/tabs/tab.mm ('k') | ios/web/navigation/navigation_manager_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 2928fdc368e65249df970f0040e4a15ae657ad5d..83513d14823aefbee845c27c18342b1700d6507d 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -2884,13 +2884,20 @@ - (void)overscrollActionsController:(OverscrollActionsController*)controller
case OverscrollAction::CLOSE_TAB:
[self closeCurrentTab];
break;
- case OverscrollAction::REFRESH:
+ case OverscrollAction::REFRESH: {
if ([[[_model currentTab] webController] loadPhase] ==
web::PAGE_LOADING) {
[[_model currentTab] stopLoading];
}
- [[_model currentTab] reload];
+
+ web::WebState* webState = [_model currentTab].webState;
+ if (webState)
+ // |check_for_repost| is true because the reload is explicitly initiated
+ // by the user.
+ webState->GetNavigationManager()->Reload(web::ReloadType::NORMAL,
+ true /* check_for_repost */);
break;
+ }
case OverscrollAction::NONE:
NOTREACHED();
break;
@@ -3838,9 +3845,11 @@ - (IBAction)locationBarDidResignFirstResponder:(id)sender {
// editing ends (i.e., editing was cancelled), restart the cancelled load.
if (_locationBarEditCancelledLoad) {
_locationBarEditCancelledLoad = NO;
- if (!_toolbarModelIOS->IsLoading()) {
- [[_model currentTab] reload];
- }
+
+ web::WebState* webState = [_model currentTab].webState;
+ if (!_toolbarModelIOS->IsLoading() && webState)
+ webState->GetNavigationManager()->Reload(web::ReloadType::NORMAL,
+ false /* check_for_repost */);
}
}
@@ -3981,9 +3990,15 @@ - (IBAction)chromeExecuteCommand:(id)sender {
[super chromeExecuteCommand:sender];
}
break;
- case IDC_RELOAD:
- [[_model currentTab] reload];
+ case IDC_RELOAD: {
+ web::WebState* webState = [_model currentTab].webState;
+ if (webState)
+ // |check_for_repost| is true because the reload is explicitly initiated
+ // by the user.
+ webState->GetNavigationManager()->Reload(web::ReloadType::NORMAL,
+ true /* check_for_repost */);
break;
+ }
case IDC_SHARE_PAGE:
[self sharePage];
break;
« no previous file with comments | « ios/chrome/browser/tabs/tab.mm ('k') | ios/web/navigation/navigation_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698